diff --git a/public_html/assets/api/daily.php b/public_html/assets/api/daily.php index f1db470..5ace0ac 100644 --- a/public_html/assets/api/daily.php +++ b/public_html/assets/api/daily.php @@ -119,8 +119,8 @@ class DailyService extends CONF { $data = $this->normalizeDailyPayload($data, $existing ?: null); $data = $this->hydrateDailySnapshot($data, $existing ?: null); - // estquantity 자동 계산 - if (empty($data['d_estquantity'])) { + // estquantity 자동 계산 (입력때만 안그러면 d_estquantity 값이 0으로 덮어 씌워짐) + if (!$existing && empty($data['d_estquantity'])) { $data['d_estquantity'] = $this->calculateEstQuantity($data, $existing); } @@ -857,6 +857,7 @@ class DailyService extends CONF { if ($status !== 'F' || $visit !== 'Y') return; $customerUid = mysqli_real_escape_string($connect, $after['d_customeruid']); + $accountno = mysqli_real_escape_string($connect, $after['d_accountno']); $today = date('Ymd'); $jobtype = mysqli_real_escape_string($connect, $after['d_jobtype'] ?? 'UCO'); @@ -895,7 +896,7 @@ class DailyService extends CONF { } } - error_log("[PickupCleanup] ERP-safe delete completed for customer={$customerUid}"); + error_log("[PickupCleanup] ERP-safe delete completed for customer={$accountno}"); } private function handlePickupReset(?array $before, array $after): void @@ -914,19 +915,21 @@ class DailyService extends CONF { if ($status !== 'F' || $visit !== 'Y') return; $customerUid = mysqli_real_escape_string($connect, $after['d_customeruid']); + $accountno = mysqli_real_escape_string($connect, $after['d_accountno']); $orderdate = mysqli_real_escape_string($connect, $after['d_orderdate']); $sql = " UPDATE tbl_customer SET c_fullquantity = 0, - c_lastpickupdate = '{$orderdate}' + c_lastpickupdate = '{$orderdate}', + c_lastpickupquantity = '{$afterQty}' WHERE c_uid = '{$customerUid}' "; mysqli_query($connect, $sql); - error_log("[PickupReset] customer={$customerUid} reset fullquantity + lastpickupdate={$orderdate}"); + error_log("[PickupReset] customer={$accountno} reset fullquantity + lastpickupdate={$orderdate}"); } public function deleteDaily(string $orderdate, string $accountno, string $jobtype, array $opt = []) diff --git a/public_html/assets/internal_api.php b/public_html/assets/internal_api.php index 048bd76..87468f3 100644 --- a/public_html/assets/internal_api.php +++ b/public_html/assets/internal_api.php @@ -1642,8 +1642,7 @@ class API extends CONF { 'd_is_transfer' => 'N', 'd_level' => $_SESSION['ss_LEVEL'], ]; -error_log("=== saveInput DEBUG ==="); -error_log($_SESSION['ss_LEVEL']); + // note → daily.php에서 처리됨 if ($note !== '') { $payload['d_pickupnote'] = $note; diff --git a/public_html/login_intranet.php b/public_html/login_intranet.php index 9f6486b..108de1c 100644 --- a/public_html/login_intranet.php +++ b/public_html/login_intranet.php @@ -1,7 +1,7 @@