diff --git a/wms/contract/api/getFacilityNo.php b/wms/contract/api/getFacilityNo.php
index 10b1081d..571fa903 100644
--- a/wms/contract/api/getFacilityNo.php
+++ b/wms/contract/api/getFacilityNo.php
@@ -75,7 +75,7 @@ class CreateFacilityNo
$next_seq = $this->getNextFacilitySeq("mf_vol_no") + 1;
$new_facility_arr = [];
for ($start_num = 1; $start_num <= $num; $start_num++) {
- $facility_no_tmp = $Y . $sale_type . $make_type
+ $facility_no_tmp = $Y . $sale_type[$start_num - 1] . $make_type[$start_num - 1]
. str_pad($next_seq, 5, "0", STR_PAD_LEFT);
array_push($new_facility_arr, $facility_no_tmp);
$next_seq++;
@@ -85,7 +85,7 @@ class CreateFacilityNo
$next_seq = $this->getNextFacilitySeq("tf_vol_no");
$new_facility_arr = [];
for ($start_num = 1; $start_num <= $num; $start_num++) {
- $facility_no_tmp = $Y . $sale_type . $make_type
+ $facility_no_tmp = $Y . $sale_type[$start_num - 1] . $make_type[$start_num - 1]
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT)
. str_pad($start_num, 2, "0", STR_PAD_LEFT);
array_push($new_facility_arr, $facility_no_tmp);
@@ -154,7 +154,7 @@ class CreateFacilityNo
$new_facility_no_arr = [];
for ($i = 1; $i <= $num; $i++) {
- $new_facility_no = $Y . $sale_type . $make_type
+ $new_facility_no = $Y . $sale_type[$i-1] . $make_type[$i-1]
. str_pad($next_seq, 5, "0", STR_PAD_LEFT);
array_push($new_facility_no_arr, $new_facility_no);
$next_seq++;
@@ -184,7 +184,7 @@ class CreateFacilityNo
$new_facility_no_arr = [];
for ($i = 1; $i <= $num; $i++) {
- $new_facility_no = $Y . $sale_type . $make_type
+ $new_facility_no = $Y . $sale_type[$i - 1] . $make_type[$i - 1]
. str_pad($next_seq + 1, 3, "0", STR_PAD_LEFT)
. str_pad($i, 2, "0", STR_PAD_LEFT);
array_push($new_facility_no_arr, $new_facility_no);
@@ -449,13 +449,17 @@ class CreateFacilityNo
/**
* 建立新的新梯作番
- * @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
- * @param string $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
+ * @param array $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
+ * @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @param int $seq_name : 幾個案場 0-99
* @return array $new_facilityno : 作番號
*/
function makeMFacilityNo($sale_type, $make_type, $num)
{
+ if (count($sale_type) !== $num)
+ return "陣列數量不一致!";
+ if (count($make_type) !== $num)
+ return "陣列數量不一致!";
$new_facility_no = $this->getNextFacilityNo("M", $sale_type, $make_type, $num);
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) {
// 如果作番號重複 使用此函數修正
@@ -466,13 +470,17 @@ class CreateFacilityNo
/**
* 建立新的汰改作番
- * @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
- * @param string $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
+ * @param array $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品
+ * @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正
* @param int $seq_name : 幾個案場 0-99
* @return array $new_facilityno : 作番號
*/
function makeTFacilityNo($sale_type, $make_type, $num)
{
+ if (count($sale_type) !== $num)
+ return "陣列數量不一致!";
+ if (count($make_type) !== $num)
+ return "陣列數量不一致!";
$new_facility_no = $this->getNextFacilityNo("T", $sale_type, $make_type, $num);
if ($this->checkFacilityRepeatStatus($new_facility_no) == false) {
// 如果作番號重複 使用此函數修正
@@ -506,10 +514,10 @@ class CreateFacilityNo
$cfn = new CreateFacilityNo;
// // 建立作番號 - 新梯
-// print_r($cfn->makeMFacilityNo("M", "X", 5));
-// echo "
";
+print_r($cfn->makeMFacilityNo(["M", "E"], ["X", "W"], 2));
+echo "
";
// // 建立作番號 - 汰改
-// print_r($cfn->makeTFacilityNo("M", "X", 1));
+// print_r($cfn->makeTFacilityNo(["M", "E"], ["X", "W"], 2));
// echo "
";
// // 建立作番號 - 保養
// print_r($cfn->makeBFacilityNo(["M", "E"], ["X", "W"], 2));
diff --git a/wms/wipwhole-change-planning-customer-name-submit.php b/wms/wipwhole-change-planning-customer-name-submit.php
index 7646c944..689aadb5 100644
--- a/wms/wipwhole-change-planning-customer-name-submit.php
+++ b/wms/wipwhole-change-planning-customer-name-submit.php
@@ -1,5 +1,5 @@
$wipwholestatus_id[0],
@@ -52,7 +54,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
'tds' => $tds,
'form_key' => getFomkeySeq($link),
'customer_planning_verify_file' => $customer_planning_verify_file,
- 'user_id' => $user_id
+ 'user_id' => $user_id,
+ 'change_status' => $assign_status
);
// 寫入表單主檔
addWipwholeChangeContractdateDetails($link, $data_arr);