刪除 " : ""; ?>
+
diff --git a/wms/wipwhole-renovate-index.php b/wms/wipwhole-renovate-index.php
index acc8c186..754adc79 100644
--- a/wms/wipwhole-renovate-index.php
+++ b/wms/wipwhole-renovate-index.php
@@ -33,6 +33,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if ($form_name == 'del_form') {
$sql = "UPDATE wipwholestatus SET status = '0' WHERE id = '$del_seq' ";
mysqli_query($link, $sql);
+ $sql = "UPDATE flow set flow_code = 'Z' where form_id = '$del_seq' and flow_id = 'wws02' ";
+ mysqli_query($link, $sql);
}
}
@@ -404,7 +406,10 @@ mysqli_close($link);
window.location.href = '';
}
- $('#table_index2,#table_index3,#table_index4,#table_index5,#table_index6,#table_index7').DataTable({
+ $('#table_index2').DataTable({
+ fixedColumns: {
+ leftColumns: 4
+ },
scrollX: true,
fixedHeader: true,
scrollY: 500,
@@ -585,4 +590,11 @@ mysqli_close($link);
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/wms/wipwhole-renovate-rec-invoice-edit-submit.php b/wms/wipwhole-renovate-rec-invoice-edit-submit.php
index d1d792cd..98579974 100644
--- a/wms/wipwhole-renovate-rec-invoice-edit-submit.php
+++ b/wms/wipwhole-renovate-rec-invoice-edit-submit.php
@@ -1,6 +1,8 @@
$v) {
@@ -8,28 +10,17 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$$k = htmlspecialchars(stripslashes(trim($v)));
}
- // 時間戳記
$datetime = date("Y-m-d H:i:s");
$create_at = date("Y-m-d H:i:s");
-
- // 合約號
$contractno = $_POST['contractno'];
- // 號機
$facility_temp_no = $_POST['facility_temp_no'];
- // 汰改方案 B
$renovate_type = json_encode($_POST['renovate_type'], JSON_UNESCAPED_UNICODE);
- // 作番號
$facilityno = $_POST['facilityno'];
- // 客戶名稱
$custom = $_POST['custom'];
- // 工地負責人
$site_manager = $_POST['site_manager'];
- // 緯度
$latitude = $_POST['latitude'];
- // 經度
$longitude = $_POST['longitude'];
$weight = $_POST['weight'];
-
$numberofpassenger = $_POST['numberofpassenger'];
$numberofstop = $_POST['numberofstop'];
$numberoffloor = $_POST['numberoffloor'];
@@ -38,64 +29,45 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$facility_kind = $_POST['facility_kind'];
$address = $_POST['address'];
$real_address = $_POST['real_address'];
-
- //合約到貨日
$contract_arrival_date = $_POST['contract_arrival_date'];
- //合約到貨日
$real_contract_arrival_date = $_POST['real_contract_arrival_date'];
-
- //营业规格确认
$sales_spec_verify = $_POST['sales_spec_verify'];
$sales_spec_verify_at = $_POST['sales_spec_verify_at'] ?: $row['sales_spec_verify_at'];
$sales_spec_verify_owner = $_POST['sales_spec_verify_owner'] ?: $row['sales_spec_verify_owner'];
- //客户颜色确认
$customer_color_verify = $_POST['customer_color_verify'];
$customer_color_verify_at = $_POST['customer_color_verify_at'] ?: $row['customer_color_verify_at'];
$customer_color_verify_owner = $_POST['customer_color_verify_owner'] ?: $row['customer_color_verify_owner'];
- //客户颜色确认
$customer_style_verify = $_POST['customer_style_verify'];
$customer_style_verify_at = $_POST['customer_style_verify_at'] ?: $row['customer_style_verify_at'];
$customer_style_verify_owner = $_POST['customer_style_verify_owner'] ?: $row['customer_style_verify_owner'];
- //工勘聯絡表
$site_survey_contact_form_verify = $_POST['site_survey_contact_form_verify'];
$site_survey_contact_form_verify_at = $_POST['site_survey_contact_form_verify_at'] ?: $row['site_survey_contact_form_verify_at'];
$site_survey_contact_form_verify_owner = $_POST['site_survey_contact_form_verify_owner'] ?: $row['site_survey_contact_form_verify_owner'];
-
- //设计规格确认
$desin_spec_verify = $_POST['desin_spec_verify'];
$desin_spec_verify_at = $_POST['desin_spec_verify_at'] ?: $row['desin_spec_verify_at'];
$desin_spec_verify_owner = $_POST['desin_spec_verify_owner'] ?: $row['desin_spec_verify_owner'];
- //设计计划图确认
$desin_planning_verify = $_POST['desin_planning_verify'];
$desin_planning_verify_at = $_POST['desin_planning_verify_at'] ?: $row['desin_planning_verify_at'];
$desin_planning_verify_owner = $_POST['desin_planning_verify_owner'] ?: $row['desin_planning_verify_owner'];
- //设计颜色确认
$desin_color_verify = $_POST['desin_color_verify'];
$desin_color_verify_at = $_POST['desin_color_verify_at'] ?: $row['desin_color_verify_at'];
$desin_color_verify_owner = $_POST['desin_color_verify_owner'] ?: $row['desin_color_verify_owner'];
- //设计仕样确认
$desin_style_verify = $_POST['desin_style_verify'];
$desin_style_verify_at = $_POST['desin_style_verify_at'] ?: $row['desin_style_verify_at'];
$desin_style_verify_owner = $_POST['desin_style_verify_owner'] ?: $row['desin_style_verify_owner'];
- //设计主管確認
$desin_leader_verify = $_POST['desin_leader_verify'];
$desin_leader_verify_at = $_POST['desin_leader_verify_at'] ?: $row['desin_leader_verify_at'];
$desin_leader_verify_owner = $_POST['desin_leader_verify_owner'] ?: $row['desin_leader_verify_owner'];
- //楼高通报
$building_heigh_verify = $_POST['building_heigh_verify'];
$building_heigh_verify_at = $_POST['building_heigh_verify_at'] ?: $row['building_heigh_verify_at'];
$building_heigh_verify_owner = $_POST['building_heigh_verify_owner'] ?: $row['building_heigh_verify_owner'];
- //客户计划图确认
$customer_planning_verify = $_POST['customer_planning_verify'];
$customer_planning_verify_at = $_POST['customer_planning_verify_at'] ?: $row['customer_planning_verify_at'];
$customer_planning_verify_owner = $_POST['customer_planning_verify_owner'] ?: $row['customer_planning_verify_owner'];
- //工勘
$site_survey_contact_verify = $_POST['site_survey_contact_verify'];
$site_survey_contact_verify_at = $_POST['site_survey_contact_verify_at'] ?: $row['site_survey_contact_verify_at'];
$site_survey_contact_verify_owner = $_POST['site_survey_contact_verify_owner'] ?: $row['site_survey_contact_verify_owner'];
$old_site_survey_contact_verify = $_POST['old_site_survey_contact_verify'];
-
- // 工務助理
$outsourcer_type = $_POST['outsourcer_type'];
$install_outsourcer = $_POST['install_outsourcer'];
$install_outsourcer_owner = $_POST['install_outsourcer_owner'];
@@ -114,117 +86,37 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$estimate_tryrun_end_date = $_POST['estimate_tryrun_end_date'];
$estimate_tryrun_end_date_owner = $_POST['estimate_tryrun_end_date_owner'];
$warehouse_assistant_remark = $_POST['warehouse_assistant_remark'];
-
- // 工勘變更通知繪圖人員
- if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
- $site_survey_status = array(
- "1" => "請選擇",
- "0" => "已確認",
- "2" => "無工勘需求",
- "A" => "未動工",
- "B" => "地下室施工",
- "C" => "打樁",
- "D" => "地基",
- "E" => "挖土",
- "G" => "機房",
- "H" => "機械式淨高",
- "M" => "樓中樓",
- "OH" => "最高層(頂樓高度)",
- "P" => "PIT(機坑深度)",
- "R" => "R 樓",
- "S" => "停工",
- "T" => "TOP",
- "TC" => "頂部間隙",
- "TS" => "行程",
- "TH" => "全高",
- "Y" => "已搭、已出",
- "YB" => "退購結案",
- "YF" => "既有建物",
- "YN" => "已搭、未出"
- );
- $sql = "
- SELECT accountid
- FROM account
- WHERE department_id = '321'
- AND role_id IN ('2','3','5');
- ";
- $result = mysqli_query($link, $sql);
- foreach ($result as $row) {
- $permission = $row["accountid"];
- $title = "客戶:$custom 作番:$facilityno 工勘狀態更改";
- $content = "客戶:$custom
-作番:$facilityno
-工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]";
-
- $sql = "
- INSERT INTO notice(
- kind,
- related_id,
- title,
- content,
- haveread,
- permission,
- creater,
- create_at
- )VALUES(
- '1',
- '$id',
- '$title',
- '$content',
- null,
- '$permission',
- '$creater',
- '$create_at'
- );
- ";
- mysqli_query($link, $sql);
- }
- }
-
- //是否齊備
$shengguanok_status = $_POST['shengguanok_status'];
$shengguanok_status_at = $_POST['shengguanok_status_at'];
$shengguanok_status_owner = $_POST['shengguanok_status_owner'] ?: $row['shengguanok_status_owner'];
- //下單日(普萊特富)
$prattford_order_date_verify = $_POST['prattford_order_date_verify'];
$prattford_order_date = $_POST['prattford_order_date'];
$prattford_order_date_owner = $_POST['prattford_order_date_owner'] ?: $row['prattford_order_date_owner'];
- // 預計發貨日(到港日)
$estimated_shipping_date_verify = $_POST['estimated_shipping_date_verify'];
$estimated_shipping_date = $_POST['estimated_shipping_date'];
$estimated_shipping_date_owner = $_POST['estimated_shipping_date_owner'] ?: $row['estimated_shipping_date_owner'];
- // 預計船期(改成預計到廠日)
$estimated_shipping_schedule_date_verify = $_POST['estimated_shipping_schedule_date_verify'];
$estimated_shipping_schedule_date = $_POST['estimated_shipping_schedule_date'];
$estimated_shipping_schedule_date_owner = $_POST['estimated_shipping_schedule_date_owner'] ?: $row['estimated_shipping_schedule_date_owner'];
- // 普來特富發貨類別
$goods_type = $_POST['goods_type'] ?: $row['goods_type'];
$goods_type_date = $_POST['goods_type_date'];
$goods_type_owner = $_POST['goods_type_owner'] ?: $row['goods_type_owner'];
- // 台灣自理發貨類別
$taiwan_goods_type = $_POST['taiwan_goods_type'] ?: $row['taiwan_goods_type'];
$taiwan_goods_type_date = $_POST['taiwan_goods_type_date'];
$taiwan_goods_type_owner = $_POST['taiwan_goods_type_owner'] ?: $row['taiwan_goods_type_owner'];
- // 實際到貨日
$arrival_date_verify = $_POST['arrival_date_verify'] ?: $row['arrival_date_verify'];
$actual_tofactory_date = $_POST['actual_tofactory_date'];
$arrival_date_owner = $_POST['arrival_date_owner'] ?: $row['arrival_date_owner'];
-
- // 各部門備註
$marketing_remark = $_POST['marketing_remark'] ?: $row['marketing_remark'];
$desin_remark = $_POST['desin_remark'] ?: $row['desin_remark'];
$desin_leader_remark = $_POST['desin_leader_remark'] ?: $row['desin_leader_remark'];
$warehouse_remark = $_POST['warehouse_remark'] ?: $row['warehouse_remark'];
$yewu_remark = $_POST['yewu_remark'] ?: $row['yewu_remark'];
$shengguan_remark = $_POST['shengguan_remark'] ?: $row['shengguan_remark'];
-
- // 台製件
$desin_taiwan_items_no = json_encode($_POST['desin_taiwan_items_no'], JSON_UNESCAPED_UNICODE);
$desin_taiwan_items_name = json_encode($_POST['desin_taiwan_items_name'], JSON_UNESCAPED_UNICODE);
$desin_taiwan_items_no = $desin_taiwan_items_no == 'null' ? null : $desin_taiwan_items_no;
$desin_taiwan_items_name = $desin_taiwan_items_name == 'null' ? null : $desin_taiwan_items_name;
-
- // 品証部
$qc_date = $_POST['qc_date'] ?: $row['qc_date'];
$qc_date_owner = $_POST['qc_date_owner'] ?: $row['qc_date_owner'];
$end_qc_date = $_POST['end_qc_date'] ?: $row['end_qc_date'];
@@ -233,52 +125,183 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$old_official_check_date = $_POST['old_official_check_date'] ?: $row['old_official_check_date'];
$official_check_date_owner = $_POST['official_check_date_owner'] ?: $row['official_check_date_owner'];
$delivery_date = $_POST['delivery_date'] ?: $row['delivery_date'];
+ $old_delivery_date = $_POST['old_delivery_date'] ?: $row['old_delivery_date'];
$delivery_date_owner = $_POST['delivery_date_owner'] ?: $row['delivery_date_owner'];
+ $warehouseid = $_POST['warehouseid'] ?: $row['warehouseid'];
+ $old_warehouseid = $_POST['old_warehouseid'] ?: $row['warehouseid'];
+
$creater = $_POST['creater'];
$create_at = date("Y-m-d H:i:s");
// 上傳附件
include "wipwhole-rec-invoice-edit-fileupload.php";
+ // 指派工勘人員
+
+ if ($warehouseid !== $old_warehouseid) {
+ if (checkNowFormStatus($link) == 'A') {
+ $sql = "SELECT form_key FROM flow
+ WHERE form_id = '$id'
+ AND flow_id = 'wws02'
+ AND flow_code = 'A'
+ ";
+ $result = mysqli_query($link, $sql);
+ $form_key = $result->fetch_row()[0];
+ if (!empty($form_key)) {
+ $sql = "UPDATE wipwholestatus
+ SET warehouseid = '$warehouseid'
+ WHERE id = '$id';
+ ";
+ mysqli_query($link, $sql);
+ $sql = "UPDATE subflow
+ SET current_assigner = '$warehouseid'
+ WHERE 1 = 1
+ AND seq = '1'
+ AND form_key = '$form_key';
+ ";
+ mysqli_query($link, $sql);
+ }
+ }
+ }
+
+ if (!empty($official_check_date)) {
+ if ($official_check_date !== $old_official_check_date) {
+ $sql = "
+ SELECT accountid
+ FROM account
+ WHERE department_id = '250'
+ AND role_id IN ('1','2','3','4');
+ ";
+ $result = mysqli_query($link, $sql);
+ foreach ($result as $row) {
+ $permission = $row["accountid"];
+ $title = "客戶:$custom 作番:$facilityno 官檢日變更";
+ $content = "客戶:$custom
+ 作番:$facilityno
+ 官檢日 $old_official_check_date => $official_check_date";
+ $data = array(
+ 'kind' => 1,
+ 'related_id' => $id,
+ 'title' => $title,
+ 'content' => $content,
+ 'permission' => $permission,
+ 'creater' => $creater,
+ 'create_at' => date("Y-m-d H:i:s")
+ );
+ $cn->sendx($data);
+ }
+ }
+ }
// 工勘變更通知繪圖人員
- if ($official_check_date !== $old_official_check_date) {
+ if ($site_survey_contact_verify !== $old_site_survey_contact_verify) {
+ $site_survey_status = array(
+ "1" => "請選擇",
+ "0" => "已確認",
+ "2" => "無工勘需求",
+ "A" => "未動工",
+ "B" => "地下室施工",
+ "C" => "打樁",
+ "D" => "地基",
+ "E" => "挖土",
+ "G" => "機房",
+ "H" => "機械式淨高",
+ "M" => "樓中樓",
+ "OH" => "最高層(頂樓高度)",
+ "P" => "PIT(機坑深度)",
+ "R" => "R 樓",
+ "S" => "停工",
+ "T" => "TOP",
+ "TC" => "頂部間隙",
+ "TS" => "行程",
+ "TH" => "全高",
+ "Y" => "已搭、已出",
+ "YB" => "退購結案",
+ "YF" => "既有建物",
+ "YN" => "已搭、未出"
+ );
$sql = "
SELECT accountid
FROM account
- WHERE department_id = '250'
- AND role_id IN ('1','2','3','4');
+ WHERE department_id = '321'
+ AND role_id IN ('2','3','5');
";
$result = mysqli_query($link, $sql);
foreach ($result as $row) {
$permission = $row["accountid"];
- $title = "客戶:$custom 作番:$facilityno 官檢日變更";
+ $title = "客戶:$custom 作番:$facilityno 工勘狀態更改";
$content = "客戶:$custom
作番:$facilityno
-官檢日 $old_official_check_date => $official_check_date";
+工勘狀態 $site_survey_status[$old_site_survey_contact_verify] => $site_survey_status[$site_survey_contact_verify]";
- $sql = "
- INSERT INTO notice(
- kind,
- related_id,
- title,
- content,
- haveread,
- permission,
- creater,
- create_at
- )VALUES(
- '1',
- '$id',
- '$title',
- '$content',
- null,
- '$permission',
- '$creater',
- '" . date("Y-m-d H:i:s") . "'
+ $data = array(
+ 'kind' => 1,
+ 'related_id' => $id,
+ 'title' => $title,
+ 'content' => $content,
+ 'permission' => $permission,
+ 'creater' => $creater,
+ 'create_at' => date("Y-m-d H:i:s")
);
- ";
- mysqli_query($link, $sql);
+ $cn->sendx($data);
+ }
+ }
+
+ if (!empty($desin_documents_verify_file)) {
+ $title = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件";
+ $content = "合約號:$contract_no 作番號:$facilityno 設計上傳追加技術文件
+ 前往下載
+";
+ $data = array(
+ 'kind' => 1,
+ 'related_id' => $id,
+ 'title' => $title,
+ 'content' => $content,
+ 'permission' => "M0168",
+ 'creater' => $creater,
+ 'create_at' => date("Y-m-d H:i:s")
+ );
+ $cn->sendx($data);
+ }
+
+
+ // 官檢日及移交日通知生管人員
+ if (!empty($official_check_date)) {
+ if ($official_check_date !== $old_official_check_date) {
+ $permission = "M0168";
+ $title = "官檢日變更 客戶:$custom 作番:$facilityno";
+ $content = "客戶:$custom
+ 作番:$facilityno
+ 官檢日 $old_official_check_date => $official_check_date";
+ $data = array(
+ 'kind' => 1,
+ 'related_id' => $id,
+ 'title' => $title,
+ 'content' => $content,
+ 'permission' => $permission,
+ 'creater' => $creater,
+ 'create_at' => date("Y-m-d H:i:s")
+ );
+ $cn->sendx($data);
+ }
+ }
+ if (!empty($delivery_date)) {
+ if ($delivery_date !== $old_delivery_date) {
+ $permission = "M0168";
+ $title = "移交日變更 客戶:$custom 作番:$facilityno";
+ $content = "客戶:$custom
+ 作番:$facilityno
+ 移交日 $old_delivery_date => $delivery_date";
+ $data = array(
+ 'kind' => 1,
+ 'related_id' => $id,
+ 'title' => $title,
+ 'content' => $content,
+ 'permission' => $permission,
+ 'creater' => $creater,
+ 'create_at' => date("Y-m-d H:i:s")
+ );
+ $cn->sendx($data);
}
}
@@ -293,9 +316,6 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
site_survey_contact_verify = '$site_survey_contact_verify',
site_survey_contact_verify_at = '$site_survey_contact_verify_at',
site_survey_contact_verify_owner = '$site_survey_contact_verify_owner',
- customer_planning_verify = '$customer_planning_verify',
- customer_planning_verify_at = '$customer_planning_verify_at',
- customer_planning_verify_owner = '$customer_planning_verify_owner',
";
$updatesql .= "warehouse_remark = '', ";
if (!empty(trim($warehouse_remark))) {
@@ -305,8 +325,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
}
$updatesql .= empty($building_heigh_verify_file) ? "" : "building_heigh_verify_file = '$building_heigh_verify_file',";
$updatesql .= empty($site_survey_contact_verify_file) ? "" : "site_survey_contact_verify_file = '$site_survey_contact_verify_file',";
- $updatesql .= empty($customer_planning_verify_file) ? "" : "customer_planning_verify_file = '$customer_planning_verify_file',";
- } else if (in_array($user_department_id, [311, 312, 313, 314, 315, 511, 512, 513, 514])) {
+ }
+
+ if (in_array($user_department_id, [311, 312, 313, 314, 315, 511, 512, 513, 514, 515])) {
// 契約更新;
$updatesql .= "
sales_spec_verify = '$sales_spec_verify',
@@ -323,6 +344,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
site_survey_contact_form_verify_owner = '$site_survey_contact_form_verify_owner',
delivery_date = '$delivery_date',
delivery_date_owner = '$delivery_date_owner',
+ customer_planning_verify = '$customer_planning_verify',
+ customer_planning_verify_at = '$customer_planning_verify_at',
+ customer_planning_verify_owner = '$customer_planning_verify_owner',
marketing_remark = '',
";
if (!empty(trim($marketing_remark))) {
@@ -330,6 +354,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . " " . $marketing_remark . " ',IF(all_remark IS NULL,'',all_remark)),
";
}
+ $updatesql .= empty($customer_planning_verify_file) ? "" : "customer_planning_verify_file = '$customer_planning_verify_file',";
$updatesql .= empty($sales_spec_verify_file) ? "" : "sales_spec_verify_file = '$sales_spec_verify_file',";
$updatesql .= empty($customer_color_verify_file) ? "" : "customer_color_verify_file = '$customer_color_verify_file',";
$updatesql .= empty($customer_style_verify_file) ? "" : "customer_style_verify_file = '$customer_style_verify_file',";
@@ -492,8 +517,69 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
}
// 工務助理
- if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117'])) {
+ if (
+ in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188', 'M0117', 'M0054'])
+ || in_array($user_department_id, [521, 531, 541, 542, 543, 544, 545])
+ ) {
+
+ // $outsourcer_type = $_POST['outsourcer_type'];
+ // $qc_official_type = $_POST['qc_official_type2'] ?: $row['qc_official_type'];
+ // $qc_date = $_POST['qc_date2'] ?: $row['qc_date'];
+ // $qc_date_owner = $_POST['qc_date2_owner'] ?: $row['qc_date_owner'];
+ // $end_qc_date = $_POST['end_qc_date2'] ?: $row['end_qc_date'];
+ // $end_qc_date_owner = $_POST['end_qc_date2_owner'] ?: $row['end_qc_date_owner'];
+ // $official_check_date = $_POST['official_check_date2'] ?: $row['official_check_date'];
+ // $old_official_check_date = $_POST['old_official_check_date2'] ?: $row['old_official_check_date'];
+ // $official_check_date_owner = $_POST['official_check_date2_owner'] ?: $row['official_check_date_owner'];
+ // $delivery_date = $_POST['delivery_date2'] ?: $row['delivery_date'];
+ // $delivery_date_owner = $_POST['delivery_date2_owner'] ?: $row['delivery_date_owner'];
+ // $install_start_date = $_POST['install_start_date2'] ?: $row['install_start_date'];
+ // $install_start_date_owner = $_POST['install_start_date2_owner'] ?: $row['install_start_date_owner'];
+ // $install_end_date = $_POST['install_end_date2'] ?: $row['install_end_date'];
+ // $install_end_date_owner = $_POST['install_end_date2_owner'] ?: $row['install_end_date_owner'];
+ // $tryrun_start_date = $_POST['tryrun_start_date2'] ?: $row['tryrun_start_date'];
+ // $tryrun_start_date_owner = $_POST['tryrun_start_date2_owner'] ?: $row['tryrun_start_date_owner'];
+ // $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'];
+
$updatesql .= "
+ qc_official_type = '$qc_official_type',
+ install_start_date = '$install_start_date',
+ install_start_date_owner = '$install_start_date_owner',
+ install_end_date = '$install_end_date',
+ install_end_date_owner = '$install_end_date_owner',
+ 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',
+ delivery_date = '$delivery_date',
+ delivery_date_owner = '$delivery_date_owner',
+ qc_date = '$qc_date',
+ qc_date_owner = '$qc_date_owner',
+ end_qc_date = '$end_qc_date',
+ end_qc_date_owner = '$end_qc_date_owner',
+ official_check_date = '$official_check_date',
+ official_check_date_owner = '$official_check_date_owner',
outsourcer_type = '$outsourcer_type',
install_outsourcer = '$install_outsourcer',
install_outsourcer_owner = '$install_outsourcer_owner',
@@ -513,6 +599,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
estimate_tryrun_end_date_owner = '$estimate_tryrun_end_date_owner',
warehouse_assistant_remark = '$warehouse_assistant_remark',
";
+
if (!empty($plan_diagram_file)) {
$updatesql .= "plan_diagram_file = '$plan_diagram_file', ";
$updatesql .= "
@@ -526,7 +613,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
";
}
if (!empty($outsourcer_contract_file)) {
- $updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', ";
+ echo $updatesql .= "outsourcer_contract_file = '$outsourcer_contract_file', ";
}
}
@@ -807,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)));
@@ -820,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
@@ -831,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' ";
@@ -1010,7 +1137,7 @@ function checkWwsAssianStatus($link, $user_id)
],
"永佳捷科技"
);
- do_wws_next_assign("M0173", $form_YD_key, 'C');
+ do_wws_next_assign("M0173", $form_key, 'C');
return true;
}
}
diff --git a/wms/wipwhole-renovate-rec-invoice-edit.php b/wms/wipwhole-renovate-rec-invoice-edit.php
index ddf9f81a..f458ab65 100644
--- a/wms/wipwhole-renovate-rec-invoice-edit.php
+++ b/wms/wipwhole-renovate-rec-invoice-edit.php
@@ -1,12 +1,13 @@
'工務確認中',
'B' => '工務部門已確認 營業部門確認中',
+ 'F' => '營業部門已確認 營業主管確認中',
'C' => '營業部門已確認 設計部門確認中',
'D' => '設計部門已確認 設計部門主管確認中',
'E' => '營業部門主管已確認 生管部門確認中',
'Z' => '此作番大日程已結案',
);
-
if (checkNowFormStatus($link) == '') {
echo "此作番大日程已結案";
} else {
@@ -283,6 +284,78 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
+
+ 工勘人員
+
+ ">
+
+ >
+ 請選擇
+ >吳宗紘
+ >羅盛騰
+
+
+
+ >
+ 請選擇
+ >廖堉勝
+ >劉子睿
+
+
+
+ >
+ 請選擇
+ >許益連
+ >鄭存邑
+ >田祖豪
+
+
+
+ >
+ 請選擇
+ >高培軒
+
+
+
+ >
+ 請選擇
+ >張潘榮
+ >羅盛騰
+ >許益連
+ >鄭存邑
+ >廖堉勝
+ >田祖豪
+ >高培軒
+ >劉子睿
+
+
+
+
樓高通報
@@ -373,78 +446,6 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
-
-
- 客戶計劃圖
-
- (意匠圖)
- ";
- echo "申請上傳 ";
- } else {
- if (in_array($row2['change_status'], ['A', 'B', 'D'])) {
- echo " ";
- echo "客戶姓名:" . $row2['custom_name'] . " 狀態:審核中 ";
- }
- if ($row2['change_status'] == 'C') {
- echo " ";
- echo "客戶姓名:" . $row2['custom_name'] . " 狀態:已取消 ";
- }
- if ($row2['change_status'] == 'Z') {
- echo " ";
- echo "客戶姓名:" . $row2['custom_name'] . " 狀態:審核通過 ";
- }
- }
- ?>
-
-
- >
- value="1">請選擇
- value="0">已完成
- value="1">進行中
- value="2">無需求
-
-
- 附件
-
- >
- 下載附件" : "";
- ?>
-
- 下載附件_" . $row2['custom_name'] . "_" . $row2['create_at'] . "";
- endforeach;
- ?>
-
- 確認時間
-
- 確認人
-
-
- 請選擇
-
-
-
-
如有複數檔案請放置同個壓縮檔後再上傳
@@ -549,6 +550,28 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
+
+ 移交日
+
+
+ >
+
+ >清除
+
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+ 有官檢日或QC合格日後才可填寫
+
+
@@ -1267,12 +1410,12 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
QC及官檢類型
- />
- 只需QC
- />
- 只需官檢
- />
- QC+官檢
+ />
+ 只需QC
+ />
+ 只需官檢
+ />
+ QC+官檢
@@ -1363,6 +1506,96 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
(工務助理項目)
+
+
+ QC及官檢類型
+
+ />
+ 只需QC
+ />
+ 只需官檢
+ />
+ QC+官檢
+
+
+
+ 內部QC日
+
+
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
+ QC合格日
+
+
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
+ 官檢日
+
+
+ >
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
+ 移交日
+
+
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
發包類型
@@ -1536,6 +1769,84 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
+
+
+ 實際安裝開工日
+
+
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
+ 實際安裝完工日
+
+
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
+ 實際試車開工日
+
+
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
+ 實際試車完工日
+
+
+ >
+
+ >清除
+
+
+
+ 確認人
+
+
+ 請選擇
+
+
+
+
+
備註
@@ -1574,15 +1885,19 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
@@ -189,10 +184,8 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
-
-
(int)$radeY . $radeM) {
-
種類
@@ -252,9 +244,6 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
-
@@ -284,29 +273,47 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// 新梯出貨
$all_count = 0;
$all_count = getShipping("A", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
- echo "$all_count ";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
+ ?>
+
+
+
+
+
+
+ ?>
$a_count";
- // echo "$b_count ";
- // echo "$c_count ";
?>
@@ -335,29 +342,47 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// M1出貨
$all_count = 0;
$all_count = getShipping("B", "M1", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
- echo "$all_count ";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
+ ?>
+
+
+
+
+
+
+ ?>
$a_count";
- // echo "$b_count ";
- // echo "$c_count ";
?>
@@ -386,29 +411,47 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// MA出貨
$all_count = 0;
$all_count = getShipping("B", "MA", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
- echo "$all_count ";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
+ ?>
+
+
+
+
+
+
+ ?>
$a_count";
- // echo "$b_count ";
- // echo "$c_count ";
?>
@@ -437,33 +480,187 @@ if ((int)$radsY . $radsM > (int)$radeY . $radeM) {
// 出貨
$all_count = 0;
$all_count = getShipping("", "", $radsY, $radsM, $radsYi, str_pad($start_month, 2, "0", STR_PAD_LEFT));
- echo "$all_count ";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
-
+ ?>
+
+
+
+
+
+ $all_count";
+ ?>
+
+
+
+
+
+
+ ?>
$a_count";
- // echo "$b_count ";
- // echo "$c_count ";
?>
+
+
+
+
+
+
X
+
+
+
+
+
+
+ 序列
+ 合約號
+ 作番號
+ 出貨日
+ 試車完工日
+ 官檢日
+ 移交日
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/wms/wipwholeinstall-index-function.php b/wms/wipwholeinstall-index-function.php
index cd3500c0..a2b99b11 100644
--- a/wms/wipwholeinstall-index-function.php
+++ b/wms/wipwholeinstall-index-function.php
@@ -899,11 +899,10 @@ function getMarketingStatus($link, $user_department_id, $role_id)
{
if ($user_department_id == 220)
return "";
- if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315)
+ if (in_array($user_department_id, [311, 312, 313, 314, 315]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
- if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514)
+ if (in_array($user_department_id, [501, 511, 512, 513, 514, 515]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
-
return "disabled";
}
@@ -957,7 +956,7 @@ function getGunwuName($address)
$north_arr = array('台北', '基隆', '新北', '桃園', '新竹');
$north_arr2 = array('宜蘭');
$center_arr = array('南投', '彰化', '雲林', '台中', '苗栗');
- $south_arr = array('台南', '嘉義', '屏東', '高雄');
+ $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東');
foreach ($north_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "張潘榮";
@@ -966,7 +965,7 @@ function getGunwuName($address)
return "高培軒";
foreach ($center_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false)
- return "林瑋隆";
+ return "劉子睿";
foreach ($south_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "鄭存邑";
diff --git a/wms/wipwholeinstall-renovate-index-function.php b/wms/wipwholeinstall-renovate-index-function.php
index bf00e7bd..c8aa2898 100644
--- a/wms/wipwholeinstall-renovate-index-function.php
+++ b/wms/wipwholeinstall-renovate-index-function.php
@@ -920,11 +920,10 @@ function getMarketingStatus($link, $user_department_id, $role_id)
{
if ($user_department_id == 220)
return "";
- if ($user_department_id == 311 || $user_department_id == 312 || $user_department_id == 313 || $user_department_id == 314 || $user_department_id == 315)
+ if (in_array($user_department_id, [311, 312, 313, 314, 315]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
- if ($user_department_id == 501 || $user_department_id == 511 || $user_department_id == 512 || $user_department_id == 513 || $user_department_id == 514)
+ if (in_array($user_department_id, [501, 511, 512, 513, 514, 515]))
return checkNowFormYDStatus($link) == 'A' ? "" : "disabled";
-
return "disabled";
}
@@ -978,7 +977,7 @@ function getGunwuName($address)
$north_arr = array('台北', '基隆', '新北', '桃園', '新竹');
$north_arr2 = array('宜蘭');
$center_arr = array('南投', '彰化', '雲林', '台中', '苗栗');
- $south_arr = array('台南', '嘉義', '屏東', '高雄');
+ $south_arr = array('台南', '嘉義', '屏東', '高雄', '台東');
foreach ($north_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "吳宗紘";
@@ -987,7 +986,7 @@ function getGunwuName($address)
return "高培軒";
foreach ($center_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false)
- return "林瑋隆";
+ return "劉子睿";
foreach ($south_arr as $key => $value)
if (mb_strpos($address, $value, 0, "UTF-8") !== false)
return "鄭存邑";