order 테이블에 주문금액 등 기록되도록 수정

This commit is contained in:
chicpro
2013-09-10 15:55:58 +09:00
parent 3d4ccc4505
commit b5313b7bde
21 changed files with 385 additions and 631 deletions

View File

@ -33,13 +33,12 @@ if ($sel_ca_id != "") {
if ($sel_field == "") $sel_field = "od_id";
$sql_common = " from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (a.od_id=b.od_id)
$sql_common = " from {$g4['shop_order_table']}
$sql_search ";
// 테이블의 전체 레코드수만 얻음
if ($chk_misu) {
$sql = " select a.od_id, a.*, "._MISU_QUERY_." $sql_common group by od_id having misu <= 0 ";
$sql = " select *, "._MISU_QUERY_." $sql_common having misu <= 0 ";
$result = sql_query($sql);
$total_count = mysql_num_rows($result);
}
@ -90,7 +89,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field">
<option value="a.od_id" <?php echo get_selected($sel_field, 'a.od_id'); ?>>주문번호</option>
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="od_invoice" <?php echo get_selected($sel_field, 'od_invoice'); ?>>운송장번호</option>
</select>
@ -112,8 +111,8 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<ul class="sort_odr">
<li><a href="<?php echo title_sort("od_id",1) . "&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_name") . "&amp;$qstr1"; ?>">주문자<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("orderamount",1) . "&amp;$qstr1"; ?>">주문액<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("receiptamount",1) . "&amp;$qstr1"; ?>">입금액<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_cart_amount",1) . "&amp;$qstr1"; ?>">주문액<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_receipt_amount",1) . "&amp;$qstr1"; ?>">입금액<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("misu",1) . "&amp;$qstr1"; ?>">미수금<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_hope_date",1) . "&amp;$qstr1"; ?>">희망배송일<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_invoice_time") . "&amp;$qstr1"; ?>">배송일시<span class="sound_only"> 순 정렬</span></a></li>
@ -144,14 +143,12 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
</thead>
<tbody>
<?php
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
$sql_common
group by a.od_id ";
$sql = " select *, "._MISU_QUERY_."
$sql_common ";
if ($chk_misu)
$sql .= " having misu <= 0 ";
$sql .= " order by $sort1 $sort2/* 김선용 심각한 트래픽으로 미사용, a.od_invoice asc*/
limit $from_record, $config[cf_page_rows] ";
$sql .= " order by $sort1 $sort2
limit $from_record, {$config['cf_page_rows']} ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
@ -176,8 +173,8 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>"><?php echo $row['od_id']; ?></a>
</td>
<td class="td_name"><?php echo $row['od_name']; ?></td>
<td><?php echo display_price($row['orderamount']); ?></td>
<td><?php echo display_price($row['receiptamount']); ?></td>
<td><?php echo display_price($row['od_cart_amount']); ?></td>
<td><?php echo display_price($row['od_receipt_amount']); ?></td>
<td><?php echo display_price($row['misu']); ?></td>
<td><?php echo $hope_date; ?></td>
<td><input type="text" name="od_invoice_time[<?php echo $i; ?>]" value="<?php echo $invoice_time; ?>" class="frm_input" size="20" maxlength="19"></td>
@ -195,11 +192,6 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
</td>
</tr>
<?php
if ($row['dl_id']) {
//echo "<script> document.fdeliverylistupate.elements('dl_id[$i]').value = '$row[dl_id]'; </script>";
// FF 3.0 에서 위의 코드는 에러를 발생함 (080626 수정)
echo "<script> document.fdeliverylistupate.elements['dl_id[$i]'].value = '{$row['dl_id']}'; </script>";
}
}
if ($i == 0)
echo '<tr><td colspan="20" class="empty_table">자료가 한건도 없습니다.</td></tr>';

View File

@ -32,15 +32,10 @@ $pg_anchor = '<ul class="anchor">
<tbody>
<?php
// 미수금이 없고 운송장번호가 없는 자료를 구함
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.od_id=a.od_id)
group by a.od_id
/*having misu <= 0 and a.od_invoice = '' and ordercancel = 0*/
/*having orderamount - receiptamount = 0 and a.od_invoice = ''*/
having misu <= 0 and a.od_invoice = ''
order by a.od_id desc
$sql = " select *, "._MISU_QUERY_."
from {$g4['shop_order_table']}
having misu <= 0 and od_invoice = ''
order by od_id desc
limit $max_limit ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
@ -64,7 +59,7 @@ $pg_anchor = '<ul class="anchor">
<tr>
<td class="td_odrnum2"><?php echo $row['od_id']; ?></td>
<td class="td_name"><?php echo $name; ?></td>
<td class="td_bignum"><?php echo display_price($row['receiptamount']); ?></td>
<td class="td_bignum"><?php echo display_price($row['od_receipt_amount']); ?></td>
<td class="td_payby"><?php echo $settle_method; ?></td>
<td class="td_smallmng"><a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>">수정</a></td>
</tr>
@ -97,14 +92,10 @@ $pg_anchor = '<ul class="anchor">
<tbody>
<?php
// 미수금이 있고 송장번호가 없는 자료를 구함
$sql = " select a.od_id,
a.*, "._MISU_QUERY_."
from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (b.od_id=a.od_id)
group by a.od_id
/* having receiptamount <= 0 */
$sql = " select *, "._MISU_QUERY_."
from {$g4['shop_order_table']}
having misu > 0
order by a.od_id desc
order by od_id desc
limit $max_limit ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)

View File

@ -116,7 +116,7 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<section id="anc_sodr_list" class="cbox">
<h2>주문상품 목록</h2>
<?php echo $pg_anchor; ?>
<p>주문일시 <?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>) / 주문총액 <strong><?php echo number_format($od['od_temp_amount']); ?></strong>원</p>
<p>주문일시 <?php echo substr($od['od_time'],0,16); ?> (<?php echo get_yoil($od['od_time']); ?>) / 주문총액 <strong><?php echo number_format($od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2']); ?></strong>원</p>
<?php if ($default['de_hope_date_use']) { ?><p>희망배송일은 <?php echo $od['od_hope_date']; ?> (<?php echo get_yoil($od['od_hope_date']); ?>) 입니다.</p><?php } ?>
<?php if($od['od_mobile']) { ?>
<p>모바일 쇼핑몰의 주문입니다.</p>
@ -184,10 +184,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
$ct_amount['소계'] = $opt_price * $opt['ct_qty'];
$ct_point['소계'] = $opt['ct_point'] * $opt['ct_qty'];
if ($opt['ct_status']=='주문' || $opt['ct_status']=='준비' || $opt['ct_status']=='배송' || $opt['ct_status']=='완료')
$t_ct_amount['정상'] += $ct_amount['소계'];
else if ($opt['ct_status']=='취소' || $opt['ct_status']=='반품' || $opt['ct_status']=='품절')
$t_ct_amount['취소'] += $ct_amount['소계'];
?>
<tr>
<td class="td_chk">
@ -210,7 +206,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
</tr>
<?php
$chk_cnt++;
$t_cp_amount += $opt['cp_amount']; // 쿠폰사용금액
}
?>
</tbody>
@ -218,8 +213,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
</li>
<?php
$t_ct_amount['합계'] += $ct_amount['소계'];
$t_ct_point['합계'] += $ct_point['소계'];
}
?>
</ul>
@ -254,16 +247,19 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<?php
// 주문금액 = 상품구입금액 + 배송비 + 추가배송비
$amount['정상'] = $t_ct_amount['정상'] + $od['od_send_cost'] + $od['od_send_cost2'];
$amount['주문'] = $od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2'];
// 입금액 = 결제금액 + 포인트
$amount['입금'] = $od['od_receipt_amount'] + $od['od_receipt_point'];
// 쿠폰금액 od_send_cost에는 배송비 할인 쿠폰이 적용된 금액이 기록되므로 계산에 추가하지 않음
$amount['쿠폰'] = $t_cp_amount + $od['od_coupon'] + $od['od_send_coupon'];
// 쿠폰금액
$amount['쿠폰'] = $od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon'];
// 미수금 = (주문금액 - DC + 환불액) - (입금액 - 결제승인취소) - 쿠폰금액
$amount['미수'] = ($amount['정상'] - $od['od_dc_amount'] + $od['od_refund_amount']) - ($amount['입금'] - $od['od_cancel_card']) - $amount['쿠폰'];
// 취소금액
$amount['취소'] = $od['od_cancel_amount'];
// 미수금 = 주문금액 - 취소금액 - 입금금액 - 쿠폰금액
$amount['미수'] = $amount['주문'] - $amount['입금'] - $amount['쿠폰'];
// 결제방법
$s_receipt_way = $od['od_settle_case'];
@ -283,8 +279,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<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>
</tr>
</thead>
@ -292,13 +286,11 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<tr>
<td class="td_odrnum2"><?php echo $od['od_id']; ?></td>
<td class="td_payby"><?php echo $s_receipt_way; ?></td>
<td class="td_bignum"><?php echo display_price($amount['정상']); ?></td>
<td class="td_bignum"><?php echo display_price($amount['주문']); ?></td>
<td class="td_bignum"><?php echo display_point($od['od_receipt_point']); ?></td>
<td class="td_bignum"><?php echo number_format($amount['입금']); ?>원</td>
<td class="td_bignum"><?php echo display_price($amount['쿠폰']); ?></td>
<td class="td_bignum"><?php echo display_price($od['od_dc_amount']); ?></td>
<td class="td_bignum"><?php echo display_price($od['od_refund_amount']); ?></td>
<td class="td_bignum"><?php echo number_format($t_ct_amount['취소']); ?>원</td>
<td class="td_bignum"><?php echo number_format($amount['취소']); ?></td>
</tr>
</tbody>
</table>
@ -412,12 +404,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<th scope="row"><?php echo $od['od_settle_case']; ?> 입금액</th>
<td><?php echo display_price($od['od_receipt_amount']); ?></td>
</tr>
<?php if($od['od_settle_case'] == '계좌이체') { ?>
<tr>
<th scope="row">결제 취소금액</th>
<td><?php echo display_price($od['od_cancel_card']); ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row">입금자</th>
<td><?php echo $od['od_deposit_name']; ?></td>
@ -468,10 +454,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<?php } ?>
</td>
</tr>
<tr>
<th scope="row" class="sodr_sppay">카드 승인취소</th>
<td><?php echo display_price($od['od_cancel_card']); ?></td>
</tr>
<?php } ?>
<?php if($od['od_tax_flag']) { ?>
<tr>
@ -492,12 +474,8 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<td><?php echo display_point($od['od_receipt_point']); ?></td>
</tr>
<tr>
<th scope="row">DC</th>
<td><?php echo display_price($od['od_dc_amount']); ?></td>
</tr>
<tr>
<th scope="row">환불액</th>
<td><?php echo display_price($od['od_refund_amount']); ?></td>
<th scope="row">취소/환불액</th>
<td><?php echo display_price($od['od_cancel_amount']); ?></td>
</tr>
<?php
$sql = " select dl_company, dl_url, dl_tel from {$g4['shop_delivery_table']} where dl_id = '{$od['dl_id']}' ";
@ -619,14 +597,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<?php } ?>
</td>
</tr>
<?php if($od['od_settle_case'] == '계좌이체') { ?>
<tr>
<th scope="row"><label for="od_cancel_card">결제 취소금액</label></th>
<td>
<input type="text" name="od_cancel_card" value="<?php echo $od['od_cancel_card']; ?>" class="frm_input" size="10"> 원
</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="od_deposit_name">입금자명</label></th>
<td>
@ -688,12 +658,6 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<input type="text" name="od_receipt_time" value="<?php echo is_null_time($od['od_receipt_time']) ? "" : $od['od_receipt_time']; ?>" id="od_receipt_time" class="frm_input" size="19" maxlength="19">
</td>
</tr>
<tr>
<th scope="row" class="sodr_sppay"><label for="od_cancel_card">카드 승인취소</label></th>
<td>
<input type="text" name="od_cancel_card" value="<?php echo $od['od_cancel_card']; ?>" class="frm_input" size="10"> 원
</td>
</tr>
<?php } ?>
<tr>
@ -701,14 +665,9 @@ $pg_anchor .='<li><a href="#anc_sodr_chk">결제상세정보 확인</a></li>
<td><input type="text" name="od_receipt_point" value="<?php echo $od['od_receipt_point']; ?>" id="od_receipt_point" class="frm_input" size="10"> 점</td>
</tr>
<tr>
<th scope="row"><label for="od_dc_amount">DC</label></th>
<td><input type="text" name="od_dc_amount" value="<?php echo $od['od_dc_amount']; ?>" id="od_dc_amount" class="frm_input" size="10"> 원</td>
</tr>
<tr>
<th scope="row"><label for="od_refund_amount">환불액</label></th>
<th scope="row"><label for="od_cancel_amount">취소/환불 금액</label></th>
<td>
<?php echo help("카드승인취소를 입력한 경우에는 중복하여 입력하면 미수금이 틀려집니다."); ?>
<input type="text" name="od_refund_amount" value="<?php echo $od['od_refund_amount']; ?>" id="od_refund_amount" class="frm_input" size="10"> 원
<input type="text" name="od_cancel_amount" value="<?php echo $od['od_cancel_amount']; ?>" class="frm_input" size="10"> 원
</td>
</tr>
<tr>

View File

@ -13,9 +13,6 @@ if ($search != "")
{
if ($sel_field != "")
{
if($sel_field == 'mb_id')
$sel_field = 'a.'.$sel_field;
$sql_search .= " $where $sel_field like '%$search%' ";
$where = " and ";
}
@ -24,20 +21,14 @@ if ($search != "")
$page = 1;
}
if ($sel_field == "") $sel_field = "a.od_id";
if ($sort1 == "") $sort1 = "a.od_id";
if ($sel_field == "") $sel_field = "od_id";
if ($sort1 == "") $sort1 = "od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (a.od_id=b.od_id)
$sql_common = " from {$g4['shop_order_table']}
$sql_search ";
// 김선용 200805 : 조인 사용으로 전체카운트가 일정레코드 이상일 때 지연시간 문제가 심각하므로 변경
/*
$result = sql_query(" select DISTINCT od_id ".$sql_common);
$total_count = mysql_num_rows($result);
*/
$sql = " select count(distinct a.od_id) as cnt " . $sql_common;
$sql = " select count(od_id) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
@ -46,37 +37,12 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select a.*, "._MISU_QUERY_."
$sql = " select *, "._MISU_QUERY_."
$sql_common
group by a.od_id
order by $sort1 $sort2
limit $from_record, $rows ";
$result = sql_query($sql, false);
$lines = array();
$tot_itemcnt = 0;
$tot_orderamount = 0;
$tot_ordercancel = 0;
$tot_dc_amount = 0;
$tot_receiptamount = 0;
$tot_receiptcancel = 0;
$tot_misuamount = 0;
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
$lines[$i] = $row;
$tot_itemcount += $row['itemcount'];
$tot_orderamount += $row['orderamount'];
$tot_ordercancel += $row['ordercancel'];
$tot_dc_amount += $row['od_dc_amount'];
$tot_receiptamount += $row['receiptamount'];
$tot_receiptcancel += $row['receiptcancel'];
$tot_misu += $row['misu'];
}
//$qstr1 = "sel_ca_id=$sel_ca_id&amp;sel_field=$sel_field&amp;search=$search";
// 김선용 200805 : sel_ca_id - 쓰레기 코드
//$qstr1 = "sel_ca_id=$sel_ca_id&amp;sel_field=$sel_field&amp;search=$search&amp;save_search=$search";
$qstr1 = "sel_field=$sel_field&amp;search=$search&amp;save_search=$search";
$qstr = "$qstr1&amp;sort1=$sort1&amp;sort2=$sort2&amp;page=$page";
@ -103,7 +69,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
<option value="a.od_id" <?php echo get_selected($sel_field, 'a.od_id'); ?>>주문번호</option>
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
<option value="mb_id" <?php echo get_selected($sel_field, 'mb_id'); ?>>회원 ID</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?>>주문자전화</option>
@ -133,12 +99,10 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<li><a href="<?php echo title_sort("od_id", 1)."&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_name")."&amp;$qstr1"; ?>">주문자<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("mb_id")."&amp;$qstr1"; ?>">회원ID<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("itemcount", 1)."&amp;$qstr1"; ?>">건수<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("orderamount", 1)."&amp;$qstr1"; ?>">주문합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("ordercancel", 1)."&amp;$qstr1"; ?>">주문취소<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_dc_amount", 1)."&amp;$qstr1"; ?>">DC<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("receiptamount")."&amp;$qstr1"; ?>">입금합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("receiptcancel", 1)."&amp;$qstr1"; ?>">입금취소<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_cart_count", 1)."&amp;$qstr1"; ?>">건수<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_cart_amount", 1)."&amp;$qstr1"; ?>">주문합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_cancel_amount", 1)."&amp;$qstr1"; ?>">주문취소<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_receipt_amount")."&amp;$qstr1"; ?>">입금합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("misu", 1)."&amp;$qstr1"; ?>">미수금<span class="sound_only"> 순 정렬</span></a></li>
</ul>
@ -149,37 +113,23 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<th scope="col">주문자<br>회원ID</th>
<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>
<th scope="col">결제수단</th>
<th scope="col">관리</th>
</tr>
</thead>
<tfoot>
<tr class="orderlist">
<th scope="row" colspan="2">합 계</td>
<td><?php echo (int)$tot_itemcount; ?>건</td>
<td><?php echo number_format($tot_orderamount); ?></td>
<td><?php echo number_format($tot_ordercancel); ?></td>
<td><?php echo number_format($tot_dc_amount); ?></td>
<td><?php echo number_format($tot_receiptamount); ?></td>
<td><?php echo number_format($tot_receiptcancel); ?></td>
<td><?php echo number_format($tot_misu); ?></td>
<td colspan="2"></td>
</tr>
</tfoot>
<tbody>
<?php
for ($i=0; $i<count($lines[$i]); $i++)
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 결제 수단
$s_receipt_way = $s_br = "";
if ($lines[$i]['od_settle_case'])
if ($row['od_settle_case'])
{
$s_receipt_way = $lines[$i]['od_settle_case'];
$s_receipt_way = $row['od_settle_case'];
$s_br = '<br />';
}
else
@ -188,61 +138,77 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
$s_br = '<br />';
}
if ($lines[$i]['od_receipt_point'] > 0)
if ($row['od_receipt_point'] > 0)
$s_receipt_way .= $s_br."포인트";
$mb_nick = get_sideview($lines[$i]['mb_id'], $lines[$i]['od_name'], $lines[$i]['od_email'], '');
$mb_nick = get_sideview($row['mb_id'], $row['od_name'], $row['od_email'], '');
$od_cnt = 0;
if ($lines[$i]['mb_id'])
if ($row['mb_id'])
{
$sql2 = " select count(*) as cnt from {$g4['shop_order_table']} where mb_id = '{$lines[$i]['mb_id']}' ";
$sql2 = " select count(*) as cnt from {$g4['shop_order_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
$od_cnt = $row2['cnt'];
}
// 주문device
$od_mobile = '';
if($lines[$i]['od_mobile'])
if($row['od_mobile'])
$od_mobile = '(M)';
$uid = md5($lines[$i]['od_id'].$lines[$i]['od_time'].$lines[$i]['od_ip']);
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
?>
<tr class="orderlist">
<td class="td_odrnum2">
<?php echo $od_mobile; ?>
<a href="<?php echo G4_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $lines[$i]['od_id']; ?>&amp;uid=<?php echo $uid; ?>">
<?php echo $lines[$i]['od_id']; ?><br>
<span class="sound_only">주문일시 </span><?php echo $lines[$i]['od_time']; ?>
<a href="<?php echo G4_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&amp;uid=<?php echo $uid; ?>">
<?php echo $row['od_id']; ?><br>
<span class="sound_only">주문일시 </span><?php echo $row['od_time']; ?>
</a>
</td>
<!-- <td align=center><a href="<?php echo $_SERVER['PHP_SELF']; ?>?sort1=$sort1&amp;sort2=$sort2&amp;sel_field=od_name&amp;search=<?php echo $lines[$i]['od_name']; ?>'><span title="<?php echo $od_deposit_name; ?>"><?php echo cut_str($lines[$i]['od_name'],8,""); ?></span></a></td> -->
<td class="td_name">
<?php echo $mb_nick; ?><br>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?sort1=<?php echo $sort1; ?>&amp;sort2=<?php echo $sort2; ?>&amp;sel_field=mb_id&amp;search=<?php echo $lines[$i]['mb_id']; ?>">
<?php echo $lines[$i]['mb_id']; ?>
<a href="<?php echo $_SERVER['PHP_SELF']; ?>?sort1=<?php echo $sort1; ?>&amp;sort2=<?php echo $sort2; ?>&amp;sel_field=mb_id&amp;search=<?php echo $row['mb_id']; ?>">
<?php echo $row['mb_id']; ?>
</a>
</td>
<td class="td_sodr_cnt"><b><?php echo $lines[$i]['itemcount']; ?></b>건<?php if($od_cnt) { ?><br>누적 <?php echo $od_cnt; ?>건<?php } ?></td>
<td class="td_sodr_sum"><?php echo number_format($lines[$i]['orderamount']); ?></td>
<td><?php echo number_format($lines[$i]['ordercancel']); ?></td>
<td><?php echo number_format($lines[$i]['od_dc_amount']); ?></td>
<td class="td_sodr_sum"><?php echo number_format($lines[$i]['receiptamount']); ?></td>
<td><?php echo number_format($lines[$i]['receiptcancel']); ?></td>
<td class="td_sodr_nonpay"><?php echo number_format($lines[$i]['misu']); ?></td>
<td class="td_sodr_cnt"><b><?php echo $row['od_cart_count']; ?></b>건<?php if($od_cnt) { ?><br>누적 <?php echo $od_cnt; ?>건<?php } ?></td>
<td class="td_sodr_sum"><?php echo number_format($row['od_cart_amount']); ?></td>
<td><?php echo number_format($row['od_receipt_amount']); ?></td>
<td><?php echo number_format($row['od_cancel_amount']); ?></td>
<td class="td_sodr_sum"><?php echo number_format($row['couponamount']); ?></td>
<td class="td_sodr_nonpay"><?php echo number_format($row['misu']); ?></td>
<td><?php echo $s_receipt_way; ?></td>
<td class="td_mng">
<a href="./orderform.php?od_id=<?php echo $lines[$i]['od_id']; ?>&amp;<?php echo $qstr; ?>"><span class="sound_only"><?php echo $lines[$i]['od_id']; ?> </span>수정</a>
<a href="./orderdelete.php?od_id=<?php echo $lines[$i]['od_id']; ?>&amp;mb_id=<?php echo $lines[$i]['mb_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return delete_confirm();"><span class="sound_only"><?php echo $lines[$i]['od_id']; ?> </span>삭제</a>
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&amp;<?php echo $qstr; ?>"><span class="sound_only"><?php echo $row['od_id']; ?> </span>수정</a>
<a href="./orderdelete.php?od_id=<?php echo $row['od_id']; ?>&amp;mb_id=<?php echo $row['mb_id']; ?>&amp;<?php echo $qstr; ?>" onclick="return delete_confirm();"><span class="sound_only"><?php echo $row['od_id']; ?> </span>삭제</a>
</td>
</tr>
<?php
$tot_itemcount += $row['od_cart_count'];
$tot_orderamount += $row['od_cart_amount'];
$tot_ordercancel += $row['od_cancel_amount'];
$tot_receiptamount += $row['od_receipt_amount'];
$tot_couponamount += $row['couponamount'];
$tot_misu += $row['misu'];
}
mysql_free_result($result);
if ($i == 0)
echo '<tr><td colspan="11" class="empty_table">자료가 없습니다.</td></tr>';
echo '<tr><td colspan="10" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
<tfoot>
<tr class="orderlist">
<th scope="row" colspan="2">합 계</td>
<td><?php echo (int)$tot_itemcount; ?>건</td>
<td><?php echo number_format($tot_orderamount); ?></td>
<td><?php echo number_format($tot_receiptamount); ?></td>
<td><?php echo number_format($tot_ordercancel); ?></td>
<td><?php echo number_format($tot_couponamount); ?></td>
<td><?php echo number_format($tot_misu); ?></td>
<td colspan="2"></td>
</tr>
</tfoot>
</table>
</section>

View File

@ -21,16 +21,15 @@ if ($search != "")
$page = 1;
}
if ($sel_field == "") $sel_field = "a.od_id";
if ($sort1 == "") $sort1 = "a.od_id";
if ($sel_field == "") $sel_field = "od_id";
if ($sort1 == "") $sort1 = "od_id";
if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$g4['shop_order_table']} a
left join {$g4['shop_cart_table']} b on (a.od_id=b.od_id)
$sql_common = " from {$g4['shop_order_table']}
$sql_search ";
// 테이블의 전체 레코드수만 얻음
$row = sql_fetch("select count(od_id) as cnt from {$g4['shop_order_table']} $sql_search ");
$row = sql_fetch("select count(od_id) as cnt " . $sql_common);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
@ -38,23 +37,12 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select a.*, "._MISU_QUERY_."
$sql = " select *, "._MISU_QUERY_."
$sql_common
group by a.od_id
order by $sort1 $sort2
limit $from_record, $rows ";
$result = sql_query($sql);
$lines = array();
$tot_itemcnt = 0;
$tot_orderamount = 0;
$tot_ordercancel = 0;
$tot_dc_amount = 0;
$tot_receiptamount = 0;
$tot_receiptcancel = 0;
$tot_misuamount = 0;
//$qstr1 = "sel_ca_id=$sel_ca_id&amp;sel_field=$sel_field&amp;search=$search";
$qstr1 = "sel_ca_id=$sel_ca_id&amp;sel_field=$sel_field&amp;search=$search&amp;save_search=$search";
$qstr = "$qstr1&amp;sort1=$sort1&amp;sort2=$sort2&amp;page=$page";
@ -78,7 +66,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<label for="sel_field" class="sound_only">검색대상</label>
<select name="sel_field" id="sel_field">
<option value="a.od_id" <?php echo get_selected($sel_field, 'a.od_id'); ?>>주문번호</option>
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
<option value="mb_id" <?php echo get_selected($sel_field, 'mb_id'); ?>>회원 ID</option>
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
<option value="od_b_name" <?php echo get_selected($sel_field, 'od_b_name'); ?>>받는분</option>
@ -101,14 +89,12 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
</div>
<ul class="sort_odr">
<li><a href="<?php echo title_sort("a.od_id", 1)."&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_id", 1)."&amp;$qstr1"; ?>">주문번호<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_name")."&amp;$qstr1"; ?>">주문자<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("itemcount", 1)."&amp;$qstr1"; ?>">건수<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("orderamount", 1)."&amp;$qstr1"; ?>">주문합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("ordercancel", 1)."&amp;$qstr1"; ?>">주문취소<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_dc_amount", 1)."&amp;$qstr1"; ?>">DC<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("receiptamount")."&amp;$qstr1"; ?>">입금합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("receiptcancel", 1)."&amp;$qstr1"; ?>">입금취소<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_cart_count", 1)."&amp;$qstr1"; ?>">건수<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_cart_amount", 1)."&amp;$qstr1"; ?>">주문합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_cancel_amount", 1)."&amp;$qstr1"; ?>">주문취소<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("od_receipt_amount")."&amp;$qstr1"; ?>">입금합계<span class="sound_only"> 순 정렬</span></a></li>
<li><a href="<?php echo title_sort("misu", 1)."&amp;$qstr1"; ?>">미수금<span class="sound_only"> 순 정렬</span></a></li>
</ul>
@ -136,12 +122,10 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
if($row['od_mobile'])
$od_mobile = '(M)';
$tot_itemcount += $row['itemcount'];
$tot_orderamount += $row['orderamount'];
$tot_ordercancel += $row['ordercancel'];
$tot_dc_amount += $row['od_dc_amount'];
$tot_receiptamount += $row['receiptamount'];
$tot_receiptcancel += $row['receiptcancel'];
$tot_itemcount += $row['od_cart_count'];
$tot_orderamount += $row['od_cart_amount'];
$tot_ordercancel += $row['od_cancel_amount'];
$tot_receiptamount += $row['od_receipt_amount'];
$tot_couponamount += $row['couponamount'];
$tot_misu += $row['misu'];
@ -159,7 +143,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<dt>주문일시</dt>
<dd><?php echo date('y년 m월 d일 H시 i분 s초', strtotime($row['od_time'])); ?></dd>
<dt>건수</dt>
<dd><?php echo $row['itemcount']; ?>건</dd>
<dd><?php echo $row['od_cart_count']; ?>건</dd>
</dl>
<dl class="sodr_person">
@ -177,19 +161,15 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<dl class="sodr_pay">
<dt class="sodr_pay_1">주문합계</dt>
<dd class="sodr_pay_1"><?php echo number_format($row['orderamount']); ?></dd>
<dd class="sodr_pay_1"><?php echo number_format($row['od_cart_amount']); ?></dd>
<dt class="sodr_pay_1">결제수단</dt>
<dd class="sodr_pay_1"><?php echo $s_receipt_way; ?></dd>
<dt class="sodr_pay_1">DC</dt>
<dd class="sodr_pay_1"><?php echo number_format($row['od_dc_amount']); ?></dd>
<dt class="sodr_pay_1">입금합계</dt>
<dd class="sodr_pay_1"><?php echo number_format($row['receiptamount']); ?></dd>
<dd class="sodr_pay_1"><?php echo number_format($row['od_receipt_amount']); ?></dd>
<dt>쿠폰사용</dt>
<dd><?php echo number_format($row['couponamount']); ?></dd>
<dt>주문취소</dt>
<dd><?php echo number_format($row['ordercancel']); ?></dd>
<dt>입금취소</dt>
<dd><?php echo number_format($row['receiptcancel']); ?></dd>
<dd><?php echo number_format($row['od_cancel_amount']); ?></dd>
<dt>미수금</dt>
<dd><?php echo number_format($row['misu']); ?></dd>
</dl>
@ -292,9 +272,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<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>
</tr>
</thead>
@ -304,9 +282,7 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
<td><?php echo number_format($tot_orderamount); ?></td>
<td><?php echo number_format($tot_couponamount); ?></td>
<td><?php echo number_format($tot_ordercancel); ?></td>
<td><?php echo number_format($tot_dc_amount); ?></td>
<td><?php echo number_format($tot_receiptamount); ?></td>
<td><?php echo number_format($tot_receiptcancel); ?></td>
<td><?php echo number_format($tot_misu); ?></td>
</tr>
</tbody>

View File

@ -18,9 +18,7 @@ $sql = " update {$g4['shop_order_table']}
od_receipt_time = '$od_receipt_time',
od_receipt_amount = '$od_receipt_amount',
od_receipt_point = '$od_receipt_point',
od_cancel_card = '$od_cancel_card',
od_dc_amount = '$od_dc_amount',
od_refund_amount = '$od_refund_amount',
od_cancel_amount = '$od_cancel_amount',
dl_id = '$dl_id',
od_invoice = '$od_invoice',
od_invoice_time = '$od_invoice_time' ";

View File

@ -24,7 +24,7 @@ $wrp_tag_end = '';
if($popup == 'yes') { // 팝업창일 때
include_once(G4_PATH.'/head.sub.php');
$pp['od_id'] = $od_id;
$sql = " select od_id, od_name, (od_temp_amount - od_receipt_amount) as misu
$sql = " select od_id, od_name, (od_cart_amount + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon - od_receipt_amount - od_cancel_amount) as misu
from {$g4['shop_order_table']}
where od_id = '$od_id' ";
$od = sql_fetch($sql);

View File

@ -12,9 +12,6 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
function print_line($save)
{
global $admin_dir;
static $count = 0;
$date = preg_replace("/-/", "", $save['od_date']);
?>
@ -22,60 +19,29 @@ function print_line($save)
<td><a href="./sale1today.php?date=<?php echo $date; ?>"><?php echo $save['od_date']; ?></a></td>
<td><?php echo number_format($save['ordercount']); ?></td>
<td><?php echo number_format($save['orderamount']); ?></td>
<td><?php echo number_format($save['ordercancel'] + $save['dc']); ?></td>
<td><?php echo number_format($save['ordercoupon']); ?></td>
<td><?php echo number_format($save['receiptbank']); ?></td>
<td><?php echo number_format($save['receiptcard']); ?></td>
<td><?php echo number_format($save['receiptpoint']); ?></td>
<td><?php echo number_format($save['receiptcancel']); ?></td>
<td><?php echo number_format($save['ordercancel']); ?></td>
<td><?php echo number_format($save['misu']); ?></td>
</tr>
<?php
}
unset($save);
unset($tot);
$lines = $lines1 = array();
$sql = " select od_id,
SUBSTRING(od_time,1,10) as od_date,
od_send_cost,
od_settle_case,
od_receipt_amount,
od_receipt_point,
od_dc_amount,
(od_receipt_amount + od_receipt_point) as receiptamount,
(od_refund_amount + od_cancel_card) as receiptcancel
od_cart_amount,
od_cancel_amount,
(od_cart_amount + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon - od_receipt_amount - od_cancel_amount) as misu,
(od_cart_coupon + od_coupon + od_send_coupon) as couponamount
from {$g4['shop_order_table']}
where SUBSTRING(od_time,1,10) between '$fr_date' and '$to_date'
order by od_time desc ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
$lines[$i] = $row;
// 장바구니 상태별 금액
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];
$misu = $row1['orderamount'] - $row1['ordercancel'] - $row['od_dc_amount'] - $row['receiptamount'] + $row['receiptcancel'];
$lines1[$i] = $row1;
$tot['ordercount']++;
$tot['orderamount'] += $row1['orderamount'];
$tot['ordercancel'] += $row1['ordercancel'];
$tot['dc'] += $row['od_dc_amount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_amount'];
$tot['receiptpoint '] += $row['od_receipt_point'];
$tot['receiptamount'] += $row['receiptamount'];
$tot['receiptcancel'] += $row['receiptcancel'];
$tot['misu'] += $misu;
}
?>
<section id="ssale_date" class="cbox">
@ -87,55 +53,50 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
<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>
<th scope="col">입금취소</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
</tr>
</thead>
<tfoot>
<tr>
<td>합계</td>
<td><?php echo number_format($tot['ordercount']); ?></td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['ordercancel'] + $tot['dc']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['receiptcancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
<tbody>
<?php
unset($save);
unset($tot);
for ($i=0; $i<count($lines); $i++)
for ($i=0; $row=sql_fetch_array($result); $i++)
{
if ($i == 0)
$save['od_date'] = $lines[$i]['od_date'];
$save['od_date'] = $row['od_date'];
if ($save['od_date'] != $lines[$i]['od_date']) {
if ($save['od_date'] != $row['od_date']) {
print_line($save);
unset($save);
$save['od_date'] = $lines[$i]['od_date'];
$save['od_date'] = $row['od_date'];
}
$misu = $lines1[$i]['orderamount'] - $lines1[$i]['ordercancel'] - $lines[$i]['od_dc_amount'] - $lines[$i]['receiptamount'] + $lines[$i]['receiptcancel'];
$save['ordercount']++;
$save['orderamount'] += $lines1[$i]['orderamount'];
$save['ordercancel'] += $lines1[$i]['ordercancel'];
$save['dc'] += $lines[$i]['od_dc_amount'];
if($lines[$i]['od_settle_case'] == '무통장' || $lines[$i]['od_settle_case'] == '가상계좌' || $lines[$i]['od_settle_case'] == '계좌이체')
$save['receiptbank'] += $lines[$i]['od_receipt_amount'];
if($lines[$i]['od_settle_case'] == '신용카드')
$save['receiptcard'] += $lines[$i]['od_receipt_amount'];
$save['orderamount'] += $row['od_cart_amount'];
$save['ordercancel'] += $row['od_cancel_amount'];
$save['ordercoupon'] += $row['couponamount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$save['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$save['receiptcard'] += $row['od_receipt_amount'];
$save['receiptpoint'] += $lines[$i]['od_receipt_point'];
$save['receiptcancel'] += $lines[$i]['receiptcancel'];
$save['misu'] += $misu;
$save['misu'] += $row['misu'];
$tot['ordercount']++;
$tot['orderamount'] += $row['od_cart_amount'];
$tot['ordercancel'] += $row1['od_cancel_amount'];
$tot['ordercoupon'] += $row['couponamount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_amount'];
$tot['receiptpoint '] += $row['od_receipt_point'];
$tot['misu'] += $row['misu'];
}
if ($i == 0) {
@ -145,6 +106,19 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
}
?>
</tbody>
<tfoot>
<tr>
<td>합계</td>
<td><?php echo number_format($tot['ordercount']); ?></td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['ordercoupon']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
</table>
</section>

View File

@ -12,9 +12,6 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
function print_line($save)
{
global $admin_dir;
static $count = 0;
$date = preg_replace("/-/", "", $save['od_date']);
?>
@ -32,50 +29,20 @@ function print_line($save)
<?php
}
unset($save);
unset($tot);
$lines = $lines1 = array();
$sql = " select od_id,
SUBSTRING(od_time,1,7) as od_date,
od_send_cost,
od_settle_case,
od_receipt_amount,
od_receipt_point,
od_dc_amount,
(od_receipt_amount + od_receipt_point) as receiptamount,
(od_refund_amount + od_cancel_card) as receiptcancel
od_cart_amount,
od_cancel_amount,
(od_cart_amount + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon - od_receipt_amount - od_cancel_amount) as misu,
(od_cart_coupon + od_coupon + od_send_coupon) as couponamount
from {$g4['shop_order_table']}
where SUBSTRING(od_time,1,7) between '$fr_month' and '$to_month'
order by od_time desc ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
$lines[$i] = $row;
// 장바구니 상태별 금액
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];
$misu = $row1['orderamount'] - $row1['ordercancel'] - $row['od_dc_amount'] - $row['receiptamount'] + $row['receiptcancel'];
$lines1[$i] = $row1;
$tot['ordercount']++;
$tot['orderamount'] += $row1['orderamount'];
$tot['ordercancel'] += $row1['ordercancel'];
$tot['dc'] += $row['od_dc_amount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_amount'];
$tot['receiptpoint'] += $row['od_receipt_point'];
$tot['receiptamount'] += $row['receiptamount'];
$tot['receiptcancel'] += $row['receiptcancel'];
$tot['misu'] += $misu;
}
?>
<section id="ssale_month" class="cbox">
@ -87,55 +54,50 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
<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>
<th scope="col">입금취소</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
</tr>
</thead>
<tfoot>
<tr>
<td>합 계</td>
<td><?php echo number_format($tot['ordercount']); ?></td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['ordercancel'] + $tot['dc']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['receiptcancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
<tbody>
<?php
unset($save);
unset($tot);
for ($i=0; $i<count($lines); $i++)
for ($i=0; $row=sql_fetch_array($result); $i++)
{
if ($i == 0)
$save['od_date'] = $lines[$i]['od_date'];
$save['od_date'] = $row['od_date'];
if ($save['od_date'] != $lines[$i]['od_date']) {
if ($save['od_date'] != $row['od_date']) {
print_line($save);
unset($save);
$save['od_date'] = $lines[$i]['od_date'];
$save['od_date'] = $row['od_date'];
}
$misu = $lines1[$i]['orderamount'] - $lines1[$i]['ordercancel'] - $lines[$i]['od_dc_amount'] - $lines[$i]['receiptamount'] + $lines[$i]['receiptcancel'];
$save['ordercount']++;
$save['orderamount'] += $lines1[$i]['orderamount'];
$save['ordercancel'] += $lines1[$i]['ordercancel'];
$save['dc'] += $lines[$i]['od_dc_amount'];
if($lines[$i]['od_settle_case'] == '무통장' || $lines[$i]['od_settle_case'] == '가상계좌' || $lines[$i]['od_settle_case'] == '계좌이체')
$save['receiptbank'] += $lines[$i]['od_receipt_amount'];
if($lines[$i]['od_settle_case'] == '신용카드')
$save['receiptcard'] += $lines[$i]['od_receipt_amount'];
$save['receiptpoint'] += $lines[$i]['od_receipt_point'];
$save['receiptcancel'] += $lines[$i]['receiptcancel'];
$save['misu'] += $misu;
$save['orderamount'] += $row['od_cart_amount'];
$save['ordercancel'] += $row['od_cancel_amount'];
$save['ordercoupon'] += $row['couponamount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$save['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$save['receiptcard'] += $row['od_receipt_amount'];
$save['receiptpoint'] += $row['od_receipt_point'];
$save['misu'] += $row['misu'];
$tot['ordercount']++;
$tot['orderamount'] += $row['od_cart_amount'];
$tot['ordercancel'] += $row['od_cancel_amount'];
$tot['ordercoupon'] += $row['couponamount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_amount'];
$tot['receiptpoint'] += $row['od_receipt_point'];
$tot['misu'] += $row['misu'];
}
if ($i == 0) {
@ -145,7 +107,19 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
}
?>
</tbody>
<tfoot>
<tr>
<td>합 계</td>
<td><?php echo number_format($tot['ordercount']); ?></td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['ordercoupon']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
</table>
</section>

View File

@ -9,49 +9,20 @@ $date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $date);
$g4['title'] = "$date 일 매출현황";
include_once (G4_ADMIN_PATH.'/admin.head.php');
unset($tot);
$lines = $lines1 = array();
$sql = " select od_id,
mb_id,
od_name,
od_send_cost,
od_settle_case,
od_cart_amount,
od_receipt_amount,
od_receipt_point,
od_dc_amount,
(od_receipt_amount + od_receipt_point) as receiptamount,
(od_refund_amount + od_cancel_card) as receiptcancel
od_cancel_amount,
(od_cart_amount + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon - od_receipt_amount - od_cancel_amount) as misu,
(od_cart_coupon + od_coupon + od_send_coupon) as couponamount
from {$g4['shop_order_table']}
where SUBSTRING(od_time,1,10) = '$date'
order by od_id desc ";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
$lines[$i] = $row;
// 장바구니 상태별 금액
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];
$misu = $row1['orderamount'] - $row1['ordercancel'] - $row['od_dc_amount'] - $row['receiptamount'] + $row['receiptcancel'];
$lines1[$i] = $row1;
$tot['orderamount'] += $row1['orderamount'];
$tot['ordercancel'] += $row1['ordercancel'];
$tot['dc'] += $row['od_dc_amount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receipt_bank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receipt_card'] += $row['od_receipt_amount'];
$tot['receipt_point'] += $row['od_receipt_point'];
$tot['receiptamount'] += $row['receiptamount'];
$tot['receiptcancel'] += $row['receiptcancel'];
$tot['misu'] += $misu;
}
?>
<section class="cbox">
@ -63,58 +34,55 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
<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>
<th scope="col">입금취소</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="2">합 계</td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['ordercancel'] + $tot['dc']); ?></td>
<td><?php echo number_format($tot['receipt_bank']); ?></td>
<td><?php echo number_format($tot['receipt_card']); ?></td>
<td><?php echo number_format($tot['receipt_point']); ?></td>
<td><?php echo number_format($tot['receiptcancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
<tbody>
<?php
unset($tot);
for ($i=0; $i<count($lines); $i++)
for ($i=0; $row=sql_fetch_array($result); $i++)
{
if ($row['mb_id'] == '') { // 비회원일 경우는 주문자로 링크
$href = '<a href="./orderlist.php?sel_field=od_name&amp;search='.$lines[$i]['od_name'].'">';
$href = '<a href="./orderlist.php?sel_field=od_name&amp;search='.$row['od_name'].'">';
} else { // 회원일 경우는 회원아이디로 링크
$href = '<a href="./orderlist.php?sel_field=mb_id&amp;search='.$lines[$i]['mb_id'].'">';
$href = '<a href="./orderlist.php?sel_field=mb_id&amp;search='.$row['mb_id'].'">';
}
$misu = $lines1[$i]['orderamount'] - $lines1[$i]['ordercancel'] - $lines[$i]['od_dc_amount'] - $lines[$i]['receiptamount'] + $lines[$i]['receiptcancel'];
$misu = $row['misu'];
$receipt_bank = $receipt_card = 0;
if($lines[$i]['od_settle_case'] == '무통장' || $lines[$i]['od_settle_case'] == '가상계좌' || $lines[$i]['od_settle_case'] == '계좌이체')
$receipt_bank = $lines[$i]['od_receipt_amount'];
if($lines[$i]['od_settle_case'] == '신용카드')
$receipt_card = $lines[$i]['od_receipt_amount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$receipt_bank = $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$receipt_card = $row['od_receipt_amount'];
?>
<tr>
<td class="td_odrnum2"><a href="./orderform.php?od_id=<?php echo $lines[$i]['od_id']; ?>"><?php echo $lines[$i]['od_id']; ?></a></td>
<td class="td_name"><?php echo $href; ?><?php echo $lines[$i]['od_name']; ?></a></td>
<td class="td_num"><?php echo number_format($lines1[$i]['orderamount']); ?></td>
<td class="td_num"><?php echo number_format($lines1[$i]['ordercancel'] + $lines[$i]['od_dc_amount']); ?></td>
<td class="td_odrnum2"><a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>"><?php echo $row['od_id']; ?></a></td>
<td class="td_name"><?php echo $href; ?><?php echo $row['od_name']; ?></a></td>
<td class="td_num"><?php echo number_format($row['od_cart_amount']); ?></td>
<td class="td_num"><?php echo number_format($row['couponamount']); ?></td>
<td class="td_num"><?php echo number_format($receipt_bank); ?></td>
<td class="td_num"><?php echo number_format($receipt_card); ?></td>
<td class="td_num"><?php echo number_format($lines[$i]['od_receipt_point']); ?></td>
<td class="td_num"><?php echo number_format($lines[$i]['receiptcancel']); ?></td>
<td class="td_num"><?php echo number_format($row['od_receipt_point']); ?></td>
<td class="td_num"><?php echo number_format($row['od_cancel_amount']); ?></td>
<td class="td_num"><?php echo number_format($misu); ?></td>
</tr>
<?php
$tot['orderamount'] += $row['od_cart_amount'];
$tot['ordercancel'] += $row1['od_cancel_amount'];
$tot['coupon'] += $row['couponamount'] ;
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receipt_bank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receipt_card'] += $row['od_receipt_amount'];
$tot['receipt_point'] += $row['od_receipt_point'];
$tot['misu'] += $misu;
}
if ($i == 0) {
@ -122,6 +90,18 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
}
?>
</tbody>
<tfoot>
<tr>
<td colspan="2">합 계</td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['coupon']); ?></td>
<td><?php echo number_format($tot['receipt_bank']); ?></td>
<td><?php echo number_format($tot['receipt_card']); ?></td>
<td><?php echo number_format($tot['receipt_point']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
</table>
</section>

View File

@ -9,9 +9,6 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
function print_line($save)
{
global $admin_dir;
static $count = 0;
?>
<tr>
<td><a href="./sale1month.php?fr_month=<?php echo $save['od_date']; ?>01&amp;to_month=<?php echo $save['od_date']; ?>12"><?php echo $save['od_date']; ?></a></td>
@ -27,50 +24,20 @@ function print_line($save)
<?php
}
$lines = $lines1 = array();
unset($save);
unset($tot);
$sql = " select od_id,
SUBSTRING(od_time,1,4) as od_date,
od_send_cost,
od_settle_case,
od_receipt_amount,
od_receipt_point,
od_dc_amount,
(od_receipt_amount + od_receipt_point) as receiptamount,
(od_refund_amount + od_cancel_card) as receiptcancel
od_cart_amount,
od_cancel_amount,
(od_cart_amount + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon - od_receipt_amount - od_cancel_amount) as misu,
(od_cart_coupon + od_coupon + od_send_coupon) as couponamount
from {$g4['shop_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++)
{
$lines[$i] = $row;
// 장바구니 상태별 금액
$sql1 = " select (SUM(IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty))) as orderamount, /* 주문합계 */
(SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', IF(io_type = 1, io_price * ct_qty, (ct_price + io_price) * ct_qty), 0))) as ordercancel /* 주문취소 */
from {$g4['shop_cart_table']}
where od_id = '{$row['od_id']}' ";
$row1 = sql_fetch($sql1);
$row1['orderamount'] += $row['od_send_cost'];
$misu = $row1['orderamount'] - $row1['ordercancel'] - $row['od_dc_amount'] - $row['receiptamount'] + $row['receiptcancel'];
$lines1[$i] = $row1;
$tot['ordercount']++;
$tot['orderamount'] += $row1['orderamount'];
$tot['ordercancel'] += $row1['ordercancel'];
$tot['dc'] += $row['od_dc_amount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_amount'];
$tot['receiptpoint'] += $row['od_receipt_point'];
$tot['receiptamount'] += $row['receiptamount'];
$tot['receiptcancel'] += $row['receiptcancel'];
$tot['misu'] += $misu;
}
?>
<section id="ssale_year" class="cbox">
@ -82,55 +49,50 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
<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>
<th scope="col">입금취소</th>
<th scope="col">주문취소</th>
<th scope="col">미수금</th>
</tr>
</thead>
<tfoot>
<tr>
<td>합 계</td>
<td><?php echo number_format($tot['ordercount']); ?></td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['ordercancel'] + $tot['dc']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['receiptcancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
<tbody>
<?php
unset($save);
unset($tot);
for ($i=0; $i<count($lines); $i++)
for ($i=0; $row=sql_fetch_array($result); $i++)
{
if ($i == 0)
$save['od_date'] = $lines[$i]['od_date'];
$save['od_date'] = $row['od_date'];
if ($save['od_date'] != $lines[$i]['od_date']) {
if ($save['od_date'] != $row['od_date']) {
print_line($save);
unset($save);
$save['od_date'] = $$lines[$i]['od_date'];
$save['od_date'] = $row['od_date'];
}
$misu = $lines1[$i]['orderamount'] - $lines1[$i]['ordercancel'] - $lines[$i]['od_dc_amount'] - $lines[$i]['receiptamount'] + $lines[$i]['receiptcancel'];
$save['ordercount']++;
$save['orderamount'] += $lines1[$i]['orderamount'];
$save['ordercancel'] += $lines1[$i]['ordercancel'];
$save['dc'] += $lines[$i]['od_dc_amount'];
if($lines[$i]['od_settle_case'] == '무통장' || $lines[$i]['od_settle_case'] == '가상계좌' || $lines[$i]['od_settle_case'] == '계좌이체')
$save['receiptbank'] += $lines[$i]['od_receipt_amount'];
if($lines[$i]['od_settle_case'] == '신용카드')
$save['receiptcard'] += $lines[$i]['od_receipt_amount'];
$save['receiptpoint'] += $lines[$i]['od_receipt_point'];
$save['receiptcancel'] += $lines[$i]['receiptcancel'];
$save['misu'] += $misu;
$save['orderamount'] += $row['od_cart_amount'];
$save['ordercancel'] += $row['od_cancel_amount'];
$save['ordercoupon'] += $row['couponamount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$save['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$save['receiptcard'] += $row['od_receipt_amount'];
$save['receiptpoint'] += $row['od_receipt_point'];
$save['misu'] += $row['misu'];
$tot['ordercount']++;
$tot['orderamount'] += $row['od_cart_amount'];
$tot['ordercancel'] += $row1['od_cancel_amount'];
$tot['ordercoupon'] += $row['couponamount'];
if($row['od_settle_case'] == '무통장' || $row['od_settle_case'] == '가상계좌' || $row['od_settle_case'] == '계좌이체')
$tot['receiptbank'] += $row['od_receipt_amount'];
if($row['od_settle_case'] == '신용카드')
$tot['receiptcard'] += $row['od_receipt_amount'];
$tot['receiptpoint'] += $row['od_receipt_point'];
$tot['misu'] += $row['misu'];
}
if ($i == 0) {
@ -140,6 +102,19 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
}
?>
</tbody>
<tfoot>
<tr>
<td>합 계</td>
<td><?php echo number_format($tot['ordercount']); ?></td>
<td><?php echo number_format($tot['orderamount']); ?></td>
<td><?php echo number_format($tot['ordercoupon']); ?></td>
<td><?php echo number_format($tot['receiptbank']); ?></td>
<td><?php echo number_format($tot['receiptcard']); ?></td>
<td><?php echo number_format($tot['receiptpoint']); ?></td>
<td><?php echo number_format($tot['ordercancel']); ?></td>
<td><?php echo number_format($tot['misu']); ?></td>
</tr>
</tfoot>
</table>
</section>

View File

@ -27,21 +27,9 @@ if (G4_HTTPS_DOMAIN) {
// 테이블 a 는 주문서 ($g4[shop_order_table])
// 테이블 b 는 장바구니 ($g4[shop_cart_table])
define(_MISU_QUERY_, "
count(distinct a.od_id) as ordercount, /* 주문서건수 */
count(b.ct_id) as itemcount, /* 상품건수 */
(SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost + a.od_send_cost2) as orderamount, /* 주문합계 */
(SUM(b.cp_amount) + a.od_coupon) as couponamount, /* 쿠폰합계*/
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) as ordercancel, /* 주문취소 */
(a.od_receipt_amount + a.od_receipt_point) as receiptamount, /* 입금합계 */
(a.od_refund_amount + a.od_cancel_card) as receiptcancel, /* 입금취소 */
(
(SUM(IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)) + a.od_send_cost + a.od_send_cost2 - a.od_send_coupon) -
(SUM(IF(b.ct_status = '취소' OR b.ct_status = '반품' OR b.ct_status = '품절', (IF(b.io_type = 1, b.io_price * b.ct_qty, (b.ct_price + b.io_price) * b.ct_qty)), 0))) -
a.od_dc_amount -
(a.od_receipt_amount + a.od_receipt_point) +
(a.od_refund_amount + a.od_cancel_card) -
(SUM(b.cp_amount) + a.od_coupon)
) as misu /* 미수금 = 주문합계 - 주문취소 - DC - 입금합계 + 입금취소 - 쿠폰합계 */");
( od_cart_amount + od_send_cost + od_send_cost2 - od_cart_coupon - od_coupon - od_send_coupon - od_receipt_amount - od_cancel_amount ) as misu,
( od_cart_coupon + od_coupon + od_send_coupon ) as couponamount
");
//------------------------------------------------------------------------------
// 쇼핑몰 상수 모음 끝
//------------------------------------------------------------------------------
@ -59,6 +47,13 @@ define('G4_SHOP_SKIN_URL', G4_URL .'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_
define('G4_MSHOP_SKIN_PATH', G4_MOBILE_PATH.'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']);
define('G4_MSHOP_SKIN_URL', G4_MOBILE_URL .'/'.G4_SKIN_DIR.'/shop/'.$default['de_shop_mobile_skin']);
// 주문상태 상수
define('G4_OD_STATUS_ORDER' , '입금확인중');
define('G4_OD_STATUS_SETTLE' , '결제완료');
define('G4_OD_STATUS_READY' , '배송준비중');
define('G4_OD_STATUS_DELIVERY' , '배송중');
define('G4_OD_STATUS_FINISH' , '배송완료');
//==============================================================================
// 쇼핑몰 필수 실행코드 모음 끝
//==============================================================================

View File

@ -474,4 +474,14 @@ if(!sql_query(" select de_settle_min_point from {$g4['shop_default_table']} ", f
ADD `de_settle_point_unit` int(11) NOT NULL DEFAULT '0' AFTER `de_settle_max_point`,
DROP `de_point_per` ", true);
}
// 주문 금액 등의 필드 추가
if(!sql_query(" select od_cart_count from {$g4['shop_order_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g4['shop_order_table']}`
ADD `od_cart_count` int(11) NOT NULL DEFAULT '0' AFTER `od_memo`,
ADD `od_cart_amount` int(11) NOT NULL DEFAULT '0' AFTER `od_cart_count`,
ADD `od_cart_coupon` int(11) NOT NULL DEFAULT '0' AFTER `od_cart_amount`,
ADD `od_cancel_amount` int(11) NOt NULL DEFAULT '0' AFTER `od_receipt_amount`,
ADD `od_status` varchar(255) NOT NULL DEFAULT '' AFTER `od_mod_history` ", true);
}
?>

View File

@ -572,20 +572,21 @@ CREATE TABLE IF NOT EXISTS `shop_order` (
`od_b_addr1` varchar(100) NOT NULL DEFAULT '',
`od_b_addr2` varchar(100) NOT NULL DEFAULT '',
`od_memo` text NOT NULL,
`od_cart_count` int(11) NOT NULL DEFAULT '0',
`od_cart_amount` int(11) NOT NULL DEFAULT '0',
`od_cart_coupon` int(11) NOT NULL DEFAULT '0',
`od_send_cost` int(11) NOT NULL DEFAULT '0',
`od_send_coupon` int(11) NOT NULL DEFAULT '0',
`od_send_cost2` int(11) NOT NULL DEFAULT '0',
`od_temp_amount` int(11) NOT NULL DEFAULT '0',
`od_receipt_amount` int(11) NOT NULL DEFAULT '0',
`od_cancel_amount` int(11) NOT NULL DEFAULT '0',
`od_receipt_point` int(11) NOT NULL DEFAULT '0',
`od_bank_account` varchar(255) NOT NULL DEFAULT '',
`od_receipt_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`od_cancel_card` int(11) NOT NULL DEFAULT '0',
`od_dc_amount` int(11) NOT NULL DEFAULT '0',
`od_coupon` int(11) NOT NULL DEFAULT '0',
`od_refund_amount` int(11) NOT NULL DEFAULT '0',
`od_shop_memo` text NOT NULL,
`od_mod_history` text NOT NULL,
`od_status` varchar(255) NOT NULL DEFAULT '',
`dl_id` int(11) NOT NULL DEFAULT '0',
`od_invoice` varchar(255) NOT NULL DEFAULT '',
`od_invoice_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

View File

@ -1367,7 +1367,10 @@ function payment_check(f)
{
var temp_point = 0;
var max_point = 0;
var tot_sell_amount = parseInt($("input[name=od_amount]").val());
var od_amount = parseInt(f.od_amount.value);
var send_cost = parseInt(f.od_send_cost.value);
var send_cost2 = parseInt(f.od_send_cost2.value);
var send_coupon = parseInt(f.od_send_coupon.value);
if (typeof(f.max_temp_point) != "undefined")
var max_point = parseInt(f.max_temp_point.value);
@ -1384,7 +1387,7 @@ function payment_check(f)
return false;
}
if (temp_point > tot_sell_amount) {
if (temp_point > od_amount) {
alert("상품 주문금액(배송비 제외) 보다 많이 포인트결제할 수 없습니다.");
f.od_temp_point.select();
return false;
@ -1410,6 +1413,8 @@ function payment_check(f)
}
}
var tot_amount = od_amount + send_cost + send_cost2 - send_coupon - temp_point;
if (document.getElementById("od_settle_iche")) {
if (document.getElementById("od_settle_iche").checked) {
if (tot_amount - temp_point < 150) {

View File

@ -3,13 +3,9 @@ include_once('./_common.php');
if(get_magic_quotes_gpc())
{
//$_GET = array_map("stripslashes", $_GET);
//$_POST = array_map("stripslashes", $_POST);
$_GET = array_add_callback("stripslashes", $_GET);
$_POST = array_add_callback("stripslashes", $_POST);
}
//$_GET = array_map("mysql_real_escape_string", $_GET);
//$_POST = array_map("mysql_real_escape_string", $_POST);
$_GET = array_add_callback("mysql_real_escape_string", $_GET);
$_POST = array_add_callback("mysql_real_escape_string", $_POST);
@ -301,16 +297,14 @@ $i_amount = $i_amount + $i_send_cost + $i_send_cost2 - $i_temp_point - $i_send_c
if ($od_settle_case == "무통장")
{
$od_temp_amount = $i_amount;
$od_receipt_point = $i_temp_point;
$od_receipt_amount = 0;
$od_status = G4_OD_STATUS_ORDER;
}
else if ($od_settle_case == "계좌이체")
{
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_tno = $tno;
$od_receipt_amount = $amount;
$od_receipt_point = $i_temp_point;
@ -320,14 +314,13 @@ else if ($od_settle_case == "계좌이체")
$bank_name = iconv("cp949", "utf8", $bank_name);
$od_bank_account = $bank_name;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_SETTLE;
}
else if ($od_settle_case == "가상계좌")
{
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_receipt_point = $i_temp_point;
$od_tno = $tno;
$od_receipt_amount = 0;
$bankname = iconv("cp949", "utf8", $bankname);
@ -335,26 +328,24 @@ else if ($od_settle_case == "가상계좌")
$od_bank_account = $bankname.' '.$account.' '.$depositor;
$od_deposit_name = $od_name;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_ORDER;
}
else if ($od_settle_case == "휴대폰")
{
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_tno = $tno;
$od_receipt_amount = $amount;
$od_receipt_point = $i_temp_point;
$od_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$od_bank_account = $commid.' '.$mobile_no;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_SETTLE;
}
else if ($od_settle_case == "신용카드")
{
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_tno = $tno;
$od_app_no = $app_no;
$od_receipt_amount = $amount;
@ -363,6 +354,7 @@ else if ($od_settle_case == "신용카드")
$card_name = iconv("cp949", "utf8", $card_name);
$od_bank_account = $card_name;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_SETTLE;
}
else
{
@ -392,8 +384,8 @@ if($escw_yn == 'Y')
$od_escrow = 1;
// 복합과세 금액
$od_tax_mny = round($od_temp_amount / 1.1);
$od_vat_mny = $od_temp_amount - $od_tax_mny;
$od_tax_mny = round($i_amount / 1.1);
$od_vat_mny = $i_amount - $od_tax_mny;
$od_free_mny = 0;
if($default['de_tax_flag_use']) {
$od_tax_mny = (int)$_POST['comm_tax_mny'];
@ -423,11 +415,13 @@ $sql = " insert {$g4['shop_order_table']}
od_b_addr2 = '$od_b_addr2',
od_deposit_name = '$od_deposit_name',
od_memo = '$od_memo',
od_cart_count = '$tot_ct_count',
od_cart_amount = '$tot_ct_amount',
od_cart_coupon = '$tot_it_cp_amount',
od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_amount',
od_send_cost2 = '$od_send_cost2',
od_coupon = '$tot_od_cp_amount',
od_temp_amount = '$od_temp_amount',
od_receipt_amount = '$od_receipt_amount',
od_receipt_point = '$od_receipt_point',
od_bank_account = '$od_bank_account',
@ -439,6 +433,7 @@ $sql = " insert {$g4['shop_order_table']}
od_tax_mny = '$od_tax_mny',
od_vat_mny = '$od_vat_mny',
od_free_mny = '$od_free_mny',
od_status = '$od_status',
od_shop_memo = '',
od_hope_date = '$od_hope_date',
od_time = '".G4_TIME_YMDHIS."',

View File

@ -123,13 +123,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<td class="td_smallmng"><?php echo $opt['ct_status']; ?></td>
</tr>
<?php
if ($opt['ct_status'] == '취소' || $opt['ct_status'] == '반품' || $opt['ct_status'] == '품절') {
$tot_cancel_amount += $sell_amount;
}
else {
$tot_point += $point;
$tot_sell_amount += $sell_amount;
}
$tot_point += $point;
// 전체 상품의 상태가 주문인지 비교할 때 사용
$od_count1++;
@ -143,12 +137,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
</table>
</li>
<?php
$tot_cp_amount += $row['cp_amount'];
}
$send_cost = $od['od_send_cost'];
$send_cost2 = $od['od_send_cost2'];
$send_coupon = $od['od_send_coupon'];
?>
</ul>
@ -284,37 +273,36 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
$od_coupon = $od['od_coupon'];
$tot_amount = $tot_sell_amount + $send_cost + $send_cost2 - $tot_cp_amount - $od_coupon - $send_coupon;
$tot_amount = $od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2'] - $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon'];
?>
<dl id="sod_bsk_tot">
<dt class="sod_bsk_dvr">주문총액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($tot_sell_amount); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_amount']); ?> 원</strong></dd>
<?php if($tot_cp_amount > 0) { ?>
<?php if($od['od_cart_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">상품할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($tot_cp_amount); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if($od_coupon > 0) { ?>
<?php if($od['od_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">결제할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od_coupon); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($send_cost > 0) { ?>
<?php if ($od['od_send_cost'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost']); ?> 원</strong></dd>
<?php } ?>
<?php if($send_coupon > 0) { ?>
<?php if($od['od_send_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_coupon); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($send_cost2 > 0) { ?>
<?php if ($od['od_send_cost2'] > 0) { ?>
<dt class="sod_bsk_dvr">추가배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost2); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost2']); ?> 원</strong></dd>
<?php } ?>
<dt class="sod_bsk_cnt">총계</dt>
@ -331,8 +319,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
$receipt_amount = $od['od_receipt_amount']
+ $od['od_receipt_point']
- $od['od_cancel_card']
- $od['od_refund_amount'];
- $od['od_cancel_amount'];
$misu = true;
@ -474,22 +461,12 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
}
if ($od['od_cancel_card'] > 0)
if ($od['od_cancel_amount'] > 0)
{
?>
<tr>
<th scope="row">승인취소 금액</th>
<td><?php echo display_price($od['od_cancel_card']); ?></td>
</tr>
<?php
}
if ($od['od_refund_amount'] > 0)
{
?>
<tr>
<th scope="row">환불 금액</th>
<td><?php echo display_price($od['od_refund_amount']); ?></td>
<th scope="row">취소/환불 금액</th>
<td><?php echo display_price($od['od_cancel_amount']); ?></td>
</tr>
<?php
}

View File

@ -1511,7 +1511,11 @@ function forderform_check(f)
return false;
}
var tot_sell_amount = parseInt($("input[name=od_amount]").val());
var od_amount = parseInt(f.od_amount.value);
var send_cost = parseInt(f.od_send_cost.value);
var send_cost2 = parseInt(f.od_send_cost2.value);
var send_coupon = parseInt(f.od_send_coupon.value);
var max_point = 0;
if (typeof(f.max_temp_point) != "undefined")
max_point = parseInt(f.max_temp_point.value);
@ -1529,7 +1533,7 @@ function forderform_check(f)
return false;
}
if (temp_point > tot_sell_amount) {
if (temp_point > od_amount) {
alert("상품 주문금액(배송비 제외) 보다 많이 포인트결제할 수 없습니다.");
f.od_temp_point.select();
return false;
@ -1564,6 +1568,8 @@ function forderform_check(f)
}
}
var tot_amount = od_amount + send_cost + send_cost2 - send_coupon - temp_point;
if (document.getElementById("od_settle_iche")) {
if (document.getElementById("od_settle_iche").checked) {
if (tot_amount - temp_point < 150) {

View File

@ -61,10 +61,12 @@ $i_temp_point = (int)$_POST['od_temp_point'];
// 주문금액이 상이함
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as od_amount,
COUNT(distinct it_id) as cart_count
from {$g4['shop_cart_table']} where od_id = '$tmp_cart_id' and ct_select = '1' ";
$row = sql_fetch($sql);
$tot_ct_amount = $row['od_amount'];
$cart_count = $row['cart_count'];
// 쿠폰금액계산
$tot_cp_amount = 0;
@ -292,16 +294,14 @@ $i_amount = $i_amount + $i_send_cost + $i_send_cost2 - $i_temp_point - $i_send_c
if ($od_settle_case == "무통장")
{
$od_temp_amount = $i_amount;
$od_receipt_point = $i_temp_point;
$od_receipt_amount = 0;
$od_status = G4_OD_STATUS_ORDER;
}
else if ($od_settle_case == "계좌이체")
{
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_tno = $tno;
$od_receipt_amount = $amount;
$od_receipt_point = $i_temp_point;
@ -311,14 +311,13 @@ else if ($od_settle_case == "계좌이체")
$bank_name = iconv("cp949", "utf8", $bank_name);
$od_bank_account = $bank_name;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_SETTLE;
}
else if ($od_settle_case == "가상계좌")
{
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_receipt_point = $i_temp_point;
$od_tno = $tno;
$od_receipt_amount = 0;
$bankname = iconv("cp949", "utf8", $bankname);
@ -326,26 +325,24 @@ else if ($od_settle_case == "가상계좌")
$od_bank_account = $bankname.' '.$account.' '.$depositor;
$od_deposit_name = $depositor;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_ORDER;
}
else if ($od_settle_case == "휴대폰")
{
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_tno = $tno;
$od_receipt_amount = $amount;
$od_receipt_point = $i_temp_point;
$od_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$od_bank_account = $commid.' '.$mobile_no;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_SETTLE;
}
else if ($od_settle_case == "신용카드")
{
include G4_SHOP_PATH.'/kcp/pp_ax_hub.php';
$od_temp_amount = $i_amount;
$od_tno = $tno;
$od_app_no = $app_no;
$od_receipt_amount = $amount;
@ -354,6 +351,7 @@ else if ($od_settle_case == "신용카드")
$card_name = iconv("cp949", "utf8", $card_name);
$od_bank_account = $card_name;
$pg_amount = $amount;
$od_status = G4_OD_STATUS_SETTLE;
}
else
{
@ -383,8 +381,8 @@ if($escw_yn == 'Y')
$od_escrow = 1;
// 복합과세 금액
$od_tax_mny = round($od_temp_amount / 1.1);
$od_vat_mny = $od_temp_amount - $od_tax_mny;
$od_tax_mny = round($i_amount / 1.1);
$od_vat_mny = $i_amount - $od_tax_mny;
$od_free_mny = 0;
if($default['de_tax_flag_use']) {
$od_tax_mny = (int)$_POST['comm_tax_mny'];
@ -414,11 +412,13 @@ $sql = " insert {$g4['shop_order_table']}
od_b_addr2 = '$od_b_addr2',
od_deposit_name = '$od_deposit_name',
od_memo = '$od_memo',
od_cart_count = '$cart_count',
od_cart_amount = '$tot_ct_amount',
od_cart_coupon = '$tot_it_cp_amount',
od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_amount',
od_send_cost2 = '$od_send_cost2',
od_coupon = '$tot_od_cp_amount',
od_temp_amount = '$od_temp_amount',
od_receipt_amount = '$od_receipt_amount',
od_receipt_point = '$od_receipt_point',
od_bank_account = '$od_bank_account',
@ -430,6 +430,7 @@ $sql = " insert {$g4['shop_order_table']}
od_tax_mny = '$od_tax_mny',
od_vat_mny = '$od_vat_mny',
od_free_mny = '$od_free_mny',
od_status = '$od_status',
od_shop_memo = '',
od_hope_date = '$od_hope_date',
od_time = '".G4_TIME_YMDHIS."',

View File

@ -136,13 +136,7 @@ if(openwin != null) {
<td class="td_smallmng"><?php echo $opt['ct_status']; ?></td>
</tr>
<?php
if ($opt['ct_status'] == '취소' || $opt['ct_status'] == '반품' || $opt['ct_status'] == '품절') {
$tot_cancel_amount += $sell_amount;
}
else {
$tot_point += $point;
$tot_sell_amount += $sell_amount;
}
$tot_point += $point;
// 전체 상품의 상태가 주문인지 비교할 때 사용
$od_count1++;
@ -150,7 +144,6 @@ if(openwin != null) {
$od_count2++;
$idx++;
$tot_cp_amount += $opt['cp_amount'];
}
?>
</tbody>
@ -158,10 +151,6 @@ if(openwin != null) {
</li>
<?php
}
$send_cost = $od['od_send_cost'];
$send_cost2 = $od['od_send_cost2'];
$send_coupon = $od['od_send_coupon'];
?>
</ul>
@ -298,37 +287,36 @@ if(openwin != null) {
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
$od_coupon = $od['od_coupon'];
$tot_amount = $tot_sell_amount + $send_cost + $send_cost2 - $tot_cp_amount - $od_coupon - $send_coupon;
$tot_amount = $od['od_cart_amount'] + $od['od_send_cost'] + $od['od_send_cost2'] - $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon'];
?>
<dl id="sod_bsk_tot">
<dt class="sod_bsk_dvr">주문총액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($tot_sell_amount); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_amount']); ?> 원</strong></dd>
<?php if($tot_cp_amount > 0) { ?>
<?php if($od['od_cart_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">상품할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($tot_cp_amount); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if($od_coupon > 0) { ?>
<?php if($od['od_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">결제할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od_coupon); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($send_cost > 0) { ?>
<?php if ($od['od_send_cost'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost']); ?> 원</strong></dd>
<?php } ?>
<?php if($send_coupon > 0) { ?>
<?php if($od['od_send_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_coupon); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($send_cost2 > 0) { ?>
<?php if ($od['od_send_cost2'] > 0) { ?>
<dt class="sod_bsk_dvr">추가배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost2); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost2']); ?> 원</strong></dd>
<?php } ?>
<dt class="sod_bsk_cnt">총계</dt>
@ -346,8 +334,7 @@ if(openwin != null) {
<?php
$receipt_amount = $od['od_receipt_amount']
+ $od['od_receipt_point']
- $od['od_cancel_card']
- $od['od_refund_amount'];
- $od['od_cancel_amount'];
$misu = true;
@ -486,22 +473,12 @@ if(openwin != null) {
<?php
}
if ($od['od_cancel_card'] > 0)
if ($od['od_cancel_amount'] > 0)
{
?>
<tr>
<th scope="row">결제취소 금액</th>
<td><?php echo display_price($od['od_cancel_card']); ?></td>
</tr>
<?php
}
if ($od['od_refund_amount'] > 0)
{
?>
<tr>
<th scope="row">환불 금액</th>
<td><?php echo display_price($od['od_refund_amount']); ?></td>
<th scope="row">취소/환불 금액</th>
<td><?php echo display_price($od['od_cancel_amount']); ?></td>
</tr>
<?php
}

View File

@ -159,6 +159,7 @@ if(!$default['de_card_test']) {
$sql = " update {$g4['shop_order_table']}
set od_receipt_amount = od_receipt_amount + '$ipgm_mnyx',
od_receipt_time = '$tx_tm',
od_status = '".G4_OD_STATUS_SETTLE."',
od_shop_memo = concat(od_shop_memo, \"\\n개인결제 ".$row['pp_id']." 로 결제완료 - ".$receipt_time."\")
where od_id = '{$row['od_id']}' ";
sql_query($sql, FALSE);
@ -167,7 +168,8 @@ if(!$default['de_card_test']) {
// 주문서 UPDATE
$sql = " update {$g4['shop_order_table']}
set od_receipt_amount = '$ipgm_mnyx',
od_receipt_time = '$tx_tm'
od_receipt_time = '$tx_tm',
od_status = '".G4_OD_STATUS_SETTLE."'
where od_id = '$order_no'
and od_tno = '$tno' ";
sql_query($sql, FALSE);