테스트 사이트 - 개발 중인 베타 버전입니다

주문관리에서 취소를 했는데.. 모든 주문내역이 취소 및 미수금이 되었습니다.

· 14년 전 · 86 · 2
주문관리에서 미수금에 대해 취소를 했더니,,
결제완료된 내용들도 모두 미수금에 금액이 보입니다.
입금취소에서도 금액이 보이구요,
그리고, 주문번호를 클릭해서 들어가면 고객페이지인데, 거기에서도 미수되었다고 되어 있습니다.

확인 부탁드립니다.


그리고, 관리자가 회원관리에서 회원을 임의로 추가 하였습니다. 그리고
그 추가된 아이디로 다른 게시판에는 글이 잘 써지는데, 상품평에서만 정상적인 접근이 아니라고 합니다.
같이 부탁드립니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 2개

수정하신 코드중에 adm/shop_admin/ordercartupdate.php 의

// 주문취소 시 포인트 반환 3월 20일 Harry
$sql1 = " select * from $g4[yc4_cart_table]
where on_uid = '$on_uid'
or (ct_status = '취소'
and on_uid= '$on_uid')";
$result = sql_query($sql1);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 회원 ID 를 얻는다.
$tmp_row = sql_fetch("select * from $g4[yc4_order_table] where on_uid = '$row[on_uid]' ");
// 여러개의 제품을 주문했을 시 취소한 것이 있는지 확인하기 위해
$tmp_cnt = sql_fetch("select count(*) as cnt from $g4[yc4_cart_table] where ct_status = '취소' and on_uid = '$row[on_uid]' ");
//주문서 중 취소된 주문금액 합산
$tmp_cancel = sql_fetch("select sum(ct_amount) as cnt from $g4[yc4_cart_table] where ct_status = '취소' and on_uid = '$row[on_uid]' ");
//주문서 중 취소를 제외한 주문금액 합산
$tmp_order = sql_fetch("select sum(ct_amount) as cnt from $g4[yc4_cart_table] where (ct_status = '주문' or ct_status = '준비' or ct_status = '배송' or ct_status = '완료') and on_uid = '$row[on_uid]' ");
//주문총액에서 취소된 금액을 빼기
$tmp_amount1 = ($tmp_row[od_temp_point] + $tmp_row[od_temp_bank] - $tmp_cancel[cnt]) ;
$tmp_amount2 = ($tmp_row[od_temp_point] + $tmp_row[od_temp_card] - $tmp_cancel[cnt]) ;
//주문서 중 남은 금액에 대한 포인트 사용한도 계산 (무통장)
$tmp_point1 = $tmp_amount1 * ($default[de_point_per] / 100); // 포인트 결제 % 적용
$tmp_point1 = (int)(($tmp_point1 / 100) * 100); // 100점 단위
//주문서 중 남은 금액에 대한 포인트 사용한도 계산 (신용카드)
$tmp_point2 = $tmp_amount2 * ($default[de_point_per] / 100); // 포인트 결제 % 적용
$tmp_point2 = (int)(($tmp_point2 / 100) * 100); // 100점 단위

// 무통장의 경우 - 결제 시 사용한 포인트가 주문취소로 인해 현재 남은 결재액의 포인트 사용한도 보다 높은 경우
if ($tmp_row[od_receipt_point] > $tmp_point1 && $tmp_cnt[cnt] > 0 && $tmp_row[od_settle_case] == '무통장') {

$po_point = ($tmp_row[od_receipt_point] - $tmp_point1) ; //고객에게 반환될 포인트
$po_leave = ($tmp_row[od_receipt_point] - $po_point) ; //사용가능한 포인트
$od_refund = ($tmp_row[od_receipt_bank] + $tmp_row[od_receipt_point] - $tmp_order[cnt]); // 고객에게 환불할 금액
insert_point($mb_id, $po_point, "주문번호 $od_id ($ct_id) 주문취소로 포인트 일부 반환");
sql_query("update $g4[yc4_order_table] set od_receipt_point = '$po_leave' where on_uid = '$tmp_row[on_uid]' ");

if ($tmp_row[od_receipt_bank] > 0 && $tmp_row[od_temp_bank] >= $tmp_row[od_receipt_bank]) {
sql_query("update $g4[yc4_order_table] set od_refund_amount = '$od_refund' where od_refund_amount = '$tmp_row[od_refund_amount]' ");
}
}
if ($tmp_row[od_receipt_point] <= $tmp_point1 && $tmp_cnt[cnt] > 0 && $tmp_row[od_settle_case] == '무통장') {
$od_refund = ($tmp_row[od_receipt_bank] + $tmp_row[od_receipt_point] - $tmp_order[cnt]);

if ($tmp_row[od_receipt_bank] > 0 && $tmp_row[od_temp_bank] >= $tmp_row[od_receipt_bank]) {
sql_query("update $g4[yc4_order_table] set od_refund_amount = '$od_refund' where od_refund_amount = '$tmp_row[od_refund_amount]' ");
}
}
// 신용카드의 경우 - 결제 시 사용한 포인트가 주문취소로 인해 현재 남은 결재액의 포인트 사용한도 보다 높은 경우
if ($tmp_row[od_receipt_point] > $tmp_point2 && $tmp_cnt[cnt] > 0 && $tmp_row[od_settle_case] == '신용카드') {

$po_point = ($tmp_row[od_receipt_point] - $tmp_point2) ;
$po_leave = ($tmp_row[od_receipt_point] - $po_point) ;
$od_refund = ($tmp_row[od_receipt_card] + $tmp_row[od_receipt_point] - $tmp_order[cnt]);
insert_point($mb_id, $po_point, "주문번호 $od_id ($ct_id) 주문취소로 포인트 일부 반환");
sql_query("update $g4[yc4_order_table] set od_receipt_point = '$po_leave' where od_receipt_point = '$tmp_row[od_receipt_point]' ");

if ($tmp_row[od_receipt_card] > 0 && $tmp_row[od_temp_card] >= $tmp_row[od_receipt_card]) {
sql_query("update $g4[yc4_order_table] set od_cancel_card = '$od_refund' where od_cancel_card = '$tmp_row[od_cancel_card]' ");
}
}
if ($tmp_row[od_receipt_point] <= $tmp_point2 && $tmp_cnt[cnt] > 0 && $tmp_row[od_settle_case] == '신용카드') {
$od_refund = ($tmp_row[od_receipt_card] + $tmp_row[od_receipt_point] - $tmp_order[cnt]);

if ($tmp_row[od_receipt_card] > 0 && $tmp_row[od_temp_card] >= $tmp_row[od_receipt_card]) {
sql_query("update $g4[yc4_order_table] set od_cancel_card = '$od_refund' where od_cancel_card = '$tmp_row[od_cancel_card]' ");
}
}
}
// 주문취소내용 추가 끝
// 포인트결재를 한 후 주문취소를 할 경우 포인트 반환 3월 18일 Harry
$sql1 = " select * from $g4[yc4_cart_table]
where on_uid = '$on_uid'
or (ct_status = '취소'
and on_uid= '$on_uid')";
$result = sql_query($sql1);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 회원 ID 를 얻는다.
$tmp_row = sql_fetch("select od_id, mb_id, od_temp_point, od_receipt_point from $g4[yc4_order_table] where on_uid = '$row[on_uid]' ");

// 여러개의 제품을 주문했을 시 취소한 것이 전체인지 일부인지 확인하기 위해
$tmp_cnt1 = sql_fetch("select count(*) as cnt from $g4[yc4_cart_table] where on_uid = '$row[on_uid]' ");
$tmp_cnt2 = sql_fetch("select count(*) as cnt from $g4[yc4_cart_table] where ct_status = '취소' and on_uid = '$row[on_uid]' ");

// 주문취소 전 제품구입 시 포인트를 사용했다면 포인트 반환, 하지만 일부만 취소할 경우 반환하지 않음
if ($tmp_row[mb_id] && $tmp_row[od_receipt_point] > 0 && ($tmp_cnt1[cnt] == $tmp_cnt2[cnt])) {
$po_point = $tmp_row[od_receipt_point];
$po_content = "주문번호 $tmp_row[od_id] ($row[ct_id]) 주문취소로 포인트 반환";
insert_point($tmp_row[mb_id], $po_point, $po_content, "@return", $tmp_row[mb_id], "$tmp_row[od_id],$row[on_uid],$row[ct_id]");
sql_query("update $g4[yc4_order_table] set od_receipt_point = '0' where od_receipt_point = '$tmp_row[od_receipt_point]' ");
}
}
// 추가사항 끝


이런 코드가 있는데 이중에서 where 조건이 올바르지 않은 코드가 있습니다.
이런 코드는 주문서 전체에 영향을 미칠수 있습니다.
코드를 확인하여 수정하시기 바랍니다.

sql_query("update $g4[yc4_order_table] set od_receipt_point = '$po_leave' where od_receipt_point = '$tmp_row[od_receipt_point]' ");
sql_query("update $g4[yc4_order_table] set od_cancel_card = '$od_refund' where od_cancel_card = '$tmp_row[od_cancel_card]' ");
sql_query("update $g4[yc4_order_table] set od_cancel_card = '$od_refund' where od_cancel_card = '$tmp_row[od_cancel_card]' ");
sql_query("update $g4[yc4_order_table] set od_receipt_point = '0' where od_receipt_point = '$tmp_row[od_receipt_point]' ");
상품문의나 상품평에서 정상적인 접근이 아니라고 나오는 것은
bbs/kcaptcha_session.php 이 두번 이상 실행되어 키가 바뀌는 것으로 생각되는데
프로그램을 수정해 놓은 부분에서 그런 현상이 발생되는 것으로 판단됩니다.
시간을 내서 다시 확인해 드리겠습니다.

게시글 목록

번호 제목
56073
56067
56065
56060
56058
56055
56051
56048
56044
56043
56042
56039
56035
56032
56030
56028
56025
56018
56012
56010