관리자 주문상세 부분취소 기능 추가

This commit is contained in:
chicpro
2013-09-16 17:20:06 +09:00
parent 51a2c5d329
commit ed6ae4643d
6 changed files with 373 additions and 4 deletions

View File

@ -18,6 +18,35 @@ if ($od_receipt_time)
alert('결제일시 오류입니다.');
}
// 주문 합계
$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_send_cost + $od_send_cost2 )
- ( $od['od_coupon'] + $od['od_send_coupon'] + $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_send_cost + $od_send_cost2 )
- ( $od['od_coupon'] + $od['od_send_coupon'] + $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_send_cost + $od_send_cost2 )
- ( $od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon'] )
@ -31,6 +60,9 @@ $sql = " update {$g5['g5_shop_order_table']}
od_receipt_point = '$od_receipt_point',
od_refund_price = '$od_refund_price',
od_misu = '$od_misu',
od_tax_mny = '$od_tax_mny',
od_vat_mny = '$od_vat_mny',
od_free_mny = '$od_free_mny',
dl_id = '$dl_id',
od_invoice = '$od_invoice',
od_invoice_time = '$od_invoice_time',