관리자 취소 기능 추가

This commit is contained in:
chicpro
2015-09-16 17:20:42 +09:00
parent 9a1a1c4765
commit 8f662516bb
7 changed files with 172 additions and 11 deletions

View File

@ -444,6 +444,25 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tr>
<?php } ?>
<?php if ($od['od_settle_case'] == 'KAKAOPAY') { ?>
<tr>
<th scope="row" class="sodr_sppay">KAKOPAY 결제금액</th>
<td>
<?php if ($od['od_receipt_time'] == "0000-00-00 00:00:00") {?>0원
<?php } else { ?><?php echo display_price($od['od_receipt_price']); ?>
<?php } ?>
</td>
</tr>
<tr>
<th scope="row" class="sodr_sppay">KAKAOPAY 승인일시</th>
<td>
<?php if ($od['od_receipt_time'] == "0000-00-00 00:00:00") {?>신용카드 결제 일시 정보가 없습니다.
<?php } else { ?><?php echo substr($od['od_receipt_time'], 0, 20); ?>
<?php } ?>
</td>
</tr>
<?php } ?>
<?php if ($od['od_settle_case'] == '간편결제') { ?>
<tr>
<th scope="row" class="sodr_sppay"><?php echo $s_receipt_way; ?> 결제금액</th>
@ -482,6 +501,10 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
$pg_url = 'https://iniweb.inicis.com/';
$pg_test = 'KG이니시스';
break;
case 'KAKAOPAY':
$pg_url = 'https://mms.cnspay.co.kr';
$pg_test = 'KAKAOPAY';
break;
default:
$pg_url = 'http://admin8.kcp.co.kr';
$pg_test = 'KCP';
@ -713,6 +736,42 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
</tr>
<?php } ?>
<?php if ($od['od_settle_case'] == 'KAKAOPAY') { ?>
<tr>
<th scope="row" class="sodr_sppay"><label for="od_receipt_price">KAKAOPAY 결제금액</label></th>
<td>
<?php echo $html_receipt_chk; ?>
<input type="text" name="od_receipt_price" id="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" class="frm_input" size="10"> 원
</td>
</tr>
<tr>
<th scope="row" class="sodr_sppay"><label for="od_receipt_time">KAKAOPAY 승인일시</label></th>
<td>
<input type="checkbox" name="od_card_chk" id="od_card_chk" value="<?php echo date("Y-m-d H:i:s", G5_SERVER_TIME); ?>" onclick="if (this.checked == true) this.form.od_receipt_time.value=this.form.od_card_chk.value; else this.form.od_receipt_time.value = this.form.od_receipt_time.defaultValue;">
<label for="od_card_chk">현재 시간으로 설정</label><br>
<input type="text" name="od_receipt_time" value="<?php echo is_null_time($od['od_receipt_time']) ? "" : $od['od_receipt_time']; ?>" id="od_receipt_time" class="frm_input" size="19" maxlength="19">
</td>
</tr>
<?php } ?>
<?php if ($od['od_settle_case'] == '간편결제') { ?>
<tr>
<th scope="row" class="sodr_sppay"><label for="od_receipt_price"><?php echo $s_receipt_way; ?> 결제금액</label></th>
<td>
<?php echo $html_receipt_chk; ?>
<input type="text" name="od_receipt_price" id="od_receipt_price" value="<?php echo $od['od_receipt_price']; ?>" class="frm_input" size="10"> 원
</td>
</tr>
<tr>
<th scope="row" class="sodr_sppay"><label for="od_receipt_time"><?php echo $s_receipt_way; ?> 승인일시</label></th>
<td>
<input type="checkbox" name="od_card_chk" id="od_card_chk" value="<?php echo date("Y-m-d H:i:s", G5_SERVER_TIME); ?>" onclick="if (this.checked == true) this.form.od_receipt_time.value=this.form.od_card_chk.value; else this.form.od_receipt_time.value = this.form.od_receipt_time.defaultValue;">
<label for="od_card_chk">현재 시간으로 설정</label><br>
<input type="text" name="od_receipt_time" value="<?php echo is_null_time($od['od_receipt_time']) ? "" : $od['od_receipt_time']; ?>" id="od_receipt_time" class="frm_input" size="19" maxlength="19">
</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="od_receipt_point">포인트 결제액</label></th>
<td><input type="text" name="od_receipt_point" value="<?php echo $od['od_receipt_point']; ?>" id="od_receipt_point" class="frm_input" size="10"> 점</td>
@ -773,7 +832,7 @@ add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
<?php if($od['od_status'] == '주문' && $od['od_misu'] > 0) { ?>
<a href="./personalpayform.php?popup=yes&amp;od_id=<?php echo $od_id; ?>" id="personalpay_add">개인결제추가</a>
<?php } ?>
<?php if($od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체')) { ?>
<?php if($od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == 'KAKAOPAY')) { ?>
<a href="./orderpartcancel.php?od_id=<?php echo $od_id; ?>" id="orderpartcancel"><?php echo $od['od_settle_case']; ?> 부분취소</a>
<?php } ?>
<a href="./orderlist.php?<?php echo $qstr; ?>">목록</a>
@ -1001,16 +1060,21 @@ function form_submit(f)
var msg = "";
<?php if($od['od_settle_case'] == '신용카드') { ?>
<?php if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == 'KAKAOPAY' || $od['od_settle_case'] == '간편결제') { ?>
if(status == "취소" || status == "반품" || status == "품절") {
var $ct_chk = $("input[name^=ct_chk]");
var chk_cnt = $ct_chk.size();
var chked_cnt = $ct_chk.filter(":checked").size();
<?php if($od['od_pg'] == 'KAKAOPAY') { ?>
var cancel_pg = "카카오페이";
<?php } else { ?>
var cancel_pg = "PG사의 <?php echo $od['od_settle_case']; ?>";
<?php } ?>
if(chk_cnt == chked_cnt) {
if(confirm("PG사의 신용카드 결제를 함께 취소하시겠습니까?\n\n한번 취소한 결제는 다시 복구할 수 없습니다.")) {
if(confirm(cancel_pg+" 결제를 함께 취소하시겠습니까?\n\n한번 취소한 결제는 다시 복구할 수 없습니다.")) {
f.pg_cancel.value = 1;
msg = "PG사의 신용카드 결제 취소와 함께 ";
msg = cancel_pg+" 결제 취소와 함께 ";
} else {
f.pg_cancel.value = 0;
msg = "";

View File

@ -181,7 +181,7 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
$od = sql_fetch($sql);
if($od['od_tno'] && $od['od_settle_case'] == '신용카드') {
if($od['od_tno'] && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '간편결제' || $od['od_settle_case'] == 'KAKAOPAY')) {
switch($od['od_pg']) {
case 'lg':
include_once(G5_SHOP_PATH.'/settle_lg.inc.php');
@ -253,6 +253,14 @@ if (in_array($_POST['ct_status'], $status_cancel)) {
$pg_res_msg = iconv_utf8($res_msg);
}
break;
case 'KAKAOPAY':
include_once(G5_SHOP_PATH.'/settle_kakaopay.inc.php');
$_REQUEST['TID'] = $od['od_tno'];
$_REQUEST['Amt'] = $od['od_receipt_price'];
$_REQUEST['CancelMsg'] = '쇼핑몰 운영자 승인 취소';
$_REQUEST['PartialCancelCode'] = 0;
include G5_SHOP_PATH.'/kakaopay/kakaopay_cancel.php';
break;
default:
include_once(G5_SHOP_PATH.'/settle_kcp.inc.php');
require_once(G5_SHOP_PATH.'/kcp/pp_ax_hub_lib.php');

View File

@ -49,10 +49,12 @@ $od_misu = abs($od['od_misu']);
<th scope="row"><label for="mod_tax_mny">과세 취소금액</label></th>
<td><input type="text" name="mod_tax_mny" value="" id="mod_tax_mny" class="frm_input"> 원</td>
</tr>
<?php if($od['od_pg'] != 'KAKAOPAY') { ?>
<tr>
<th scope="row"><label for="mod_free_mny">비과세 취소금액</label></th>
<td><input type="text" name="mod_free_mny" value="" id="mod_free_mny" class="frm_input"> 원</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="mod_memo">요청사유</label></th>
<td><input type="text" name="mod_memo" id="mod_memo" required class="required frm_input" size="50"></td>
@ -73,7 +75,9 @@ function form_check(f)
{
var max_mny = parseInt(<?php echo $od_misu; ?>);
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", ""));
var free_mny = 0;
if(typeof f.mod_free.mny.value != "undefined")
free_mny = parseInt(f.mod_free_mny.value.replace("/[^0-9]/g", ""));
if(!tax_mny && !free_mny) {
alert("과세 취소금액 또는 비과세 취소금액을 입력해 주십시오.");

View File

@ -36,7 +36,7 @@ if($free_mny && $free_mny > $od_misu)
alert('비과세 취소금액을 '.display_price($od_misu).' 이하로 입력해 주십시오.');
// PG사별 부분취소 실행
include_once(G5_SHOP_PATH.'/'.$od['od_pg'].'/orderpartcancel.inc.php');
include_once(G5_SHOP_PATH.'/'.strtolower($od['od_pg']).'/orderpartcancel.inc.php');
include_once(G5_PATH.'/head.sub.php');
?>