From c22e9185470cc1b57694858e6348519bb3531a65 Mon Sep 17 00:00:00 2001 From: "gary_chen\\gary_chen" Date: Tue, 9 Jan 2024 14:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=98=87=E5=AD=9D=E5=80=AB:=20=E6=B1=9F?= =?UTF-8?q?=E5=8D=94=E7=90=86=E5=A5=BD=EF=BC=9A=E9=BA=BB=E7=85=A9=E8=AB=8B?= =?UTF-8?q?=E9=96=8B=E5=90=84=E5=8D=80=E5=B7=A5=E4=BA=8B=E7=B6=93=E7=90=86?= =?UTF-8?q?=E8=83=BD=E8=BC=B8=E5=85=A5=EF=BC=82=E7=A7=BB=E4=BA=A4=E6=97=A5?= =?UTF-8?q?=EF=BC=82=E7=9A=84=E6=AC=8A=E9=99=90=EF=BC=8C=E9=BA=BB=E7=85=A9?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BC=B8=E5=85=A5=E5=84=B2=E5=AD=98=E5=BE=8C?= =?UTF-8?q?=E6=9C=89MAIL=E9=80=9A=E7=9F=A5=E7=87=9F=E6=A5=AD=E4=BA=BA?= =?UTF-8?q?=E5=93=A1=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/wipwhole-rec-invoice-edit-submit.php | 84 ++++++++++++++----- wms/wipwhole-rec-invoice-edit.php | 45 ++++++++-- ...whole-renovate-rec-invoice-edit-submit.php | 42 +++++++++- wms/wipwhole-renovate-rec-invoice-edit.php | 45 ++++++++-- 4 files changed, 181 insertions(+), 35 deletions(-) diff --git a/wms/wipwhole-rec-invoice-edit-submit.php b/wms/wipwhole-rec-invoice-edit-submit.php index 14803ce7..e3e07ea5 100644 --- a/wms/wipwhole-rec-invoice-edit-submit.php +++ b/wms/wipwhole-rec-invoice-edit-submit.php @@ -543,25 +543,25 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { // $tryrun_end_date = $_POST['tryrun_end_date2'] ?: $row['tryrun_end_date']; // $tryrun_end_date_owner = $_POST['tryrun_end_date2_owner'] ?: $row['tryrun_end_date_owner']; - $outsourcer_type = isset($_POST['outsourcer_type'])? $_POST['outsourcer_type'] : $row['outsourcer_type']; - $qc_official_type = isset($_POST['qc_official_type2'])? $_POST['qc_official_type2'] : $row['qc_official_type']; - $qc_date = isset($_POST['qc_date2'])? $_POST['qc_date2'] : $row['qc_date']; - $qc_date_owner = isset($_POST['qc_date2_owner'])? $_POST['qc_date2_owner'] : $row['qc_date_owner']; - $end_qc_date = isset($_POST['end_qc_date2'])? $_POST['end_qc_date2'] : $row['end_qc_date']; - $end_qc_date_owner = isset($_POST['end_qc_date2_owner'])? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner']; - $official_check_date = isset($_POST['official_check_date2'])? $_POST['official_check_date2'] : $row['official_check_date']; - $old_official_check_date = isset($_POST['old_official_check_date2'])? $_POST['old_official_check_date2'] : $row['old_official_check_date']; - $official_check_date_owner = isset($_POST['official_check_date2_owner'])? $_POST['official_check_date2_owner'] : $row['official_check_date_owner']; - $delivery_date = isset($_POST['delivery_date2'])? $_POST['delivery_date2'] : $row['delivery_date']; - $delivery_date_owner = isset($_POST['delivery_date2_owner'])? $_POST['delivery_date2_owner'] : $row['delivery_date_owner']; - $install_start_date = isset($_POST['install_start_date2'])? $_POST['install_start_date2'] : $row['install_start_date']; - $install_start_date_owner = isset($_POST['install_start_date2_owner'])? $_POST['install_start_date2_owner'] : $row['install_start_date_owner']; - $install_end_date = isset($_POST['install_end_date2'])? $_POST['install_end_date2'] : $row['install_end_date']; - $install_end_date_owner = isset($_POST['install_end_date2_owner'])? $_POST['install_end_date2_owner'] : $row['install_end_date_owner']; - $tryrun_start_date = isset($_POST['tryrun_start_date2'])? $_POST['tryrun_start_date2'] : $row['tryrun_start_date']; - $tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner'])? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner']; - $tryrun_end_date = isset($_POST['tryrun_end_date2'])? $_POST['tryrun_end_date2'] : $row['tryrun_end_date']; - $tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner'])? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner']; + $outsourcer_type = isset($_POST['outsourcer_type']) ? $_POST['outsourcer_type'] : $row['outsourcer_type']; + $qc_official_type = isset($_POST['qc_official_type2']) ? $_POST['qc_official_type2'] : $row['qc_official_type']; + $qc_date = isset($_POST['qc_date2']) ? $_POST['qc_date2'] : $row['qc_date']; + $qc_date_owner = isset($_POST['qc_date2_owner']) ? $_POST['qc_date2_owner'] : $row['qc_date_owner']; + $end_qc_date = isset($_POST['end_qc_date2']) ? $_POST['end_qc_date2'] : $row['end_qc_date']; + $end_qc_date_owner = isset($_POST['end_qc_date2_owner']) ? $_POST['end_qc_date2_owner'] : $row['end_qc_date_owner']; + $official_check_date = isset($_POST['official_check_date2']) ? $_POST['official_check_date2'] : $row['official_check_date']; + $old_official_check_date = isset($_POST['old_official_check_date2']) ? $_POST['old_official_check_date2'] : $row['old_official_check_date']; + $official_check_date_owner = isset($_POST['official_check_date2_owner']) ? $_POST['official_check_date2_owner'] : $row['official_check_date_owner']; + $delivery_date = isset($_POST['delivery_date2']) ? $_POST['delivery_date2'] : $row['delivery_date']; + $delivery_date_owner = isset($_POST['delivery_date2_owner']) ? $_POST['delivery_date2_owner'] : $row['delivery_date_owner']; + $install_start_date = isset($_POST['install_start_date2']) ? $_POST['install_start_date2'] : $row['install_start_date']; + $install_start_date_owner = isset($_POST['install_start_date2_owner']) ? $_POST['install_start_date2_owner'] : $row['install_start_date_owner']; + $install_end_date = isset($_POST['install_end_date2']) ? $_POST['install_end_date2'] : $row['install_end_date']; + $install_end_date_owner = isset($_POST['install_end_date2_owner']) ? $_POST['install_end_date2_owner'] : $row['install_end_date_owner']; + $tryrun_start_date = isset($_POST['tryrun_start_date2']) ? $_POST['tryrun_start_date2'] : $row['tryrun_start_date']; + $tryrun_start_date_owner = isset($_POST['tryrun_start_date2_owner']) ? $_POST['tryrun_start_date2_owner'] : $row['tryrun_start_date_owner']; + $tryrun_end_date = isset($_POST['tryrun_end_date2']) ? $_POST['tryrun_end_date2'] : $row['tryrun_end_date']; + $tryrun_end_date_owner = isset($_POST['tryrun_end_date2_owner']) ? $_POST['tryrun_end_date2_owner'] : $row['tryrun_end_date_owner']; $updatesql .= " @@ -873,11 +873,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST['form_name'] == 'update_install_date_form') { + include "./class/Cmail.php"; + $cmail = new Cmail(); foreach ($_POST as $k => $v) $$k = htmlspecialchars(stripslashes(trim($v))); $change_all_contractno = $_POST['change_all_contractno']; - $contractno = $_POST['contractno2']; + $contractno2 = $_POST['contractno2']; $install_start_date = $_POST['install_start_date']; $install_start_date_owner = $_POST['install_start_date_owner']; $install_end_date = $_POST['install_end_date']; @@ -886,6 +888,42 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $tryrun_start_date_owner = $_POST['tryrun_start_date_owner']; $tryrun_end_date = $_POST['tryrun_end_date']; $tryrun_end_date_owner = $_POST['tryrun_end_date_owner']; + $old_delivery_date = $_POST['old_delivery_date']; + $delivery_date = $_POST['delivery_date']; + $delivery_date_owner = $_POST['delivery_date_owner']; + $contractno = $_POST['contractno']; + $facilityno = $_POST['facilityno']; + $salesid = $_POST['salesid']; + + $salesname = accountid2name($salesid)[$salesid]; + $salesmail = accountid2email([$salesid])[$salesid]; + + if ($old_delivery_date !== $delivery_date) { + + if (empty($change_all_contractno)) { + $mail_title = "作番大日程(新梯)合約號:" . $contractno . "-移交日變更通知"; + $mail_content = "作番大日程(新梯) + 合約號:" . $contractno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } else { + $mail_title = "作番大日程(新梯)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知"; + $mail_content = "作番大日程(新梯) + 合約號:" . $contractno + . " + 作番號:" . $facilityno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$salesname, $salesmail] + ], + "永佳捷科技" + ); + } $updatesql = " UPDATE wipwholestatus @@ -897,12 +935,14 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { tryrun_start_date = '$tryrun_start_date', tryrun_start_date_owner = '$tryrun_start_date_owner', tryrun_end_date = '$tryrun_end_date', - tryrun_end_date_owner = '$tryrun_end_date_owner' + tryrun_end_date_owner = '$tryrun_end_date_owner', + delivery_date = '$delivery_date', + delivery_date_owner = '$delivery_date_owner' "; if (empty($change_all_contractno)) { $updatesql .= "WHERE id = '$id' "; } else { - $updatesql .= "WHERE contractno = '$contractno' "; + $updatesql .= "WHERE contractno = '$contractno2' "; } // echo $updatesql; // exit; diff --git a/wms/wipwhole-rec-invoice-edit.php b/wms/wipwhole-rec-invoice-edit.php index a8346328..e458cb2d 100644 --- a/wms/wipwhole-rec-invoice-edit.php +++ b/wms/wipwhole-rec-invoice-edit.php @@ -497,7 +497,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; - + @@ -1058,6 +1058,28 @@ include "wipwhole-rec-invoice-edit-submit.php"; + + 移交日 + +
+ > + + + + +
+ + 確認人 + + + + + 有官檢日或QC合格日後才可填寫 + + " /> + + + + + +
@@ -1960,12 +1988,12 @@ include "wipwhole-rec-invoice-edit-submit.php"; } function checkDeliveryDateKeyinStatus() { - $("#delivery_date").prop("disabled", true); + $("#delivery_date,#delivery_date_tmp").prop("disabled", true); if ($("#end_qc_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } if ($("#official_check_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } } $(function() { @@ -1995,7 +2023,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 'qc_date2', 'end_qc_date2', 'official_check_date2', - 'delivery_date', + // 'delivery_date', 'delivery_date2', 'install_start_date2', 'install_end_date2', @@ -2030,6 +2058,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 'install_end_date', 'tryrun_start_date', 'tryrun_end_date', + 'delivery_date' ] for (var i = 0; i < oursourcer_input_arr.length; i++) { inputChangeOutsourcer(oursourcer_input_arr[i]); @@ -2304,6 +2333,8 @@ include "wipwhole-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } } else { @@ -2315,6 +2346,8 @@ include "wipwhole-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } } diff --git a/wms/wipwhole-renovate-rec-invoice-edit-submit.php b/wms/wipwhole-renovate-rec-invoice-edit-submit.php index 6e87a316..98579974 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit-submit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit-submit.php @@ -894,6 +894,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_SERVER["REQUEST_METHOD"] == "POST") { if ($_POST['form_name'] == 'update_install_date_form') { + include "./class/Cmail.php"; + $cmail = new Cmail(); foreach ($_POST as $k => $v) $$k = htmlspecialchars(stripslashes(trim($v))); @@ -907,6 +909,42 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { $tryrun_start_date_owner = $_POST['tryrun_start_date_owner']; $tryrun_end_date = $_POST['tryrun_end_date']; $tryrun_end_date_owner = $_POST['tryrun_end_date_owner']; + $old_delivery_date = $_POST['old_delivery_date']; + $delivery_date = $_POST['delivery_date']; + $delivery_date_owner = $_POST['delivery_date_owner']; + $contractno = $_POST['contractno']; + $facilityno = $_POST['facilityno']; + $salesid = $_POST['salesid']; + + $salesname = accountid2name($salesid)[$salesid]; + $salesmail = accountid2email([$salesid])[$salesid]; + + if ($old_delivery_date !== $delivery_date) { + + if (empty($change_all_contractno)) { + $mail_title = "作番大日程(汰改)合約號:" . $contractno . "-移交日變更通知"; + $mail_content = "作番大日程(汰改)$salesname$salesmail + 合約號:" . $contractno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } else { + $mail_title = "作番大日程(汰改)合約號:" . $contractno . "作番號:" . $facilityno . "-移交日變更通知"; + $mail_content = "作番大日程(汰改) + 合約號:" . $contractno + . " + 作番號:" . $facilityno + . " + 移交日:" . $old_delivery_date . " => " . $delivery_date; + } + $cmail->sendx( + $mail_title, + $mail_content, + [ + [$salesname, $salesmail] + ], + "永佳捷科技" + ); + } $updatesql = " UPDATE wipwholestatus @@ -918,7 +956,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { tryrun_start_date = '$tryrun_start_date', tryrun_start_date_owner = '$tryrun_start_date_owner', tryrun_end_date = '$tryrun_end_date', - tryrun_end_date_owner = '$tryrun_end_date_owner' + tryrun_end_date_owner = '$tryrun_end_date_owner', + delivery_date = '$delivery_date', + delivery_date_owner = '$delivery_date_owner' "; if (empty($change_all_contractno)) { $updatesql .= "WHERE id = '$id' "; diff --git a/wms/wipwhole-renovate-rec-invoice-edit.php b/wms/wipwhole-renovate-rec-invoice-edit.php index 57fbd03f..f458ab65 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit.php @@ -550,6 +550,28 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; + + 移交日 + +
+ > + + + + +
+ + 確認人 + + + + + 有官檢日或QC合格日後才可填寫 + + - + @@ -1907,6 +1929,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; + + + + + +
@@ -1959,12 +1987,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; } function checkDeliveryDateKeyinStatus() { - $("#delivery_date").prop("disabled", true); + $("#delivery_date,#delivery_date_tmp").prop("disabled", true); if ($("#end_qc_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } if ($("#official_check_date").val() !== "") { - $("#delivery_date").prop("disabled", false); + $("#delivery_date,#delivery_date_tmp").prop("disabled", false); } } $(function() { @@ -1990,7 +2018,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 'qc_date', 'end_qc_date', 'official_check_date', - 'delivery_date', + // 'delivery_date', 'qc_date2', 'end_qc_date2', 'official_check_date2', @@ -2028,6 +2056,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 'install_end_date', 'tryrun_start_date', 'tryrun_end_date', + 'delivery_date' ] for (var i = 0; i < oursourcer_input_arr.length; i++) { inputChangeOutsourcer(oursourcer_input_arr[i]); @@ -2329,6 +2358,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } } else { @@ -2340,6 +2371,8 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; $("#tryrun_start_date_owner").val($("#tryrun_start_date_owner_tmp").val()); $("#tryrun_end_date").val($("#tryrun_end_date_tmp").val()); $("#tryrun_end_date_owner").val($("#tryrun_end_date_owner_tmp").val()); + $("#delivery_date").val($("#delivery_date_tmp").val()); + $("#delivery_date_owner").val($("#delivery_date_owner_tmp").val()); $('#update_install_date_form').submit(); } }