Merge branch 'master' of github.com:gnuboard/yc4s
This commit is contained in:
@ -306,6 +306,194 @@ $pg_anchor ='<ul class="anchor">
|
||||
<label for="chk_all_it_model">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_tel_inq">전화문의</label></th>
|
||||
<td>
|
||||
<?php echo help("상품 금액 대신 전화문의로 표시됩니다."); ?>
|
||||
<input type="checkbox" name="it_tel_inq" value="1" id="it_tel_inq" <?php echo ($it['it_tel_inq']) ? "checked" : ""; ?>> 예
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_tel_inq" value="1" id="chk_ca_it_tel_inq">
|
||||
<label for="chk_ca_it_tel_inq">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_tel_inq" value="1" id="chk_all_it_tel_inq">
|
||||
<label for="chk_all_it_tel_inq">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_use">판매가능</label></th>
|
||||
<td>
|
||||
<?php echo help("잠시 판매를 중단하거나 재고가 없을 경우에 체크를 해제해 놓으면 출력되지 않으며, 주문도 받지 않습니다."); ?>
|
||||
<input type="checkbox" name="it_use" value="1" id="it_use" <?php echo ($it['it_use']) ? "checked" : ""; ?>> 예
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_use" value="1" id="chk_ca_it_use">
|
||||
<label for="chk_ca_it_use">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_use" value="1" id="chk_all_it_use">
|
||||
<label for="chk_all_it_use">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_basic">기본설명</label></th>
|
||||
<td>
|
||||
<?php echo help("상품상세페이지의 상품설명 상단에 표시되는 설명입니다. HTML 입력도 가능합니다."); ?>
|
||||
<input type="text" name="it_basic" value="<?php echo get_text($it['it_basic']); ?>" id="it_basic" class="frm_input" size="80">
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_basic" value="1" id="chk_ca_it_basic">
|
||||
<label for="chk_ca_it_basic">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_basic" value="1" id="chk_all_it_basic">
|
||||
<label for="chk_all_it_basic">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">상품설명</th>
|
||||
<td colspan="2"> <?php echo editor_html('it_explan', $it['it_explan']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">모바일 상품설명</th>
|
||||
<td colspan="2"> <?php echo editor_html('it_mobile_explan', $it['it_mobile_explan']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_sell_email">판매자 e-mail</label></th>
|
||||
<td>
|
||||
<?php echo help("운영자와 실제 판매자가 다른 경우 실제 판매자의 e-mail을 입력하면, 상품 주문 시점을 기준으로 실제 판매자에게도 주문서를 발송합니다."); ?>
|
||||
<input type="text" name="it_sell_email" value="<?php echo $it['it_sell_email']; ?>" id="it_sell_email" class="frm_input" size="40">
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_sell_email" value="1" id="chk_ca_it_sell_email">
|
||||
<label for="chk_ca_it_sell_email">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_sell_email" value="1" id="chk_all_it_sell_email">
|
||||
<label for="chk_all_it_sell_email">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section id="anc_sitfrm_compact" class="cbox">
|
||||
<h2>상품요약정보</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
<p><strong>전자상거래 등에서의 상품 등의 정보제공에 관한 고시</strong>에 따라 총 35개 상품군에 대해 상품 특성 등을 양식에 따라 입력할 수 있습니다.</p>
|
||||
|
||||
<div id="sit_compact">
|
||||
<?php echo help("상품군을 선택하면 자동으로 항목이 변환됩니다."); ?>
|
||||
<select id="it_info_gubun" name="it_info_gubun">
|
||||
<option value="">상품군을 선택하세요.</option>
|
||||
<?php
|
||||
if(!$it['it_info_gubun']) $it['it_info_gubun'] = 'wear';
|
||||
foreach($item_info as $key=>$value) {
|
||||
$opt_value = $key;
|
||||
$opt_text = $value['title'];
|
||||
echo '<option value="'.$opt_value.'" '.get_selected($opt_value, $it['it_info_gubun']).'>'.$opt_text.'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div id="sit_compact_fields"><?php include_once(G4_ADMIN_PATH.'/shop_admin/iteminfo.php'); ?></div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#it_info_gubun").live("change", function() {
|
||||
var gubun = $(this).val();
|
||||
$.post(
|
||||
"<?php echo G4_ADMIN_URL; ?>/shop_admin/iteminfo.php",
|
||||
{ it_id: "<?php echo $it['it_id']; ?>", gubun: gubun },
|
||||
function(data) {
|
||||
$("#sit_compact_fields").empty().html(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<section id="anc_sitfrm_cost" class="cbox">
|
||||
<h2>가격 및 재고</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
<table class="frm_tbl">
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_price">판매가격</label></th>
|
||||
<td>
|
||||
<input type="text" name="it_price" value="<?php echo $it['it_price']; ?>" id="it_price" class="frm_input" size="8"> 원
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_price" value="1" id="chk_ca_it_price">
|
||||
<label for="chk_ca_it_price">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_price" value="1" id="chk_all_it_price">
|
||||
<label for="chk_all_it_price">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_cust_price">시중가격</label></th>
|
||||
<td>
|
||||
<?php echo help("입력하지 않으면 상품상세페이지에 출력하지 않습니다."); ?>
|
||||
<input type="text" name="it_cust_price" value="<?php echo $it['it_cust_price']; ?>" id="it_cust_price" class="frm_input" size="8"> 원
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_cust_price" value="1" id="chk_ca_it_cust_price">
|
||||
<label for="chk_ca_it_cust_price">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_cust_price" value="1" id="chk_all_it_cust_price">
|
||||
<label for="chk_all_it_cust_price">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_point_type">포인트 유형</label></th>
|
||||
<td>
|
||||
<?php echo help("포인트 유형을 설정할 수 있습니다. 비율로 설정했을 경우 판매가격의 %비율로 포인트가 지급됩니다."); ?>
|
||||
<select name="it_point_type" id="it_point_type">
|
||||
<option value="0"<?php echo get_selected('0', $it['it_point_type']); ?>>금액</option>
|
||||
<option value="1"<?php echo get_selected('1', $it['it_point_type']); ?>>비율</option>
|
||||
</select>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#it_point_type").change(function() {
|
||||
if($(this).val() == "1")
|
||||
$("#it_point_unit").text("%");
|
||||
else
|
||||
$("#it_point_unit").text("점");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_point_type" value="1" id="chk_ca_it_point_type">
|
||||
<label for="chk_ca_it_point_type">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_point_type" value="1" id="chk_all_it_point_type">
|
||||
<label for="chk_all_it_point_type">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_point">포인트</label></th>
|
||||
<td>
|
||||
<?php echo help("주문완료후 환경설정에서 설정한 주문완료 설정일 후 회원에게 부여하는 포인트입니다.\n또, 포인트부여를 '아니오'로 설정한 경우 신용카드, 계좌이체로 주문하는 회원께는 부여하지 않습니다.\n게시판의 포인트 기능과는 별개로 동작합니다."); ?>
|
||||
<input type="text" name="it_point" value="<?php echo $it['it_point']; ?>" id="it_point" class="frm_input" size="8"> <span id="it_point_unit"><?php if($it['it_point_type']) echo '%'; else echo '점'; ?></span>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_point" value="1" id="chk_ca_it_point">
|
||||
<label for="chk_ca_it_point">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_point" value="1" id="chk_all_it_point">
|
||||
<label for="chk_all_it_point">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_stock_qty">재고수량</label></th>
|
||||
<td>
|
||||
<?php echo help("<b>주문관리에서 상품별 상태 변경에 따라 자동으로 재고를 가감합니다.</b> 재고는 규격/색상별이 아닌, 상품별로만 관리됩니다."); ?>
|
||||
<input type="text" name="it_stock_qty" value="<?php echo $it['it_stock_qty']; ?>" id="it_stock_qty" class="frm_input" size="8"> 개
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_stock_qty" value="1" id="chk_ca_it_stock_qty">
|
||||
<label for="chk_ca_it_stock_qty">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_stock_qty" value="1" id="chk_all_it_stock_qty">
|
||||
<label for="chk_all_it_stock_qty">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_notax">상품과세 유형</label></th>
|
||||
<td>
|
||||
@ -652,194 +840,6 @@ $pg_anchor ='<ul class="anchor">
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_basic">기본설명</label></th>
|
||||
<td>
|
||||
<?php echo help("상품상세페이지의 상품설명 상단에 표시되는 설명입니다. HTML 입력도 가능합니다."); ?>
|
||||
<input type="text" name="it_basic" value="<?php echo get_text($it['it_basic']); ?>" id="it_basic" class="frm_input" size="80">
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_basic" value="1" id="chk_ca_it_basic">
|
||||
<label for="chk_ca_it_basic">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_basic" value="1" id="chk_all_it_basic">
|
||||
<label for="chk_all_it_basic">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">상품설명</th>
|
||||
<td colspan="2"> <?php echo editor_html('it_explan', $it['it_explan']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">모바일 상품설명</th>
|
||||
<td colspan="2"> <?php echo editor_html('it_mobile_explan', $it['it_mobile_explan']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_sell_email">판매자 e-mail</label></th>
|
||||
<td>
|
||||
<?php echo help("운영자와 실제 판매자가 다른 경우 실제 판매자의 e-mail을 입력하면, 상품 주문 시점을 기준으로 실제 판매자에게도 주문서를 발송합니다."); ?>
|
||||
<input type="text" name="it_sell_email" value="<?php echo $it['it_sell_email']; ?>" id="it_sell_email" class="frm_input" size="40">
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_sell_email" value="1" id="chk_ca_it_sell_email">
|
||||
<label for="chk_ca_it_sell_email">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_sell_email" value="1" id="chk_all_it_sell_email">
|
||||
<label for="chk_all_it_sell_email">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_tel_inq">전화문의</label></th>
|
||||
<td>
|
||||
<?php echo help("상품 금액 대신 전화문의로 표시됩니다."); ?>
|
||||
<input type="checkbox" name="it_tel_inq" value="1" id="it_tel_inq" <?php echo ($it['it_tel_inq']) ? "checked" : ""; ?>> 예
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_tel_inq" value="1" id="chk_ca_it_tel_inq">
|
||||
<label for="chk_ca_it_tel_inq">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_tel_inq" value="1" id="chk_all_it_tel_inq">
|
||||
<label for="chk_all_it_tel_inq">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_use">판매가능</label></th>
|
||||
<td>
|
||||
<?php echo help("잠시 판매를 중단하거나 재고가 없을 경우에 체크를 해제해 놓으면 출력되지 않으며, 주문도 받지 않습니다."); ?>
|
||||
<input type="checkbox" name="it_use" value="1" id="it_use" <?php echo ($it['it_use']) ? "checked" : ""; ?>> 예
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_use" value="1" id="chk_ca_it_use">
|
||||
<label for="chk_ca_it_use">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_use" value="1" id="chk_all_it_use">
|
||||
<label for="chk_all_it_use">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section id="anc_sitfrm_compact" class="cbox">
|
||||
<h2>상품요약정보</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
<p><strong>전자상거래 등에서의 상품 등의 정보제공에 관한 고시</strong>에 따라 총 35개 상품군에 대해 상품 특성 등을 양식에 따라 입력할 수 있습니다.</p>
|
||||
|
||||
<div id="sit_compact">
|
||||
<?php echo help("상품군을 선택하면 자동으로 항목이 변환됩니다."); ?>
|
||||
<select id="it_info_gubun" name="it_info_gubun">
|
||||
<option value="">상품군을 선택하세요.</option>
|
||||
<?php
|
||||
if(!$it['it_info_gubun']) $it['it_info_gubun'] = 'wear';
|
||||
foreach($item_info as $key=>$value) {
|
||||
$opt_value = $key;
|
||||
$opt_text = $value['title'];
|
||||
echo '<option value="'.$opt_value.'" '.get_selected($opt_value, $it['it_info_gubun']).'>'.$opt_text.'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div id="sit_compact_fields"><?php include_once(G4_ADMIN_PATH.'/shop_admin/iteminfo.php'); ?></div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#it_info_gubun").live("change", function() {
|
||||
var gubun = $(this).val();
|
||||
$.post(
|
||||
"<?php echo G4_ADMIN_URL; ?>/shop_admin/iteminfo.php",
|
||||
{ it_id: "<?php echo $it['it_id']; ?>", gubun: gubun },
|
||||
function(data) {
|
||||
$("#sit_compact_fields").empty().html(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<section id="anc_sitfrm_cost" class="cbox">
|
||||
<h2>가격 및 재고</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
<table class="frm_tbl">
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_price">판매가격</label></th>
|
||||
<td>
|
||||
<input type="text" name="it_price" value="<?php echo $it['it_price']; ?>" id="it_price" class="frm_input" size="8"> 원
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_price" value="1" id="chk_ca_it_price">
|
||||
<label for="chk_ca_it_price">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_price" value="1" id="chk_all_it_price">
|
||||
<label for="chk_all_it_price">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_cust_price">시중가격</label></th>
|
||||
<td>
|
||||
<?php echo help("입력하지 않으면 상품상세페이지에 출력하지 않습니다."); ?>
|
||||
<input type="text" name="it_cust_price" value="<?php echo $it['it_cust_price']; ?>" id="it_cust_price" class="frm_input" size="8"> 원
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_cust_price" value="1" id="chk_ca_it_cust_price">
|
||||
<label for="chk_ca_it_cust_price">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_cust_price" value="1" id="chk_all_it_cust_price">
|
||||
<label for="chk_all_it_cust_price">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_point_type">포인트 유형</label></th>
|
||||
<td>
|
||||
<?php echo help("포인트 유형을 설정할 수 있습니다. 비율로 설정했을 경우 판매가격의 %비율로 포인트가 지급됩니다."); ?>
|
||||
<select name="it_point_type" id="it_point_type">
|
||||
<option value="0"<?php echo get_selected('0', $it['it_point_type']); ?>>금액</option>
|
||||
<option value="1"<?php echo get_selected('1', $it['it_point_type']); ?>>비율</option>
|
||||
</select>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#it_point_type").change(function() {
|
||||
if($(this).val() == "1")
|
||||
$("#it_point_unit").text("%");
|
||||
else
|
||||
$("#it_point_unit").text("점");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_point_type" value="1" id="chk_ca_it_point_type">
|
||||
<label for="chk_ca_it_point_type">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_point_type" value="1" id="chk_all_it_point_type">
|
||||
<label for="chk_all_it_point_type">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_point">포인트</label></th>
|
||||
<td>
|
||||
<?php echo help("주문완료후 환경설정에서 설정한 주문완료 설정일 후 회원에게 부여하는 포인트입니다.\n또, 포인트부여를 '아니오'로 설정한 경우 신용카드, 계좌이체로 주문하는 회원께는 부여하지 않습니다.\n게시판의 포인트 기능과는 별개로 동작합니다."); ?>
|
||||
<input type="text" name="it_point" value="<?php echo $it['it_point']; ?>" id="it_point" class="frm_input" size="8"> <span id="it_point_unit"><?php if($it['it_point_type']) echo '%'; else echo '점'; ?></span>
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_point" value="1" id="chk_ca_it_point">
|
||||
<label for="chk_ca_it_point">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_point" value="1" id="chk_all_it_point">
|
||||
<label for="chk_all_it_point">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_stock_qty">재고수량</label></th>
|
||||
<td>
|
||||
<?php echo help("<b>주문관리에서 상품별 상태 변경에 따라 자동으로 재고를 가감합니다.</b> 재고는 규격/색상별이 아닌, 상품별로만 관리됩니다."); ?>
|
||||
<input type="text" name="it_stock_qty" value="<?php echo $it['it_stock_qty']; ?>" id="it_stock_qty" class="frm_input" size="8"> 개
|
||||
</td>
|
||||
<td class="group_setting">
|
||||
<input type="checkbox" name="chk_ca_it_stock_qty" value="1" id="chk_ca_it_stock_qty">
|
||||
<label for="chk_ca_it_stock_qty">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_stock_qty" value="1" id="chk_all_it_stock_qty">
|
||||
<label for="chk_all_it_stock_qty">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
@ -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' ";
|
||||
|
||||
@ -251,7 +251,7 @@ $pg_anchor = '<ul class="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 = '<ul class="anchor">
|
||||
$s_receipt_way .= "+포인트";
|
||||
?>
|
||||
|
||||
<strong class="sodr_nonpay">미수금 <?php echo display_price($amount['미수']); ?></strong>
|
||||
<strong class="sodr_nonpay">미수금 <?php echo display_price($od['od_misu']); ?></strong>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
@ -394,8 +394,8 @@ $pg_anchor = '<ul class="anchor">
|
||||
<td><?php echo display_point($od['od_receipt_point']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">취소/환불액</th>
|
||||
<td><?php echo display_price($od['od_cancel_price']); ?></td>
|
||||
<th scope="row">결제취소/환불액</th>
|
||||
<td><?php echo display_price($od['od_refund_price']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$sql = " select dl_company, dl_url, dl_tel from {$g4['shop_delivery_table']} where dl_id = '{$od['dl_id']}' ";
|
||||
@ -585,9 +585,9 @@ $pg_anchor = '<ul class="anchor">
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="od_cancel_price">취소/환불 금액</label></th>
|
||||
<th scope="row"><label for="od_refund_price">결제취소/환불 금액</label></th>
|
||||
<td>
|
||||
<input type="text" name="od_cancel_price" value="<?php echo $od['od_cancel_price']; ?>" class="frm_input" size="10"> 원
|
||||
<input type="text" name="od_refund_price" value="<?php echo $od['od_refund_price']; ?>" class="frm_input" size="10"> 원
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -640,7 +640,7 @@ $pg_anchor = '<ul class="anchor">
|
||||
|
||||
<div class="btn_confirm">
|
||||
<input type="submit" value="결제/배송내역 수정" class="btn_submit">
|
||||
<?php if($amount['미수'] > 0) { ?>
|
||||
<?php if($od['od_misu'] > 0) { ?>
|
||||
<a href="./personalpayform.php?popup=yes&od_id=<?php echo $od_id; ?>" id="personalpay_add">개인결제추가</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
?>
|
||||
|
||||
@ -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',
|
||||
|
||||
Reference in New Issue
Block a user