From ceda8bea0aad2ae90c889c3ffdd5054bd0d1c273 Mon Sep 17 00:00:00 2001 From: Cheng Date: Fri, 19 Jan 2024 09:29:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B0=BD=E6=A0=B8BUG(=E4=BF=AE=E6=AD=A3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/cont/MSCalculator.php | 2 +- wms/fun_global.php | 9 +++++ wms/mkt/pricereview-record-update.php | 51 +++++++++++++-------------- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/wms/cont/MSCalculator.php b/wms/cont/MSCalculator.php index 7aabafcc..cd56873b 100644 --- a/wms/cont/MSCalculator.php +++ b/wms/cont/MSCalculator.php @@ -33,7 +33,7 @@ class MSCalculator $maintain_times = $item['maintain_times']; $sql_get_price = " - select + SELECT elevator_type, base_price, floors_price, diff --git a/wms/fun_global.php b/wms/fun_global.php index 3a0d9f1a..b468f413 100644 --- a/wms/fun_global.php +++ b/wms/fun_global.php @@ -182,6 +182,15 @@ function pricereview_renovate_class($rate, $user_id, $renovate_flag) return $ret; } + +/** + * 汰改(契約)價審簽核順位 + * @param string $rate:破價比 + * @param string $user_id:使用者ID + * @param string $renovate_flag:REN=M1改 + * @return array + * + */ function pricereview_maintainance_class($rate, $user_id, $renovate_flag) { } diff --git a/wms/mkt/pricereview-record-update.php b/wms/mkt/pricereview-record-update.php index 8baeb778..de81ae7e 100644 --- a/wms/mkt/pricereview-record-update.php +++ b/wms/mkt/pricereview-record-update.php @@ -1,7 +1,7 @@ $v) { $$k = htmlspecialchars(stripslashes(trim($v))); @@ -52,9 +52,9 @@ if(isset($_POST['pmstatus'])) { $temp_file_name = $_FILES["attatch1"]["tmp_name"]; $file_size = $_FILES["attatch1"]["size"]; $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $target_file1 = $target_dir.$contractno."-price-".$tds.".".$img_file_type; + $target_file1 = $target_dir . $contractno . "-price-" . $tds . "." . $img_file_type; $upload_ok = 1; - foreach (glob($target_dir.$contractno."-price-*") as $todelfile) { + foreach (glob($target_dir . $contractno . "-price-*") as $todelfile) { unlink($todelfile); } $upload_res_1 = move_uploaded_file($temp_file_name, $target_file1); @@ -62,7 +62,7 @@ if(isset($_POST['pmstatus'])) { } else { $target_file1 = ""; if ($file_price_del == 1) { - foreach (glob($target_dir.$contractno."-price-*") as $todelfile) { + foreach (glob($target_dir . $contractno . "-price-*") as $todelfile) { unlink($todelfile); } $sql_atta = "attatch1 = NULL, "; @@ -75,9 +75,9 @@ if(isset($_POST['pmstatus'])) { $temp_file_name = $_FILES["attatch2"]["tmp_name"]; $file_size = $_FILES["attatch2"]["size"]; $img_file_type = pathinfo($file_name, PATHINFO_EXTENSION); - $target_file2 = $target_dir.$contractno."-appendix-".$tds.".".$img_file_type; + $target_file2 = $target_dir . $contractno . "-appendix-" . $tds . "." . $img_file_type; $upload_ok = 1; - foreach (glob($target_dir.$contractno."-appendix-*") as $todelfile) { + foreach (glob($target_dir . $contractno . "-appendix-*") as $todelfile) { unlink($todelfile); } $upload_res_2 = move_uploaded_file($temp_file_name, $target_file2); @@ -85,7 +85,7 @@ if(isset($_POST['pmstatus'])) { } else { $target_file2 = ""; if ($file_appendix_del == 1) { - foreach (glob($target_dir.$contractno."-appendix-*") as $todelfile) { + foreach (glob($target_dir . $contractno . "-appendix-*") as $todelfile) { unlink($todelfile); } $sql_atta = "attatch2 = NULL, "; @@ -169,7 +169,7 @@ if(isset($_POST['pmstatus'])) { $fp_seat_arr[$k] = (isset($fp_seat_arr[$k])) ? $fp_seat_arr[$k] : ""; $fp_numberofstop_arr[$k] = (isset($fp_numberofstop_arr[$k])) ? $fp_numberofstop_arr[$k] : ""; $fp_speed_arr[$k] = (isset($fp_speed_arr[$k])) ? $fp_speed_arr[$k] : ""; - $note = $fp_kind_arr[$k].",".$fp_seat_arr[$k].",".$fp_numberofstop_arr[$k].",".$fp_speed_arr[$k]; + $note = $fp_kind_arr[$k] . "," . $fp_seat_arr[$k] . "," . $fp_numberofstop_arr[$k] . "," . $fp_speed_arr[$k]; $db_query = "update pricereview_item set item_unit_price = '$item_unit_price_arr[$k]', item_qty = '$item_qty_arr[$k]', "; $db_query .= "item_price_bp = '$item_price_bp_arr[$k]', item_price_ct = '$item_price_ct_arr[$k]', note = '$note', "; $db_query .= "item_spec = '$item_spec_arr[$k]', item_weight = '$item_weight_arr[$k]', item_op = '$item_op_arr[$k]' "; @@ -192,7 +192,7 @@ if(isset($_POST['pmstatus'])) { $nextno = $row[0] + 1; foreach ($to_ins_arr as $v) { if (!$fp_id_arr[$v]) $fp_id_arr[$v] = 0; - $note = $fp_kind_arr[$v].",".$fp_seat_arr[$v].",".$fp_numberofstop_arr[$v].",".$fp_speed_arr[$v]; + $note = $fp_kind_arr[$v] . "," . $fp_seat_arr[$v] . "," . $fp_numberofstop_arr[$v] . "," . $fp_speed_arr[$v]; $db_query = "insert into pricereview_item (mid, price_id, item_no, item_spec, item_weight, item_op, item_group, item_unit_price, item_qty, item_price_bp, "; $db_query .= "item_price_ct, item_price, gross_profit, gross_profit_rate, note) values ("; $db_query .= "'$id', '$fp_id_arr[$v]', '$nextno', '$item_spec_arr[$v]', '$item_weight_arr[$v]', '$item_op_arr[$v]', 'A', '$item_unit_price_arr[$v]', '$item_qty_arr[$v]', '$item_price_bp_arr[$v]', "; @@ -223,7 +223,7 @@ if(isset($_POST['pmstatus'])) { $option_relate_spec = ""; $tmp_arr = explode("
", $option_relate_facil_arr[$k]); foreach ($tmp_arr as $val) { - $option_relate_spec .= substr($val, 0, strpos($val, ".")).","; + $option_relate_spec .= substr($val, 0, strpos($val, ".")) . ","; } $option_relate_spec = rtrim($option_relate_spec, ","); $db_query = "update pricereview_item set item_unit_price = '$option_unit_price_arr[$k]', item_qty = '$option_qty_arr[$k]', "; @@ -251,7 +251,7 @@ if(isset($_POST['pmstatus'])) { $option_relate_spec = ""; $tmp_arr = explode("
", $option_relate_facil_arr[$k]); foreach ($tmp_arr as $val) { - $option_relate_spec .= substr($val, 0, strpos($val, ".")).","; + $option_relate_spec .= substr($val, 0, strpos($val, ".")) . ","; } $option_relate_spec = rtrim($option_relate_spec, ","); $db_query = "insert into pricereview_item (mid, price_id, item_no, item_spec, option_relate_spec, item_group, item_unit_price, item_qty, item_price_bp, memo) values ("; @@ -284,11 +284,11 @@ if(isset($_POST['pmstatus'])) { $mn_seat_arr[$k] = (isset($mn_seat_arr[$k])) ? $mn_seat_arr[$k] : ""; $mn_numberofstop_arr[$k] = (isset($mn_numberofstop_arr[$k])) ? $mn_numberofstop_arr[$k] : ""; $mn_speed_arr[$k] = (isset($mn_speed_arr[$k])) ? $mn_speed_arr[$k] : ""; - $note = $mn_seat_arr[$k].",".$mn_numberofstop_arr[$k].",".$mn_speed_arr[$k]; + $note = $mn_seat_arr[$k] . "," . $mn_numberofstop_arr[$k] . "," . $mn_speed_arr[$k]; $option_relate_spec = ""; $tmp_arr = explode("
", $mn_relate_facil_arr[$k]); foreach ($tmp_arr as $val) { - $option_relate_spec .= substr($val, 0, strpos($val, ".")).","; + $option_relate_spec .= substr($val, 0, strpos($val, ".")) . ","; } $option_relate_spec = rtrim($option_relate_spec, ","); $db_query = "update pricereview_item set item_unit_price = '$mn_unit_price_arr[$k]', item_qty = '$mn_qty_arr[$k]', "; @@ -313,11 +313,11 @@ if(isset($_POST['pmstatus'])) { $nextno = $row[0] + 1; foreach ($to_ins_arr as $v) { if (!$mn_id_arr[$v]) $mn_id_arr[$v] = 0; - $note = $mn_seat_arr[$v].",".$mn_numberofstop_arr[$v].",".$mn_speed_arr[$v]; + $note = $mn_seat_arr[$v] . "," . $mn_numberofstop_arr[$v] . "," . $mn_speed_arr[$v]; $option_relate_spec = ""; $tmp_arr = explode("
", $mn_relate_facil_arr[$v]); foreach ($tmp_arr as $val) { - $option_relate_spec .= substr($val, 0, strpos($val, ".")).","; + $option_relate_spec .= substr($val, 0, strpos($val, ".")) . ","; } $option_relate_spec = rtrim($option_relate_spec, ","); $db_query = "insert into pricereview_item (mid, price_id, item_no, item_spec, option_relate_spec, item_group, item_unit_price, item_qty, item_price_bp, note, memo) values ("; @@ -376,7 +376,7 @@ if(isset($_POST['pmstatus'])) { $pay_scale_arr = explode(",", $pay_scale_all); $pay_amount_arr = explode(",", $pay_amount_all); $pay_period_arr = explode(",", $pay_period_all); - for ($i=0; $i<7; $i++) { + for ($i = 0; $i < 7; $i++) { $sql = "update pricereview_pay set pay_kind = '$pay_kind_arr[$i]', pay_scale = '$pay_scale_arr[$i]', pay_amount = '$pay_amount_arr[$i]', "; $sql .= "pay_period = '$pay_period_arr[$i]', pay_note = '$pay_note' "; $sql .= "where id = '$pay_id_arr[$i]'"; @@ -387,7 +387,7 @@ if(isset($_POST['pmstatus'])) { // 小於80%呈至總經理審核. ($price_rate) // 上級主管 > 伃廷 > MAX > 總經理 if ($status == "YS") { - $manager_arr = pricereview_class($price_rate, $user_id); + $manager_arr = pricereview_class($price_rate, $user_id, $ret, $special_fee); if ($manager_arr) { $sign1 = $sign2 = $sign3 = $sign4 = ""; foreach ($manager_arr as $k => $v) { @@ -396,7 +396,7 @@ if(isset($_POST['pmstatus'])) { elseif ($k == 3) $sign3 = $v; else $sign4 = $v; } - $sql = "insert into pricereview_sign (mid, sign1, sign2, sign3, sign4, sign_total) values ('$id', '$sign1', '$sign2', '$sign3', '$sign4', '".count($manager_arr)."')"; + $sql = "insert into pricereview_sign (mid, sign1, sign2, sign3, sign4, sign_total) values ('$id', '$sign1', '$sign2', '$sign3', '$sign4', '" . count($manager_arr) . "')"; mysqli_query($link, $sql); // 寫入待簽表 if (strlen($sign1) == 7) $next_signer = str_replace(",", "", $sign1); @@ -413,11 +413,11 @@ if(isset($_POST['pmstatus'])) { $ret = accountid2email($next_signer); if (!empty($ret)) { foreach ($ret as $uid => $uemail) { - $mail_list[] = [$uid, $uemail]; + $mail_list[] = [$uid, $uemail]; } - include dirname(__DIR__)."/class/Cmail.php"; + include dirname(__DIR__) . "/class/Cmail.php"; $sendmail = new Cmail; - $title = "【新梯價審通知】卷號:".$contractno; + $title = "【新梯價審通知】卷號:" . $contractno; $content = "

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

"; $sendmail->sendx($title, $content, $mail_list); } @@ -428,14 +428,13 @@ if(isset($_POST['pmstatus'])) { mysqli_close($link); if ($affected > 0) { echo ""; } else { echo ""; } } -?> \ No newline at end of file