diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0.php b/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0.php new file mode 100644 index 00000000..7d45b3a1 --- /dev/null +++ b/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0.php @@ -0,0 +1,125 @@ +$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "$bonus_array"=>$bonus_array #所有獎金水庫 + ]; + +*/ + + + +function elevator_new_deal_bonus_v1_0($ver, $contract_type, $elevator_knockdown_price, $sales_id, $region_manger_id){ + $bonus_array = []; + if ($ver == "1.0"){ + + #合約總類($contract_type):戰略客戶(strategy_customer)、一般客戶(general_customer) + switch ($contract_type){ + case "strategy_customer": + #契約員獎金($sales_bonus) + $sales_bonus = $elevator_knockdown_price * 0.007; + #地區經理經理獎金($region_manager_bonus) + $region_manager_bonus = 400; + break; + + case "general_customer": + #契約員獎金($sales_bonus) + $sales_bonus = $elevator_knockdown_price * 0.015; + #區域經理獎金($region_manager_bonus) + $region_manager_bonus = 600; + break; + }; + + #營銷人員銷售獎金水庫-----訂金已收款20%,發放總獎金20% + array_push($bonus_array,[ + "bonus_type" => "營銷人員銷售獎金-訂金段", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus * 0.2), #金額 + "payment_schedul_due" => "deposit", #訂金已收款20% + "payment_schedul_regulation" => "訂金已收款20%,發放總獎金20%" #發放規定 + ]); + + #營銷人員銷售獎金水庫-----出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50% + array_push($bonus_array,[ + "bonus_type" => "營銷人員銷售獎金-出貨款段", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus * 0.5), #金額 + "payment_schedul_due" => "shipping", #訂金已收款20% + "payment_schedul_regulation" => "出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%" #發放規定 + ]); + + #營銷人員銷售獎金水庫-----驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30% + array_push($bonus_array,[ + "bonus_type" => "營銷人員銷售獎金-驗收款段", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus * 0.3), #金額 + "payment_schedul_due" => "acceptance", #訂金已收款20% + "payment_schedul_regulation" => "驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%" #發放規定 + ]); + + #區域經理獎金水庫-----訂金已收款100%,發放總獎金50% + array_push($bonus_array,[ + "bonus_type" => "區域經理提成獎金-訂金段", #獎金名稱 + "bonus_receiver" => $region_manger_id, #發放人員 + "bonus_amount" => round($region_manager_bonus * 0.5), #金額 + "payment_schedul_due" => "deposit", #訂金已收款100% + "payment_schedul_regulation" => "訂金已收款100%,發放總獎金50%" #發放規定 + ]); + + #區域經理獎金水庫-----貨到工地款(含)之前所有款項已收款100%,發放總獎金50% + array_push($bonus_array,[ + "bonus_type" => "區域經理提成獎金-貨到工地款段", #獎金名稱 + "bonus_receiver" => $region_manger_id, #發放人員 + "bonus_amount" => round($region_manager_bonus * 0.5), #金額 + "payment_schedul_due" => "deliveried", #貨到工地款(含)之前所有款項已收款100% + "payment_schedul_regulation" => "貨到工地款(含)之前所有款項已收款100%,發放總獎金50%" #發放規定 + ]); + + $result_array = [ + "ver"=>$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "bonus_array"=>$bonus_array #獎金水庫 + ]; + }else{ + array_push($bonus_array,[ + "bonus_type" => "error", #獎金名稱 + "bonus_receiver" => "error", #發放人員 + "bonus_amount" => 0, #金額 + "payment_schedul_due" => "9999-1-1", #預計發放時間 + "payment_schedul_regulation" => "error" #發放規定 + ]); + + $result_array = [ + "ver"=>$ver, #獎金版本 + "result_status"=>"error", #計算結果 + "bonus_array"=>$bonus_array #獎金水庫 + ]; + }; + + return $result_array; +}; + +?> \ No newline at end of file diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0_examination.php b/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0_examination.php new file mode 100644 index 00000000..97c47660 --- /dev/null +++ b/wms/bons/elevator_new/elevator_new_deal_bonus_v1_0_examination.php @@ -0,0 +1,72 @@ +$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "$bonus_array"=>$bonus_array #所有獎金水庫 + ]; + +*/ + + +require_once("elevator_new_deal_bonus_v1_0.php"); + +#$ver, $contract_type, $elevator_knockdown_price, $sales_id, $region_manger_id + +#獎金測試 +$examination_array = [ + #錯誤版本 + ["2.0","strategy_customer",1000000,"M0001", "M0003"], + #戰略客戶(strategy_customer) + ["1.0","strategy_customer",1000000,"M0001", "M0003"], #戰略客戶 + + #一般客戶(general_customer) + ["1.0","general_customer",1000000,"M0001", "M0003"] #一般客戶 +]; + + + +for($i = 0; $i"; + echo "計算結果:" . $result["result_status"] . "
"; + echo "輸入參數:" . $examination_array[$i][1] . " " . $examination_array[$i][2] . " " . $examination_array[$i][3] . " " . $examination_array[$i][4] . "
"; + for($j = 0; $j"; + }; + echo "-------------------------" . "
"; + +}; + + +?> diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0.php b/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0.php new file mode 100644 index 00000000..84dde3cd --- /dev/null +++ b/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0.php @@ -0,0 +1,164 @@ +$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "$bonus_array"=>$bonus_array #所有獎金水庫 + ]; + +*/ + + + +function elevator_new_deal_bonus_v2_0($ver, $contract_type, $elevator_type, $elevator_list_price, $elevator_knockdown_price, $sales_id, $region_manger_id){ + $bonus_array = []; + if ($ver == "2.0"){ + $discount = round($elevator_knockdown_price / $elevator_list_price, 3); #銷售點數,取到小數點第三位。 + + #合約總類($contract_type):戰略客戶(strategy_customer)、一般客戶(general_customer) + switch ($contract_type){ + case "strategy_customer": + #契約員獎金($sales_bonus) + $sales_bonus = $elevator_knockdown_price * 0.007; + #地區經理提成獎金($region_manager_bonus) + $region_manager_bonus = 400; + break; + + case "general_customer": + switch ($elevator_type) { + #客梯(passenger)、貨梯(cargo) + case ($elevator_type == "passenger" or $elevator_type == "cargo"): + switch ($discount) { + case ($discount >= 1.0): + $sales_bonus = $elevator_knockdown_price * 0.02; + break; + case ($discount >= 0.9 and $discount < 1.0): + $sales_bonus = $elevator_knockdown_price * 0.018; + break; + case ($discount >= 0.75 and $discount < 0.9): + $sales_bonus = $elevator_knockdown_price * 0.015; + break; + case ($discount < 0.75): + $sales_bonus = $elevator_knockdown_price * 0.008; + break; + }; + break; + + #小電梯(dumbwaiter)、平台梯(flatbase)、強驅(positive_drive) + case ($elevator_type == "dumbwaiter" or $elevator_type == "flatbase" or $elevator_type == "positive_drive"): + switch ($discount) { + case ($discount >= 1.0): + $sales_bonus = $elevator_knockdown_price * 0.02; + break; + case ($discount >= 0.9 and $discount < 1.0): + $sales_bonus = $elevator_knockdown_price * 0.018; + break; + case ($discount >= 0.72 and $discount < 0.9): + $sales_bonus = $elevator_knockdown_price * 0.015; + break; + case ($discount < 0.72): + $sales_bonus = $elevator_knockdown_price * 0.008; + break; + }; + break; + }; + #區域經理提成獎金($region_manager_bonus) + $region_manager_bonus = 600; + break; + }; + + #營銷人員銷售獎金水庫-----訂金已收款20%,發放總獎金20% + array_push($bonus_array,[ + "bonus_type" => "營銷人員銷售獎金-訂金段", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus * 0.2), #金額 + "payment_schedul_due" => "deposit", #訂金已收款20% + "payment_schedul_regulation" => "訂金已收款20%,發放總獎金20%" #發放規定 + ]); + + #營銷人員銷售獎金水庫-----出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50% + array_push($bonus_array,[ + "bonus_type" => "營銷人員銷售獎金-出貨款段", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus * 0.5), #金額 + "payment_schedul_due" => "shipping", #訂金已收款20% + "payment_schedul_regulation" => "出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%" #發放規定 + ]); + + #營銷人員銷售獎金水庫-----驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30% + array_push($bonus_array,[ + "bonus_type" => "營銷人員銷售獎金-驗收款段", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus * 0.3), #金額 + "payment_schedul_due" => "acceptance", #訂金已收款20% + "payment_schedul_regulation" => "驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%" #發放規定 + ]); + + #區域經理提成獎金水庫-----訂金已收款100%,發放總獎金50% + array_push($bonus_array,[ + "bonus_type" => "區域經理提成獎金-訂金段", #獎金名稱 + "bonus_receiver" => $region_manger_id, #發放人員 + "bonus_amount" => round($region_manager_bonus * 0.5), #金額 + "payment_schedul_due" => "deposit", #訂金已收款100% + "payment_schedul_regulation" => "訂金已收款100%,發放總獎金50%" #發放規定 + ]); + + #區域經理獎金水庫-----貨到工地款(含)之前所有款項已收款100%,發放總獎金50% + array_push($bonus_array,[ + "bonus_type" => "區域經理提成獎金-貨到工地款段", #獎金名稱 + "bonus_receiver" => $region_manger_id, #發放人員 + "bonus_amount" => round($region_manager_bonus * 0.5), #金額 + "payment_schedul_due" => "deliveried", #貨到工地款(含)之前所有款項已收款100% + "payment_schedul_regulation" => "貨到工地款(含)之前所有款項已收款100%,發放總獎金50%" #發放規定 + ]); + + $result_array = [ + "ver"=>$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "bonus_array"=>$bonus_array #獎金水庫 + ]; + }else{ + array_push($bonus_array,[ + "bonus_type" => "error", #獎金名稱 + "bonus_receiver" => "error", #發放人員 + "bonus_amount" => 0, #金額 + "payment_schedul_due" => "9999-1-1", #預計發放時間 + "payment_schedul_regulation" => "error" #發放規定 + ]); + + $result_array = [ + "ver"=>$ver, #獎金版本 + "result_status"=>"error", #計算結果 + "bonus_array"=>$bonus_array #獎金水庫 + ]; + }; + + return $result_array; +}; + +?> \ No newline at end of file diff --git a/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0_examination.php b/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0_examination.php new file mode 100644 index 00000000..771b791b --- /dev/null +++ b/wms/bons/elevator_new/elevator_new_deal_bonus_v2_0_examination.php @@ -0,0 +1,116 @@ +$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "$bonus_array"=>$bonus_array #所有獎金水庫 + ]; + +*/ + + +require_once("elevator_new_deal_bonus_v2_0.php"); + +#$ver, $contract_type, $elevator_type, $elevator_list_price, $elevator_knockdown_price, $sales_id, $region_manger_id + +#獎金測試 +$examination_array = [ + #錯誤版本 + ["1.0","strategy_customer","passenger",1000000,1000000,"M0001", "M0003"], + #戰略客戶(strategy_customer) + ["2.0","strategy_customer","passenger",1000000,1000000,"M0001", "M0003"], #戰略客戶、客梯、銷售點數100% + ["2.0","strategy_customer","passenger",1000000,900000,"M0001", "M0003"], #戰略客戶、客梯、銷售點數90% + ["2.0","strategy_customer","passenger",1000000,750000,"M0001", "M0003"], #戰略客戶、客梯、銷售點數75% + ["2.0","strategy_customer","passenger",1000000,600000,"M0001", "M0003"], #戰略客戶、客梯、銷售點數60% + ["2.0","strategy_customer","cargo",1000000,1000000,"M0001", "M0003"], #戰略客戶、貨梯、銷售點數100% + ["2.0","strategy_customer","cargo",1000000,900000,"M0001", "M0003"], #戰略客戶、貨梯、銷售點數90% + ["2.0","strategy_customer","cargo",1000000,750000,"M0001", "M0003"], #戰略客戶、貨梯、銷售點數75% + ["2.0","strategy_customer","cargo",1000000,600000,"M0001", "M0003"], #戰略客戶、貨梯、銷售點數60% + ["2.0","strategy_customer","dumbwaiter",1000000,1000000,"M0001", "M0003"], #戰略客戶、小電梯、銷售點數100% + ["2.0","strategy_customer","dumbwaiter",1000000,900000,"M0001", "M0003"], #戰略客戶、小電梯、銷售點數90% + ["2.0","strategy_customer","dumbwaiter",1000000,720000,"M0001", "M0003"], #戰略客戶、小電梯、銷售點數75% + ["2.0","strategy_customer","dumbwaiter",1000000,600000,"M0001", "M0003"], #戰略客戶、小電梯、銷售點數60% + ["2.0","strategy_customer","flatbase",1000000,1000000,"M0001", "M0003"], #戰略客戶、平台梯、銷售點數100% + ["2.0","strategy_customer","flatbase",1000000,900000,"M0001", "M0003"], #戰略客戶、平台梯、銷售點數90% + ["2.0","strategy_customer","flatbase",1000000,720000,"M0001", "M0003"], #戰略客戶、平台梯、銷售點數75% + ["2.0","strategy_customer","flatbase",1000000,600000,"M0001", "M0003"], #戰略客戶、平台梯、銷售點數60% + ["2.0","strategy_customer","positive_drive",1000000,1000000,"M0001", "M0003"], #戰略客戶、強驅、銷售點數100% + ["2.0","strategy_customer","positive_drive",1000000,900000,"M0001", "M0003"], #戰略客戶、強驅、銷售點數90% + ["2.0","strategy_customer","positive_drive",1000000,720000,"M0001", "M0003"], #戰略客戶、強驅、銷售點數75% + ["2.0","strategy_customer","positive_drive",1000000,600000,"M0001", "M0003"], #戰略客戶、強驅、銷售點數60% + + #一般客戶(general_customer) + ["2.0","general_customer","passenger",1000000,1000000,"M0001", "M0003"], #一般客戶、客梯、銷售點數100% + ["2.0","general_customer","passenger",1000000,900000,"M0001", "M0003"], #一般客戶、客梯、銷售點數90% + ["2.0","general_customer","passenger",1000000,750000,"M0001", "M0003"], #一般客戶、客梯、銷售點數75% + ["2.0","general_customer","passenger",1000000,600000,"M0001", "M0003"], #一般客戶、客梯、銷售點數60% + ["2.0","general_customer","cargo",1000000,1000000,"M0001", "M0003"], #一般客戶、貨梯、銷售點數100% + ["2.0","general_customer","cargo",1000000,900000,"M0001", "M0003"], #一般客戶、貨梯、銷售點數90% + ["2.0","general_customer","cargo",1000000,750000,"M0001", "M0003"], #一般客戶、貨梯、銷售點數75% + ["2.0","general_customer","cargo",1000000,600000,"M0001", "M0003"], #一般客戶、貨梯、銷售點數60% + ["2.0","general_customer","dumbwaiter",1000000,1000000,"M0001", "M0003"], #一般客戶、小電梯、銷售點數100% + ["2.0","general_customer","dumbwaiter",1000000,900000,"M0001", "M0003"], #一般客戶、小電梯、銷售點數90% + ["2.0","general_customer","dumbwaiter",1000000,720000,"M0001", "M0003"], #一般客戶、小電梯、銷售點數75% + ["2.0","general_customer","dumbwaiter",1000000,600000,"M0001", "M0003"], #一般客戶、小電梯、銷售點數60% + ["2.0","general_customer","flatbase",1000000,1000000,"M0001", "M0003"], #一般客戶、平台梯、銷售點數100% + ["2.0","general_customer","flatbase",1000000,900000,"M0001", "M0003"], #一般客戶、平台梯、銷售點數90% + ["2.0","general_customer","flatbase",1000000,720000,"M0001", "M0003"], #一般客戶、平台梯、銷售點數75% + ["2.0","general_customer","flatbase",1000000,600000,"M0001", "M0003"], #一般客戶、平台梯、銷售點數60% + ["2.0","general_customer","positive_drive",1000000,1000000,"M0001", "M0003"], #一般客戶、強驅、銷售點數100% + ["2.0","general_customer","positive_drive",1000000,900000,"M0001", "M0003"], #一般客戶、強驅、銷售點數90% + ["2.0","general_customer","positive_drive",1000000,720000,"M0001", "M0003"], #一般客戶、強驅、銷售點數75% + ["2.0","general_customer","positive_drive",1000000,600000,"M0001", "M0003"] #一般客戶、強驅、銷售點數60% +]; + + + +for($i = 0; $i"; + echo "計算結果:" . $result["result_status"] . "
"; + echo "輸入參數:" . $examination_array[$i][1] . " " . $examination_array[$i][2] . " " . $examination_array[$i][3] . " " . $examination_array[$i][4] . " " + . $examination_array[$i][5] . " " . $examination_array[$i][6] . "
"; + for($j = 0; $j"; + }; + echo "-------------------------" . "
"; + +}; + + +?> diff --git a/wms/bons/maintainance_contract_payment_status.php b/wms/bons/maintainance_contract_payment_status.php new file mode 100644 index 00000000..ed76f046 --- /dev/null +++ b/wms/bons/maintainance_contract_payment_status.php @@ -0,0 +1,399 @@ +query($sql); + +function getContractnoDetails($link, $user_id, $contractno = null) +{ + $sql = " + SELECT + c.contractno + FROM contract AS c + LEFT JOIN con_maintance_examine_apply AS cmea + ON c.contractno = cmea.vol_no + WHERE 1 = 1 + AND cmea.salesman IN (" . getAccountids($link, $user_id) . ") + "; + if (!empty($contractno)) { + $sql .= " + AND c.contractno = '$contractno' + "; + } + $result = mysqli_query($link, $sql); + $data = []; + foreach ($result as $row) { + array_push($data, $row['contractno']); + } + return "'" . implode("','", $data) . "'"; +} + +function getSalesmanNo($link, $contractno) +{ + $sql = " + SELECT + cmea.salesman + FROM contract AS c + LEFT JOIN con_maintance_examine_apply AS cmea + ON c.contractno = cmea.vol_no + WHERE 1 = 1 + AND c.contractno IN ('$contractno') + "; + $result = mysqli_query($link, $sql); + $data = []; + foreach ($result as $row) + return $row['salesman']; + return ""; +} +function getSalesmanName($link, $contractno) +{ + $sql = " + SELECT + a.name + FROM contract AS c + LEFT JOIN con_maintance_examine_apply AS cmea + ON c.contractno = cmea.vol_no + LEFT JOIN account AS a + ON cmea.salesman = a.accountid + WHERE 1 = 1 + AND c.contractno IN ('$contractno') + "; + $result = mysqli_query($link, $sql); + $data = []; + foreach ($result as $row) + return $row['name']; + return ""; +} + +function getAccountids($link, $user_id) +{ + $sql = " + SELECT + accountid + FROM account + WHERE 1 = 1 + AND (accountid = '$user_id' + OR accountid IN ( + SELECT + accountid + FROM account + WHERE 1 = 1 + AND manager = '$user_id' + AND accounttype IN ('B','E','M','W') + ) + ) + "; + $result = mysqli_query($link, $sql); + $data = []; + foreach ($result as $row) { + array_push($data, $row['accountid']); + } + return "'" . implode("','", $data) . "'"; +} + +function checkArCheckBillStatus($row) +{ + $CU_EstPayDate = $row['CU_EstPayDate']; + $BillNo2 = $row['BillNo2']; + if (substr($CU_EstPayDate, 0, 6) <= date("Ym")) { + if (empty($BillNo2)) { + return "未轉應收確認單"; + } else { + return "已轉應收確認單"; + } + } else { + return "時間未到"; + } +} + +function arSellInvoiceMaterial($row) +{ + + $CU_EstPayDate = $row['CU_EstPayDate']; + $InvoiceName = $row['InvoiceName']; + + if (substr($CU_EstPayDate, 0, 6) <= date("Ym")) { + if (empty($InvoiceName)) { + return "未開發票"; + } else { + return "已開發票"; + } + } else { + return "時間未到"; + } +} + +function checkArWriteOffBill($conn, $row) +{ + $BillNo = $row['BillNo2']; + + $sql = " + SELECT + * + -- a.BillNo, + -- a.WriteOffBizPartnerId, + -- a.PayWriteOffOAmount, + -- b.FromBillDate AS ReceivedDate, + -- b.CurrWOFeeOAmt AS Fee, + -- c.OrderBillNo, + -- c.checkBillNo, + -- c.InvoiceNo, + -- c.BillDate AS CheckBillDate + FROM arWriteOffBill AS a + LEFT JOIN arWriteOffBillRec AS b ON a.BillNo=b.BillNo + LEFT JOIN + (SELECT temp1.*,arWriteOffBillDetail.* FROM arWriteOffBillDetail + LEFT JOIN + (SELECT + arCheckBill.BillNo AS checkBillNo, arCheckBill.BillDate,arCheckBillInvInfo.InvoiceNo + FROM arCheckBill + LEFT JOIN arCheckBillInvInfo + ON arCheckBill.InvoiceBillNo=arCheckBillInvInfo.InvoiceBillNo) AS temp1 + ON temp1.checkBillNo = arWriteOffBillDetail.FromBillNo) AS c + ON a.BillNo=c.BillNo + WHERE c.checkBillNo = '$BillNo' + "; + + $del = $conn->query($sql); + $i = 0; + foreach ($del as $row) + $i++; + if (empty($i)) { + return "未收款"; + } else { + return "已收款"; + } +} + +?> + + + + + + + + +
+
+ + + + + + + + + + + + + +
+

保養合約-應收款項明細

+
合約號 + + + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
營業人員/契約人員合約號標示號電梯編號預計請款日催收次數應收申請單狀態請款金額(未轉應收)請款金額(已轉應收)應收申請單號發票狀態發票單標示號發票單號發票明細發票金額發票號碼核銷
+ "; + echo getSalesmanName($link, $row['BillNo']); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +There is no record!"; +endif; + +#代表結束連線 +mysqli_close($link); + +include "footer.php"; +?> \ No newline at end of file diff --git a/wms/bons/maintance/maintenance_contract_bonus_v2_0.php b/wms/bons/maintance/maintenance_contract_bonus_v2_0.php new file mode 100644 index 00000000..c2cadb3e --- /dev/null +++ b/wms/bons/maintance/maintenance_contract_bonus_v2_0.php @@ -0,0 +1,248 @@ +$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "$bonus_array"=>$bonus_array #所有獎金水庫 + ]; + +*/ + + + +function maintenance_contract_bonus_v2_0($ver, $contract_type, $contract_years, $discount, $fee_per_st, $commission_fee, $receivable_date_due, $sales_id, $region_manger_id, $regular_contract_manger_id){ + $bonus_array = []; + if ($ver == "2.0"){ + + #契約總類($contract_type):新簽約(new)、免保轉有費(free_to_charge)、續簽約(原價或僅契約金額異動)(renew_priceissue) + switch ($contract_type){ + case "new": + #契約員獎金($sales_bonus) + switch ($fee_per_st) { + case ($fee_per_st <= 3000): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.6; + break; + case ($fee_per_st >= 3001 and $fee_per_st <= 3499): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.7; + break; + case ($fee_per_st >= 3500 and $fee_per_st <= 3999): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.8; + break; + case ($fee_per_st >= 4000): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.9; + break; + }; + #地區經理經理獎金($region_manager_bonus) + $region_manager_bonus = 170; + #專任契約經理獎金($regular_contract_manger_bonus) + $regular_contract_manger_bonus = 300; + break; + + case "free_to_charge": + switch ($fee_per_st) { + case ($fee_per_st <= 3000): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.3; + break; + case ($fee_per_st >= 3001 and $fee_per_st <= 3499): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.35; + break; + case ($fee_per_st >= 3500 and $fee_per_st <= 3999): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.4; + break; + case ($fee_per_st >= 4000): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.5; + break; + }; + #地區經理經理獎金($region_manager_bonus) + $region_manager_bonus = 100; + #專任契約經理獎金($regular_contract_manger_bonus) + $regular_contract_manger_bonus = 100; + break; + + case "renew_priceissue": + switch ($fee_per_st) { + case ($fee_per_st <= 3000): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.25; + break; + case ($fee_per_st >= 3001 and $fee_per_st <= 3499): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.3; + break; + case ($fee_per_st >= 3500 and $fee_per_st <= 3999): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.35; + break; + case ($fee_per_st >= 4000): + $sales_bonus = ($fee_per_st - $commission_fee) * 0.4; + break; + }; + #地區經理經理獎金($region_manager_bonus) + $region_manager_bonus = 100; + #專任契約經理獎金($regular_contract_manger_bonus) + $regular_contract_manger_bonus = 100; + break; + }; + + #合約折扣率($discount):大於80%以上(含)(above_80)、60-79%(含)以上(60_to_79)、折扣率59% (含)以下(below_59) + switch ($discount) { + case ($discount < 0.6): + $sales_bonus = $sales_bonus * 0.7; + break; + case ($discount >= 0.6 and $discount < 0.8): + $sales_bonus = $sales_bonus * 0.8; + break; + case ($discount >= 0.8): + $sales_bonus = $sales_bonus * 1.0; + break; + }; + + #簽約年數($contract_years):1年(1),超過1年(above) + + switch ($contract_years){ + case $contract_years == "one": + #契約員獎金 + array_push($bonus_array,[ + "bonus_type" => "契約員獎金", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +1 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + + #地區經理經理獎金 + array_push($bonus_array,[ + "bonus_type" => "地區經理獎金", #獎金名稱 + "bonus_receiver" => $region_manger_id, #發放人員 + "bonus_amount" => round($region_manager_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +1 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + + #專任契約經理獎金 + array_push($bonus_array,[ + "bonus_type" => "專任契約經理獎金", #獎金名稱 + "bonus_receiver" => $regular_contract_manger_id, #發放人員 + "bonus_amount" => round($regular_contract_manger_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +1 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + + $result_array = [ + "ver"=>$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "bonus_array"=>$bonus_array #獎金水庫 + ]; + break; + + case $contract_years == "above_two": + /*** 以下第1年獎金 ***/ + #契約員獎金 + array_push($bonus_array,[ + "bonus_type" => "契約員獎金", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +1 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + + #地區經理經理獎金 + array_push($bonus_array,[ + "bonus_type" => "地區經理獎金", #獎金名稱 + "bonus_receiver" => $region_manger_id, #發放人員 + "bonus_amount" => round($region_manager_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +1 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + + #專任契約經理獎金 + array_push($bonus_array,[ + "bonus_type" => "專任契約經理獎金", #獎金名稱 + "bonus_receiver" => $regular_contract_manger_id, #發放人員 + "bonus_amount" => round($regular_contract_manger_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +1 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + /*** 以上第1年獎金 ***/ + + /*** 以下第2年獎金 ***/ + #第2年契約員獎金 + array_push($bonus_array,[ + "bonus_type" => "契約員獎金", #獎金名稱 + "bonus_receiver" => $sales_id, #發放人員 + "bonus_amount" => round($sales_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +13 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + + #第2年地區經理經理獎金 + array_push($bonus_array,[ + "bonus_type" => "地區經理獎金", #獎金名稱 + "bonus_receiver" => $region_manger_id, #發放人員 + "bonus_amount" => round($region_manager_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +13 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + + #第2年專任契約經理獎金 + array_push($bonus_array,[ + "bonus_type" => "專任契約經理獎金", #獎金名稱 + "bonus_receiver" => $regular_contract_manger_id, #發放人員 + "bonus_amount" => round($regular_contract_manger_bonus), #金額 + "pay_day_due" => date("Y-m-d",strtotime("$receivable_date_due +13 months")), #預計發放時間 + "bonus_regulation" => "合約簽回及保養款項收回的次月一次性發" #發放規定 + ]); + /*** 以上第2年獎金 ***/ + + $result_array = [ + "ver"=>$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "bonus_array"=>$bonus_array #獎金水庫 + ]; + break; + } + }else{ + array_push($bonus_array,[ + "bonus_type" => "error", #獎金名稱 + "bonus_receiver" => "error", #發放人員 + "bonus_amount" => 0, #金額 + "pay_day_due" => "9999-1-1", #預計發放時間 + "bonus_regulation" => "error" #發放規定 + ]); + $result_array = [ + "ver"=>$ver, #獎金版本 + "result_status"=>"error", #計算結果 + "bonus_array"=>$bonus_array #獎金水庫 + ]; + } + + return $result_array; +}; + + +?> diff --git a/wms/bons/maintance/maintenance_contract_bonus_v2_0_examination.php b/wms/bons/maintance/maintenance_contract_bonus_v2_0_examination.php new file mode 100644 index 00000000..de316b53 --- /dev/null +++ b/wms/bons/maintance/maintenance_contract_bonus_v2_0_examination.php @@ -0,0 +1,156 @@ +$ver, #獎金版本 + "result_status"=>"success", #計算結果 + "$bonus_array"=>$bonus_array #所有獎金水庫 + ]; + +*/ + + +require_once("maintenance_contract_bonus_v2_0.php"); + + + +#獎金測試 +$examination_array = [ + #錯誤版本 + ["1.0","new","one",0.8,4000,333, "2014-07-01", "M0001", "M0002", "M0003"], + #新簽約 + ["2.0","new","one",0.8,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3000元 + ["2.0","new","one",0.8,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3200元 + ["2.0","new","one",0.8,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3500元 + ["2.0","new","one",0.8,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、4000元 + ["2.0","new","one",0.7,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3000元 + ["2.0","new","one",0.7,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3200元 + ["2.0","new","one",0.7,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3500元 + ["2.0","new","one",0.7,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、4000元 + ["2.0","new","one",0.6,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3000元 + ["2.0","new","one",0.6,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3200元 + ["2.0","new","one",0.6,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3500元 + ["2.0","new","one",0.6,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、4000元 + ["2.0","new","above_two",0.8,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3000元 + ["2.0","new","above_two",0.8,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3200元 + ["2.0","new","above_two",0.8,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3500元 + ["2.0","new","above_two",0.8,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、4000元 + ["2.0","new","above_two",0.7,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3000元 + ["2.0","new","above_two",0.7,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3200元 + ["2.0","new","above_two",0.7,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3500元 + ["2.0","new","above_two",0.7,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、4000元 + ["2.0","new","above_two",0.6,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3000元 + ["2.0","new","above_two",0.6,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3200元 + ["2.0","new","above_two",0.6,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3500元 + ["2.0","new","above_two",0.6,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、4000元 + + #免保轉有費(free_to_charge) + ["2.0","free_to_charge","one",0.8,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3000元 + ["2.0","free_to_charge","one",0.8,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3200元 + ["2.0","free_to_charge","one",0.8,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3500元 + ["2.0","free_to_charge","one",0.8,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、4000元 + ["2.0","free_to_charge","one",0.7,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3000元 + ["2.0","free_to_charge","one",0.7,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3200元 + ["2.0","free_to_charge","one",0.7,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3500元 + ["2.0","free_to_charge","one",0.7,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、4000元 + ["2.0","free_to_charge","one",0.6,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3000元 + ["2.0","free_to_charge","one",0.6,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3200元 + ["2.0","free_to_charge","one",0.6,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3500元 + ["2.0","free_to_charge","one",0.6,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、4000元 + ["2.0","free_to_charge","above_two",0.8,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3000元 + ["2.0","free_to_charge","above_two",0.8,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3200元 + ["2.0","free_to_charge","above_two",0.8,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3500元 + ["2.0","free_to_charge","above_two",0.8,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、4000元 + ["2.0","free_to_charge","above_two",0.7,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3000元 + ["2.0","free_to_charge","above_two",0.7,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3200元 + ["2.0","free_to_charge","above_two",0.7,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3500元 + ["2.0","free_to_charge","above_two",0.7,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、4000元 + ["2.0","free_to_charge","above_two",0.6,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3000元 + ["2.0","free_to_charge","above_two",0.6,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3200元 + ["2.0","free_to_charge","above_two",0.6,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3500元 + ["2.0","free_to_charge","above_two",0.6,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、4000元 + + #續簽約(原價或僅契約金額異動)(renew_priceissue) + ["2.0","renew_priceissue","one",0.8,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3000元 + ["2.0","renew_priceissue","one",0.8,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3200元 + ["2.0","renew_priceissue","one",0.8,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、3500元 + ["2.0","renew_priceissue","one",0.8,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.8、4000元 + ["2.0","renew_priceissue","one",0.7,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3000元 + ["2.0","renew_priceissue","one",0.7,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3200元 + ["2.0","renew_priceissue","one",0.7,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、3500元 + ["2.0","renew_priceissue","one",0.7,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.7、4000元 + ["2.0","renew_priceissue","one",0.6,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3000元 + ["2.0","renew_priceissue","one",0.6,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3200元 + ["2.0","renew_priceissue","one",0.6,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、3500元 + ["2.0","renew_priceissue","one",0.6,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、1年、折扣率0.6、4000元 + ["2.0","renew_priceissue","above_two",0.8,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3000元 + ["2.0","renew_priceissue","above_two",0.8,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3200元 + ["2.0","renew_priceissue","above_two",0.8,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、3500元 + ["2.0","renew_priceissue","above_two",0.8,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.8、4000元 + ["2.0","renew_priceissue","above_two",0.7,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3000元 + ["2.0","renew_priceissue","above_two",0.7,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3200元 + ["2.0","renew_priceissue","above_two",0.7,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、3500元 + ["2.0","renew_priceissue","above_two",0.7,4000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.7、4000元 + ["2.0","renew_priceissue","above_two",0.6,3000,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3000元 + ["2.0","renew_priceissue","above_two",0.6,3200,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3200元 + ["2.0","renew_priceissue","above_two",0.6,3500,333,"2014-07-01", "M0001", "M0002", "M0003"], #新簽約、2年以上、折扣率0.6、3500元 + ["2.0","renew_priceissue","above_two",0.6,4000,333,"2014-07-01", "M0001", "M0002", "M0003"] #新簽約、2年以上、折扣率0.6、4000元 +]; + + + +for($i = 0; $i"; + echo "計算結果:" . $result["result_status"] . "
"; + echo "輸入參數:" . $examination_array[$i][1] . " " . $examination_array[$i][2] . " " . $examination_array[$i][3] . " " . $examination_array[$i][4] . " " + . $examination_array[$i][5] . " " . $examination_array[$i][6] . " " . $examination_array[$i][7]. " " . $examination_array[$i][8] . "
"; + for($j = 0; $j"; + }; + echo "-------------------------" . "
"; + +}; + + +?> diff --git a/wms/contract/api/T8salIncomeApply.php b/wms/contract/api/T8salIncomeApply.php index 96246a7c..0a3d7698 100644 --- a/wms/contract/api/T8salIncomeApply.php +++ b/wms/contract/api/T8salIncomeApply.php @@ -29,9 +29,7 @@ function T8API($data) echo 'API傳入失敗,' . $result['ErrorMsg']; return $result; } else { - // echo '
';
             // print_r($result);
-            // echo '
'; return $result; } } diff --git a/wms/contract/api/postContractData.php b/wms/contract/api/postContractData.php index d9b9f8b8..5f099f45 100644 --- a/wms/contract/api/postContractData.php +++ b/wms/contract/api/postContractData.php @@ -459,12 +459,12 @@ function T8insert($data, $facilityno) // print_r($elevators['maintainance']); // echo ''; foreach ($elevators as $index => $elevator) { - $type[] = $elevator['maintainance']; - if ($type[$index] == 'A') { + $type = $elevator['maintainance']; + if ($type == 'A') { $type = 'C3'; - } else if ($type[$index] == 'B') { + } else if ($type == 'B') { $type = 'C4'; - } else if ($type[$index] == 'C') { + } else if ($type == 'C') { $type = 'C5'; } } @@ -537,8 +537,8 @@ function T8insert($data, $facilityno) for ($i = 0; $i < $IncomeId[$payType]; $i++) { // 計算分期款的收款月份 $paymonth = $i * $SQuantity; - $payday = date('Y-m-d', strtotime("$date_1 + $paymonth months")); - + $countDay = date('Y-m-d', strtotime("$date_1 + $paymonth months")); + $payDay = str_replace('-', '', $countDay); $rows_data = [ "BillNo" => "$contractno", "IncomeId" => "$payType", @@ -551,7 +551,7 @@ function T8insert($data, $facilityno) "ProjectId" => "$contractno", "FromSourceTag" => 0, "CU_MaterialId" => "$facilityno[$index]", - "CU_EstPayDate" => "$payday" + "CU_EstPayDate" => "$payDay" ]; $salIncomeApplyDetail_rows[] = $rows_data; } @@ -594,7 +594,7 @@ function T8insert($data, $facilityno) // 呼叫 API $result = T8API($API_body); - if ($result['Status'] == 'Error') { + if ($result['Status'] == 'Error' || $result['Status'] == 'Fails') { http_response_code(404); die('Error!:' . $result['ErrorMsg']); } diff --git a/wms/contract/api/testT8API.php b/wms/contract/api/testT8API.php index 3718df5d..e468654f 100644 --- a/wms/contract/api/testT8API.php +++ b/wms/contract/api/testT8API.php @@ -2,13 +2,18 @@ $date = Date('Y-m-d'); $date1 = Date('Y-m-d', strtotime("$date +1 months")); - +// $countDay = date('Ymd', strtotime("$date1 + 1 months")); +// echo '
';
+// print_r($countDay);
+// echo '
'; +// exit(); $a = 1; -$b = 12 / $a; +$b = 24 / $a; for ($i = 0; $i < $b; $i++) { $c = $i * $a; $date1 = Date('Y-m-d', strtotime("$date + $c months")); + $date2 = str_replace('-', '', $date1); echo '
';
-    print_r($date1);
+    print_r($date2);
     echo '
'; } diff --git a/wms/contract/js/alpine.js b/wms/contract/js/alpine.js index d13d8389..35f81f58 100644 --- a/wms/contract/js/alpine.js +++ b/wms/contract/js/alpine.js @@ -734,7 +734,7 @@ const contractDownload = () => { this.standardData.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' this.onstandardViewData.list.plaintext[10].text = '電梯保養:
一、乙方完工交車後,期後 ' + this.installfill2 + ' 個月內應負責免費定期保養,及履行免費保固,於免費保養期間屆至後,雙方再協商嗣後保養事宜。
二、如因可歸責乙方因素致安裝產品有所瑕疵時,乙方應負責修復或修繕,惟非因乙方因素致有修復產品需要時,乙方仍負責修復或修繕,惟得向甲方酌收基本材料與人工費用。
三、另依法令規定,非經竣工檢查合格後取得使用許可證之電梯,依法不得使用。' }, - errorFn(){ + errorFn() { alert("資料有誤,請先填完整資料進行保存") }, sendBuyInputFn() { diff --git a/wms/mkt/pricereview-index.php b/wms/mkt/pricereview-index.php index 0919e468..3fff3ce6 100644 --- a/wms/mkt/pricereview-index.php +++ b/wms/mkt/pricereview-index.php @@ -332,10 +332,14 @@ function get_pending($token) $result = get_pending($token); // print_r($result); +<<<<<<< HEAD if (count($result) > 0) { $result[1]['sid'] = !empty($result) ? $result[1]['sid'] : 'prm'; $result[1]['fid'] = !empty($result) ? $result[1]['fid'] : 'prm01'; } +======= + +>>>>>>> 5b4e2536 (0125) if ($data) : /*