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(); } }