diff --git a/adm/shop_admin/deliverylist.php b/adm/shop_admin/deliverylist.php
index f7db663cc..f971a237d 100644
--- a/adm/shop_admin/deliverylist.php
+++ b/adm/shop_admin/deliverylist.php
@@ -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) // 검색렬일 때만 처음 버튼을 보여줌
검색대상
- >주문번호
+ >주문번호
>주문자
>운송장번호
@@ -112,8 +111,8 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
">주문번호 순 정렬
">주문자 순 정렬
- ">주문액 순 정렬
- ">입금액 순 정렬
+ ">주문액 순 정렬
+ ">입금액 순 정렬
">미수금 순 정렬
">희망배송일 순 정렬
">배송일시 순 정렬
@@ -144,14 +143,12 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
">
-
-
+
+
@@ -195,11 +192,6 @@ if ($search) // 검색렬일 때만 처음 버튼을 보여줌
document.fdeliverylistupate.elements('dl_id[$i]').value = '$row[dl_id]'; ";
- // FF 3.0 에서 위의 코드는 에러를 발생함 (080626 수정)
- echo "";
- }
}
if ($i == 0)
echo '자료가 한건도 없습니다. ';
diff --git a/adm/shop_admin/index.php b/adm/shop_admin/index.php
index 16adebf13..e7abad381 100644
--- a/adm/shop_admin/index.php
+++ b/adm/shop_admin/index.php
@@ -32,15 +32,10 @@ $pg_anchor = '
diff --git a/adm/shop_admin/orderreceiptupdate.php b/adm/shop_admin/orderreceiptupdate.php
index 12847b015..40586ff9f 100644
--- a/adm/shop_admin/orderreceiptupdate.php
+++ b/adm/shop_admin/orderreceiptupdate.php
@@ -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' ";
diff --git a/adm/shop_admin/personalpayform.php b/adm/shop_admin/personalpayform.php
index 9db175e34..5c855a4f0 100644
--- a/adm/shop_admin/personalpayform.php
+++ b/adm/shop_admin/personalpayform.php
@@ -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);
diff --git a/adm/shop_admin/sale1date.php b/adm/shop_admin/sale1date.php
index 707a1404e..3e0fb4f69 100644
--- a/adm/shop_admin/sale1date.php
+++ b/adm/shop_admin/sale1date.php
@@ -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)
-
+
-
+
@@ -87,55 +53,50 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
주문일
주문수
주문합계
- 취소+DC
- 무통장입금
+ 쿠폰
+ 계좌입금
카드입금
포인트입금
- 입금취소
+ 주문취소
미수금
-
-
- 합계
-
-
-
-
-
-
-
-
-
-
+
+
+ 합계
+
+
+
+
+
+
+
+
+
+
diff --git a/adm/shop_admin/sale1month.php b/adm/shop_admin/sale1month.php
index fbff3a231..5c72164d5 100644
--- a/adm/shop_admin/sale1month.php
+++ b/adm/shop_admin/sale1month.php
@@ -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)
@@ -87,55 +54,50 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
주문월
주문수
주문합계
- 취소+DC
- 무통장입금
+ 쿠폰
+ 계좌입금
카드입금
포인트입금
- 입금취소
+ 주문취소
미수금
-
-
- 합 계
-
-
-
-
-
-
-
-
-
-
-
+
+
+ 합 계
+
+
+
+
+
+
+
+
+
+
diff --git a/adm/shop_admin/sale1today.php b/adm/shop_admin/sale1today.php
index f4fe1c4fc..201c2fa65 100644
--- a/adm/shop_admin/sale1today.php
+++ b/adm/shop_admin/sale1today.php
@@ -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;
-}
?>
diff --git a/adm/shop_admin/sale1year.php b/adm/shop_admin/sale1year.php
index ef3de453f..611af8046 100644
--- a/adm/shop_admin/sale1year.php
+++ b/adm/shop_admin/sale1year.php
@@ -9,9 +9,6 @@ include_once (G4_ADMIN_PATH.'/admin.head.php');
function print_line($save)
{
- global $admin_dir;
- static $count = 0;
-
?>
@@ -27,50 +24,20 @@ function print_line($save)
@@ -82,55 +49,50 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
주문년도
주문수
주문합계
- 취소+DC
- 무통장입금
+ 쿠폰
+ 계좌입금
카드입금
포인트입금
- 입금취소
+ 주문취소
미수금
-
-
- 합 계
-
-
-
-
-
-
-
-
-
-
+
+
+ 합 계
+
+
+
+
+
+
+
+
+
+
diff --git a/extend/shop.extend.php b/extend/shop.extend.php
index 871991d76..1b6ee0e24 100644
--- a/extend/shop.extend.php
+++ b/extend/shop.extend.php
@@ -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' , '배송완료');
+
//==============================================================================
// 쇼핑몰 필수 실행코드 모음 끝
//==============================================================================
diff --git a/extend/shop.extend2.php b/extend/shop.extend2.php
index d285d45d2..9a69e3bcd 100644
--- a/extend/shop.extend2.php
+++ b/extend/shop.extend2.php
@@ -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);
+}
?>
diff --git a/install/shop.sql b/install/shop.sql
index 7d1c86f0f..f43414d66 100644
--- a/install/shop.sql
+++ b/install/shop.sql
@@ -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',
diff --git a/mobile/shop/orderform.php b/mobile/shop/orderform.php
index 1c751513b..ca9f71026 100644
--- a/mobile/shop/orderform.php
+++ b/mobile/shop/orderform.php
@@ -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) {
diff --git a/mobile/shop/orderformupdate.php b/mobile/shop/orderformupdate.php
index df5feb013..b8583e059 100644
--- a/mobile/shop/orderformupdate.php
+++ b/mobile/shop/orderformupdate.php
@@ -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."',
diff --git a/mobile/shop/orderinquiryview.php b/mobile/shop/orderinquiryview.php
index 051ffeeae..4a4f9b2ca 100644
--- a/mobile/shop/orderinquiryview.php
+++ b/mobile/shop/orderinquiryview.php
@@ -123,13 +123,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
@@ -284,37 +273,36 @@ include_once(G4_MSHOP_PATH.'/_head.php');
주문총액
- 원
+ 원
- 0) { ?>
+ 0) { ?>
상품할인
- 원
+ 원
- 0) { ?>
+ 0) { ?>
결제할인
- 원
+ 원
- 0) { ?>
+ 0) { ?>
배송비
- 원
+ 원
- 0) { ?>
+ 0) { ?>
배송비할인
- 원
+ 원
- 0) { ?>
+ 0) { ?>
추가배송비
- 원
+ 원
총계
@@ -331,8 +319,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
0)
+ if ($od['od_cancel_amount'] > 0)
{
?>
- 승인취소 금액
-
-
- 0)
- {
- ?>
-
- 환불 금액
-
+ 취소/환불 금액
+
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) {
diff --git a/shop/orderformupdate.php b/shop/orderformupdate.php
index 9a2f0e0a6..36e9c2bea 100644
--- a/shop/orderformupdate.php
+++ b/shop/orderformupdate.php
@@ -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."',
diff --git a/shop/orderinquiryview.php b/shop/orderinquiryview.php
index 6ba78a425..a30dde5ef 100644
--- a/shop/orderinquiryview.php
+++ b/shop/orderinquiryview.php
@@ -136,13 +136,7 @@ if(openwin != null) {
@@ -158,10 +151,6 @@ if(openwin != null) {
@@ -298,37 +287,36 @@ if(openwin != null) {
주문총액
- 원
+ 원
- 0) { ?>
+ 0) { ?>
상품할인
- 원
+ 원
- 0) { ?>
+ 0) { ?>
결제할인
- 원
+ 원
- 0) { ?>
+ 0) { ?>
배송비
- 원
+ 원
- 0) { ?>
+ 0) { ?>
배송비할인
- 원
+ 원
- 0) { ?>
+ 0) { ?>
추가배송비
- 원
+ 원
총계
@@ -346,8 +334,7 @@ if(openwin != null) {
0)
+ if ($od['od_cancel_amount'] > 0)
{
?>
- 결제취소 금액
-
-
- 0)
- {
- ?>
-
- 환불 금액
-
+ 취소/환불 금액
+