@ -53,17 +53,17 @@ function print_line($save)
|
|||||||
<col class="grid_2">
|
<col class="grid_2">
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">주문월</th>
|
<th scope="col">주문월</th>
|
||||||
<th scope="col">주문수</th>
|
<th scope="col">주문수</th>
|
||||||
<th scope="col">주문합계</th>
|
<th scope="col">주문합계</th>
|
||||||
<th scope="col">취소+DC</th>
|
<th scope="col">취소+DC</th>
|
||||||
<th scope="col">무통장입금</th>
|
<th scope="col">무통장입금</th>
|
||||||
<th scope="col">카드입금</th>
|
<th scope="col">카드입금</th>
|
||||||
<th scope="col">포인트입금</th>
|
<th scope="col">포인트입금</th>
|
||||||
<th scope="col">입금취소</th>
|
<th scope="col">입금취소</th>
|
||||||
<th scope="col">미수금</th>
|
<th scope="col">미수금</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?
|
<?
|
||||||
|
|||||||
@ -15,116 +15,134 @@ function print_line($save)
|
|||||||
if ($count++ > 0)
|
if ($count++ > 0)
|
||||||
echo "<tr><td colspan=9 height=1 bgcolor=#EEEEEE></td></tr>\n";
|
echo "<tr><td colspan=9 height=1 bgcolor=#EEEEEE></td></tr>\n";
|
||||||
|
|
||||||
echo "
|
?>
|
||||||
<tr class=ht>
|
<tr class="sale1">
|
||||||
<td align=center><a href='./sale1month.php?fr_date={$save['od_date']}01&to_date={$save['od_date']}12'>{$save['od_date']}</a></td>
|
<td><a href="./sale1month.php?fr_month=<?=$save['od_date']?>01&to_month=<?=$save['od_date']?>12"><?=$save['od_date']?></a></td>
|
||||||
<td align=center>".number_format($save['ordercount'])."</td>
|
<td><?=number_format($save['ordercount'])?></td>
|
||||||
<td align=right >".number_format($save['orderamount'])."</td>
|
<td><?=number_format($save['orderamount'])?></td>
|
||||||
<td align=right >".number_format($save['ordercancel'] + $save['dc'])."</td>
|
<td><?=number_format($save['ordercancel'] + $save['dc'])?></td>
|
||||||
<td align=right >".number_format($save['receiptbank'])."</td>
|
<td><?=number_format($save['receiptbank'])?></td>
|
||||||
<td align=right >".number_format($save['receiptcard'])."</td>
|
<td><?=number_format($save['receiptcard'])?></td>
|
||||||
<td align=right >".number_format($save['receiptpoint'])."</td>
|
<td><?=number_format($save['receiptpoint'])?></td>
|
||||||
<td align=right >".number_format($save['receiptcancel'])."</td>
|
<td><?=number_format($save['receiptcancel'])?></td>
|
||||||
<td align=right >".number_format($save['misu'])."</td>
|
<td><?=number_format($save['misu'])?></td>
|
||||||
</tr>\n";
|
</tr>
|
||||||
|
<?
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?//=subtitle($g4['title'])?>
|
<style type="text/css">
|
||||||
|
.sale1{text-align:center}
|
||||||
|
</style>
|
||||||
|
<section class="cbox">
|
||||||
|
<h2>연별 매출현황</h2>
|
||||||
|
<table>
|
||||||
|
<colgroup>
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
<col class="grid_2">
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">주문년도</th>
|
||||||
|
<th scope="col">주문수</th>
|
||||||
|
<th scope="col">주문합계</th>
|
||||||
|
<th scope="col">취소+DC</th>
|
||||||
|
<th scope="col">무통장입금</th>
|
||||||
|
<th scope="col">카드입금</th>
|
||||||
|
<th scope="col">포인트입금</th>
|
||||||
|
<th scope="col">입금취소</th>
|
||||||
|
<th scope="col">미수금</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?
|
||||||
|
unset($save);
|
||||||
|
unset($tot);
|
||||||
|
$sql = " select uq_id,
|
||||||
|
SUBSTRING(od_time,1,4) as od_date,
|
||||||
|
od_send_cost,
|
||||||
|
od_receipt_bank,
|
||||||
|
od_receipt_card,
|
||||||
|
od_receipt_point,
|
||||||
|
od_dc_amount,
|
||||||
|
(od_receipt_bank + od_receipt_card + od_receipt_point) as receiptamount,
|
||||||
|
(od_refund_amount + od_cancel_card) as receiptcancel
|
||||||
|
from {$g4['yc4_order_table']}
|
||||||
|
where SUBSTRING(od_time,1,4) between '$fr_year' and '$to_year'
|
||||||
|
order by od_time desc ";
|
||||||
|
$result = sql_query($sql);
|
||||||
|
for ($i=0; $row=mysql_fetch_array($result); $i++)
|
||||||
|
{
|
||||||
|
if ($i == 0)
|
||||||
|
$save['od_date'] = $row['od_date'];
|
||||||
|
|
||||||
<table cellpadding=0 cellspacing=0 width=100%>
|
if ($save['od_date'] != $row['od_date']) {
|
||||||
<tr><td colspan=9 height=2 bgcolor=#0E87F9></td></tr>
|
print_line($save);
|
||||||
<tr class=ht>
|
unset($save);
|
||||||
<td width=100 align=center>주문년도</td>
|
$save['od_date'] = $row['od_date'];
|
||||||
<td align=center>주문수</td>
|
}
|
||||||
<td width=90 align=right>주문합계</td>
|
|
||||||
<td width=90 align=right>취소+DC</td>
|
|
||||||
<td width=90 align=right>무통장입금</td>
|
|
||||||
<td width=90 align=right>카드입금</td>
|
|
||||||
<td width=90 align=right>포인트입금</td>
|
|
||||||
<td width=90 align=right>입금취소</td>
|
|
||||||
<td width=90 align=right>미수금</td>
|
|
||||||
</tr>
|
|
||||||
<tr><td colspan=9 height=1 bgcolor=#CCCCCC></td></tr>
|
|
||||||
<?
|
|
||||||
unset($save);
|
|
||||||
unset($tot);
|
|
||||||
$sql = " select uq_id,
|
|
||||||
SUBSTRING(od_time,1,4) as od_date,
|
|
||||||
od_send_cost,
|
|
||||||
od_receipt_bank,
|
|
||||||
od_receipt_card,
|
|
||||||
od_receipt_point,
|
|
||||||
od_dc_amount,
|
|
||||||
(od_receipt_bank + od_receipt_card + od_receipt_point) as receiptamount,
|
|
||||||
(od_refund_amount + od_cancel_card) as receiptcancel
|
|
||||||
from {$g4['yc4_order_table']}
|
|
||||||
where SUBSTRING(od_time,1,4) between '$fr_date' and '$to_date'
|
|
||||||
order by od_time desc ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
for ($i=0; $row=mysql_fetch_array($result); $i++)
|
|
||||||
{
|
|
||||||
if ($i == 0)
|
|
||||||
$save['od_date'] = $row['od_date'];
|
|
||||||
|
|
||||||
if ($save['od_date'] != $row['od_date']) {
|
// 장바구니 상태별 금액
|
||||||
print_line($save);
|
$sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
|
||||||
unset($save);
|
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
|
||||||
$save['od_date'] = $row['od_date'];
|
from {$g4['yc4_cart_table']}
|
||||||
|
where uq_id = '{$row['uq_id']}' ";
|
||||||
|
$row1 = sql_fetch($sql1);
|
||||||
|
|
||||||
|
$row1['orderamount'] += $row['od_send_cost'];
|
||||||
|
$misu = $row1['orderamount'] - $row1['ordercancel'] - $row['od_dc_amount'] - $row['receiptamount'] + $row['receiptcancel'];
|
||||||
|
|
||||||
|
$save['ordercount']++;
|
||||||
|
$save['orderamount'] += $row1['orderamount'];
|
||||||
|
$save['ordercancel'] += $row1['ordercancel'];
|
||||||
|
$save['dc'] += $row['od_dc_amount'];
|
||||||
|
$save['receiptbank'] += $row['od_receipt_bank'];
|
||||||
|
$save['receiptcard'] += $row['od_receipt_card'];
|
||||||
|
$save['receiptpoint'] += $row['od_receipt_point'];
|
||||||
|
$save['receiptcancel'] += $row['receiptcancel'];
|
||||||
|
$save['misu'] += $misu;
|
||||||
|
|
||||||
|
$tot['ordercount']++;
|
||||||
|
$tot['orderamount'] += $row1['orderamount'];
|
||||||
|
$tot['ordercancel'] += $row1['ordercancel'];
|
||||||
|
$tot['dc'] += $row['od_dc_amount'];
|
||||||
|
$tot['receiptbank'] += $row['od_receipt_bank'];
|
||||||
|
$tot['receiptcard'] += $row['od_receipt_card'];
|
||||||
|
$tot['receiptpoint'] += $row['od_receipt_point'];
|
||||||
|
$tot['receiptamount'] += $row['receiptamount'];
|
||||||
|
$tot['receiptcancel'] += $row['receiptcancel'];
|
||||||
|
$tot['misu'] += $misu;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 장바구니 상태별 금액
|
if ($i == 0) {
|
||||||
$sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
|
echo '<tr><td colspan="9" calss=""><span>자료가 한건도 없습니다.</span></td></tr>';
|
||||||
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
|
} else {
|
||||||
from {$g4['yc4_cart_table']}
|
print_line($save);
|
||||||
where uq_id = '{$row['uq_id']}' ";
|
}
|
||||||
$row1 = sql_fetch($sql1);
|
?>
|
||||||
|
</tbody>
|
||||||
$row1['orderamount'] += $row['od_send_cost'];
|
<tfoot>
|
||||||
$misu = $row1['orderamount'] - $row1['ordercancel'] - $row['od_dc_amount'] - $row['receiptamount'] + $row['receiptcancel'];
|
<tr class="sale1">
|
||||||
|
<td>합 계</td>
|
||||||
$save['ordercount']++;
|
<td><?=number_format($tot['ordercount'])?></td>
|
||||||
$save['orderamount'] += $row1['orderamount'];
|
<td><?=number_format($tot['orderamount'])?></td>
|
||||||
$save['ordercancel'] += $row1['ordercancel'];
|
<td><?=number_format($tot['ordercancel'] + $tot['dc'])?></td>
|
||||||
$save['dc'] += $row['od_dc_amount'];
|
<td><?=number_format($tot['receiptbank'])?></td>
|
||||||
$save['receiptbank'] += $row['od_receipt_bank'];
|
<td><?=number_format($tot['receiptcard'])?></td>
|
||||||
$save['receiptcard'] += $row['od_receipt_card'];
|
<td><?=number_format($tot['receiptpoint'])?></td>
|
||||||
$save['receiptpoint'] += $row['od_receipt_point'];
|
<td><?=number_format($tot['receiptcancel'])?></td>
|
||||||
$save['receiptcancel'] += $row['receiptcancel'];
|
<td><?=number_format($tot['misu'])?></td>
|
||||||
$save['misu'] += $misu;
|
</tr>
|
||||||
|
</tfoot>
|
||||||
$tot['ordercount']++;
|
</table>
|
||||||
$tot['orderamount'] += $row1['orderamount'];
|
</section>
|
||||||
$tot['ordercancel'] += $row1['ordercancel'];
|
|
||||||
$tot['dc'] += $row['od_dc_amount'];
|
|
||||||
$tot['receiptbank'] += $row['od_receipt_bank'];
|
|
||||||
$tot['receiptcard'] += $row['od_receipt_card'];
|
|
||||||
$tot['receiptpoint'] += $row['od_receipt_point'];
|
|
||||||
$tot['receiptamount'] += $row['receiptamount'];
|
|
||||||
$tot['receiptcancel'] += $row['receiptcancel'];
|
|
||||||
$tot['misu'] += $misu;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($i == 0) {
|
|
||||||
echo "<tr><td colspan=9 align=center height=100 bgcolor=#FFFFFF><span class=point>자료가 한건도 없습니다.</span></td></tr>";
|
|
||||||
} else {
|
|
||||||
print_line($save);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<tr><td colspan=9 height=1 bgcolor=#CCCCCC></td></tr>
|
|
||||||
<tr class=ht>
|
|
||||||
<td align=center>합 계</td>
|
|
||||||
<td align=center><?=number_format($tot['ordercount'])?></td>
|
|
||||||
<td align=right ><?=number_format($tot['orderamount'])?></td>
|
|
||||||
<td align=right ><?=number_format($tot['ordercancel'] + $tot['dc'])?></td>
|
|
||||||
<td align=right ><?=number_format($tot['receiptbank'])?></td>
|
|
||||||
<td align=right ><?=number_format($tot['receiptcard'])?></td>
|
|
||||||
<td align=right ><?=number_format($tot['receiptpoint'])?></td>
|
|
||||||
<td align=right ><?=number_format($tot['receiptcancel'])?></td>
|
|
||||||
<td align=right ><?=number_format($tot['misu'])?></td>
|
|
||||||
</tr>
|
|
||||||
<tr><td colspan=9 height=1 bgcolor=#CCCCCC></td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<?
|
<?
|
||||||
include_once (G4_ADMIN_PATH.'/admin.tail.php');
|
include_once (G4_ADMIN_PATH.'/admin.tail.php');
|
||||||
|
|||||||
Reference in New Issue
Block a user