From 25ffdef1a4039cf4e05ad4a5796028b562863d22 Mon Sep 17 00:00:00 2001 From: Hyojin Ahn Date: Thu, 30 Apr 2026 08:23:08 -0400 Subject: [PATCH] =?UTF-8?q?v1.2.6=20-=20[ETC]=20Plant=20=EB=8A=94=20Report?= =?UTF-8?q?=20=EB=A9=94=EB=89=B4=20=EC=88=A8=EA=B9=80.=20-=20[INSTALL=20WA?= =?UTF-8?q?IT=20LIST]=20Oil=20Pickup=20=ED=95=84=EC=9A=94=20=EC=98=B5?= =?UTF-8?q?=EC=85=98=20=EC=B6=94=EA=B0=80.=20-=20[INSTALL=20ORDER]=20?= =?UTF-8?q?=EC=99=84=EB=A3=8C=20type=20=EB=B3=80=EA=B2=BD=ED=95=B4?= =?UTF-8?q?=EB=8F=84=20=EB=85=B8=ED=8A=B8=20=EC=88=98=EC=A0=95=20=EC=95=88?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95.=20Container?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20=EC=97=AC=EB=B6=80=20=ED=91=9C=EC=8B=9C?= =?UTF-8?q?.=20-=20[CUSTOMER]=20Container=20install=20=EB=82=A0=EC=A7=9C?= =?UTF-8?q?=20=EC=9E=85=EB=A0=A5=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/assets/api/install.php | 39 ++++++++++++++++++---- public_html/doc/install_order.php | 10 +++--- public_html/doc/install_wait_list.php | 18 ++++++++-- public_html/include/top.php | 30 +++++++++-------- public_html/js/install_wait_modal.js | 9 ++++- public_html/lib/add_install_wait_modal.php | 19 ++++++++--- 6 files changed, 92 insertions(+), 33 deletions(-) diff --git a/public_html/assets/api/install.php b/public_html/assets/api/install.php index 41cb5cb..228306c 100644 --- a/public_html/assets/api/install.php +++ b/public_html/assets/api/install.php @@ -438,6 +438,8 @@ trait InstallAPI { $cycle = intval($_POST['scheduled_cycle'] ?? 0); $lock_date = intval($_POST['lock_date'] ?? 0); + $need_oil = $_POST['need_oil'] ?? 0; // 0 or 1 + // Two-person OFF = NULL if (!$person_cnt) { $person_cnt = null; @@ -462,9 +464,9 @@ trait InstallAPI { iw_required_person_cnt = ".($person_cnt !== null ? intval($person_cnt) : "NULL").", iw_multi_person_reason = ".($person_reason ? "'".addslashes($person_reason)."'" : "NULL").", - iw_scheduled = '{$scheduled}', iw_scheduled_cycle = '{$cycle}', + iw_need_oil_pickup = '{$need_oil}', iw_status = 'WAITING' WHERE iw_uid = '{$iw_uid}' @@ -1107,7 +1109,7 @@ trait InstallAPI { cc_has_wheel='{$has_wheel}', cc_has_woodframe='{$has_frame}', cc_owner_type='{$owner_type}', - cc_install_date={$install_date}, + cc_install_date='{$install_date}', cc_install_at={$install_at_sql}, cc_install_note='{$install_note}', cc_modified_at=NOW(), @@ -1198,11 +1200,17 @@ trait InstallAPI { $this->upsertAdditionalNote($di, $additional_note); // 3) 컨테이너 반영 - if ($di['di_status'] === 'A' && $newStatus === 'P') { - $this->apply_container_changes_for_di($di_uid, $install_note, intval($di['di_customer_uid'])); + if ($di['di_status'] !== 'P' && $newStatus === 'P') { - // 3-1) 컨테이너 반영 후 customer 의 main 볼륨이랑 main 컨테이너 변경 - $this->updateCustomerMainContainer(intval($di['di_customer_uid']), $di['di_install_date']); + if ($di['di_container_applied'] == 0) { + $this->apply_container_changes_for_di($di_uid, $install_note, intval($di['di_customer_uid'])); + + // 3-1) 컨테이너 반영 후 customer 의 main 볼륨이랑 main 컨테이너 변경 + $this->updateCustomerMainContainer(intval($di['di_customer_uid']), $di['di_install_date']); + + // 실행 완료 기록 + $this->markContainerApplied($di_uid); + } } // 4) oil pickup → daily @@ -1367,6 +1375,25 @@ trait InstallAPI { } } + private function markContainerApplied( + int $di_uid + ) + { + $conn = $GLOBALS['conn']; + + $sql = " + UPDATE tbl_daily_install + SET + di_container_applied = 1 + WHERE di_uid = '{$di_uid}' + LIMIT 1 + "; + + if (!qry($sql)) { + throw new Exception('daily install status update failed'); + } + } + private function saveDailyFromInstallIfNeeded(int $di_uid, int $oil_qty, int $sludge): void { if ($oil_qty <= 0) return; diff --git a/public_html/doc/install_order.php b/public_html/doc/install_order.php index cdb6d47..e33e3a4 100644 --- a/public_html/doc/install_order.php +++ b/public_html/doc/install_order.php @@ -947,11 +947,6 @@ function updateCommentReadonlyByResult(){ }else{ textarea.removeAttribute('readonly'); textarea.classList.remove('bg-light'); - - // 기존 저장값이 있으면 유지, 없을 때만 빈칸 - if (selectedRow) { - textarea.value = selectedRow.di_install_note || ''; - } } } @@ -1488,6 +1483,11 @@ function renderWorkCell(row){ // 보조 아이콘 const icons = []; + const applied = String(row.di_container_applied || '0') === '1'; + if(applied > 0){ + icons.push(``); + } + const note = (row.di_additional_note || '').trim(); if(note.length > 0){ icons.push(``); diff --git a/public_html/doc/install_wait_list.php b/public_html/doc/install_wait_list.php index 9fe902d..ace2890 100644 --- a/public_html/doc/install_wait_list.php +++ b/public_html/doc/install_wait_list.php @@ -119,15 +119,15 @@ if ($iw_uids) { * 4) Customer images (install_order) * ============================ */ $imageMap = []; // [customer_uid => true] -if ($customer_uids) { - $in = implode(',', $customer_uids); +if ($iw_uids) { + $in = implode(',', $iw_uids); $sql_img = " SELECT DISTINCT i_customeruid FROM tbl_customer_image WHERE i_status = 'A' AND i_type = 'install_order' - AND i_customeruid IN ($in) + AND i_sourceuid IN ($in) "; $ri = $jdb->nQuery($sql_img, "Load customer images error"); @@ -431,6 +431,11 @@ function formatPhone($phone) { iwRecurringDays.value = data.iw_scheduled_cycle || ''; } + // Oil-Pickup + if (data.iw_need_oil_pickup == 1) { + btnNeedOilPickup.classList.add('iw-toggle-on'); + } + // job label 갱신 document.getElementById('iwStep3Title').innerText = `Step 3 of 3 - ${data.iw_work_type} Detail`; @@ -671,6 +676,13 @@ function formatPhone($phone) { + 0): ?> + + + Pickup + + +
diff --git a/public_html/include/top.php b/public_html/include/top.php index 4e20f06..a8b9654 100644 --- a/public_html/include/top.php +++ b/public_html/include/top.php @@ -81,20 +81,22 @@ $canExport = in_array($level, [1, 5, 6, 7]); - + + +
-
+
- +
@@ -207,7 +207,7 @@
-
+
+ +
+
+ +
+
@@ -237,7 +248,7 @@
-
+