diff --git a/.gitignore b/.gitignore index 74665935..c01e362a 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ wms/excel/gary_test.xlsx wms/excel/wipwholeintall.xlsx wms/excel/estimated_shipping_date_report.xlsx *.docx +wms/mkt/WriteOffRepair.xlsx \ No newline at end of file diff --git a/wms/contract/api/getFacilityNo.php b/wms/contract/api/getFacilityNo.php index 3c92c600..10b1081d 100644 --- a/wms/contract/api/getFacilityNo.php +++ b/wms/contract/api/getFacilityNo.php @@ -60,8 +60,8 @@ class CreateFacilityNo /** * 取得下一個新的作番 * @param string $facility_type : M:新梯 T:汰改 B:保養 - * @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 $num : 號機 * @return array $new_facility_arr */ @@ -95,7 +95,7 @@ class CreateFacilityNo $next_seq = $this->getNextFacilitySeq("bf_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); @@ -109,8 +109,8 @@ class CreateFacilityNo /** * 建立新的作番 * @param string $facility_type : M:新梯 T:汰改 B:保養 - * @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 string $num : 號機 (非必填) * @return string $new_facility_no */ @@ -214,7 +214,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); @@ -407,26 +407,28 @@ class CreateFacilityNo /** * 檢查 $sale_type 是否有存在規則之中 - * @param string $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 + * @param array $sale_type : M:内銷 E:外銷 T:他社维保 J:汰改 X:特殊部品 * @return boolean $status : true:合法代碼 false:非法代碼 */ function checkSaleTypeStatus($sale_type) { - if (in_array($sale_type, ['M', 'E', 'T', 'J', 'X'])) - return true; - return false; + foreach ($sale_type as $row) + if (!in_array($row, ['M', 'E', 'T', 'J', 'X'])) + return false; + return true; } /** * 檢查 $sale_type 是否有存在規則之中 - * @param string $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 + * @param array $make_type : X:小機房 W:無機房 H:家用梯 Z:雜物梯 F:扶梯 B:部品 Q:品保對策 T:研究開發 N:設備 W:出貨現場要求購買 J:營業問題對策 Y:已出貨作番營業進行規格訂正 * @return boolean $status : true:合法代碼 false:非法代碼 */ function checkMakeTypeStatus($make_type) { - if (in_array($make_type, ['X', 'W', 'H', 'Z', 'F', 'B', 'Q', 'T', 'N', 'W', 'J', 'Y'])) - return true; - return false; + foreach ($make_type as $row) + if (!in_array($row, ['X', 'W', 'H', 'Z', 'F', 'B', 'Q', 'T', 'N', 'W', 'J', 'Y'])) + return false; + return true; } /** @@ -481,13 +483,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 makeBFacilityNo($sale_type, $make_type, $num) { + if (count($sale_type) !== $num) + return "陣列數量不一致!"; + if (count($make_type) !== $num) + return "陣列數量不一致!"; $new_facility_no = $this->getNextFacilityNo("B", $sale_type, $make_type, $num); if ($this->checkFacilityRepeatStatus($new_facility_no) == false) { // 如果作番號重複 使用此函數修正 @@ -498,7 +504,7 @@ class CreateFacilityNo } -// $cfn = new CreateFacilityNo; +$cfn = new CreateFacilityNo; // // 建立作番號 - 新梯 // print_r($cfn->makeMFacilityNo("M", "X", 5)); // echo "

"; @@ -506,5 +512,5 @@ class CreateFacilityNo // print_r($cfn->makeTFacilityNo("M", "X", 1)); // echo "

"; // // 建立作番號 - 保養 -// print_r($cfn->makeBFacilityNo("M", "X", 1)); +// print_r($cfn->makeBFacilityNo(["M", "E"], ["X", "W"], 2)); // echo "

"; diff --git a/wms/mkt/assets/img/image001.png b/wms/mkt/assets/img/image001.png new file mode 100644 index 00000000..3cee3340 Binary files /dev/null and b/wms/mkt/assets/img/image001.png differ diff --git a/wms/mkt/assets/img/stamp.png b/wms/mkt/assets/img/stamp.png new file mode 100644 index 00000000..c108a496 Binary files /dev/null and b/wms/mkt/assets/img/stamp.png differ diff --git a/wms/mkt/pricereview_contractno-api.php b/wms/mkt/pricereview_contractno-api.php new file mode 100644 index 00000000..2c33004b --- /dev/null +++ b/wms/mkt/pricereview_contractno-api.php @@ -0,0 +1,63 @@ + "ok", "err" => ""); + +try { + if (empty($_POST) || empty($_POST["pa"])) throw new \Exception("parameter empty"); + + foreach ($_POST as $k => $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + + // 基本資料 + $db_query = "select a.address, a.repairerid, c.contractno, c.company, c.taxid from account a, contract c "; + $db_query .= "where a.accountid = c.customerid and c.contractno = '$pa'"; + $res = mysqli_query($link, $db_query); + if ($row = mysqli_fetch_row($res)) { + $rarr["address"] = $row[0]; + $rarr["repairerid"] = $row[1]; + $rarr["contractno"] = $row[2]; + $rarr["company"] = $row[3]; + $rarr["taxid"] = $row[4]; + } + mysqli_free_result($res); + + // 電梯編號 + $db_query = "select facilityno from facility where contractno = '$pa' order by facilityno"; + $res = mysqli_query($link, $db_query); + while ($row = mysqli_fetch_row($res)) { + $rarr["faci"][] = $row[0]; + } + mysqli_free_result($res); + + if (!isset($rarr["contractno"])) { + $rarr["st"] = "err"; + $rarr["err"] = "無資料!"; + } +}catch(\Exception $e) { + $rarr["st"] = "err"; + $rarr["err"] = $e->getMessage(); +} +//print_r($rarr);exit; +echo json_encode($rarr, JSON_UNESCAPED_UNICODE); +exit; +?> \ No newline at end of file diff --git a/wms/mkt/pricereview_mi-api.php b/wms/mkt/pricereview_mi-api.php index 098064f7..931f22e4 100644 --- a/wms/mkt/pricereview_mi-api.php +++ b/wms/mkt/pricereview_mi-api.php @@ -71,6 +71,7 @@ try { $elev_arr[$row[5]]["floors"] = $floors; $elev_arr[$row[5]]["speed"] = $speed; $elev_arr[$row[5]]["option"] = []; + $elev_arr[$row[5]]["mn"] = []; $elev_qty_all += $row[1]; } mysqli_free_result($res); @@ -108,20 +109,22 @@ try { mysqli_free_result($res); $opt_nosel_id_arr = array_diff(array_keys($opt_elev_arr), $opt_sel_id_arr); - // 保固延長<->電梯項次 - $mn_arr = []; - $sql = "select id, item_spec, item_qty, option_relate_spec from pricereview_item where mid = '$id' and item_group = 'D'"; + // 電梯所屬保固延長 + $mn_elev_arr = $mn_sel_id_arr = []; + $sql = "select id, item_spec, item_price_bp, option_relate_spec from pricereview_item where mid = '$id' and item_group = 'D'"; $res = mysqli_query($link, $sql); while ($row = mysqli_fetch_row($res)) { - $mn_arr[$row[0]]["item_spec"] = $row[1]; - $mn_arr[$row[0]]["item_qty"] = $row[2]; + $mn_elev_arr[$row[0]]["item_spec"] = $row[1]; + $mn_elev_arr[$row[0]]["item_price_bp"] = $row[2]; $tmp_arr = explode(",", $row[3]); - $mn_arr[$row[0]]["elev_no"] = $tmp_arr; + $mn_elev_arr[$row[0]]["elev_no"] = $tmp_arr; foreach ($tmp_arr as $v) { $elev_arr[$v]["mn"][] = $row[0]; + $mn_sel_id_arr[] = $row[0]; } } mysqli_free_result($res); + $mn_nosel_id_arr = array_diff(array_keys($mn_elev_arr), $mn_sel_id_arr); // 除外項目平均分到每台電梯 $exarr = []; @@ -160,7 +163,7 @@ try { //print_r($elev_arr); //print_r($opt_elev_arr); //print_r($opt_nosel_id_arr); - //print_r($mn_arr); + //print_r($mn_elev_arr); //print_r($ex_arr);exit; foreach ($elev_arr as $item_no => $v) { @@ -243,8 +246,10 @@ try { if (empty($todo_opt_arr)) $todo_opt_arr = $opt_nosel_id_arr; if (!empty($todo_opt_arr)) { foreach ($todo_opt_arr as $val) { - $sql4 = "select o.base_floor, o.base_floor_plus, o.price, r.equipment from option_mi o, elevator_quotation_rule r "; - $sql4 .= "where o.quotation_no = r.quotation_no and o.option_price_id = ".$opt_elev_arr[$val]["price_id"]." "; + $sql4 = "select o.base_floor, o.base_floor_plus, o.price, r.equipment, p.price 'OP' "; + $sql4 .= "from option_mi o, elevator_quotation_rule r, option_price p "; + $sql4 .= "where o.quotation_no = r.quotation_no and o.option_price_id = p.id "; + $sql4 .= "and o.option_price_id = ".$opt_elev_arr[$val]["price_id"]." "; $sql4 .= "and ($v[item_weight] between o.min_weight and o.max_weight) and o.open_kind = '".$v["item_op"]."'"; $res_om = mysqli_query($link, $sql4); if ($row_om = mysqli_fetch_assoc($res_om)) { @@ -252,6 +257,7 @@ try { // 特例 if ($opt_elev_arr[$val]["price_id"] == "256" && ($v["floors"] < $row_om["base_floor"])) $row_om["price"] = 9815; if ($opt_elev_arr[$val]["price_id"] == "266" && $v["floors"] >= 20) $plus += 44.8; // 15层,14.6元/层(19层内,跳20层再追加44.8元) + if ($row_om["price"] == 0) $row_om["price"] = $row_om["OP"]*0.6; // 實體且沒成本的:抓牌價6成 // 含此option的電梯總台數 $myelev_qty = 0; foreach ($opt_elev_arr[$val]["elev_no"] as $pval) { @@ -273,10 +279,18 @@ try { // 保固延長 $mnarr = []; $mn_fee = $j = 0; - if (!empty($v["mn"][0])) { - foreach ($v["mn"] as $val) { + $todo_mn_arr = $v["mn"]; + if (!empty($todo_mn_arr[0])) { + foreach ($todo_mn_arr as $val) { $mn_amt = 0; - $mnarr[$j][0] = $mn_arr[$val]["item_spec"]."保養費"; + // 含此保延的電梯總台數 + $myelev_qty = 0; + foreach ($mn_elev_arr[$val]["elev_no"] as $pval) { + $myelev_qty += $elev_arr[$pval]["item_qty"]; + } + // 分配:延保總價除以電梯總台數 + $mn_amt += round(0+($mn_elev_arr[$val]["item_price_bp"]/$myelev_qty), 0); + $mnarr[$j][0] = $mn_elev_arr[$val]["item_spec"]."保養費"; $mnarr[$j][1] = $mn_amt; $mn_fee += $mn_amt; $j++; diff --git a/wms/mkt/pricereview_repair-check.php b/wms/mkt/pricereview_repair-check.php new file mode 100644 index 00000000..011a6869 --- /dev/null +++ b/wms/mkt/pricereview_repair-check.php @@ -0,0 +1,268 @@ +"; + echo "alert('請勿重覆簽核!!');"; + echo "window.close();"; + echo ""; + exit; + } +} + +$assign_status = ''; + +$data = []; +$db_query = "select * from pricereview_repair_main where id = '$id'"; +$data = mysqli_query($link, $db_query); + +foreach($data as $data) : + // 公司站點 + $sql = "select content from code where field_name = 'masada_addr' and code_name = '".$data["masada_addr"]."'"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_row($res)) { + $data["maddr"] = $row[0]; + } + mysqli_free_result($res); + + // 保養人員 + $repairer_arr = []; + $sql = "select name from account where accounttype = 'B' and accountid = '".$data["repairerid"]."'"; + $res = mysqli_query($link, $sql); + if ($row = mysqli_fetch_row($res)) { + $data["repair"] = $row[0]; + } + mysqli_free_result($res); + + // 價審明細 + $item_arr = []; + $sql = "select * from pricereview_repair_item where rid = '$id' order by item_no"; + $res = mysqli_query($link, $sql); + while ($row = mysqli_fetch_assoc($res)) { + $item_arr[$row["item_no"]]["title"] = $row["title"]; + $item_arr[$row["item_no"]]["item_unit_price"] = $row["item_unit_price"]; + $item_arr[$row["item_no"]]["item_qty"] = $row["item_qty"]; + $item_arr[$row["item_no"]]["item_price_bp"] = $row["item_price_bp"]; + $item_arr[$row["item_no"]]["memo"] = $row["memo"]; + } + mysqli_free_result($res); + + // get form_key + $sql = "select max(form_key) from assign where assign_opinion = '".$data["repair_no"]."'"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_row($res); + $form_key = $row[0]; + mysqli_free_result($res); +?> + + + +
+
+
+ + "> +
+
+ + "> +
+
+
+
+ "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+ + "> +
+
+
+
+ +
+ +
+
+ +
+ + + + + + + + + + + + + $v) { + ?> + + + + + + + + + + + + + + + + + + + + +
項次名稱數量單價合計備註
+ + + "> + + "> + + "> + + "> + + "> +
營業稅
+ "> +
總價
+ "> +
+
+ +
+ +
+ + + + + + + + + + + + + + + +
簽核操作
簽核狀態 + + 下位簽核者 + + + +
+
+ + + + +
+
+ + \ No newline at end of file diff --git a/wms/mkt/pricereview_repair-create.php b/wms/mkt/pricereview_repair-create.php new file mode 100644 index 00000000..b8fd4938 --- /dev/null +++ b/wms/mkt/pricereview_repair-create.php @@ -0,0 +1,514 @@ +'; +$item_str .= ' + + 序號 + 名稱 + 類別 + 單位 + 售價 + 備註 + '; +foreach ($item_arr as $k => $v) { + $item_str .= ""; + $item_str .= "".$k.""; + $item_str .= "".$v["title"].""; + $item_str .= "".$v["stype"].""; + $item_str .= "".$v["unit"].""; + $item_str .= "".number_format($v["price"]).""; + $item_str .= "".$v["memo"].""; + $item_str .= ""; +} +$item_str .= ""; + +/* +#獲取簽核意見 +$assign_opinions = Assign::get_records($form_key); +$assigner = $wf->getAssignerList(); +$assign_status = $wf->getAssignStatus($assigner); +*/ +$assign_status = '' +?> + + + + + + + + +
+Please fill up the required field!

"; + } else { + echo "

Record has added successfully

"; + } +} +*/ +?> +
" enctype="multipart/form-data"> +
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+ +
+
+ + +
+
+ + +
+
+ + + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
新增
名稱數量單價合計備註操作
+ 點選 + + + + + + + + + + + + X +
營業稅
+ +
總價
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + +
簽核操作
簽核狀態 + + 下位簽核者 + + + +
+
+ + + + + + + + +
+
+ + \ No newline at end of file diff --git a/wms/mkt/pricereview_repair-download.php b/wms/mkt/pricereview_repair-download.php new file mode 100644 index 00000000..63a04ae5 --- /dev/null +++ b/wms/mkt/pricereview_repair-download.php @@ -0,0 +1,185 @@ +load("repair-sample.xlsx"); + $sheet = $spreadsheet->getActiveSheet(); + $sheet->getProtection()->setSheet(true); + $sheet->getStyle('A5:J10')->getFont()->setSize(14); + $sheet->setCellValue('C5', $data["maddr"]); + $sheet->setCellValue('C6', $data["company"]); + $sheet->setCellValue('J6', $data["invoice"]); + $sheet->setCellValue('C7', $data["facilityno"]); + $sheet->setCellValue('C8', $data["address"]); + $sheet->setCellValue('J8', $data["taxid"]); + $sheet->setCellValue('C10', substr($data["sign_date"], 0, 10)); + $sheet->setCellValue('J10', $data["repair_no"]); + $st = 12; + foreach ($item_arr as $k => $v) { + //$sheet->setCellValue('A'.$st, $k); + $sheet->setCellValue('B'.$st, $v["title"]); + $sheet->setCellValue('H'.$st, $v["item_qty"]); + $sheet->setCellValue('I'.$st, $v["item_unit_price"]); + $sheet->setCellValue('J'.$st, $v["item_price_bp"]); + $sheet->setCellValue('M'.$st, $v["memo"]); + $st++; + } + $sheet->setCellValue('J18', $data["sales_tax"]); + $sheet->setCellValue('J19', $data["total_price"]); + $sheet->setCellValue('A20', "合計:新台幣 ".numberToChinese($data["total_price"])." 整(含稅)"); + $sheet->setCellValue('B23', $data["memo"]); + $sheet->setCellValue('M36', $data["repair"]); + //$sheet->setCellValue('I35', mb_substr($accountname_arr[$data["checker"]],0,1).mb_substr($accountname_arr[$data["checker"]],1)); + + $writer = new Xls($spreadsheet); + $file_path = 'WriteOffRepair.xlsx'; + $writer->save('WriteOffRepair.xlsx'); + echo $file_path; +endforeach; + +function numberToChinese($num) { + $chineseNumbers = ['零', '壹', '貮', '參', '肆', '伍', '陸', '㭍', '捌', '玖','拾']; + $units = [' 元', ' 拾 ', ' 佰 ', ' 仟 ', ' 萬 ', ' 拾 ']; + + $num = str_pad($num, 6, "0", STR_PAD_LEFT); + if ($num <= 10) { + return $chineseNumbers[$num]; + } elseif ($num < 20) { + return $units[1] . $chineseNumbers[$num % 10]; + } elseif ($num < 100) { + return $chineseNumbers[intval($num / 10)] . $units[1] . ($num % 10 > 0 ? $chineseNumbers[$num % 10] : ''); + } else { + $result = ''; + $strNum = strval($num); + $length = strlen($strNum); + for ($i = 0; $i < $length; $i++) { + $currentDigit = intval($strNum[$i]); + $result .= $chineseNumbers[$currentDigit] . $units[$length - $i - 1]; + /* + if ($currentDigit > 0) { + $result .= $chineseNumbers[$currentDigit] . $units[$length - $i - 1]; + } else { + $result .= $chineseNumbers[$currentDigit]; + } + */ + } + return $result; + } +} + +exit; + +if ($_SERVER["REQUEST_METHOD"] == "POST") { + //print_r($_POST);exit; + foreach ($_POST as $k => $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + + if ($assign_status == "F6") $pstatus = "B1"; + elseif ($assign_status == "Y1") $pstatus = "X"; + $tds = date("Y-m-d H:i:s"); + + /* + // 檢查報價單編號 + $sql = "select count(*) from pricereview_main where contractno = '$contractno' and status in ('Y1', 'YS', 'YY')"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_row($res); + if ($row[0] > 0) { + echo ""; + exit; + } + */ + + // 更新狀態 + $db_query = "update pricereview_repair_main set pstatus = '$pstatus', check_date = '$tds' "; + $db_query .= "where id = '$id'"; + $result = mysqli_query($link, $db_query); + $affected = mysqli_affected_rows($link); + if ($affected > 0) { + // 更新待簽表 + $sql = "update subflow set current_assigner = '00000', update_date = '$tds' where form_key = '$form_key'"; + mysqli_query($link, $sql); + $sql = "update flow set flow_code = 'Z' where system_id = 'prm' and flow_id = 'prm03' and form_id = '$id' and form_key = '$form_key'"; + mysqli_query($link, $sql); + + /* + // 寄信給下位簽核人 + $mail_list = []; + $ret = accountid2email($next_signer); + if (!empty($ret)) { + foreach ($ret as $uid => $uemail) { + $mail_list[] = [$uid, $uemail]; + } + $mail_list[] = ['M0044', 'jrbin@masada.com.tw']; + include dirname(__DIR__)."/class/Cmail.php"; + $sendmail = new Cmail; + $title = "【新梯價審通知】卷號:".$contractno; + $content = "

您有待簽核案件,請至客戶管理 > 價格審查_新梯,點擊「待簽核」進行作業,謝謝!

"; + $sendmail->sendx($title, $content, $mail_list); + } + */ + } + + mysqli_close($link); + if ($affected > 0) { + echo ""; + } else { + echo ""; + } +} +?> \ No newline at end of file diff --git a/wms/mkt/pricereview_repair-index.php b/wms/mkt/pricereview_repair-index.php new file mode 100644 index 00000000..e9908255 --- /dev/null +++ b/wms/mkt/pricereview_repair-index.php @@ -0,0 +1,272 @@ + "簽核中", "B1" => "已同意", "B2" => "已完工", "X" => "不同意"]; + +// 設置一個空陣列來放資料 +$data = array(); +// sql語法存在變數中 +$sql_cmd = sql_myself($user_id, "repairerid"); +$is_manager = 0; +// 宜:M0054-陳志文 +$repman_arr[0] = ["M0177"]; +// 北:M0137-劉永德 +$repman_arr[1] = ["M0059","M0083","M0084","M0090","M0064","M0106","M0092","M0120","M0147","M0139","M0194","M0210"]; +// 桃:M0026-張莉凱 +$repman_arr[2] = ["M0018", "M0045","M0089","M0104","M0111"]; +// 中:M0086-李烘銘 +$repman_arr[3] = ["M0148","M0114","M0161"]; +// 南:M0033-吳育宗 +$repman_arr[4] = ["M0196","M0195","M0190","M0094","M0123","M0124"]; +if ($user_id == "M0054") { $is_manager = 1; $sql_cmd = "where repairerid in ('".implode("','", $repman_arr[0])."')"; } +elseif ($user_id == "M0137") { $is_manager = 1; $sql_cmd = "where repairerid in ('".implode("','", $repman_arr[1])."')"; } +elseif ($user_id == "M0026") { $is_manager = 1; $sql_cmd = "where repairerid in ('".implode("','", $repman_arr[2])."')"; } +elseif ($user_id == "M0086") { $is_manager = 1; $sql_cmd = "where repairerid in ('".implode("','", $repman_arr[3])."')"; } +elseif ($user_id == "M0033") { $is_manager = 1; $sql_cmd = "where repairerid in ('".implode("','", $repman_arr[4])."')"; } +elseif ($user_id == "M0012") $sql_cmd = ""; +$sql = "select * from pricereview_repair_main $sql_cmd order by id"; +$data = mysqli_query($link,$sql); +$para = "function_name=pricereview_repair&".$token_link; +?> + + + + +

+ + + +

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
項次報價單編號卷號客戶名稱電梯編號總價簽訂日完工日申請人簽核主管狀態簽核時間建立時間操作
+ 0) echo number_format($data['final_price'])."
(".number_format($data['total_price']).")"; + else echo number_format($data['total_price']); + ?> +
+ 簽核"; + } else $str .= "&view=1\" class=\"btn btn-warning btn-sm\">檢視"; + //if ($data['pstatus'][0] == 'B') $str .= "
列印"; + if ($data['pstatus'][0] == 'B') $str .= "
下載"; + if (($user_id=="M0012" || $user_id=="M0105") && $data['pstatus'] == 'B1') $str .= "
結案"; + echo $str; + ?> +
+
+There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "../footer.php"; +?> \ No newline at end of file diff --git a/wms/mkt/pricereview_repair-record-check.php b/wms/mkt/pricereview_repair-record-check.php new file mode 100644 index 00000000..e0441123 --- /dev/null +++ b/wms/mkt/pricereview_repair-record-check.php @@ -0,0 +1,40 @@ + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + + if ($assign_status == "F6") $pstatus = "B1"; + elseif ($assign_status == "Y1") $pstatus = "X"; + $tds = date("Y-m-d H:i:s"); + + // 更新狀態 + $db_query = "update pricereview_repair_main set pstatus = '$pstatus', check_date = '$tds' "; + $db_query .= "where id = '$id'"; + $result = mysqli_query($link, $db_query); + $affected = mysqli_affected_rows($link); + if ($affected > 0) { + // 更新待簽表 + $sql = "update subflow set current_assigner = '00000', update_date = '$tds' where form_key = '$form_key'"; + mysqli_query($link, $sql); + $sql = "update flow set flow_code = 'Z' where system_id = 'prm' and flow_id = 'prm03' and form_id = '$id' and form_key = '$form_key'"; + mysqli_query($link, $sql); + } + + mysqli_close($link); + if ($affected > 0) { + echo ""; + } else { + echo ""; + } +} +?> \ No newline at end of file diff --git a/wms/mkt/pricereview_repair-record-submit.php b/wms/mkt/pricereview_repair-record-submit.php new file mode 100644 index 00000000..ced4dfe0 --- /dev/null +++ b/wms/mkt/pricereview_repair-record-submit.php @@ -0,0 +1,78 @@ + $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + + $sales_tax = str_replace(",", "", $sales_tax); + $total_price = str_replace(",", "", $total_price); + $item_memo_arr = explode("@@,", rtrim($item_memo_all, "@@")); + $create_at = date("Y-m-d H:i:s"); + + // 避免報價單編號重覆 + $repair_no_a = date("Ymd"); + $sql = "select max(repair_no) from pricereview_repair_main where SUBSTRING(repair_no, 1, 8) = '$repair_no_a'"; + $res = mysqli_query($link, $sql); + $row = mysqli_fetch_row($res); + if (empty($row[0])) $serial = "001"; + else $serial = str_pad(substr($row[0]+1, -3), 3, 0, STR_PAD_LEFT); + $new_repair_no = $repair_no_a.$serial; + if ($new_repair_no != $repair_no) $repair_no = $new_repair_no; + + // 價審單-主文 pricereview_repair_main + $db_query = "insert into pricereview_repair_main(repair_no, contractno, masada_addr, company, taxid, invoice, facilityno, "; + $db_query .= "address, sales_tax, total_price, sign_date, memo, repairerid, pstatus, checker, creater, create_at) values ("; + $db_query .= "'$repair_no', '$contractno', '$masada_addr', '$company', '$taxid', '$invoice', '$facilityno', "; + $db_query .= "'$address', $sales_tax, $total_price, '$sign_date', '$memo', '$repairerid', 'A', '$next_users', '$user_id', '$create_at')"; + $result = mysqli_query($link, $db_query); + $affected = mysqli_affected_rows($link); + if ($rid = mysqli_insert_id($link)) { + // 價審單-明細項目 pricereview_repair_item + $item_title_all = str_replace("點選", "", $item_title_all); + $item_title_arr = explode(",", $item_title_all); + $item_qty_arr = explode(",", $item_qty_all); + $item_unit_price_arr = explode(",", $item_unit_price_all); + $item_price_bp_arr = explode(",", $item_price_bp_all); + $item_memo_arr = explode("@@,", rtrim($item_memo_all, "@@")); + $item_no = 1; + for ($i=0; $iinitWorkFlow($user_id); + $form_key = $wf->flowContext->getFormKey(); + $sql = "insert into assign (form_key, seq, assigner, assign_opinion) values ('$form_key', 1, '$next_users', '$repair_no')"; + mysqli_query($link, $sql); + $sql = "update subflow set seq = seq+1, current_assigner = '$next_users', update_date = '$create_at' where form_key = '$form_key'"; + mysqli_query($link, $sql); + } + + mysqli_close($link); + if ($affected > 0) { + echo ""; + } else { + echo ""; + } +} +?> \ No newline at end of file diff --git a/wms/mkt/pricereview_repair_end-api.php b/wms/mkt/pricereview_repair_end-api.php new file mode 100644 index 00000000..829dc321 --- /dev/null +++ b/wms/mkt/pricereview_repair_end-api.php @@ -0,0 +1,56 @@ + 'ok', 'err' => ''); + +try { + if (empty($_POST) || empty($_POST["pa"])) throw new \Exception("parameter empty"); + + foreach ($_POST as $k => $v) { + $$k = htmlspecialchars(stripslashes(trim($v))); + } + + list($id, $total_price, $final_price, $finish_date) = explode("##", $pa); + if (!$id || !$final_price || !$finish_date) throw new \Exception("parameter empty[2]"); + $create_at = date("Y-m-d H:i:s"); + + $final_price = str_replace(",", "", $final_price); + $sql = "update pricereview_repair_main set final_price = '$final_price', finish_date = '$finish_date', pstatus = 'B2', "; + $sql .= "creater = '$user_id', create_at = '$create_at' where id = '$id'"; + $res = mysqli_query($link, $sql); + $affected = mysqli_affected_rows($link); + if ($affected > 0) { + $rarr['tp'] = $total_price; + $rarr['fp'] = number_format($final_price); + $rarr['fp'] = number_format($final_price); + $rarr['fd'] = $finish_date; + } else { + $rarr['st'] = 'err'; + $rarr['err'] = '無更新'; + } +}catch(\Exception $e) { + $rarr['st'] = 'err'; + $rarr['err'] = $e->getMessage(); +} + +echo json_encode($rarr, JSON_UNESCAPED_UNICODE); +exit; +?> \ No newline at end of file diff --git a/wms/mkt/repair-sample.xlsx b/wms/mkt/repair-sample.xlsx new file mode 100644 index 00000000..d3d61718 Binary files /dev/null and b/wms/mkt/repair-sample.xlsx differ diff --git a/wms/mkt/specsurvey-create.php b/wms/mkt/specsurvey-create.php index 36ad2a30..d3e5d170 100644 --- a/wms/mkt/specsurvey-create.php +++ b/wms/mkt/specsurvey-create.php @@ -260,7 +260,7 @@ C:當天第3版,依次類推……" readonly> -->
- +

diff --git a/wms/mkt/specsurvey-edit.php b/wms/mkt/specsurvey-edit.php index 7772cd38..e6d7977a 100644 --- a/wms/mkt/specsurvey-edit.php +++ b/wms/mkt/specsurvey-edit.php @@ -176,7 +176,7 @@ C:當天第3版,依次類推……" readonly>
- +
重選號機 @@ -1514,7 +1514,7 @@ C:當天第3版,依次類推……" readonly> @@ -1627,7 +1627,7 @@ C:當天第3版,依次類推……" readonly> @@ -1888,7 +1888,7 @@ C:當天第3版,依次類推……" readonly>
- + @@ -1609,7 +1609,7 @@ C:當天第3版,依次類推……"> diff --git a/wms/mkt/specsurvey_renovate-create.php b/wms/mkt/specsurvey_renovate-create.php index 414854a5..9063dc4c 100644 --- a/wms/mkt/specsurvey_renovate-create.php +++ b/wms/mkt/specsurvey_renovate-create.php @@ -260,7 +260,7 @@ C:當天第3版,依次類推……" readonly> -->
- +

diff --git a/wms/mkt/specsurvey_renovate-edit.php b/wms/mkt/specsurvey_renovate-edit.php index 2a010c2b..4926ae75 100644 --- a/wms/mkt/specsurvey_renovate-edit.php +++ b/wms/mkt/specsurvey_renovate-edit.php @@ -176,7 +176,7 @@ C:當天第3版,依次類推……" readonly>
- +
重選號機 @@ -1514,7 +1514,7 @@ C:當天第3版,依次類推……" readonly> @@ -1627,7 +1627,7 @@ C:當天第3版,依次類推……" readonly> @@ -1888,7 +1888,7 @@ C:當天第3版,依次類推……" readonly>
- + @@ -1608,7 +1608,7 @@ C:當天第3版,依次類推……"> diff --git a/wms/wipwhole-change-contractdate.php b/wms/wipwhole-change-contractdate.php index 96a42fe0..ee6ff0f3 100644 --- a/wms/wipwhole-change-contractdate.php +++ b/wms/wipwhole-change-contractdate.php @@ -259,9 +259,10 @@ if (!empty(checkNowFormStatus($link))) ' /> - + 實際到貨日
(到觀音廠日) - + + ' /> diff --git a/wms/wipwhole-index-function.php b/wms/wipwhole-index-function.php index 6fe832da..3f8c6d67 100644 --- a/wms/wipwhole-index-function.php +++ b/wms/wipwhole-index-function.php @@ -1126,6 +1126,7 @@ function getAllCustomerPlanningVerify($link, $id) { $sql = " SELECT + custom AS custom_name, customer_planning_verify_file, create_at FROM wipwholestatus @@ -1134,6 +1135,7 @@ function getAllCustomerPlanningVerify($link, $id) AND customer_planning_verify_file IS NOT NULL UNION SELECT + custom_name, customer_planning_verify_file, create_at FROM wipwhole_change_planning_customer_details diff --git a/wms/wipwhole-rec-invoice-edit-submit.php b/wms/wipwhole-rec-invoice-edit-submit.php index 4735d395..a9456aab 100644 --- a/wms/wipwhole-rec-invoice-edit-submit.php +++ b/wms/wipwhole-rec-invoice-edit-submit.php @@ -286,7 +286,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { } } - + $updatesql = " UPDATE wipwholestatus SET @@ -484,7 +484,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if (!empty($official_check_file)) $updatesql .= "official_check_file = '$official_check_file', "; } - + // 暫時可編輯及刪除權限 if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { $updatesql .= " @@ -509,7 +509,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { } // 工務助理 - $updatesql .= " + if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188'])) { + $updatesql .= " install_outsourcer = '$install_outsourcer', install_outsourcer_owner = '$install_outsourcer_owner', install_outsourcer_date = '$install_outsourcer_date', @@ -528,11 +529,13 @@ 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 .= " + + if (!empty($plan_diagram_file)) { + $updatesql .= "plan_diagram_file = '$plan_diagram_file', "; + $updatesql .= " all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "
上傳了安裝圖附件

',IF(all_remark IS NULL,'',all_remark)), "; + } } // 許協更新業務確認項目權限 @@ -560,6 +563,15 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { "; } + // 生管 小雯 預計到貨日(到觀音廠日)權限 + if ($user_id == 'M0168') { + $updatesql .= " + estimated_shipping_schedule_date_verify = '$estimated_shipping_schedule_date_verify', + estimated_shipping_schedule_date = '$estimated_shipping_schedule_date', + estimated_shipping_schedule_date_owner = '$estimated_shipping_schedule_date_owner', + "; + } + $updatesql .= " creater = '$creater', create_at = '$create_at' diff --git a/wms/wipwhole-rec-invoice-edit.php b/wms/wipwhole-rec-invoice-edit.php index 9809feae..075ad168 100644 --- a/wms/wipwhole-rec-invoice-edit.php +++ b/wms/wipwhole-rec-invoice-edit.php @@ -203,7 +203,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 樓停 - " > + " > 樓層 @@ -364,21 +364,22 @@ include "wipwhole-rec-invoice-edit-submit.php"; 附件 - + // echo !empty($row['customer_planning_verify_file']) ? "下載附件" : ""; + ?> +
下載附件_" . $row2['create_at'] . "
"; + href='" . $row2['customer_planning_verify_file'] . "' target='_blank'>下載附件_" . $row2['custom_name'] . "_" . $row2['create_at'] . "
"; endforeach; ?> @@ -853,7 +854,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 備註 - + @@ -1038,7 +1039,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 預計到貨日
(到觀音廠日) - > @@ -1047,9 +1048,9 @@ include "wipwhole-rec-invoice-edit-submit.php";
- > + > - +
@@ -1141,6 +1142,12 @@ include "wipwhole-rec-invoice-edit-submit.php"; + + @@ -1340,6 +1347,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; if (getSaveEstimateInstallData($user_department_id, $role_id)) { ?> + @@ -1348,7 +1356,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 安裝發包廠商 - /> + /> 確認人 @@ -1362,7 +1370,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 安裝發包日
- > + > @@ -1380,7 +1388,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 預計安裝開工日
- > + > @@ -1398,7 +1406,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 預計安裝完工日
- > + > @@ -1415,7 +1423,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 試車發包廠商 - /> + /> 確認人 @@ -1429,7 +1437,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 試車發包日
- > + > @@ -1447,7 +1455,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 預計試車開工日
- > + > @@ -1465,7 +1473,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 預計試車完工日
- > + > @@ -1482,7 +1490,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; 備註 - + @@ -1861,7 +1869,7 @@ include "wipwhole-rec-invoice-edit-submit.php"; if (confirm('確定要更改日期嗎?') == true) { var estimated_shipping_schedule_date = $("#estimated_shipping_schedule_date").val(); var real_contract_arrival_date = $("#real_contract_arrival_date_tmp").val(); - if (real_contract_arrival_date <= estimated_shipping_schedule_date) { + if (real_contract_arrival_date < estimated_shipping_schedule_date) { alert("日期不可以比預計到貨日(到觀音日)早"); } else { $("#real_contract_arrival_date").val($("#real_contract_arrival_date_tmp").val()); @@ -1901,28 +1909,91 @@ include "wipwhole-rec-invoice-edit-submit.php"; } } - // function setOutSourcerDate() { + function setOutSourcerDate() { - // // 發包類型 - // let outsourcer_type = $("input[name^='outsourcer_type']").val(); - // // 預計出貨日(到工地) - // let real_contract_arrival_date = $("#real_contract_arrival_date").val(); - // // 樓停 - // let numberofstop = $("#numberofstop").val(); + // 發包類型 + let outsourcer_type = $("input[name^='outsourcer_type']:checked").val(); - // if (outsourcer_type === 'I') { - // // 預計安裝開工日 - // Date.prototype.addDays = function(days) { - // this.setDate(this.getDate() + days); - // return this; - // } + // 預計出貨日(到工地) + let real_contract_arrival_date = $("#real_contract_arrival_date").val(); + // 樓停 + let numberofstop = $("#numberofstop").val(); + // 目前操作者 + let user_id = ''; - // } - // if (outsourcer_type === 'T') { + if (outsourcer_type === 'I') { + resetTOutSourcerDate(); + $("#estimate_install_start_date").val(dateAddDays(real_contract_arrival_date, 5)); + $("#estimate_install_start_date_owner").val(user_id); + $("#estimate_install_end_date").val( + dateAddDays($("#estimate_install_start_date").val(), specificationDayFormula(numberofstop)) + ); + $("#estimate_install_end_date_owner").val(user_id); + } + if (outsourcer_type === 'T') { + resetIOutSourcerDate(); + $("#estimate_tryrun_start_date").val(dateAddDays(real_contract_arrival_date, 5)); + $("#estimate_tryrun_start_date_owner").val(user_id); + $("#estimate_tryrun_end_date").val( + dateAddDays($("#estimate_tryrun_start_date").val(), specificationDayFormula(numberofstop)) + ); + $("#estimate_tryrun_end_date_owner").val(user_id); + } + if (outsourcer_type === 'IT') { + $("#estimate_install_start_date").val(dateAddDays(real_contract_arrival_date, 5)); + $("#estimate_install_start_date_owner").val(user_id); + $("#estimate_install_end_date").val( + dateAddDays($("#estimate_install_start_date").val(), specificationDayFormula(numberofstop)) + ); + $("#estimate_install_end_date_owner").val(user_id); + $("#estimate_tryrun_start_date").val(dateAddDays($("#estimate_install_end_date").val(), 1)); + $("#estimate_tryrun_start_date_owner").val(user_id); + $("#estimate_tryrun_end_date").val( + dateAddDays($("#estimate_tryrun_start_date").val(), specificationDayFormula(numberofstop)) + ); + $("#estimate_tryrun_end_date_owner").val(user_id); + } + } - // } - // if (outsourcer_type === 'IT') { + function resetIOutSourcerDate() { + $("#estimate_install_start_date").val(""); + $("#estimate_install_end_date").val(""); + } + + function resetTOutSourcerDate() { + $("#estimate_tryrun_start_date").val(""); + $("#estimate_tryrun_end_date").val(""); + } + + + function resetAllOutSourcerDate() { + resetIOutSourcerDate(); + resetTOutSourcerDate(); + } - // } - // } + function specificationDayFormula(numberofstop) { + if (numberofstop > 0 && numberofstop <= 7) + return 7; + if (numberofstop > 7 && numberofstop < 14) + return numberofstop; + if (numberofstop >= 14) + return 14; + return 0 + } + + function dateAddDays(dateString, daysToAdd = 0) { + daysToAdd = Number(daysToAdd); + // 將日期字串轉換為日期物件 + var initialDate = new Date(dateString); + // 增加指定天數 + initialDate.setDate(initialDate.getDate() + daysToAdd); + + // 將結果轉換為所需的日期格式(例如:yyyy-mm-dd) + var year = initialDate.getFullYear(); + var month = String(initialDate.getMonth() + 1).padStart(2, "0"); // 月份從0開始,需要加1 + var day = String(initialDate.getDate()).padStart(2, "0"); + var resultDateString = year + "-" + month + "-" + day; + + return resultDateString; + } \ No newline at end of file diff --git a/wms/wipwhole-renovate-index-function.php b/wms/wipwhole-renovate-index-function.php index 72a58afd..341b2d60 100644 --- a/wms/wipwhole-renovate-index-function.php +++ b/wms/wipwhole-renovate-index-function.php @@ -1105,6 +1105,7 @@ function getAllCustomerPlanningVerify($link, $id) { $sql = " SELECT + custom AS custom_name, customer_planning_verify_file, create_at FROM wipwholestatus @@ -1113,6 +1114,7 @@ function getAllCustomerPlanningVerify($link, $id) AND customer_planning_verify_file IS NOT NULL UNION SELECT + custom_name, customer_planning_verify_file, create_at FROM wipwhole_change_planning_customer_details diff --git a/wms/wipwhole-renovate-rec-invoice-edit-submit.php b/wms/wipwhole-renovate-rec-invoice-edit-submit.php index 9bca3642..17c21cb5 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit-submit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit-submit.php @@ -464,7 +464,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if (!empty($official_check_file)) $updatesql .= "official_check_file = '$official_check_file', "; } - + if (in_array($user_id, ['M0175', 'M0079', 'M0060'])) { // 暫時可編輯及刪除權限 $updatesql .= " @@ -489,7 +489,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { } // 工務助理 - $updatesql .= " + if (in_array($user_id, ['M0164', 'M0165', 'M0127', 'M0193', 'M0170', 'M0188'])) { + $updatesql .= " install_outsourcer = '$install_outsourcer', install_outsourcer_owner = '$install_outsourcer_owner', install_outsourcer_date = '$install_outsourcer_date', @@ -508,11 +509,12 @@ 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 .= " + if (!empty($plan_diagram_file)) { + $updatesql .= "plan_diagram_file = '$plan_diagram_file', "; + $updatesql .= " all_remark = CONCAT('" . $user_id . accountidToName($user_id) . "_" . $datetime . "
上傳了安裝圖附件

',IF(all_remark IS NULL,'',all_remark)), "; + } } // 許協更新業務確認項目權限 @@ -540,6 +542,15 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { "; } + // 生管 小雯 預計到貨日(到觀音廠日)權限 + if ($user_id == 'M0168') { + $updatesql .= " + estimated_shipping_schedule_date_verify = '$estimated_shipping_schedule_date_verify', + estimated_shipping_schedule_date = '$estimated_shipping_schedule_date', + estimated_shipping_schedule_date_owner = '$estimated_shipping_schedule_date_owner', + "; + } + $updatesql .= " creater = '$creater', create_at = '$create_at' diff --git a/wms/wipwhole-renovate-rec-invoice-edit.php b/wms/wipwhole-renovate-rec-invoice-edit.php index 24d8b8a6..acba025d 100644 --- a/wms/wipwhole-renovate-rec-invoice-edit.php +++ b/wms/wipwhole-renovate-rec-invoice-edit.php @@ -414,21 +414,22 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 附件 - + // echo !empty($row['customer_planning_verify_file']) ? "下載附件" : ""; + ?> +
下載附件_" . $row2['create_at'] . ""; + href='" . $row2['customer_planning_verify_file'] . "' target='_blank'>下載附件_" . $row2['custom_name'] . "_" . $row2['create_at'] . "
"; endforeach; ?> @@ -450,7 +451,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 備註 - + @@ -766,7 +767,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 下載附件" : ""; - foreach ($customer_planning_verify_files as $row2) : + foreach ($customer_planning_verify_files as $row2) : echo "下載附件_" . $row2['create_at'] . ""; endforeach; @@ -1041,7 +1042,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 預計到貨日
(到觀音廠日) - > @@ -1050,9 +1051,9 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php";
- > + > - +
@@ -1144,6 +1145,13 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; + + @@ -1327,7 +1335,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 安裝發包廠商 - /> + /> 確認人 @@ -1341,7 +1349,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 安裝發包日
- > + > @@ -1359,7 +1367,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 預計安裝開工日
- > + > @@ -1377,7 +1385,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 預計安裝完工日
- > + > @@ -1394,7 +1402,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 試車發包廠商 - /> + /> 確認人 @@ -1408,7 +1416,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 試車發包日
- > + > @@ -1426,7 +1434,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 預計試車開工日
- > + > @@ -1444,7 +1452,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 預計試車完工日
- > + > @@ -1461,7 +1469,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; 備註 - + @@ -1847,7 +1855,7 @@ include "wipwhole-renovate-rec-invoice-edit-submit.php"; if (confirm('確定要更改日期嗎?') == true) { var estimated_shipping_schedule_date = $("#estimated_shipping_schedule_date").val(); var real_contract_arrival_date = $("#real_contract_arrival_date_tmp").val(); - if (real_contract_arrival_date <= estimated_shipping_schedule_date) { + if (real_contract_arrival_date < estimated_shipping_schedule_date) { alert("日期不可以比預計到貨日(到觀音日)早"); } else { $("#real_contract_arrival_date").val($("#real_contract_arrival_date_tmp").val());