amount 필드명 price 로 변경

This commit is contained in:
chicpro
2013-09-11 15:52:33 +09:00
parent a61215ad14
commit 97cf079a0f
60 changed files with 837 additions and 805 deletions

View File

@ -25,7 +25,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<tbody>
<?php
$tot_point = 0;
$tot_sell_amount = 0;
$tot_sell_price = 0;
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
@ -80,8 +80,8 @@ include_once(G4_MSHOP_PATH.'/_head.php');
$it_send_cost += get_item_sendcost($row['it_id'], $sum['price'], $sum['qty']);
}
$point = $sum['point'];
$sell_amount = $sum['price'];
$point = $sum['point'];
$sell_price = $sum['price'];
?>
<tr>
@ -94,14 +94,14 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<td class="td_num"><?php echo number_format($sum['qty']); ?></td>
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
<td class="td_bignum"><?php echo number_format($sell_amount); ?></td>
<td class="td_bignum"><?php echo number_format($sell_price); ?></td>
<td class="td_num"><?php echo number_format($sum['point']); ?></td>
<td class="td_smallmng"><input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1" checked="checked"></td>
</tr>
<?php
$tot_point += $point;
$tot_sell_amount += $sell_amount;
$tot_point += $point;
$tot_sell_price += $sell_price;
} // for 끝
if ($i == 0) {
@ -117,7 +117,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
if ($tot_sell_price < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
$send_cost = preg_replace('/[^0-9]/', '', $send_cost_list[$k]);
break;
}
@ -131,8 +131,8 @@ include_once(G4_MSHOP_PATH.'/_head.php');
</table>
<?php
$tot_amount = $tot_sell_amount + $send_cost; // 총계 = 주문상품금액합계 + 배송비
if ($tot_amount > 0 || $send_cost > 0) {
$tot_price = $tot_sell_price + $send_cost; // 총계 = 주문상품금액합계 + 배송비
if ($tot_price > 0 || $send_cost > 0) {
?>
<dl id="sod_bsk_tot">
<?php if ($send_cost > 0) { // 배송비가 0 보다 크다면 (있다면) ?>
@ -140,9 +140,9 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost); ?> 원</strong></dd>
<?php } ?>
<?php if ($tot_amount > 0) { ?>
<?php if ($tot_price > 0) { ?>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_amount); ?> 원 <?php echo number_format($tot_point); ?> 점</strong></dd>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_price); ?> 원 <?php echo number_format($tot_point); ?> 점</strong></dd>
<?php } ?>
</dl>
<?php } ?>

View File

@ -52,7 +52,7 @@ ob_start();
<tbody>
<?php
$tot_point = 0;
$tot_sell_amount = 0;
$tot_sell_price = 0;
$goods = $goods_it_id = "";
$goods_count = -1;
@ -144,8 +144,8 @@ ob_start();
}
}
$point = $sum['point'];
$sell_amount = $sum['price'];
$point = $sum['point'];
$sell_price = $sum['price'];
// 쿠폰
if($is_member) {
@ -157,7 +157,7 @@ ob_start();
and cp_used = '0'
and cp_start <= '".G4_TIME_YMD."'
and cp_end >= '".G4_TIME_YMD."'
and cp_minimum <= '$sell_amount'
and cp_minimum <= '$sell_price'
and (
( cp_method = '0' and cp_target = '{$row['it_id']}' )
OR
@ -175,9 +175,9 @@ ob_start();
<td>
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<input type="hidden" name="it_amount[<?php echo $i; ?>]" value="<?php echo $sell_amount; ?>">
<input type="hidden" name="it_price[<?php echo $i; ?>]" value="<?php echo $sell_price; ?>">
<input type="hidden" name="cp_id[<?php echo $i; ?>]" value="">
<input type="hidden" name="cp_amount[<?php echo $i; ?>]" value="0">
<input type="hidden" name="cp_price[<?php echo $i; ?>]" value="0">
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="it_notax[<?php echo $i; ?>]" value="<?php echo $row['it_notax']; ?>">
<?php } ?>
@ -186,13 +186,13 @@ ob_start();
<td class="td_num"><?php echo number_format($sum['qty']); ?></td>
<td class="td_bignum"><?php echo number_format($row['ct_price']); ?></td>
<td class="td_smallmng"><?php echo $cp_button; ?></td>
<td class="td_bignum"><span class="ct_sell_amount"><?php echo number_format($sell_amount); ?></span></td>
<td class="td_bignum"><span class="ct_sell_price"><?php echo number_format($sell_price); ?></span></td>
<td class="td_num"><?php echo number_format($sum['point']); ?></td>
</tr>
<?php
$tot_point += $point;
$tot_sell_amount += $sell_amount;
$tot_point += $point;
$tot_sell_price += $sell_price;
} // for 끝
if ($i == 0) {
@ -209,7 +209,7 @@ ob_start();
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
if ($tot_sell_price < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
$send_cost = preg_replace('/[^0-9]/', '', $send_cost_list[$k]);
break;
}
@ -232,15 +232,15 @@ ob_start();
<dl id="sod_bsk_tot">
<dt class="sod_bsk_sell">주문</dt>
<dd class="sod_bsk_sell"><strong><?php echo number_format($tot_sell_amount); ?> 원</strong></dd>
<dd class="sod_bsk_sell"><strong><?php echo number_format($tot_sell_price); ?> 원</strong></dd>
<dt class="sod_bsk_coupon">쿠폰</dt>
<dd class="sod_bsk_coupon"><strong id="ct_tot_coupon">0 원</strong></dd>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost); ?> 원</strong></dd>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt">
<?php $tot_amount = $tot_sell_amount + $send_cost; // 총계 = 주문상품금액합계 + 배송비 ?>
<strong id="ct_tot_amount"><?php echo number_format($tot_amount); ?> 원</strong>
<?php $tot_price = $tot_sell_price + $send_cost; // 총계 = 주문상품금액합계 + 배송비 ?>
<strong id="ct_tot_price"><?php echo number_format($tot_price); ?> 원</strong>
</dd>
<dt class="sod_bsk_point">포인트</dt>
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
@ -256,7 +256,7 @@ ob_end_clean();
<form name="sm_form" method="POST" action="<?php echo G4_MSHOP_URL; ?>/kcp/order_approval_form.php">
<input type="hidden" name="good_name" value="<?php echo $goods; ?>">
<input type="hidden" name="good_mny" value="<?php echo $tot_amount ?>" >
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="buyr_name" value="">
<input type="hidden" name="buyr_tel1" value="">
<input type="hidden" name="buyr_tel2" value="">
@ -339,8 +339,8 @@ ob_end_clean();
<div id="sod_frm">
<form name="forderform" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
<input type="hidden" name="od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="org_od_amount" value="<?php echo $tot_sell_amount; ?>">
<input type="hidden" name="od_price" value="<?php echo $tot_sell_price; ?>">
<input type="hidden" name="org_od_price" value="<?php echo $tot_sell_price; ?>">
<input type="hidden" name="od_send_cost" value="<?php echo $send_cost; ?>">
<input type="hidden" name="od_send_cost2" value="0">
<input type="hidden" name="item_coupon" value="0">
@ -587,7 +587,7 @@ ob_end_clean();
<?php } ?>
<tr>
<th>총 주문금액</th>
<td><span id="od_tot_amount"><?php echo number_format($tot_amount); ?></span>원</td>
<td><span id="od_tot_price"><?php echo number_format($tot_price); ?></span>원</td>
</tr>
<tr>
<th>추가배송비</th>
@ -653,12 +653,12 @@ ob_end_clean();
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
if ($member['mb_point'] >= $default['de_settle_min_point'])
{
$temp_point = (int)$default['de_settle_max_point'];
if($temp_point > (int)$tot_sell_amount)
$temp_point = (int)$tot_sell_amount;
if($temp_point > (int)$tot_sell_price)
$temp_point = (int)$tot_sell_price;
if($temp_point > (int)$member['mb_point'])
$temp_point = (int)$member['mb_point'];
@ -821,12 +821,12 @@ $(function() {
$(".cp_apply").live("click", function() {
var $el = $(this).closest("tr");
var cp_id = $el.find("input[name='f_cp_id[]']").val();
var amount = $el.find("input[name='f_cp_amt[]']").val();
var price = $el.find("input[name='f_cp_prc[]']").val();
var subj = $el.find("input[name='f_cp_subj[]']").val();
var sell_amount;
var sell_price;
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
if(parseInt(price) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+price+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
@ -856,18 +856,18 @@ $(function() {
}
}
var $s_el = $cp_row_el.find(".ct_sell_amount");;
sell_amount = parseInt($cp_row_el.find("input[name^=it_amount]").val());
sell_amount = sell_amount - parseInt(amount);
if(sell_amount < 0) {
var $s_el = $cp_row_el.find(".ct_sell_price");;
sell_price = parseInt($cp_row_el.find("input[name^=it_price]").val());
sell_price = sell_price - parseInt(price);
if(sell_price < 0) {
alert("쿠폰할인금액이 상품 주문금액보다 크므로 쿠폰을 적용할 수 없습니다.");
return false;
}
$s_el.text(number_format(String(sell_amount)));
$s_el.text(number_format(String(sell_price)));
$cp_row_el.find("input[name^=cp_id]").val(cp_id);
$cp_row_el.find("input[name^=cp_amount]").val(amount);
$cp_row_el.find("input[name^=cp_price]").val(price);
calculate_total_amount();
calculate_total_price();
$("#it_coupon_frm").remove();
$cp_btn_el.text("변경").focus();
if(!$cp_row_el.find(".it_coupon_cancel").size())
@ -881,7 +881,7 @@ $(function() {
$(".it_coupon_cancel").live("click", function() {
coupon_cancel($(this).closest("tr"));
calculate_total_amount();
calculate_total_price();
$("#it_coupon_frm").remove();
$(this).closest("tr").find(".it_coupon_btn").text("적용").focus();
$(this).remove();
@ -890,10 +890,10 @@ $(function() {
$("#od_coupon_btn").click(function() {
$("#od_coupon_frm").remove();
var $this = $(this);
var amount = parseInt($("input[name=org_od_amount]").val());
var price = parseInt($("input[name=org_od_price]").val());
$.post(
"./ordercoupon.php",
{ amount: amount },
{ price: price },
function(data) {
$this.after(data);
}
@ -903,19 +903,19 @@ $(function() {
$(".od_cp_apply").live("click", function() {
var $el = $(this).closest("tr");
var cp_id = $el.find("input[name='o_cp_id[]']").val();
var amount = parseInt($el.find("input[name='o_cp_amt[]']").val());
var price = parseInt($el.find("input[name='o_cp_prc[]']").val());
var subj = $el.find("input[name='o_cp_subj[]']").val();
var send_cost = $("input[name=od_send_cost]").val();
var item_coupon = parseInt($("input[name=item_coupon]").val());
var od_amount = parseInt($("input[name=org_od_amount]").val()) - item_coupon;
var od_price = parseInt($("input[name=org_od_price]").val()) - item_coupon;
if(amount == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
if(price == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+price+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
if(od_amount - amount <= 0) {
if(od_price - price <= 0) {
alert("쿠폰할인금액이 주문금액보다 크므로 쿠폰을 적용할 수 없습니다.");
return false;
}
@ -924,10 +924,10 @@ $(function() {
$("#sc_coupon_btn").text("쿠폰적용");
$("#sc_coupon_cancel").remove();
$("input[name=od_amount]").val(od_amount - amount);
$("input[name=od_price]").val(od_price - price);
$("input[name=od_cp_id]").val(cp_id);
$("input[name=od_coupon]").val(amount);
calculate_order_amount();
$("input[name=od_coupon]").val(price);
calculate_order_price();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").text("쿠폰변경").focus();
if(!$("#od_coupon_cancel").size())
@ -940,13 +940,13 @@ $(function() {
});
$("#od_coupon_cancel").live("click", function() {
var org_amount = $("input[name=org_od_amount]").val();
var org_price = $("input[name=org_od_price]").val();
var item_coupon = parseInt($("input[name=item_coupon]").val());
$("input[name=od_amount]").val(org_amount - item_coupon);
$("input[name=od_price]").val(org_price - item_coupon);
$("input[name=sc_cp_id]").val("");
$("input[name=od_coupon]").val(0);
$("input[name=od_send_coupon]").val(0);
calculate_order_amount();
calculate_order_price();
$("#od_coupon_frm").remove();
$("#od_coupon_btn").text("쿠폰적용").focus();
$(this).remove();
@ -957,11 +957,11 @@ $(function() {
$("#sc_coupon_btn").click(function() {
$("#sc_coupon_frm").remove();
var $this = $(this);
var amount = parseInt($("input[name=od_amount]").val());
var price = parseInt($("input[name=od_price]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
$.post(
"./ordersendcostcoupon.php",
{ amount: amount, send_cost: send_cost },
{ price: price, send_cost: send_cost },
function(data) {
$this.after(data);
}
@ -971,19 +971,19 @@ $(function() {
$(".sc_cp_apply").live("click", function() {
var $el = $(this).closest("tr");
var cp_id = $el.find("input[name='s_cp_id[]']").val();
var amount = parseInt($el.find("input[name='s_cp_amt[]']").val());
var price = parseInt($el.find("input[name='s_cp_prc[]']").val());
var subj = $el.find("input[name='s_cp_subj[]']").val();
var send_cost = parseInt($("input[name=od_send_cost]").val());
if(parseInt(amount) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+amount+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
if(parseInt(price) == 0) {
if(!confirm(subj+"쿠폰의 할인 금액은 "+price+"원입니다.\n쿠폰을 적용하시겠습니까?")) {
return false;
}
}
$("input[name=sc_cp_id]").val(cp_id);
$("input[name=od_send_coupon]").val(amount);
calculate_order_amount();
$("input[name=od_send_coupon]").val(price);
calculate_order_price();
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").text("쿠폰변경").focus();
if(!$("#sc_coupon_cancel").size())
@ -997,7 +997,7 @@ $(function() {
$("#sc_coupon_cancel").live("click", function() {
$("input[name=od_send_coupon]").val(0);
calculate_order_amount();
calculate_order_price();
$("#sc_coupon_frm").remove();
$("#sc_coupon_btn").text("쿠폰적용").focus();
$(this).remove();
@ -1074,39 +1074,39 @@ $(function() {
function coupon_cancel($el)
{
var $dup_sell_el = $el.find(".ct_sell_amount");
var $dup_amount_el = $el.find("input[name^=cp_amount]");
var org_sell_amount = $el.find("input[name^=it_amount]").val();
var $dup_sell_el = $el.find(".ct_sell_price");
var $dup_price_el = $el.find("input[name^=cp_price]");
var org_sell_price = $el.find("input[name^=it_price]").val();
$dup_sell_el.text(number_format(String(org_sell_amount)));
$dup_amount_el.val(0);
$dup_sell_el.text(number_format(String(org_sell_price)));
$dup_price_el.val(0);
$el.find("input[name^=cp_id]").val("");
}
function calculate_total_amount()
function calculate_total_price()
{
var $it_amt = $("input[name^=it_amount]");
var $cp_amt = $("input[name^=cp_amount]");
var tot_sell_amount = sell_amount = tot_cp_amount = 0;
var it_amount, cp_amount, it_notax;
var $it_prc = $("input[name^=it_price]");
var $cp_prc = $("input[name^=cp_price]");
var tot_sell_price = sell_price = tot_cp_price = 0;
var it_price, cp_price, it_notax;
var tot_mny = comm_tax_mny = comm_vat_mny = comm_free_mny = tax_mny = vat_mny = 0;
var send_cost = parseInt($("input[name=od_send_cost]").val());
$it_amt.each(function(index) {
it_amount = parseInt($(this).val());
cp_amount = parseInt($cp_amt.eq(index).val());
sell_amount += it_amount;
tot_cp_amount += cp_amount;
$it_prc.each(function(index) {
it_price = parseInt($(this).val());
cp_price = parseInt($cp_prc.eq(index).val());
sell_price += it_price;
tot_cp_price += cp_price;
});
tot_sell_amount = sell_amount - tot_cp_amount + send_cost;
tot_sell_price = sell_price - tot_cp_price + send_cost;
$("#ct_tot_coupon").text(number_format(String(tot_cp_amount))+" 원");
$("#ct_tot_amount").text(number_format(String(tot_sell_amount))+" 원");
$("#ct_tot_coupon").text(number_format(String(tot_cp_price))+" 원");
$("#ct_tot_price").text(number_format(String(tot_sell_price))+" 원");
$("input[name=good_mny]").val(tot_sell_amount);
$("input[name=od_amount]").val(sell_amount - tot_cp_amount);
$("input[name=item_coupon]").val(tot_cp_amount);
$("input[name=good_mny]").val(tot_sell_price);
$("input[name=od_price]").val(sell_price - tot_cp_price);
$("input[name=item_coupon]").val(tot_cp_price);
$("input[name=od_coupon]").val(0);
$("input[name=od_send_coupon]").val(0);
<?php if($oc_cnt > 0) { ?>
@ -1127,19 +1127,19 @@ function calculate_total_amount()
<?php if($temp_point > 0 && $is_member) { ?>
calculate_temp_point();
<?php } ?>
calculate_order_amount();
calculate_order_price();
}
function calculate_order_amount()
function calculate_order_price()
{
var sell_amount = parseInt($("input[name=od_amount]").val());
var sell_price = parseInt($("input[name=od_price]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var send_cost2 = parseInt($("input[name=od_send_cost2]").val());
var send_coupon = parseInt($("input[name=od_send_coupon").val());
var tot_amount = sell_amount + send_cost + send_cost2 - send_coupon;
var tot_price = sell_price + send_cost + send_cost2 - send_coupon;
$("form[name=sm_form] input[name=good_mny]").val(tot_amount);
$("#od_tot_amount").text(number_format(String(tot_amount)));
$("form[name=sm_form] input[name=good_mny]").val(tot_price);
$("#od_tot_price").text(number_format(String(tot_price)));
<?php if($temp_point > 0 && $is_member) { ?>
calculate_temp_point();
<?php } ?>
@ -1147,14 +1147,14 @@ function calculate_order_amount()
function calculate_temp_point()
{
var sell_amount = parseInt($("input[name=od_amount]").val());
var sell_price = parseInt($("input[name=od_price]").val());
var mb_point = parseInt(<?php echo $member['mb_point']; ?>);
var max_point = parseInt(<?php echo $default['de_settle_max_point']; ?>);
var point_unit = parseInt(<?php echo $default['de_settle_point_unit']; ?>);
var temp_point = max_point;
if(temp_point > sell_amount)
temp_point = sell_amount;
if(temp_point > sell_price)
temp_point = sell_price;
if(temp_point > mb_point)
temp_point = mb_point;
@ -1174,17 +1174,17 @@ function calculate_sendcost(code)
$("input[name=od_send_cost2]").val(data);
$("#od_send_cost2").text(number_format(String(data)));
calculate_order_amount();
calculate_order_price();
}
);
}
function calculate_tax()
{
var $it_amt = $("input[name^=it_amount]");
var $cp_amt = $("input[name^=cp_amount]");
var sell_amount = tot_cp_amount = 0;
var it_amount, cp_amount, it_notax;
var $it_prc = $("input[name^=it_price]");
var $cp_prc = $("input[name^=cp_price]");
var sell_price = tot_cp_price = 0;
var it_price, cp_price, it_notax;
var tot_mny = comm_free_mny = tax_mny = vat_mny = 0;
var send_cost = parseInt($("input[name=od_send_cost]").val());
var send_cost2 = parseInt($("input[name=od_send_cost2]").val());
@ -1192,16 +1192,16 @@ function calculate_tax()
var send_coupon = parseInt($("input[name=od_send_coupon]").val());
var temp_point = 0;
$it_amt.each(function(index) {
it_amount = parseInt($(this).val());
cp_amount = parseInt($cp_amt.eq(index).val());
sell_amount += it_amount;
tot_cp_amount += cp_amount;
$it_prc.each(function(index) {
it_price = parseInt($(this).val());
cp_price = parseInt($cp_prc.eq(index).val());
sell_price += it_price;
tot_cp_price += cp_price;
it_notax = $("input[name^=it_notax]").eq(index).val();
if(it_notax == "1") {
comm_free_mny += (it_amount - cp_amount);
comm_free_mny += (it_price - cp_price);
} else {
tot_mny += (it_amount - cp_amount);
tot_mny += (it_price - cp_price);
}
});
@ -1240,11 +1240,11 @@ function kcp_approval()
// pg 결제 금액에서 포인트 금액 차감
if(settle_method != "무통장") {
var od_amount = parseInt(pf.od_amount.value);
var od_price = parseInt(pf.od_price.value);
var send_cost = parseInt(pf.od_send_cost.value);
var send_cost2 = parseInt(pf.od_send_cost2.value);
var send_coupon = parseInt(pf.od_send_coupon.value);
f.good_mny.value = od_amount + send_cost + send_cost2 - send_coupon - temp_point;
f.good_mny.value = od_price + send_cost + send_cost2 - send_coupon - temp_point;
}
f.buyr_name.value = pf.od_name.value;
@ -1367,7 +1367,7 @@ function payment_check(f)
{
var temp_point = 0;
var max_point = 0;
var od_amount = parseInt(f.od_amount.value);
var od_price = parseInt(f.od_price.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);
@ -1387,7 +1387,7 @@ function payment_check(f)
return false;
}
if (temp_point > od_amount) {
if (temp_point > od_price) {
alert("상품 주문금액(배송비 제외) 보다 많이 포인트결제할 수 없습니다.");
f.od_temp_point.select();
return false;
@ -1413,11 +1413,11 @@ function payment_check(f)
}
}
var tot_amount = od_amount + send_cost + send_cost2 - send_coupon - temp_point;
var tot_price = od_price + 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) {
if (tot_price - temp_point < 150) {
alert("계좌이체는 150원 이상 결제가 가능합니다.");
return false;
}
@ -1426,7 +1426,7 @@ function payment_check(f)
if (document.getElementById("od_settle_card")) {
if (document.getElementById("od_settle_card").checked) {
if (tot_amount - temp_point < 1000) {
if (tot_price - temp_point < 1000) {
alert("신용카드는 1000원 이상 결제가 가능합니다.");
return false;
}
@ -1435,7 +1435,7 @@ function payment_check(f)
if (document.getElementById("od_settle_hp")) {
if (document.getElementById("od_settle_hp").checked) {
if (tot_amount - temp_point < 350) {
if (tot_price - temp_point < 350) {
alert("휴대폰은 350원 이상 결제가 가능합니다.");
return false;
}

View File

@ -58,7 +58,7 @@ if ($error != "")
alert($error);
}
$i_amount = (int)$_POST['od_amount'];
$i_price = (int)$_POST['od_price'];
$i_send_cost = (int)$_POST['od_send_cost'];
$i_send_cost2 = (int)$_POST['od_send_cost2'];
$i_send_coupon = (int)$_POST['od_send_coupon'];
@ -66,22 +66,24 @@ $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_price,
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'];
$tot_ct_price = $row['od_price'];
$cart_count = $row['cart_count'];
// 쿠폰금액계산
$tot_cp_amount = 0;
$tot_cp_price = 0;
if($is_member) {
// 상품쿠폰
$tot_it_cp_amount = $tot_od_cp_amount = 0;
$tot_it_cp_price = $tot_od_cp_price = 0;
$it_cp_cnt = count($_POST['cp_id']);
$arr_it_cp_amt = array();
$arr_it_cp_prc = array();
for($i=0; $i<$it_cp_cnt; $i++) {
$cid = $_POST['cp_id'][$i];
$it_id = $_POST['it_id'][$i];
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
$sql = " select cp_id, cp_method, cp_target, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '$cid'
and mb_id = '{$member['mb_id']}'
@ -124,9 +126,9 @@ if($is_member) {
$dc = 0;
if($cp['cp_type']) {
$dc = floor(($item_price * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
$dc = floor(($item_price * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
$dc = $cp['cp_price'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
@ -135,15 +137,15 @@ if($is_member) {
if($item_price < $dc)
continue;
$tot_it_cp_amount += $dc;
$arr_it_cp_amt[$it_id] = $dc;
$tot_it_cp_price += $dc;
$arr_it_cp_prc[$it_id] = $dc;
}
$tot_od_amount = $tot_ct_amount - $tot_it_cp_amount;
$tot_od_price = $tot_ct_price - $tot_it_cp_price;
// 주문쿠폰
if($_POST['od_cp_id']) {
$sql = " select cp_id, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '{$_POST['od_cp_id']}'
and mb_id = '{$member['mb_id']}'
@ -154,33 +156,33 @@ if($is_member) {
$cp = sql_fetch($sql);
$dc = 0;
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_amount)) {
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_price)) {
if($cp['cp_type']) {
$dc = floor(($tot_od_amount * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
$dc = floor(($tot_od_price * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
$dc = $cp['cp_price'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
$dc = $cp['cp_maximum'];
if($tot_od_amount < $dc)
if($tot_od_price < $dc)
die('Order coupon error.');
$tot_od_cp_amount = $dc;
$tot_od_amount -= $tot_od_cp_amount;
$tot_od_cp_price = $dc;
$tot_od_price -= $tot_od_cp_price;
}
}
$tot_cp_amount = $tot_it_cp_amount + $tot_od_cp_amount;
$tot_cp_price = $tot_it_cp_price + $tot_od_cp_price;
}
if ((int)($row['od_amount'] - $tot_cp_amount) !== $i_amount) {
if ((int)($row['od_price'] - $tot_cp_price) !== $i_price) {
die("Error.");
}
// 배송비가 상이함
$tot_sell_amount = $row['od_amount'];
$tot_sell_price = $row['od_price'];
// 배송비 계산
if ($default['de_send_cost_case'] == '없음') {
$send_cost = 0;
@ -191,7 +193,7 @@ if ($default['de_send_cost_case'] == '없음') {
$send_cost = 0;
for ($k=0; $k<count($send_cost_limit); $k++) {
// 총판매금액이 배송비 상한가 보다 작다면
if ($tot_sell_amount < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
if ($tot_sell_price < preg_replace('/[^0-9]/', '', $send_cost_limit[$k])) {
$send_cost = preg_replace('/[^0-9]/', '', $send_cost_list[$k]);
break;
}
@ -217,11 +219,11 @@ if ($default['de_send_cost_case'] == '없음') {
}
}
$tot_sc_cp_amount = 0;
$tot_sc_cp_price = 0;
if($is_member && $send_cost > 0) {
// 배송쿠폰
if($_POST['sc_cp_id']) {
$sql = " select cp_id, cp_type, cp_amount, cp_trunc, cp_minimum, cp_maximum
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
from {$g4['shop_coupon_table']}
where cp_id = '{$_POST['sc_cp_id']}'
and mb_id = '{$member['mb_id']}'
@ -232,11 +234,11 @@ if($is_member && $send_cost > 0) {
$cp = sql_fetch($sql);
$dc = 0;
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_amount)) {
if($cp['cp_id'] && ($cp['cp_minimum'] <= $tot_od_price)) {
if($cp['cp_type']) {
$dc = floor(($send_cost * ($cp['cp_amount'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
$dc = floor(($send_cost * ($cp['cp_price'] / 100)) / $cp['cp_trunc']) * $cp['cp_trunc'];
} else {
$dc = $cp['cp_amount'];
$dc = $cp['cp_price'];
}
if($cp['cp_maximum'] && $dc > $cp['cp_maximum'])
@ -245,23 +247,23 @@ if($is_member && $send_cost > 0) {
if($dc > $send_cost)
$dc = $send_cost;
$tot_sc_cp_amount = $dc;
$tot_sc_cp_price = $dc;
}
}
}
if ((int)($send_cost - $tot_sc_cp_amount) !== (int)($i_send_cost - $i_send_coupon)) {
if ((int)($send_cost - $tot_sc_cp_price) !== (int)($i_send_cost - $i_send_coupon)) {
die("Error..");
}
// 추가배송비가 상이함
$zipcode = $od_b_zip1 . $od_b_zip2;
$sql = " select sc_id, sc_amount from {$g4['shop_sendcost_table']} where sc_zip1 <= '$zipcode' and sc_zip2 >= '$zipcode' ";
$sql = " select sc_id, sc_price from {$g4['shop_sendcost_table']} where sc_zip1 <= '$zipcode' and sc_zip2 >= '$zipcode' ";
$tmp = sql_fetch($sql);
if(!$tmp['sc_id'])
$send_cost2 = 0;
else
$send_cost2 = (int)$tmp['sc_amount'];
$send_cost2 = (int)$tmp['sc_price'];
if($send_cost2 !== $i_send_cost2)
die("Error...");
@ -273,8 +275,8 @@ if ($is_member && $config['cf_use_point'])
if($member['mb_point'] >= $default['de_settle_min_point']) {
$temp_point = (int)$default['de_settle_max_point'];
if($temp_point > (int)$tot_od_amount)
$temp_point = (int)$tot_od_amount;
if($temp_point > (int)$tot_od_price)
$temp_point = (int)$tot_od_price;
if($temp_point > (int)$member['mb_point'])
$temp_point = (int)$member['mb_point'];
@ -293,12 +295,13 @@ if ($od_temp_point)
alert('회원님의 포인트가 부족하여 포인트로 결제 할 수 없습니다.');
}
$i_amount = $i_amount + $i_send_cost + $i_send_cost2 - $i_temp_point - $i_send_coupon;
$i_price = $i_price + $i_send_cost + $i_send_cost2 - $i_temp_point - $i_send_coupon;
if ($od_settle_case == "무통장")
{
$od_receipt_point = $i_temp_point;
$od_receipt_amount = 0;
$od_receipt_price = 0;
$od_misu = $i_price - $od_receipt_price;
$od_status = G4_OD_STATUS_ORDER;
}
else if ($od_settle_case == "계좌이체")
@ -306,14 +309,15 @@ else if ($od_settle_case == "계좌이체")
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$od_tno = $tno;
$od_receipt_amount = $amount;
$od_receipt_price = $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 = $od_settle_case;
$od_deposit_name = $od_name;
$bank_name = iconv("cp949", "utf8", $bank_name);
$od_bank_account = $bank_name;
$pg_amount = $amount;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
$od_status = G4_OD_STATUS_SETTLE;
}
else if ($od_settle_case == "가상계좌")
@ -322,12 +326,13 @@ else if ($od_settle_case == "가상계좌")
$od_receipt_point = $i_temp_point;
$od_tno = $tno;
$od_receipt_amount = 0;
$od_receipt_price = 0;
$bankname = iconv("cp949", "utf8", $bankname);
$depositor = iconv("cp949", "utf8", $depositor);
$od_bank_account = $bankname.' '.$account.' '.$depositor;
$od_deposit_name = $od_name;
$pg_amount = $amount;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
$od_status = G4_OD_STATUS_ORDER;
}
else if ($od_settle_case == "휴대폰")
@ -335,11 +340,12 @@ else if ($od_settle_case == "휴대폰")
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$od_tno = $tno;
$od_receipt_amount = $amount;
$od_receipt_price = $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;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
$od_status = G4_OD_STATUS_SETTLE;
}
else if ($od_settle_case == "신용카드")
@ -348,12 +354,13 @@ else if ($od_settle_case == "신용카드")
$od_tno = $tno;
$od_app_no = $app_no;
$od_receipt_amount = $amount;
$od_receipt_price = $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);
$card_name = iconv("cp949", "utf8", $card_name);
$od_bank_account = $card_name;
$pg_amount = $amount;
$pg_price = $amount;
$od_misu = $i_price - $od_receipt_price;
$od_status = G4_OD_STATUS_SETTLE;
}
else
@ -363,7 +370,7 @@ else
// 주문금액과 결제금액이 일치하는지 체크
if($tno) {
if((int)$i_amount !== (int)$pg_amount) {
if((int)$i_price !== (int)$pg_price) {
$cancel_msg = '결제금액 불일치';
include G4_MSHOP_PATH.'/kcp/pp_ax_hub_cancel.php'; // 결제취소처리
@ -384,8 +391,8 @@ if($escw_yn == 'Y')
$od_escrow = 1;
// 복합과세 금액
$od_tax_mny = round($i_amount / 1.1);
$od_vat_mny = $i_amount - $od_tax_mny;
$od_tax_mny = round($i_price / 1.1);
$od_vat_mny = $i_price - $od_tax_mny;
$od_free_mny = 0;
if($default['de_tax_flag_use']) {
$od_tax_mny = (int)$_POST['comm_tax_mny'];
@ -415,17 +422,18 @@ $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_cart_count = '$cart_count',
od_cart_price = '$tot_ct_price',
od_cart_coupon = '$tot_it_cp_price',
od_send_cost = '$od_send_cost',
od_send_coupon = '$tot_sc_cp_amount',
od_send_coupon = '$tot_sc_cp_price',
od_send_cost2 = '$od_send_cost2',
od_coupon = '$tot_od_cp_amount',
od_receipt_amount = '$od_receipt_amount',
od_coupon = '$tot_od_cp_price',
od_receipt_price = '$od_receipt_price',
od_receipt_point = '$od_receipt_point',
od_bank_account = '$od_bank_account',
od_receipt_time = '$od_receipt_time',
od_misu = '$od_misu',
od_tno = '$od_tno',
od_app_no = '$od_app_no',
od_escrow = '$od_escrow',
@ -460,7 +468,7 @@ if(!$result) {
// 장바구니 쇼핑에서 주문으로
// 신용카드로 주문하면서 신용카드 포인트 사용하지 않는다면 포인트 부여하지 않음
$sql_card_point = "";
if ($od_receipt_amount > 0 && !$default['de_card_point']) {
if ($od_receipt_price > 0 && !$default['de_card_point']) {
$sql_card_point = " , ct_point = '0' ";
}
$sql = "update {$g4['shop_cart_table']}
@ -510,9 +518,9 @@ if($is_member) {
sql_query($sql);
// 쿠폰사용금액 cart에 기록
$cp_amt = (int)$arr_it_cp_amt[$cp_it_id];
$cp_prc = (int)$arr_it_cp_prc[$cp_it_id];
$sql = " update {$g4['shop_cart_table']}
set cp_amount = '$cp_amt'
set cp_price = '$cp_prc'
where od_id = '$od_id'
and it_id = '$cp_it_id'
and ct_select = '1'
@ -570,7 +578,7 @@ if($default['de_sms_use'] && ($default['de_sms_use2'] || $default['de_sms_use3']
$sms_content = preg_replace("/{보낸분}/", $od_name, $sms_content);
$sms_content = preg_replace("/{받는분}/", $od_b_name, $sms_content);
$sms_content = preg_replace("/{주문번호}/", $od_id, $sms_content);
$sms_content = preg_replace("/{주문금액}/", number_format($ttotal_amount), $sms_content);
$sms_content = preg_replace("/{주문금액}/", number_format($$tot_ct_price), $sms_content);
$sms_content = preg_replace("/{회원아이디}/", $member['mb_id'], $sms_content);
$sms_content = preg_replace("/{회사명}/", $default['de_admin_company_name'], $sms_content);

View File

@ -18,10 +18,9 @@ if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
</thead>
<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)
$sql = " select *,
(od_cart_coupon + od_coupon + od_send_coupon) as couponprice
from {$g4['shop_order_table']}
where a.mb_id = '{$member['mb_id']}'
group by a.od_id
order by a.od_id desc
@ -38,9 +37,9 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
<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']; ?></a>
</td>
<td class="td_datetime"><?php echo substr($row['od_time'],0,16); ?> (<?php echo get_yoil($row['od_time']); ?>)</td>
<td class="td_bignum"><?php echo display_price($row['orderamount']); ?></td>
<td class="td_bignum"><?php echo display_price($row['couponamount']); ?></td>
<td class="td_stat"><?php echo display_price($row['receiptamount']); ?></td>
<td class="td_bignum"><?php echo display_price($row['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']); ?></td>
<td class="td_bignum"><?php echo display_price($row['couponprice']); ?></td>
<td class="td_stat"><?php echo display_price($row['od_receipt_price']); ?></td>
</tr>
<?php

View File

@ -41,7 +41,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<dd>상품 배송이 완료되었습니다.</dd>
</dl>
<?php
$sql = " select it_id, it_name, cp_amount
$sql = " select it_id, it_name, cp_price
from {$g4['shop_cart_table']}
where od_id = '$od_id'
group by it_id
@ -85,7 +85,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
else
$opt_price = $opt['ct_price'] + $opt['io_price'];
$sell_amount = $opt_price * $opt['ct_qty'];
$sell_price = $opt_price * $opt['ct_qty'];
$point = $opt['ct_point'] * $opt['ct_qty'];
$ct_list[$opt['ct_id']]['name'] = $opt['it_name'];
@ -95,7 +95,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<td><?php echo $opt['ct_option']; ?></td>
<td class="td_smallmng"><?php echo number_format($opt['ct_qty']); ?></td>
<td class="td_bignum"><?php echo number_format($opt_price); ?></td>
<td class="td_num"><?php echo number_format($sell_amount); ?></td>
<td class="td_num"><?php echo number_format($sell_price); ?></td>
<td class="td_num"><?php echo number_format($point); ?></td>
<td class="td_smallmng"><?php echo $opt['ct_status']; ?></td>
</tr>
@ -113,12 +113,12 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
$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'];
$tot_price = $od['od_cart_price'] + $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($od['od_cart_amount']); ?> 원</strong></dd>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_price']); ?> 원</strong></dd>
<?php if($od['od_cart_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">상품할인</dt>
@ -146,7 +146,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php } ?>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_amount); ?> 원</strong></dd>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_price); ?> 원</strong></dd>
<dt class="sod_bsk_point">포인트</dt>
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
@ -157,30 +157,28 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<div id="sod_fin_view">
<h2>결제/배송 정보</h2>
<?php
$receipt_amount = $od['od_receipt_amount']
+ $od['od_receipt_point']
- $od['od_cancel_amount'];
$receipt_price = $od['od_receipt_price']
+ $od['od_receipt_point'];
$cancel_price = $od['od_cancel_price'];
$misu = true;
if ($tot_amount - $tot_cancel_amount == $receipt_amount) {
if ($tot_price - $cancel_price == $receipt_price) {
$wanbul = " (완불)";
$misu = false; // 미수금 없음
}
else
{
$wanbul = display_price($receipt_amount);
$wanbul = display_price($receipt_price);
}
// 120615 : 취소된 값을 두번 빼주는 결과가 되어 코드 수정 (군포돼지님)
//$misu_amount = $tot_amount - $tot_cancel_amount - $receipt_amount - $od[od_dc_amount];
$misu_amount = $tot_amount - $receipt_amount - $od['od_dc_amount'];
$misu_price = $tot_price - $receipt_price - $cancel_price;
// 결제정보처리
if($od['od_receipt_amount'] > 0)
$od_receipt_amount = display_price($od['od_receipt_amount']);
if($od['od_receipt_price'] > 0)
$od_receipt_price = display_price($od['od_receipt_price']);
else
$od_receipt_amount = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$od_receipt_price = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$app_no_subj = '';
$disp_bank = true;
@ -225,10 +223,10 @@ include_once(G4_MSHOP_PATH.'/_head.php');
</tr>
<tr>
<th scope="row">결제금액</th>
<td><?php echo $od_receipt_amount; ?></td>
<td><?php echo $od_receipt_price; ?></td>
</tr>
<?php
if($od['od_receipt_amount'] > 0)
if($od['od_receipt_price'] > 0)
{
?>
<tr>
@ -301,12 +299,12 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
}
if ($od['od_cancel_amount'] > 0)
if ($od['od_cancel_price'] > 0)
{
?>
<tr>
<th scope="row">취소/환불 금액</th>
<td><?php echo display_price($od['od_cancel_amount']); ?></td>
<td><?php echo display_price($od['od_cancel_price']); ?></td>
</tr>
<?php
}
@ -314,7 +312,7 @@ include_once(G4_MSHOP_PATH.'/_head.php');
// 현금영수증 발급을 사용하는 경우에만
if ($default['de_taxsave_use'] && $default['de_card_pg'] == 'kcp') {
// 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다.
if ($misu_amount == 0 && $od['od_receipt_amount'] && ($od['od_settle_case'] == '무통장' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == '가상계좌')) {
if ($misu_price == 0 && $od['od_receipt_price'] && ($od['od_settle_case'] == '무통장' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == '가상계좌')) {
?>
<tr>
<th scope="row">현금영수증</th>
@ -477,19 +475,13 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<ul>
<li>
총 구매액
<strong><?php echo display_price($tot_amount); ?></strong>
<strong><?php echo display_price($tot_price); ?></strong>
</li>
<?php
if ($od['od_dc_amount'] > 0) {
echo '<li>';
echo '할인액'.PHP_EOL;
echo '<strong>'.display_price($od['od_dc_amount']).'</strong>';
echo '</li>';
}
if ($misu_amount > 0) {
if ($misu_price > 0) {
echo '<li>';
echo '미결제액'.PHP_EOL;
echo '<strong>'.display_price($misu_amount).'</strong>';
echo '<strong>'.display_price($misu_price).'</strong>';
echo '</li>';
}
?>
@ -504,8 +496,8 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<h2>주문취소</h2>
<?php
// 취소한 내역이 없다면
if ($tot_cancel_amount == 0) {
if (!$rq_cnt && $od_count1 == $od_count2 && ($od['od_settle_case'] != '가상계좌' || $od['od_receipt_amount'] == 0)) {
if ($cancel_price == 0) {
if ($od['od_settle_case'] != '가상계좌' || $od['od_receipt_price'] == 0) {
?>
<button type="button" onclick="document.getElementById('sod_fin_cancelfrm').style.display='block';">주문 취소하기</button>
@ -523,7 +515,6 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
}
} else {
$misu_amount = $misu_amount - $send_cost;
?>
<p>주문 취소, 반품, 품절된 내역이 있습니다.</p>
<?php } ?>

View File

@ -1,7 +1,7 @@
<?php
include_once('./_common.php');
$sql = " select * from {$g4['shop_personalpay_table']} where pp_id = '$pp_id' and pp_use = '1' and pp_amount > 0 ";
$sql = " select * from {$g4['shop_personalpay_table']} where pp_id = '$pp_id' and pp_use = '1' and pp_price > 0 ";
$pp = sql_fetch($sql);
if(!$pp['pp_id'])
@ -23,7 +23,7 @@ $ipgm_date = date("Ymd", (G4_SERVER_TIME + 86400 * 5));
$tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정(갤럭시탭,아이패드 - 1.85, 스마트폰 - 1.0)
// 개인결제 체크를 위한 hash
$hash_data = md5($pp['pp_id'].$pp['pp_amount'].$pp['pp_time']);
$hash_data = md5($pp['pp_id'].$pp['pp_price'].$pp['pp_time']);
set_session('ss_personalpay_id', $pp['pp_id']);
set_session('ss_personalpay_hash', $hash_data);
@ -33,7 +33,7 @@ if($default['de_escrow_use']) {
$good_info .= "ordr_numb={$pp_id}_".sprintf("%04d", 1).chr(31);
$good_info .= "good_name=".addslashes($pp['pp_name'].'님 개인결제').chr(31);
$good_info .= "good_cntx=1".chr(31);
$good_info .= "good_amtx=".$pp['pp_amount'].chr(31);
$good_info .= "good_amtx=".$pp['pp_price'].chr(31);
}
?>
@ -43,7 +43,7 @@ if($default['de_escrow_use']) {
<form name="sm_form" method="POST" action="<?php echo G4_MSHOP_URL; ?>/kcp/personalpay_approval_form.php">
<input type="hidden" name="good_name" value="<?php echo $pp['pp_name'].'님 개인결제'; ?>">
<input type="hidden" name="good_mny" value="<?php echo $pp['pp_amount']; ?>" >
<input type="hidden" name="good_mny" value="<?php echo $pp['pp_price']; ?>" >
<input type="hidden" name="buyr_name" value="">
<input type="hidden" name="buyr_tel1" value="">
<input type="hidden" name="buyr_tel2" value="">
@ -111,7 +111,7 @@ if($default['de_escrow_use']) {
<tbody>
<tr>
<th>결제금액</th>
<td><?php echo display_price($pp['pp_amount']); ?></td>
<td><?php echo display_price($pp['pp_price']); ?></td>
</tr>
<tr>
<th scope="row"><label for="pp_name">이름</label></th>
@ -346,11 +346,11 @@ function payfield_check(f)
// 결제체크
function payment_check(f)
{
var tot_amount = <?php echo (int)$pp['pp_amount']; ?>;
var tot_price = <?php echo (int)$pp['pp_price']; ?>;
if (document.getElementById("pp_settle_iche")) {
if (document.getElementById("pp_settle_iche").checked) {
if (tot_amount < 150) {
if (tot_price < 150) {
alert("계좌이체는 150원 이상 결제가 가능합니다.");
return false;
}
@ -359,7 +359,7 @@ function payment_check(f)
if (document.getElementById("pp_settle_card")) {
if (document.getElementById("pp_settle_card").checked) {
if (tot_amount < 1000) {
if (tot_price < 1000) {
alert("신용카드는 1000원 이상 결제가 가능합니다.");
return false;
}
@ -368,7 +368,7 @@ function payment_check(f)
if (document.getElementById("pp_settle_hp")) {
if (document.getElementById("pp_settle_hp").checked) {
if (tot_amount < 350) {
if (tot_price < 350) {
alert("휴대폰은 350원 이상 결제가 가능합니다.");
return false;
}

View File

@ -20,7 +20,7 @@ $pp = sql_fetch($sql);
if(!$pp['pp_id'])
alert('개인결제 정보가 존재하지 않습니다.');
if($pp['pp_receipt_amount'] > 0)
if($pp['pp_tno'])
alert('이미 결제하신 개인결제 내역입니다.');
$hash_data = md5($_POST['pp_id'].$_POST['good_mny'].$pp['pp_time']);
@ -32,45 +32,45 @@ if ($pp_settle_case == "계좌이체")
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$pp_tno = $tno;
$pp_receipt_amount = $amount;
$pp_receipt_price = $amount;
$pp_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);
$pp_deposit_name = $pp_name;
$bank_name = iconv("cp949", "utf8", $bank_name);
$pp_bank_account = $bank_name;
$pg_amount = $amount;
$pg_price = $amount;
}
else if ($pp_settle_case == "가상계좌")
{
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$pp_tno = $tno;
$pp_receipt_amount = 0;
$pp_receipt_price = 0;
$bankname = iconv("cp949", "utf8", $bankname);
$depositor = iconv("cp949", "utf8", $depositor);
$pp_bank_account = $bankname.' '.$account.' '.$depositor;
$pp_deposit_name = $depositor;
$pg_amount = $amount;
$pg_price = $amount;
}
else if ($pp_settle_case == "휴대폰")
{
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$pp_tno = $tno;
$pp_receipt_amount = $amount;
$pp_receipt_price = $amount;
$pp_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);
$pp_bank_account = $commid.' '.$mobile_no;
$pg_amount = $amount;
$pg_price = $amount;
}
else if ($pp_settle_case == "신용카드")
{
include G4_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$pp_tno = $tno;
$pp_receipt_amount = $amount;
$pp_receipt_price = $amount;
$pp_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);
$card_name = iconv("cp949", "utf8", $card_name);
$pp_bank_account = $card_name;
$pg_amount = $amount;
$pg_price = $amount;
}
else
{
@ -78,7 +78,7 @@ else
}
// 주문금액과 결제금액이 일치하는지 체크
if((int)$pp['pp_amount'] !== (int)$pg_amount) {
if((int)$pp['pp_price'] !== (int)$pg_price) {
$cancel_msg = '결제금액 불일치';
include G4_MSHOP_PATH.'/kcp/pp_ax_hub_cancel.php'; // 결제취소처리
@ -94,7 +94,7 @@ else
$sql = " update {$g4['shop_personalpay_table']}
set pp_tno = '$pp_tno',
pp_app_no = '$app_no',
pp_receipt_amount = '$pp_receipt_amount',
pp_receipt_price = '$pp_receipt_price',
pp_settle_case = '$pp_settle_case',
pp_bank_account = '$pp_bank_account',
pp_deposit_name = '$pp_deposit_name',
@ -114,13 +114,13 @@ if(!$result) {
}
// 주문번호가 있으면 결제정보 반영
if($pp_receipt_amount > 0 && $pp['pp_id'] && $pp['od_id']) {
if($pp_receipt_price > 0 && $pp['pp_id'] && $pp['od_id']) {
$od_escrow = 0;
if($escw_yn == 'Y')
$od_escrow = 1;
$sql = " update {$g4['shop_order_table']}
set od_receipt_amount = od_receipt_amount + '$pp_receipt_amount',
set od_receipt_price = od_receipt_price + '$pp_receipt_price',
od_receipt_time = '$pp_receipt_time',
od_tno = '$pp_tno',
od_app_no = '$app_no',

View File

@ -23,22 +23,22 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<?php
$misu = true;
if ($pp['pp_amount'] == $pp['pp_receipt_amount']) {
if ($pp['pp_price'] == $pp['pp_receipt_price']) {
$wanbul = " (완불)";
$misu = false; // 미수금 없음
}
else
{
$wanbul = display_price($pp['pp_receipt_amount']);
$wanbul = display_price($pp['pp_receipt_price']);
}
$misu_amount = $pp['pp_amount'] - $pp['pp_receipt_amount'];
$misu_price = $pp['pp_price'] - $pp['pp_receipt_price'];
// 결제정보처리
if($pp['pp_receipt_amount'] > 0)
$pp_receipt_amount = display_price($pp['pp_receipt_amount']);
if($pp['pp_receipt_price'] > 0)
$pp_receipt_price = display_price($pp['pp_receipt_price']);
else
$pp_receipt_amount = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$pp_receipt_price = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$app_no_subj = '';
$disp_bank = true;
@ -78,10 +78,10 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<th scope="row">결제방식</th>
<td><?php echo $pp['pp_settle_case']; ?></td>
</tr>
<?php if($pp_receipt_amount > 0) { ?>
<?php if($pp['pp_receipt_price'] > 0) { ?>
<tr>
<th scope="row">결제금액</th>
<td><?php echo $pp_receipt_amount; ?></td>
<td><?php echo $pp_receipt_price; ?></td>
</tr>
<tr>
<th scope="row">결제일시</th>
@ -153,13 +153,13 @@ include_once(G4_MSHOP_PATH.'/_head.php');
<ul>
<li>
총 주문액
<strong><?php echo display_price($pp['pp_amount']); ?></strong>
<strong><?php echo display_price($pp['pp_price']); ?></strong>
</li>
<?php
if ($misu_amount > 0) {
if ($misu_price > 0) {
echo '<li>';
echo '미결제액'.PHP_EOL;
echo '<strong>'.display_price($misu_amount).'</strong>';
echo '<strong>'.display_price($misu_price).'</strong>';
echo '</li>';
}
?>

View File

@ -25,7 +25,7 @@ for ($i=1; $row=sql_fetch_array($result); $i++) {
<a href="<?php echo $href; ?>" class="sct_a">
<span class="sct_img"><img src="<?php echo G4_MSHOP_SKIN_URL; ?>/img/personal.jpg" alt=""></span>
<b><?php echo get_text($row['pp_name']).'님 개인결제'; ?></b>
<span class="sct_cost"><?php echo display_price($row['pp_amount']); ?></span>
<span class="sct_cost"><?php echo display_price($row['pp_price']); ?></span>
</a>
</li>
<?php