diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php
index 6b222b32e..6732899ca 100644
--- a/adm/shop_admin/itemform.php
+++ b/adm/shop_admin/itemform.php
@@ -306,6 +306,194 @@ $pg_anchor ='
+
+ |
+
+
+ > 예
+ |
+
+
+
+
+
+ |
+
+
+ |
+
+
+ > 예
+ |
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+ | 상품설명 |
+ |
+
+
+ | 모바일 상품설명 |
+ |
+
+
+ |
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+
+ 상품요약정보
+
+ 전자상거래 등에서의 상품 등의 정보제공에 관한 고시에 따라 총 35개 상품군에 대해 상품 특성 등을 양식에 따라 입력할 수 있습니다.
+
+
+
+
+
+
+
+
+
+
+
-
-
- 상품요약정보
-
- 전자상거래 등에서의 상품 등의 정보제공에 관한 고시에 따라 총 35개 상품군에 대해 상품 특성 등을 양식에 따라 입력할 수 있습니다.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/adm/shop_admin/ordercartupdate.php b/adm/shop_admin/ordercartupdate.php
index 779d7a957..401e10b40 100644
--- a/adm/shop_admin/ordercartupdate.php
+++ b/adm/shop_admin/ordercartupdate.php
@@ -164,67 +164,101 @@ $od = sql_fetch($sql);
// 주문 합계
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
- SUM(cp_price) as coupon
+ SUM(cp_price) as coupon,
+ COUNT(distinct it_id) as cnt
from {$g4['shop_cart_table']}
where od_id = '$od_id'
and ct_status IN ( '주문', '준비', '배송', '완료' ) ";
$sum = sql_fetch($sql);
$cart_price = $sum['price'];
$cart_coupon = $sum['coupon'];
-
-// 주문할인 쿠폰
-$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
- from {$g4['shop_coupon_table']}
- where od_id = '$od_id'
- and cp_method = '2' ";
-$cp = sql_fetch($sql);
-
-if($cp['cp_id']) {
- $dc = 0;
- $tot_od_price = $cart_price - $cart_coupon;
-
- if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_price)) {
- if($cp['cp_type']) {
- $dc = floor(($tot_od_price * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
- } else {
- $dc = $cp['cp_price'];
- }
-
- if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
- $dc = $cp['cp_maximum'];
-
- if($tot_od_price < $dc)
- $dc = $tot_od_price;
- }
-}
+$cart_count = $sum['cnt'];
// 배송비
$send_cost = get_sendcost($cart_price, $od_id);
+$tot_od_cp_price = $tot_sc_cp_price = 0;
+
+if($od['mb_id']) {
+ // 주문할인 쿠폰
+ $sql = " select a.cp_id, a.cp_type, a.cp_price, a.cp_trunc, a.cp_minimum, a.cp_maximum
+ from {$g4['shop_coupon_table']} a right join {$g4['shop_coupon_log_table']} b on ( a.cp_id = b.cp_id )
+ where b.od_id = '$od_id'
+ and b.mb_id = '{$od['mb_id']}'
+ and a.cp_method = '2' ";
+ $cp = sql_fetch($sql);
+
+ $tot_od_price = $cart_price - $cart_coupon;
+
+ if($cp['cp_id']) {
+ $dc = 0;
+
+ if($cp['cp_minimum'] <= $tot_od_price) {
+ if($cp['cp_type']) {
+ $dc = floor(($tot_od_price * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
+ } else {
+ $dc = $cp['cp_price'];
+ }
+
+ if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
+ $dc = $cp['cp_maximum'];
+
+ if($tot_od_price < $dc)
+ $dc = $tot_od_price;
+
+ $tot_od_price -= $dc;
+ $tot_od_cp_price = $dc;
+ }
+ }
+
+ // 배송쿠폰 할인
+ $sql = " select a.cp_id, a.cp_type, a.cp_price, a.cp_trunc, a.cp_minimum, a.cp_maximum
+ from {$g4['shop_coupon_table']} a right join {$g4['shop_coupon_log_table']} b on ( a.cp_id = b.cp_id )
+ where b.od_id = '$od_id'
+ and b.mb_id = '{$od['mb_id']}'
+ and a.cp_method = '3' ";
+ $cp = sql_fetch($sql);
+
+ if($cp['cp_id']) {
+ $dc = 0;
+ if($cp['cp_minimum'] <= $tot_od_price) {
+ if($cp['cp_type']) {
+ $dc = floor(($send_cost * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
+ } else {
+ $dc = $cp['cp_price'];
+ }
+
+ if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
+ $dc = $cp['cp_maximum'];
+
+ if($dc > $send_cost)
+ $dc = $send_cost;
+
+ $tot_sc_cp_price = $dc;
+ }
+ }
+}
+
// 취소 합계
-$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
- SUM(cp_price) as coupon
+$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price
from {$g4['shop_cart_table']}
where od_id = '$od_id'
and ct_status IN ( '취소', '반품', '품절' ) ";
$sum = sql_fetch($sql);
$cancel_price = $sum['price'];
-$cancel_coupon = $sum['coupon'];
-
-// 배송비가 배송비 쿠폰보다 작다면 쿠폰금액으로 설정
-if($send_cost < $od['od_send_coupon'])
- $send_cost = $od['od_send_coupon'];
// 미수
-$od_misu = $od['od_cart_price'] + $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'])
- + $cancel_coupon
- + ($od['od_coupon'] - $dc);
+$od_misu = ( $cart_price + $send_cost + $od['od_send_cost2'] )
+ - ( $cart_coupon + $tot_od_cp_price + $tot_sc_cp_price )
+ - ( $od['od_receipt_price'] + $od['od_receipt_point'] - $od['od_refund_price'] );
// 주문정보 반영
$sql = " update {$g4['shop_order_table']}
- set od_cancel_price = '$cancel_price',
+ set od_cart_price = '$cart_price',
+ od_cart_coupon = '$cart_coupon',
+ od_coupon = '$tot_od_cp_price',
+ od_send_coupon = '$tot_sc_cp_price',
+ od_cancel_price = '$cancel_price',
od_send_cost = '$send_cost',
od_misu = '$od_misu'
where od_id = '$od_id' ";
diff --git a/adm/shop_admin/orderform.php b/adm/shop_admin/orderform.php
index 7a5b0b530..7550482a0 100644
--- a/adm/shop_admin/orderform.php
+++ b/adm/shop_admin/orderform.php
@@ -251,7 +251,7 @@ $pg_anchor = '
$amount['취소'] = $od['od_cancel_price'];
// 미수금 = 주문금액 - 취소금액 - 입금금액 - 쿠폰금액
- $amount['미수'] = $amount['주문'] - $amount['입금'] - $amount['쿠폰'];
+ //$amount['미수'] = $amount['주문'] - $amount['입금'] - $amount['쿠폰'];
// 결제방법
$s_receipt_way = $od['od_settle_case'];
@@ -260,7 +260,7 @@ $pg_anchor = '
$s_receipt_way .= "+포인트";
?>
- 미수금
+ 미수금
@@ -394,8 +394,8 @@ $pg_anchor = '
|
- | 취소/환불액 |
- |
+ 결제취소/환불액 |
+ |
점 |
- |
+ |
- 원
+ 원
|
@@ -640,7 +640,7 @@ $pg_anchor = '
diff --git a/adm/shop_admin/orderreceiptupdate.php b/adm/shop_admin/orderreceiptupdate.php
index 63053ec89..9f87479b0 100644
--- a/adm/shop_admin/orderreceiptupdate.php
+++ b/adm/shop_admin/orderreceiptupdate.php
@@ -6,27 +6,37 @@ include_once(G4_LIB_PATH.'/icode.sms.lib.php');
auth_check($auth[$sub_menu], "w");
+$sql = " select * from {$g4['shop_order_table']} where od_id = '$od_id' ";
+$od = sql_fetch($sql);
+
+if(!$od['od_id'])
+ alert('주문자료가 존재하지 않습니다.');
+
if ($od_receipt_time)
{
if (check_datetime($od_receipt_time) == false)
alert('결제일시 오류입니다.');
}
+// 미수
+$od_misu = ( $od['od_cart_price'] + $od_send_cost + $od_send_cost2 )
+ - ( $od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon'] )
+ - ( $od_receipt_price + $od_receipt_point - $od_refund_price );
+
$sql = " update {$g4['shop_order_table']}
set od_deposit_name = '$od_deposit_name',
od_bank_account = '$od_bank_account',
od_receipt_time = '$od_receipt_time',
od_receipt_price = '$od_receipt_price',
od_receipt_point = '$od_receipt_point',
- od_cancel_price = '$od_cancel_price',
+ od_refund_price = '$od_refund_price',
+ od_misu = '$od_misu',
dl_id = '$dl_id',
od_invoice = '$od_invoice',
- od_invoice_time = '$od_invoice_time' ";
-if (isset($od_send_cost))
- $sql .= " , od_send_cost = '$od_send_cost' ";
-if (isset($od_send_cost2))
- $sql .= " , od_send_cost2 = '$od_send_cost2' ";
-$sql .= " where od_id = '$od_id' ";
+ od_invoice_time = '$od_invoice_time',
+ od_send_cost = '$od_send_cost',
+ od_send_cost2 = '$od_send_cost2'
+ where od_id = '$od_id' ";
sql_query($sql);
diff --git a/extend/shop.extend2.php b/extend/shop.extend2.php
index d9478aa95..8782bb1fa 100644
--- a/extend/shop.extend2.php
+++ b/extend/shop.extend2.php
@@ -514,7 +514,7 @@ if(!sql_query(" select od_misu from {$g4['shop_order_table']} limit 1 ", false))
ADD `od_misu` int(11) NOT NULL DEFAULT '0' AFTER `od_coupon` ", true);
}
-// 쿠폰 history 테이블추가
+// 쿠폰로그 테이블추가
if(!isset($g4['shop_coupon_log_table']))
die_utf8('dbconfig.php 파일에 $g4[\'shop_coupon_log_table\'] = SHOP_TABLE_PREFIX.\'coupon_log\'; // 쿠폰정보 테이블 추가해주세요.');
if(!sql_query(" DESCRIBE `{$g4['shop_coupon_log_table']}` ", false)) {
@@ -534,4 +534,10 @@ if(!sql_query(" DESCRIBE `{$g4['shop_coupon_log_table']}` ", false)) {
DROP `cp_used_time`,
DROP `cp_used` ", true);
}
+
+// 환불필드 추가
+if(!sql_query(" select od_refund_price from {$g4['shop_order_table']} limit 1 ", false)) {
+ sql_query(" ALTER TABLE `{$g4['shop_order_table']}`
+ ADD `od_refund_price` int(11) NOT NULL DEFAULT '0' AFTER `od_receipt_point` ", true);
+}
?>
diff --git a/install/shop.sql b/install/shop.sql
index 071192010..76ddaa62f 100644
--- a/install/shop.sql
+++ b/install/shop.sql
@@ -596,6 +596,7 @@ CREATE TABLE IF NOT EXISTS `shop_order` (
`od_receipt_price` int(11) NOT NULL DEFAULT '0',
`od_cancel_price` int(11) NOT NULL DEFAULT '0',
`od_receipt_point` int(11) NOT NULL DEFAULT '0',
+ `od_refund_price` 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_coupon` int(11) NOT NULL DEFAULT '0',