diff --git a/adm/shop_admin/sale1month.php b/adm/shop_admin/sale1month.php
index 0a50e3fc5..7a97b0d2f 100644
--- a/adm/shop_admin/sale1month.php
+++ b/adm/shop_admin/sale1month.php
@@ -53,17 +53,17 @@ function print_line($save)
diff --git a/adm/shop_admin/sale1year.php b/adm/shop_admin/sale1year.php
index c0b43081e..916c3270f 100644
--- a/adm/shop_admin/sale1year.php
+++ b/adm/shop_admin/sale1year.php
@@ -15,116 +15,134 @@ function print_line($save)
if ($count++ > 0)
echo " |
\n";
- echo "
-
- | {$save['od_date']} |
- ".number_format($save['ordercount'])." |
- ".number_format($save['orderamount'])." |
- ".number_format($save['ordercancel'] + $save['dc'])." |
- ".number_format($save['receiptbank'])." |
- ".number_format($save['receiptcard'])." |
- ".number_format($save['receiptpoint'])." |
- ".number_format($save['receiptcancel'])." |
- ".number_format($save['misu'])." |
-
\n";
+ ?>
+
+ | =$save['od_date']?> |
+ =number_format($save['ordercount'])?> |
+ =number_format($save['orderamount'])?> |
+ =number_format($save['ordercancel'] + $save['dc'])?> |
+ =number_format($save['receiptbank'])?> |
+ =number_format($save['receiptcard'])?> |
+ =number_format($save['receiptpoint'])?> |
+ =number_format($save['receiptcancel'])?> |
+ =number_format($save['misu'])?> |
+
+
}
?>
-//=subtitle($g4['title'])?>
+
+
+ 연별 매출현황
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | 주문년도 |
+ 주문수 |
+ 주문합계 |
+ 취소+DC |
+ 무통장입금 |
+ 카드입금 |
+ 포인트입금 |
+ 입금취소 |
+ 미수금 |
+
+
+
+
+ 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'];
-
- |
-
- | 주문년도 |
- 주문수 |
- 주문합계 |
- 취소+DC |
- 무통장입금 |
- 카드입금 |
- 포인트입금 |
- 입금취소 |
- 미수금 |
-
- |
-
-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);
+ unset($save);
+ $save['od_date'] = $row['od_date'];
+ }
- if ($save['od_date'] != $row['od_date']) {
- print_line($save);
- unset($save);
- $save['od_date'] = $row['od_date'];
+ // 장바구니 상태별 금액
+ $sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
+ (SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
+ 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;
}
- // 장바구니 상태별 금액
- $sql1 = " select (SUM(ct_amount * ct_qty)) as orderamount, /* 주문합계 */
- (SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', ct_amount * ct_qty, 0))) as ordercancel /* 주문취소 */
- 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) {
- echo "| 자료가 한건도 없습니다. |
";
-} else {
- print_line($save);
-}
-?>
- |
-
- | 합 계 |
- =number_format($tot['ordercount'])?> |
- =number_format($tot['orderamount'])?> |
- =number_format($tot['ordercancel'] + $tot['dc'])?> |
- =number_format($tot['receiptbank'])?> |
- =number_format($tot['receiptcard'])?> |
- =number_format($tot['receiptpoint'])?> |
- =number_format($tot['receiptcancel'])?> |
- =number_format($tot['misu'])?> |
-
- |
-
+ if ($i == 0) {
+ echo '| 자료가 한건도 없습니다. |
';
+ } else {
+ print_line($save);
+ }
+ ?>
+
+
+
+ | 합 계 |
+ =number_format($tot['ordercount'])?> |
+ =number_format($tot['orderamount'])?> |
+ =number_format($tot['ordercancel'] + $tot['dc'])?> |
+ =number_format($tot['receiptbank'])?> |
+ =number_format($tot['receiptcard'])?> |
+ =number_format($tot['receiptpoint'])?> |
+ =number_format($tot['receiptcancel'])?> |
+ =number_format($tot['misu'])?> |
+
+
+
+
include_once (G4_ADMIN_PATH.'/admin.tail.php');