Merge branch 'master' into orderlist
Conflicts: adm/shop_admin/orderlist.php
This commit is contained in:
@ -218,14 +218,16 @@ $pg_anchor = '<ul class="anchor">
|
||||
</div>
|
||||
|
||||
<div class="btn_list02 btn_list">
|
||||
<strong>주문상태 변경</strong>
|
||||
<input type="hidden" name="chk_cnt" value="<?php echo $chk_cnt; ?>">
|
||||
<input type="submit" name="act_button" value="주문" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="상품준비중" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="배송중" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="상품" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="배송" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="완료" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="취소" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="반품" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="품절" onclick="document.pressed=this.value">
|
||||
<p>취소,반품,품절 상태는 장바구니 상품의 상태만 변경이 되며 주문서의 상태는 변경되지 않습니다.</p>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -247,19 +249,19 @@ $pg_anchor = '<ul class="anchor">
|
||||
|
||||
<?php
|
||||
// 주문금액 = 상품구입금액 + 배송비 + 추가배송비
|
||||
$amount['주문'] = $od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2'];
|
||||
$amount['order'] = $od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2'];
|
||||
|
||||
// 입금액 = 결제금액 + 포인트
|
||||
$amount['입금'] = $od['od_receipt_price'] + $od['od_receipt_point'];
|
||||
$amount['receipt'] = $od['od_receipt_price'] + $od['od_receipt_point'];
|
||||
|
||||
// 쿠폰금액
|
||||
$amount['쿠폰'] = $od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon'];
|
||||
$amount['coupon'] = $od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon'];
|
||||
|
||||
// 취소금액
|
||||
$amount['취소'] = $od['od_cancel_price'];
|
||||
$amount['cancel'] = $od['od_cancel_price'];
|
||||
|
||||
// 미수금 = 주문금액 - 취소금액 - 입금금액 - 쿠폰금액
|
||||
//$amount['미수'] = $amount['주문'] - $amount['입금'] - $amount['쿠폰'];
|
||||
//$amount['미수'] = $amount['order'] - $amount['receipt'] - $amount['coupon'];
|
||||
|
||||
// 결제방법
|
||||
$s_receipt_way = $od['od_settle_case'];
|
||||
@ -289,12 +291,12 @@ $pg_anchor = '<ul class="anchor">
|
||||
<tr>
|
||||
<td><?php echo $od['od_id']; ?></td>
|
||||
<td class="td_paybybig"><?php echo $s_receipt_way; ?></td>
|
||||
<td class="td_numbig td_numsum"><?php echo display_price($amount['주문']); ?></td>
|
||||
<td class="td_numbig td_numsum"><?php echo display_price($amount['order']); ?></td>
|
||||
<td class="td_numbig"><?php echo display_price($od['od_send_cost'] + $od['od_send_cost2']); ?></td>
|
||||
<td class="td_numbig"><?php echo display_point($od['od_receipt_point']); ?></td>
|
||||
<td class="td_numbig td_numincome"><?php echo number_format($amount['입금']); ?>원</td>
|
||||
<td class="td_numbig td_numcoupon"><?php echo display_price($amount['쿠폰']); ?></td>
|
||||
<td class="td_numbig td_numcancel"><?php echo number_format($amount['취소']); ?>원</td>
|
||||
<td class="td_numbig td_numincome"><?php echo number_format($amount['receipt']); ?>원</td>
|
||||
<td class="td_numbig td_numcoupon"><?php echo display_price($amount['coupon']); ?></td>
|
||||
<td class="td_numbig td_numcancel"><?php echo number_format($amount['cancel']); ?>원</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -414,32 +416,19 @@ $pg_anchor = '<ul class="anchor">
|
||||
<th scope="row">결제취소/환불액</th>
|
||||
<td><?php echo display_price($od['od_refund_price']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$sql = " select dl_company, dl_url, dl_tel from {$g5['g5_shop_delivery_table']} where dl_id = '{$od['dl_id']}' ";
|
||||
$dl = sql_fetch($sql);
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row">배송회사</th>
|
||||
<td>
|
||||
<?php
|
||||
if ($od['dl_id'] > 0) {
|
||||
// get 으로 날리는 경우 운송장번호를 넘김
|
||||
if (strpos($dl['dl_url'], "=")) $invoice = $od['od_invoice'];
|
||||
?>
|
||||
<a href="<?php echo $dl['dl_url']; ?><?php echo $invoice; ?>" target="_blank"><?php echo $dl['dl_company']; ?></a> (고객센터 <?php echo $dl['dl_tel']; ?>)
|
||||
<?php } else { ?>배송회사를 선택해 주세요.
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if ($od['od_invoice']) { ?>
|
||||
<tr>
|
||||
<th scope="row">운송장번호</th>
|
||||
<td><?php echo $od['od_invoice']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">배송회사</th>
|
||||
<td><?php echo $od['od_delivery_company']; ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row">배송일시</th>
|
||||
<td><?php echo is_null_time($od['od_invoice_time']) ? $od['od_invoice_time'] : ''; ?></td>
|
||||
<td><?php echo is_null_time($od['od_invoice_time']) ? "" : $od['od_invoice_time']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="od_send_cost">배송비</label></th>
|
||||
@ -536,8 +525,8 @@ $pg_anchor = '<ul class="anchor">
|
||||
<th scope="row"><label for="od_deposit_name">입금자명</label></th>
|
||||
<td>
|
||||
<?php if ($default['de_sms_use3']) { ?>
|
||||
<label for="od_sms_ipgum_check">SMS 문자전송</label>
|
||||
<input type="checkbox" name="od_sms_ipgum_check" id="od_sms_ipgum_check">
|
||||
<label for="od_sms_ipgum_check">SMS 입금 문자전송</label>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<input type="text" name="od_deposit_name" value="<?php echo $od['od_deposit_name']; ?>" id="od_deposit_name" class="frm_input">
|
||||
@ -603,35 +592,23 @@ $pg_anchor = '<ul class="anchor">
|
||||
<input type="text" name="od_refund_price" value="<?php echo $od['od_refund_price']; ?>" class="frm_input" size="10"> 원
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="dl_id">배송회사</label></th>
|
||||
<td>
|
||||
<select name="dl_id" id="dl_id">
|
||||
<option value="">배송시 선택하세요.</option>
|
||||
<?php
|
||||
$sql = "select * from {$g5['g5_shop_delivery_table']} order by dl_order desc, dl_id desc ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
?>
|
||||
<option value="<?php echo $row['dl_id']; ?>" <?php echo get_selected($od['dl_id'], $row['dl_id']); ?>><?php echo $row['dl_company']; ?></option>
|
||||
<?php
|
||||
}
|
||||
mysql_free_result($result);
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="od_invoice">운송장번호</label></th>
|
||||
<td>
|
||||
<?php if ($default['de_sms_use4']) { ?>
|
||||
<label for="od_sms_baesong_check">SMS 문자전송</label>
|
||||
<input type="checkbox" name="od_sms_baesong_check" id="od_sms_baesong_check">
|
||||
<label for="od_sms_baesong_check">SMS 배송 문자전송</label>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<input type="text" name="od_invoice" value="<?php echo $od['od_invoice']; ?>" id="od_invoice" class="frm_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="od_delivery_company">배송회사</label></th>
|
||||
<td>
|
||||
<input type="text" name="od_delivery_company" value="<?php echo $od['od_delivery_company']; ?>" id="od_delivery_company" class="frm_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="od_invoice_time">배송일시</label></th>
|
||||
<td>
|
||||
|
||||
@ -198,7 +198,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="forderlist" id="forderlist" action="./orderlistupdate.php" onsubmit="return forderlist_submit(this);" method="post">
|
||||
<form name="forderlist" id="forderlist" action="./orderlistupdate.php" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
<div class="tbl_head02 tbl_wrap">
|
||||
@ -215,7 +215,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" id="th_recvr">받는분</th>
|
||||
<th scope="col" rowspan="3">주문합계</th>
|
||||
<th scope="col" rowspan="3">주문합계<br>선불배송비포함</th>
|
||||
<th scope="col" rowspan="3">입금합계</th>
|
||||
<th scope="col" rowspan="3">주문취소</th>
|
||||
<th scope="col" rowspan="3">쿠폰</th>
|
||||
@ -336,7 +336,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
</td>
|
||||
<td headers="th_delino">
|
||||
<?php if ($od_status == '준비') { ?>
|
||||
<input type="text" name="od_invoice[<?php echo $i; ?>]" value="<?php echo $row['od_invoice']; ?>" class="frm_input" size="12">
|
||||
<input type="text" name="od_invoice[<?php echo $i; ?>]" value="<?php echo $row['od_invoice']; ?>" class="frm_input" size="10">
|
||||
<?php } else if ($od_status == '배송' || $od_status == '완료') { ?>
|
||||
<?php echo $row['od_invoice']; ?>
|
||||
<?php } else { ?>
|
||||
@ -345,7 +345,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
</td>
|
||||
<td headers="th_delicom">
|
||||
<?php if ($od_status == '준비') { ?>
|
||||
<input type="text" name="od_delivery_company[<?php echo $i; ?>]" value="<?php echo $delivery_company; ?>" class="frm_input" size="12">
|
||||
<input type="text" name="od_delivery_company[<?php echo $i; ?>]" value="<?php echo $delivery_company; ?>" class="frm_input" size="10">
|
||||
<?php } else if ($od_status == '배송' || $od_status == '완료') { ?>
|
||||
<?php echo $row['od_delivery_company']; ?>
|
||||
<?php } else { ?>
|
||||
@ -358,7 +358,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
</td>
|
||||
<td headers="th_delidate">
|
||||
<?php if ($od_status == '준비') { ?>
|
||||
<input type="text" name="od_invoice_time[<?php echo $i; ?>]" value="<?php echo $invoice_time; ?>" class="frm_input" size="12" maxlength="19">
|
||||
<input type="text" name="od_invoice_time[<?php echo $i; ?>]" value="<?php echo $invoice_time; ?>" class="frm_input" size="10" maxlength="19">
|
||||
<?php } else if ($od_status == '배송' || $od_status == '완료') { ?>
|
||||
<?php echo substr($row['od_invoice_time'],2,14); ?>
|
||||
<?php } else { ?>
|
||||
@ -397,6 +397,7 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
|
||||
<div class="local_cmd01 local_cmd">
|
||||
<?php if (($od_status == '' || $od_status == '완료') == false) { // 검색된 주문상태가 '전체', '완료' 가 아니라면 ?>
|
||||
<<<<<<< HEAD
|
||||
<label for="od_status" class="cmd_tit">주문상태 변경</label>
|
||||
<select name="od_status" id="od_status">
|
||||
<option value="">선택하세요</option>
|
||||
@ -408,6 +409,10 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
</select>
|
||||
|
||||
<?php /*
|
||||
=======
|
||||
<strong>주문상태 변경</strong>
|
||||
<?php
|
||||
>>>>>>> master
|
||||
$change_status = "";
|
||||
if ($od_status == '주문') $change_status = "입금";
|
||||
if ($od_status == '입금') $change_status = "준비";
|
||||
@ -415,12 +420,19 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
if ($od_status == '배송') $change_status = "완료";
|
||||
?>
|
||||
<?php if ($change_status) { ?>
|
||||
<<<<<<< HEAD
|
||||
<label><input type="checkbox" name="od_status" value="<?php echo $change_status; ?>"> <?php echo $od_status .' -> ' . $change_status; ?></label>
|
||||
<input type="submit" value="선택수정" class="btn_submit" onclick="document.pressed=this.value">
|
||||
<?php if ($od_status == '주문') { ?><input type="submit" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value"><?php } ?>
|
||||
<?php } */ ?>
|
||||
<input type="submit" value="선택수정" class="btn_submit" onclick="document.pressed=this.value">
|
||||
<?php if ($od_status == '주문') { ?><input type="submit" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value"><?php } ?>
|
||||
=======
|
||||
<label><input type="checkbox" name="od_status" value="<?php echo $change_status; ?>"> '<?php echo $od_status ?>'상태에서 '<strong><?php echo $change_status ?></strong>'상태로 변경합니다.</label>
|
||||
<input type="submit" value="선택수정" class="btn_submit" onclick="document.pressed=this.value">
|
||||
<?php if ($od_status == '주문') { ?> <span>주문상태에서만 삭제가 가능합니다.</span> <input type="submit" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value"><?php } ?>
|
||||
<?php } ?>
|
||||
>>>>>>> master
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@ -498,7 +510,7 @@ function forderlist_submit(f)
|
||||
}
|
||||
|
||||
if (f.od_status.checked == false) {
|
||||
alert("변경하실 주문상태를 선택하세요.");
|
||||
alert("주문상태 변경에 체크하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -57,6 +57,78 @@ function change_status($od_id, $current_status, $change_status)
|
||||
}
|
||||
|
||||
|
||||
// 주문서에 입금시 update
|
||||
function order_update_receipt($od_id)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']} set od_receipt_price = od_misu, od_misu = 0, od_receipt_time = '".G5_TIME_YMDHIS."' where od_id = '$od_id' and od_status = '입금' ";
|
||||
return sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
// 주문서에 배송시 update
|
||||
function order_update_delivery($od_id, $mb_id, $change_status, $delivery)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']} set od_delivery_company = '{$delivery['delivery_company']}', od_invoice = '{$delivery['invoice']}', od_invoice_time = '{$delivery['invoice_time']}' where od_id = '$od_id' and od_status = '배송' ";
|
||||
sql_query($sql);
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_cart_table']} where od_id = '$od_id' ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// 재고를 이미 사용했거나 재고에서 이미 뺐다면
|
||||
$stock_use = $row['ct_stock_use'];
|
||||
|
||||
if ($row['ct_stock_use'])
|
||||
{
|
||||
if ($change_status == '주문' ||
|
||||
$change_status == '취소' ||
|
||||
$change_status == '반품' ||
|
||||
$change_status == '품절')
|
||||
{
|
||||
// 재고에 다시 더한다.
|
||||
add_io_stock($row['it_id'], $row['ct_qty'], $row['io_id'], $row['io_type']);
|
||||
$stock_use = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 재고 오류로 인한 수정
|
||||
if ($change_status == '배송' ||
|
||||
$change_status == '완료')
|
||||
{
|
||||
// 재고에서 뺀다.
|
||||
subtract_io_stock($row['it_id'], $row['ct_qty'], $row['io_id'], $row['io_type']);
|
||||
$stock_use = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$point_use = $row['ct_point_use'];
|
||||
|
||||
// 회원이면서 포인트가 0보다 크거나 이미 포인트를 부여했다면 뺀다.
|
||||
if ($mb_id && $row['ct_point'] && $row['ct_point_use'])
|
||||
{
|
||||
delete_point($mb_id, "@delivery", $mb_id, "$od_id,{$row['ct_id']}");
|
||||
$point_use = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
$sql = " update {$g5['g5_shop_cart_table']}
|
||||
set ct_point_use = '$point_use',
|
||||
ct_stock_use = '$stock_use',
|
||||
ct_history = CONCAT(ct_history,'$ct_history')
|
||||
where od_id = '$od_id' ";
|
||||
*/
|
||||
$sql = " update {$g5['g5_shop_cart_table']} set ct_point_use = '$point_use', ct_stock_use = '$stock_use' where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++)
|
||||
{
|
||||
// 실제 번호를 넘김
|
||||
@ -76,39 +148,31 @@ for ($i=0; $i<count($_POST['chk']); $i++)
|
||||
$current_status = $od['od_status'];
|
||||
$change_status = $_POST['od_status'];
|
||||
|
||||
|
||||
switch ($current_status)
|
||||
{
|
||||
case '주문' :
|
||||
|
||||
if ($change_status != '입금') continue;
|
||||
if ($od['od_settle_case'] != '무통장') continue;
|
||||
|
||||
change_status($od_id, '주문', '입금');
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_receipt_price = od_misu,
|
||||
od_misu = 0,
|
||||
od_receipt_time = '".G5_TIME_YMDHIS."'
|
||||
where od_id = '$od_id' and od_status = '입금' ";
|
||||
sql_query($sql, true);
|
||||
|
||||
order_update_receipt($od_id);
|
||||
break;
|
||||
|
||||
case '입금' :
|
||||
|
||||
if ($change_status != '준비') continue;
|
||||
|
||||
change_status($od_id, '입금', '준비');
|
||||
|
||||
break;
|
||||
|
||||
case '준비' :
|
||||
|
||||
if ($change_status != '배송') continue;
|
||||
|
||||
change_status($od_id, '준비', '배송');
|
||||
|
||||
$delivery['invoice'] = $invoice;
|
||||
$delivery['invoice_time'] = $invoice_time;
|
||||
$delivery['delivery_company'] = $delivery_company;
|
||||
|
||||
order_update_delivery($od_id, $od['mb_id'], $change_status, $delivery);
|
||||
|
||||
/*
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_delivery_company = '$delivery_company',
|
||||
od_invoice = '$invoice',
|
||||
@ -156,19 +220,18 @@ for ($i=0; $i<count($_POST['chk']); $i++)
|
||||
$sql = " update {$g5['g5_shop_cart_table']}
|
||||
set ct_point_use = '$point_use',
|
||||
ct_stock_use = '$stock_use',
|
||||
ct_status = '$ct_status',
|
||||
ct_history = CONCAT(ct_history,'$ct_history')
|
||||
where od_id = '{$row['od_id']}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
*/
|
||||
|
||||
break;
|
||||
|
||||
case '배송' :
|
||||
|
||||
if ($change_status != '완료') continue;
|
||||
|
||||
change_status($od_id, '배송', '완료');
|
||||
break;
|
||||
|
||||
} // switch end
|
||||
|
||||
|
||||
@ -18,6 +18,14 @@ if($od['od_receipt_price'] - $od['od_refund_price'] <= 0)
|
||||
|
||||
$g5['title'] = $od['od_settle_case'].' 부분취소';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
// 과세, 비과세 취소가능 금액계산
|
||||
$sql = " select SUM( IF( ct_notax = 0, ( IF(io_type = 1, (io_price * ct_qty), ( (ct_price + io_price) * ct_qty) ) - cp_price ), 0 ) ) as tax_mny,
|
||||
SUM( IF( ct_notax = 1, ( IF(io_type = 1, (io_price * ct_qty), ( (ct_price + io_price) * ct_qty) ) - cp_price ), 0 ) ) as free_mny
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '$od_id'
|
||||
and ct_status IN ( '취소', '반품', '품절' ) ";
|
||||
$sum = sql_fetch($sql);
|
||||
?>
|
||||
|
||||
<form name="forderpartcancel" method="post" action="./orderpartcancelupdate.php" onsubmit="return form_check(this);">
|
||||
@ -35,12 +43,12 @@ include_once(G5_PATH.'/head.sub.php');
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">과세 입금금액</th>
|
||||
<td><?php echo display_price($od['od_tax_mny'] + $od['od_vat_mny']); ?></td>
|
||||
<th scope="row">과세 취소가능 금액</th>
|
||||
<td><?php echo display_price($sum['tax_mny']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">비과세 입금금액</th>
|
||||
<td><?php echo display_price($od['od_free_mny']); ?></td>
|
||||
<th scope="row">비과세 취소가능 금액</th>
|
||||
<td><?php echo display_price($sum['free_mny']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mod_tax_mny">과세 취소금액</label></th>
|
||||
@ -68,8 +76,8 @@ include_once(G5_PATH.'/head.sub.php');
|
||||
<script>
|
||||
function form_check(f)
|
||||
{
|
||||
var max_tax_mny = parseInt(<?php echo ($od['od_tax_mny'] + $od['od_vat_mny']); ?>);
|
||||
var max_free_mny = parseInt(<?php echo $od['od_free_mny']; ?>);
|
||||
var max_tax_mny = parseInt(<?php echo $sum['tax_mny']; ?>);
|
||||
var max_free_mny = parseInt(<?php echo $sum['free_mny']; ?>);
|
||||
var tax_mny = parseInt(f.mod_tax_mny.value.replace("/[^0-9]/g", ""));
|
||||
var free_mny = parseInt(f.mod_free_mny.value.replace("/[^0-9]/g", ""));
|
||||
|
||||
|
||||
@ -24,11 +24,19 @@ if($od['od_settle_case'] == '계좌이체' && substr($od['od_receipt_time'], 0,
|
||||
alert_close('실시간 계좌이체건의 부분취소 요청은 결제일 익일에 가능합니다.');
|
||||
|
||||
// 금액비교
|
||||
if($tax_mny && $tax_mny > ($od['od_tax_mny'] + $od['od_vat_mny']))
|
||||
alert('과세 취소금액을 '.number_format(($od['od_tax_mny'] + $od['od_vat_mny'])).'원 이하로 입력해 주십시오.');
|
||||
// 과세, 비과세 취소가능 금액계산
|
||||
$sql = " select SUM( IF( ct_notax = 0, ( IF(io_type = 1, (io_price * ct_qty), ( (ct_price + io_price) * ct_qty) ) - cp_price ), 0 ) ) as tax_mny,
|
||||
SUM( IF( ct_notax = 1, ( IF(io_type = 1, (io_price * ct_qty), ( (ct_price + io_price) * ct_qty) ) - cp_price ), 0 ) ) as free_mny
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '$od_id'
|
||||
and ct_status IN ( '취소', '반품', '품절' ) ";
|
||||
$sum = sql_fetch($sql);
|
||||
|
||||
if($free_mny && $free_mny > $od['od_free_mny'])
|
||||
alert('비과세 취소금액을 '.number_format($od['od_free_mny']).'원 이하로 입력해 주십시오.');
|
||||
if($tax_mny && $tax_mny > $sum['tax_mny'])
|
||||
alert('과세 취소금액을 '.number_format($sum['tax_mny']).'원 이하로 입력해 주십시오.');
|
||||
|
||||
if($free_mny && $free_mny > $sum['free_mny'])
|
||||
alert('비과세 취소금액을 '.number_format($sum['free_mny']).'원 이하로 입력해 주십시오.');
|
||||
|
||||
// 취소사유의 한글깨짐 방지처리
|
||||
$def_locale = setlocale(LC_CTYPE, 0);
|
||||
@ -160,52 +168,24 @@ if ( $req_tx == "mod" )
|
||||
$mod_mny = $c_PayPlus->mf_get_res_data( "panc_mod_mny" ); // 취소요청된 금액
|
||||
$rem_mny = $c_PayPlus->mf_get_res_data( "panc_rem_mny" ); // 취소요청후 잔액
|
||||
|
||||
// 주문 합계
|
||||
$sql = " select SUM( IF( ct_notax = 0, ( IF(io_type = 1, (io_price * ct_qty), ( (ct_price + io_price) * ct_qty) ) - cp_price ), 0 ) ) as tax_mny,
|
||||
SUM( IF( ct_notax = 1, ( IF(io_type = 1, (io_price * ct_qty), ( (ct_price + io_price) * ct_qty) ) - cp_price ), 0 ) ) as free_mny
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '{$od['od_id']}'
|
||||
and ct_status IN ( '주문', '준비', '배송', '완료' ) ";
|
||||
$sum = sql_fetch($sql);
|
||||
|
||||
$tax_mny = $sum['tax_mny'];
|
||||
$free_mny = $sum['free_mny'];
|
||||
|
||||
// 과세, 비과세
|
||||
if($od['od_tax_flag']) {
|
||||
$tot_tax_mny = ( $tax_mny + $od['od_send_cost'] + $od['od_send_cost2'] )
|
||||
- ( $od['od_coupon'] + $od['od_send_coupon'] + $od['od_receipt_point'] );
|
||||
if($tot_tax_mny < 0) {
|
||||
$tot_tax_mny = 0;
|
||||
$free_mny += $tot_tax_mny;
|
||||
}
|
||||
} else {
|
||||
$tot_tax_mny = ( $tax_mny + $free_mny + $od['od_send_cost'] + $od['od_send_cost2'] )
|
||||
- ( $od['od_coupon'] + $od['od_send_coupon'] + $od['od_receipt_point'] );
|
||||
$free_mny = 0;
|
||||
}
|
||||
|
||||
$od_tax_mny = round($tot_tax_mny / 1.1);
|
||||
$od_vat_mny = $tot_tax_mny - $od_tax_mny;
|
||||
$od_free_mny = $free_mny;
|
||||
|
||||
// 미수
|
||||
$od_misu = ( $od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2'] )
|
||||
- ( $od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon'] )
|
||||
- ( $od['od_receipt_price'] + $od['od_receipt_point'] - $mod_mny );
|
||||
|
||||
$shop_memo = '\\n'.$od['od_settle_case'].' 부분취소(금액: '.number_format($mod_mny).'원) - '.G5_TIME_YMDHIS;
|
||||
|
||||
// 환불금액기록
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_refund_price = od_refund_price + '$mod_mny',
|
||||
od_misu = '$od_misu',
|
||||
od_tax_mny = '$od_tax_mny',
|
||||
od_vat_mny = '$od_vat_mny',
|
||||
od_free_mny = '$od_free_mny',
|
||||
od_shop_memo = concat(od_shop_memo, \"$shop_memo\")
|
||||
od_shop_memo = concat(od_shop_memo, \"$mod_memo\")
|
||||
where od_id = '{$od['od_id']}'
|
||||
and od_tno = '$tno' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 미수금 등의 정보 업데이트
|
||||
$info = get_order_info($od_id);
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_misu = '{$info['od_misu']}',
|
||||
od_tax_mny = '{$info['od_tax_mny']}',
|
||||
od_vat_mny = '{$info['od_vat_mny']}',
|
||||
od_free_mny = '{$info['od_free_mny']}'
|
||||
where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
} // End of [res_cd = "0000"]
|
||||
|
||||
/* = -------------------------------------------------------------------------- = */
|
||||
|
||||
@ -26,7 +26,7 @@ $sql = " update {$g5['g5_shop_order_table']}
|
||||
od_receipt_price = '$od_receipt_price',
|
||||
od_receipt_point = '$od_receipt_point',
|
||||
od_refund_price = '$od_refund_price',
|
||||
dl_id = '$dl_id',
|
||||
od_deliver_company = '$od_deliver_company',
|
||||
od_invoice = '$od_invoice',
|
||||
od_invoice_time = '$od_invoice_time',
|
||||
od_send_cost = '$od_send_cost',
|
||||
|
||||
@ -96,7 +96,7 @@ $pg_anchor = '<ul class="anchor">
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="btn_confirm">
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<?php if($popup == 'yes') { ?>
|
||||
<button type="button" onclick="self.close();">닫기</button>
|
||||
|
||||
Reference in New Issue
Block a user