Browse Source

新梯、保養簽回&獎金

main
Cheng 1 year ago
parent
commit
79d4fecce6
  1. 73
      wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0.php
  2. 121
      wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0_examination.php
  3. 2
      wms/contract/api/T8api.php
  4. 15
      wms/contract/api/getContractData.php
  5. 1
      wms/contract/api/postContractData.php
  6. 761
      wms/contract/api/postNewContractData.php
  7. 407
      wms/contract/api/test copy.json
  8. 2
      wms/contract/api/test.json
  9. 127
      wms/contract/api/testT8API.php
  10. 14
      wms/contract/contract-newelevator-input.php
  11. 13
      wms/contract/js/alpine.js

73
wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0.php

@ -35,13 +35,14 @@ result_array[
function elevator_new_deal_bonus_v2_0($ver, $contract_type, $elevator_type, $elevator_list_price, $elevator_knockdown_price, $sales_id, $region_manger_id){ 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 = []; $bonus_array = [];
if ($ver == "2.0"){ if ($ver == "2.0") {
$discount = round($elevator_knockdown_price / $elevator_list_price, 3); #銷售點數,取到小數點第三位。 $discount = round($elevator_knockdown_price / $elevator_list_price, 3); #銷售點數,取到小數點第三位。
#合約總類($contract_type):戰略客戶(strategy_customer)、一般客戶(general_customer) #合約總類($contract_type):戰略客戶(strategy_customer)、一般客戶(general_customer)
switch ($contract_type){ switch ($contract_type) {
case "strategy_customer": case "strategy_customer":
#契約員獎金($sales_bonus) #契約員獎金($sales_bonus)
$sales_bonus = $elevator_knockdown_price * 0.007; $sales_bonus = $elevator_knockdown_price * 0.007;
@ -51,7 +52,7 @@ function elevator_new_deal_bonus_v2_0($ver, $contract_type, $elevator_type, $ele
case "general_customer": case "general_customer":
switch ($elevator_type) { switch ($elevator_type) {
#客梯(passenger)、貨梯(cargo) #客梯(passenger)、貨梯(cargo)
case ($elevator_type == "passenger" or $elevator_type == "cargo"): case ($elevator_type == "passenger" or $elevator_type == "cargo"):
switch ($discount) { switch ($discount) {
case ($discount >= 1.0): case ($discount >= 1.0):
@ -62,14 +63,14 @@ function elevator_new_deal_bonus_v2_0($ver, $contract_type, $elevator_type, $ele
break; break;
case ($discount >= 0.75 and $discount < 0.9): case ($discount >= 0.75 and $discount < 0.9):
$sales_bonus = $elevator_knockdown_price * 0.015; $sales_bonus = $elevator_knockdown_price * 0.015;
break; break;
case ($discount < 0.75): case ($discount < 0.75):
$sales_bonus = $elevator_knockdown_price * 0.008; $sales_bonus = $elevator_knockdown_price * 0.008;
break; break;
}; };
break; break;
#小電梯(dumbwaiter)、平台梯(flatbase)、強驅(positive_drive) #小電梯(dumbwaiter)、平台梯(flatbase)、強驅(positive_drive)
case ($elevator_type == "dumbwaiter" or $elevator_type == "flatbase" or $elevator_type == "positive_drive"): case ($elevator_type == "dumbwaiter" or $elevator_type == "flatbase" or $elevator_type == "positive_drive"):
switch ($discount) { switch ($discount) {
case ($discount >= 1.0): case ($discount >= 1.0):
@ -80,7 +81,7 @@ function elevator_new_deal_bonus_v2_0($ver, $contract_type, $elevator_type, $ele
break; break;
case ($discount >= 0.72 and $discount < 0.9): case ($discount >= 0.72 and $discount < 0.9):
$sales_bonus = $elevator_knockdown_price * 0.015; $sales_bonus = $elevator_knockdown_price * 0.015;
break; break;
case ($discount < 0.72): case ($discount < 0.72):
$sales_bonus = $elevator_knockdown_price * 0.008; $sales_bonus = $elevator_knockdown_price * 0.008;
break; break;
@ -91,74 +92,72 @@ function elevator_new_deal_bonus_v2_0($ver, $contract_type, $elevator_type, $ele
$region_manager_bonus = 600; $region_manager_bonus = 600;
break; break;
}; };
#營銷人員銷售獎金水庫-----訂金已收款20%,發放總獎金20% #營銷人員銷售獎金水庫-----訂金已收款20%,發放總獎金20%
array_push($bonus_array,[ array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-訂金段", #獎金名稱 "bonus_type" => "營銷人員銷售獎金-訂金段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員 "bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.2), #金額 "bonus_amount" => round($sales_bonus * 0.2), #金額
"payment_schedul_due" => "deposit", #訂金已收款20% "payment_schedul_due" => "deposit", #訂金已收款20%
"payment_schedul_regulation" => "訂金已收款20%,發放總獎金20%" #發放規定 "payment_schedul_regulation" => "訂金已收款20%,發放總獎金20%" #發放規定
]); ]);
#營銷人員銷售獎金水庫-----出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50% #營銷人員銷售獎金水庫-----出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%
array_push($bonus_array,[ array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-出貨款段", #獎金名稱 "bonus_type" => "營銷人員銷售獎金-出貨款段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員 "bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.5), #金額 "bonus_amount" => round($sales_bonus * 0.5), #金額
"payment_schedul_due" => "shipping", #訂金已收款20% "payment_schedul_due" => "shipping", #訂金已收款20%
"payment_schedul_regulation" => "出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%" #發放規定 "payment_schedul_regulation" => "出貨前期所有款項已收齊,且出貨款已收款50%,發放總獎金50%" #發放規定
]); ]);
#營銷人員銷售獎金水庫-----驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30% #營銷人員銷售獎金水庫-----驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%
array_push($bonus_array,[ array_push($bonus_array, [
"bonus_type" => "營銷人員銷售獎金-驗收款段", #獎金名稱 "bonus_type" => "營銷人員銷售獎金-驗收款段", #獎金名稱
"bonus_receiver" => $sales_id, #發放人員 "bonus_receiver" => $sales_id, #發放人員
"bonus_amount" => round($sales_bonus * 0.3), #金額 "bonus_amount" => round($sales_bonus * 0.3), #金額
"payment_schedul_due" => "acceptance", #訂金已收款20% "payment_schedul_due" => "acceptance", #訂金已收款20%
"payment_schedul_regulation" => "驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%" #發放規定 "payment_schedul_regulation" => "驗收前期所有款項已收齊,且驗收款已收款30%,發放總獎金30%" #發放規定
]); ]);
#區域經理提成獎金水庫-----訂金已收款100%,發放總獎金50% #區域經理提成獎金水庫-----訂金已收款100%,發放總獎金50%
array_push($bonus_array,[ array_push($bonus_array, [
"bonus_type" => "區域經理提成獎金-訂金段", #獎金名稱 "bonus_type" => "區域經理提成獎金-訂金段", #獎金名稱
"bonus_receiver" => $region_manger_id, #發放人員 "bonus_receiver" => $region_manger_id, #發放人員
"bonus_amount" => round($region_manager_bonus * 0.5), #金額 "bonus_amount" => round($region_manager_bonus * 0.5), #金額
"payment_schedul_due" => "deposit", #訂金已收款100% "payment_schedul_due" => "deposit", #訂金已收款100%
"payment_schedul_regulation" => "訂金已收款100%,發放總獎金50%" #發放規定 "payment_schedul_regulation" => "訂金已收款100%,發放總獎金50%" #發放規定
]); ]);
#區域經理獎金水庫-----貨到工地款(含)之前所有款項已收款100%,發放總獎金50% #區域經理獎金水庫-----貨到工地款(含)之前所有款項已收款100%,發放總獎金50%
array_push($bonus_array,[ array_push($bonus_array, [
"bonus_type" => "區域經理提成獎金-貨到工地款段", #獎金名稱 "bonus_type" => "區域經理提成獎金-貨到工地款段", #獎金名稱
"bonus_receiver" => $region_manger_id, #發放人員 "bonus_receiver" => $region_manger_id, #發放人員
"bonus_amount" => round($region_manager_bonus * 0.5), #金額 "bonus_amount" => round($region_manager_bonus * 0.5), #金額
"payment_schedul_due" => "deliveried", #貨到工地款(含)之前所有款項已收款100% "payment_schedul_due" => "deliveried", #貨到工地款(含)之前所有款項已收款100%
"payment_schedul_regulation" => "貨到工地款(含)之前所有款項已收款100%,發放總獎金50%" #發放規定 "payment_schedul_regulation" => "貨到工地款(含)之前所有款項已收款100%,發放總獎金50%" #發放規定
]); ]);
$result_array = [ $result_array = [
"ver"=>$ver, #獎金版本 "ver" => $ver, #獎金版本
"result_status"=>"success", #計算結果 "result_status" => "success", #計算結果
"bonus_array"=>$bonus_array #獎金水庫 "bonus_array" => $bonus_array #獎金水庫
]; ];
}else{ } else {
array_push($bonus_array,[ array_push($bonus_array, [
"bonus_type" => "error", #獎金名稱 "bonus_type" => "error", #獎金名稱
"bonus_receiver" => "error", #發放人員 "bonus_receiver" => "error", #發放人員
"bonus_amount" => 0, #金額 "bonus_amount" => 0, #金額
"payment_schedul_due" => "9999-1-1", #預計發放時間 "payment_schedul_due" => "9999-1-1", #預計發放時間
"payment_schedul_regulation" => "error" #發放規定 "payment_schedul_regulation" => "error" #發放規定
]); ]);
$result_array = [ $result_array = [
"ver"=>$ver, #獎金版本 "ver" => $ver, #獎金版本
"result_status"=>"error", #計算結果 "result_status" => "error", #計算結果
"bonus_array"=>$bonus_array #獎金水庫 "bonus_array" => $bonus_array #獎金水庫
]; ];
}; };
return $result_array; return $result_array;
}; };
?>

121
wms/bonus/elevator_new/elevator_new_deal_bonus_v2_0_examination.php

@ -41,76 +41,85 @@ require_once("elevator_new_deal_bonus_v2_0.php");
#獎金測試 #獎金測試
$examination_array = [ $examination_array = [
#錯誤版本 #錯誤版本
["1.0","strategy_customer","passenger",1000000,1000000,"M0001", "M0003"], ["1.0", "strategy_customer", "passenger", 1000000, 1000000, "M0001", "M0003"],
#戰略客戶(strategy_customer) #戰略客戶(strategy_customer)
["2.0","strategy_customer","passenger",1000000,1000000,"M0001", "M0003"], #戰略客戶、客梯、銷售點數100% ["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, 900000, "M0001", "M0003"], #戰略客戶、客梯、銷售點數90%
["2.0","strategy_customer","passenger",1000000,750000,"M0001", "M0003"], #戰略客戶、客梯、銷售點數75% ["2.0", "strategy_customer", "passenger", 1000000, 750000, "M0001", "M0003"], #戰略客戶、客梯、銷售點數75%
["2.0","strategy_customer","passenger",1000000,600000,"M0001", "M0003"], #戰略客戶、客梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #戰略客戶、貨梯、銷售點數100%
["2.0","strategy_customer","cargo",1000000,900000,"M0001", "M0003"], #戰略客戶、貨梯、銷售點數90% ["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, 750000, "M0001", "M0003"], #戰略客戶、貨梯、銷售點數75%
["2.0","strategy_customer","cargo",1000000,600000,"M0001", "M0003"], #戰略客戶、貨梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #戰略客戶、小電梯、銷售點數100%
["2.0","strategy_customer","dumbwaiter",1000000,900000,"M0001", "M0003"], #戰略客戶、小電梯、銷售點數90% ["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, 720000, "M0001", "M0003"], #戰略客戶、小電梯、銷售點數75%
["2.0","strategy_customer","dumbwaiter",1000000,600000,"M0001", "M0003"], #戰略客戶、小電梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #戰略客戶、平台梯、銷售點數100%
["2.0","strategy_customer","flatbase",1000000,900000,"M0001", "M0003"], #戰略客戶、平台梯、銷售點數90% ["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, 720000, "M0001", "M0003"], #戰略客戶、平台梯、銷售點數75%
["2.0","strategy_customer","flatbase",1000000,600000,"M0001", "M0003"], #戰略客戶、平台梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #戰略客戶、強驅、銷售點數100%
["2.0","strategy_customer","positive_drive",1000000,900000,"M0001", "M0003"], #戰略客戶、強驅、銷售點數90% ["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, 720000, "M0001", "M0003"], #戰略客戶、強驅、銷售點數75%
["2.0","strategy_customer","positive_drive",1000000,600000,"M0001", "M0003"], #戰略客戶、強驅、銷售點數60% ["2.0", "strategy_customer", "positive_drive", 1000000, 600000, "M0001", "M0003"], #戰略客戶、強驅、銷售點數60%
#一般客戶(general_customer) #一般客戶(general_customer)
["2.0","general_customer","passenger",1000000,1000000,"M0001", "M0003"], #一般客戶、客梯、銷售點數100% ["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, 900000, "M0001", "M0003"], #一般客戶、客梯、銷售點數90%
["2.0","general_customer","passenger",1000000,750000,"M0001", "M0003"], #一般客戶、客梯、銷售點數75% ["2.0", "general_customer", "passenger", 1000000, 750000, "M0001", "M0003"], #一般客戶、客梯、銷售點數75%
["2.0","general_customer","passenger",1000000,600000,"M0001", "M0003"], #一般客戶、客梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #一般客戶、貨梯、銷售點數100%
["2.0","general_customer","cargo",1000000,900000,"M0001", "M0003"], #一般客戶、貨梯、銷售點數90% ["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, 750000, "M0001", "M0003"], #一般客戶、貨梯、銷售點數75%
["2.0","general_customer","cargo",1000000,600000,"M0001", "M0003"], #一般客戶、貨梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #一般客戶、小電梯、銷售點數100%
["2.0","general_customer","dumbwaiter",1000000,900000,"M0001", "M0003"], #一般客戶、小電梯、銷售點數90% ["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, 720000, "M0001", "M0003"], #一般客戶、小電梯、銷售點數75%
["2.0","general_customer","dumbwaiter",1000000,600000,"M0001", "M0003"], #一般客戶、小電梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #一般客戶、平台梯、銷售點數100%
["2.0","general_customer","flatbase",1000000,900000,"M0001", "M0003"], #一般客戶、平台梯、銷售點數90% ["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, 720000, "M0001", "M0003"], #一般客戶、平台梯、銷售點數75%
["2.0","general_customer","flatbase",1000000,600000,"M0001", "M0003"], #一般客戶、平台梯、銷售點數60% ["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, 1000000, "M0001", "M0003"], #一般客戶、強驅、銷售點數100%
["2.0","general_customer","positive_drive",1000000,900000,"M0001", "M0003"], #一般客戶、強驅、銷售點數90% ["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, 720000, "M0001", "M0003"], #一般客戶、強驅、銷售點數75%
["2.0","general_customer","positive_drive",1000000,600000,"M0001", "M0003"] #一般客戶、強驅、銷售點數60% ["2.0", "general_customer", "positive_drive", 1000000, 600000, "M0001", "M0003"] #一般客戶、強驅、銷售點數60%
]; ];
for($i = 0; $i<count($examination_array); $i++){ for ($i = 0; $i < count($examination_array); $i++) {
$result = elevator_new_deal_bonus_v2_0( $result = elevator_new_deal_bonus_v2_0(
$examination_array[$i][0], $examination_array[$i][0],
$examination_array[$i][1], $examination_array[$i][1],
$examination_array[$i][2], $examination_array[$i][2],
$examination_array[$i][3], $examination_array[$i][3],
$examination_array[$i][4], $examination_array[$i][4],
$examination_array[$i][5], $examination_array[$i][5],
$examination_array[$i][6] $examination_array[$i][6]
); );
$customer = [
'strategy_customer' => '戰略客戶',
'general_customer' => '一般客戶'
];
//作番機種($elevator_type):客梯(passenger)、貨梯(cargo)、小電梯(dumbwaiter)、平台梯(flatbase)、強驅(positive_drive)
$elevator = [
"passenger" => "客梯",
"cargo" => "貨梯",
"dumbwaiter" => "小電梯",
"flatbase" => "平台踢",
"positive_drive" => "強驅"
];
echo "獎金版本:" . $result["ver"] . "<br>"; echo "獎金版本:" . $result["ver"] . "<br>";
echo "計算結果:" . $result["result_status"] . "<br>"; echo "計算結果:" . $result["result_status"] . "<br>";
echo "參數說明: " . $customer[$examination_array[$i][1]] . " 、 " . $elevator[$examination_array[$i][2]] . "、 作番表價:" . $examination_array[$i][3] . " 、 作番賣價: " . $examination_array[$i][4] . "、 營業員員工號:" . $examination_array[$i][5] . " 、 區域經理員工號:" . $examination_array[$i][6] . "<br>";
echo "輸入參數:" . $examination_array[$i][1] . " " . $examination_array[$i][2] . " " . $examination_array[$i][3] . " " . $examination_array[$i][4] . " " 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] . "<br>"; . $examination_array[$i][5] . " " . $examination_array[$i][6] . "<br>";
for($j = 0; $j<count($result["bonus_array"]); $j++){ for ($j = 0; $j < count($result["bonus_array"]); $j++) {
echo "輸出結果:" . $result["bonus_array"][$j]["bonus_type"] . " " . $result["bonus_array"][$j]["bonus_receiver"] . " " echo "輸出結果:" . $result["bonus_array"][$j]["bonus_type"] . " " . $result["bonus_array"][$j]["bonus_receiver"] . " "
. $result["bonus_array"][$j]["bonus_amount"] . " " . $result["bonus_array"][$j]["payment_schedul_due"] . " " . $result["bonus_array"][$j]["bonus_amount"] . " " . $result["bonus_array"][$j]["payment_schedul_due"] . " "
. $result["bonus_array"][$j]["payment_schedul_regulation"] . "<br>"; . $result["bonus_array"][$j]["payment_schedul_regulation"] . "<br>";
}; };
echo "-------------------------" . "<br>"; echo "-------------------------" . "<br>";
}; };
?>

2
wms/contract/api/T8api.php

@ -7,7 +7,7 @@ function T8salIncomeApply($data, $api_url)
// $api_url = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData'; // $api_url = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData';
$validation = get_Auth(); $validation = get_Auth();
// echo '<pre>'; // echo '<pre>';
// print_r(json_encode($data)); // print_r(json_encode($data, JSON_UNESCAPED_UNICODE));
// echo '</pre>'; // echo '</pre>';
$header = [ $header = [
"CHI_Authorization :" . $validation, "CHI_Authorization :" . $validation,

15
wms/contract/api/getContractData.php

@ -186,28 +186,13 @@ if (isset($_GET['contractno']) && $_GET['contractno'] != '' && isset($_GET['cont
foreach ($other_option_arr as $key => $option) { foreach ($other_option_arr as $key => $option) {
if ($option['item_qty'] == $result['item_qty']) { if ($option['item_qty'] == $result['item_qty']) {
$result['option_other_price'] += intval($option['item_unit_price']); $result['option_other_price'] += intval($option['item_unit_price']);
// echo '1..';
// echo "<pre>";
// print_r($option['item_unit_price']);
// echo "</pre>";
} else if ($option['item_qty'] / $result['item_qty'] != 1) { } else if ($option['item_qty'] / $result['item_qty'] != 1) {
$item_qty = intval($option['item_qty']) / intval($result['item_qty']); // 總option數量 / 總電梯台數 $item_qty = intval($option['item_qty']) / intval($result['item_qty']); // 總option數量 / 總電梯台數
$result['option_other_price'] += intval($option['item_unit_price']) * $item_qty; $result['option_other_price'] += intval($option['item_unit_price']) * $item_qty;
// echo '2..';
// echo "<pre>";
// print_r(intval($option['item_unit_price']) . ' *' . $item_qty . '=' . intval($option['item_unit_price']) * $item_qty);
// echo "</pre>";
} else { } else {
$result['option_other_price'] += $option['item_unit_price'] * intval($option['item_qty']); $result['option_other_price'] += $option['item_unit_price'] * intval($option['item_qty']);
// echo '
} }
// echo '<pre>';
// print_r($option['item_no'] . '--->' . $option['item_unit_price'] . '--->' . $option['item_qty']);
// echo '</pre>';
} }
// print_r($result['option_other_price']);
// exit();
} }

1
wms/contract/api/postContractData.php

@ -620,6 +620,7 @@ function T8insert($data, $facilityno, $depId)
"SPrice" => intval($elevator['sold_price']), "SPrice" => intval($elevator['sold_price']),
"SQuantity" => $SQuantity, "SQuantity" => $SQuantity,
"ProjectId" => "$contractno", "ProjectId" => "$contractno",
"FromBillNo" => "$contractno",
"CU_MaterialId" => "$facility_no", "CU_MaterialId" => "$facility_no",
"CU_EstPayDate" => intval($payDay) "CU_EstPayDate" => intval($payDay)
]; ];

761
wms/contract/api/postNewContractData.php

@ -1,10 +1,16 @@
<meta charset="UTF-8">
<?php <?php
// header("Content-Type: text/html; charset=utf-8");
// echo '你好';
// exit;
require_once("../conn.php"); require_once("../conn.php");
// include_once("../../fun_global.php");
include_once("./getFacilityNo.php"); include_once("./getFacilityNo.php");
include_once("./getComboNo.php"); include_once("./getComboNo.php");
include_once("./upload_chk.php"); include_once("./upload_chk.php");
ini_set('date.timezone', 'Asia/Taipei'); ini_set('date.timezone', 'Asia/Taipei');
if ($_SERVER['REQUEST_METHOD'] != 'POST') { if ($_SERVER['REQUEST_METHOD'] != 'POST') {
exit(); exit();
} }
@ -25,10 +31,13 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$qc = $_POST["qc"]; $qc = $_POST["qc"];
$contracttype = $_POST["contracttype"]; $contracttype = $_POST["contracttype"];
$elevators_nums = $_POST['nums']; $elevators_nums = $_POST['nums'];
$elevators = json_decode($_POST['elevators'], true); $area_no = $_POST['area_no'];
$elevators_detail_arr = json_decode($_POST['elevators_detail_arr'], true); $elevators = json_decode($_POST['elevators'], JSON_UNESCAPED_UNICODE);
$elevators_detail_arr = json_decode($_POST['elevators_detail_arr'], JSON_UNESCAPED_UNICODE);
// echo "<pre>";
// print_r($elevators_detail_arr);
// echo "</pre>";
// exit();
$files = !empty($_FILES['files']) ? $_FILES['files'] : null; $files = !empty($_FILES['files']) ? $_FILES['files'] : null;
$files_id = null; $files_id = null;
@ -67,19 +76,131 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$facilityno = $createFacilityNo->makeMFacilityNo('M', $arr, intval($elevators_nums)); $facilityno = $createFacilityNo->makeMFacilityNo('M', $arr, intval($elevators_nums));
echo json_encode($facilityno); echo json_encode($facilityno);
// $bonus_result = BounsCount($_POST, $conn, $facilityno); $bonus_result = BounsCount($_POST, $conn, $facilityno);
// if (!empty($bonus_result) && $bonus_result['status'] == "2") { if (!empty($bonus_result) && $bonus_result['status'] == "2") {
// $fail_arr[] = '獎金計算錯誤,請再檢查或連繫資訊人員'; $fail_arr[] = '獎金計算錯誤,請再檢查或連繫資訊人員';
// // header("HTTP/1.1 422 Unprocessable Entity"); // header("HTTP/1.1 422 Unprocessable Entity");
// echo json_encode($fail_arr, JSON_UNESCAPED_UNICODE); echo json_encode($fail_arr, JSON_UNESCAPED_UNICODE);
// exit(); exit();
// } }
T8Insert($_POST, $facilityno, $connT8); T8Insert($_POST, $facilityno, $connT8);
exit(); exit();
$conn->beginTransaction(); $conn->beginTransaction();
//create account table
$accounttype = "A";
$accountid = $vat;
$pwd = "123";
$name = $customer;
$tel = $lm_tel ?? '';
$sql = "INSERT INTO account (accounttype, accountid, pwd, name, tel, address, creater, create_at)
VALUES (:accounttype, :accountid, :pwd, :name, :tel, :address , :creater, :created_at)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':accounttype', $accounttype);
$stmt->bindParam(':accountid', $contractno);
$stmt->bindParam(':pwd', $pwd);
$stmt->bindParam(':name', $customer);
$stmt->bindParam(':tel', $tel);
$stmt->bindParam(':address', $address);
$stmt->bindParam(':creater', $created_by);
$stmt->bindParam(':created_at', $created_at);
$stmt->execute();
// exit();
//create table Wipwholestatus (作番大日程)
foreach ($elevators_detail_arr as $key => $value) {
$facilityno = $facilityno[$key]; // 作番
$weight = $value['item_weight']; // 載重
$person = $value['person']; // 人乘
$floor = $value['floor']; // 樓層
$open = $value['item_op']; // 開門方式
$speed = $value['speed']; //速度
$qc = $value['qc'];
$facility_kind = $value['spec']; //型號
$contract_arrival_date = $value['contract_arrival_date']; //到工地日期
$site_manager = $value['manage'];
$warehouseid = $value['warehouseid'];
$sql = "INSERT INTO Wipwholestatus
(contract_type,contractno,salesid,custom,accountid,site_manager,warehouseid,facilityno,weight,numberofpassenger,numberoffloor,opentype,speed,facility_kind,area_no,address,contract_arrival_date,real_contract_arrival_date,qc_official_type,creater,create_at) VALUES
('A',:contractno,:salesid,:custom,:accountid,:site_manager,:warehouseid,:facilityno,:weight,:numberofpassenger,:numberoffloor,:opentype,:speed,:facility_kind,:area_no,:address,:contract_arrival_date,:real_contract_arrival_date,:qc_official_type,:creater,:create_at)";
// $sql = "INSERT INTO Wipwholestatus
// (contract_type,contractno,salesid,custom,accountid,facilityno,weight,numberofpassenger,numberoffloor,opentype,speed,facility_kind,address,contract_arrival_date,qc_official_type,creater,create_at) VALUES
// ('A','$contractno','$salesman','$customer','$customer','$facilityno','$weight','$person','$floor','$open','$speed','$facility_kind','$address','$contract_arrival_date','$qc','$created_by','$created_at')";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':contractno', $contractno);
$stmt->bindParam(':salesid', $salesman);
$stmt->bindParam(':custom', $customer);
$stmt->bindParam(':accountid', $customer);
$stmt->bindParam(':site_manager', $site_manager);
$stmt->bindParam(':warehouseid', $warehouseid);
$stmt->bindParam(':facilityno', $facilityno);
$stmt->bindParam(':weight', $weight);
$stmt->bindParam(':numberofpassenger', $person);
$stmt->bindParam(':numberoffloor', $floor);
$stmt->bindParam(':opentype', $open);
$stmt->bindParam(':speed', $speed);
$stmt->bindParam(':facility_kind', $facility_kind);
$stmt->bindParam(':area_no', $area_no);
$stmt->bindParam(':address', $address);
$stmt->bindParam(':contract_arrival_date', $contract_arrival_date);
$stmt->bindParam(':real_contract_arrival_date', $contract_arrival_date);
$stmt->bindParam(':qc_official_type', $qc);
$stmt->bindParam(':creater', $created_by);
$stmt->bindParam(':create_at', $created_at);
$stmt->execute();
$lastId = $conn->lastInsertId();
// echo "<pre>";
// print_r($lastId);
// echo "</pre>";
if (!empty($lastId)) {
echo '123';
// 寫入待簽程狀態 A (營業)
do_wws_assign1($salesman, $lastId, 'A', $conn);
// // 寫入待簽程狀態 G (工務)
do_wws_assign1($warehouseid, $lastId, 'G', $conn);
}
// create table worksite (戰情室)
$latitude = $value['latitude'];
$longitude = $value['longitude'];
$sql = "INSERT INTO worksite
(latitude,longitude,facilitynum,facilityno,address,buildcompany,process,status,marchintotime,creater,create_at)VALUES
(:latitude,:longitude,'1',:facilityno,:address,:bulidcompany,'進行中','未工勘',:marchintotime,:creater,:create_at)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':latitude', $latitude);
$stmt->bindParam(':longitude', $longitude);
$stmt->bindParam(':facilityno', $facilityno);
$stmt->bindParam(':address', $address);
$stmt->bindParam(':bulidcompany', $customer);
$stmt->bindParam(':marchintotime', $contract_arrival_date);
$stmt->bindParam(':creater', $created_by);
$stmt->bindParam(':create_at', $created_at);
$stmt->execute();
// create table schedule
$contract_begin_date = '';
$contract_end_date = ''; // 一年
$comboNo = new CreateComboNo('em', $contract_begin_date, $contract_end_date);
$comboArr = json_decode($comboNo->getComboNo(), true);
foreach ($comboArr as $combo) {
$sql_str = 'INSERT INTO schedule (contractno, facilityno, combono, repairerid, repairername, duedate, creater, create_at) VALUES (:contractno, :facilityno, :combono, :repairerid, :repairername, :duedate, :creater, :create_at)';
$stmt = $conn->prepare($sql_str);
$stmt->bindParam(':contractno', $contractno);
$stmt->bindParam(':facilityno', $facility_no);
$stmt->bindParam(':combono', $combo[0]);
$stmt->bindParam(':repairerid', $repairerid);
$stmt->bindParam(':repairername', $repairername);
$stmt->bindParam(':duedate', $combo[1]);
$stmt->bindParam(':creater', $creater);
$stmt->bindParam(':create_at', $create_at);
$result = $stmt->execute();
}
}
$sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid ORDER BY create_at DESC"; $sql_str = "SELECT accountid, name FROM account WHERE accountid = :accountid ORDER BY create_at DESC";
$stmt = $conn->prepare($sql_str); $stmt = $conn->prepare($sql_str);
$stmt->bindParam(":accountid", $salesman); $stmt->bindParam(":accountid", $salesman);
@ -125,7 +246,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$stmt->bindParam(':file_size', $file['size']); $stmt->bindParam(':file_size', $file['size']);
$stmt->bindParam(':created_at', $created_at); $stmt->bindParam(':created_at', $created_at);
$stmt->bindParam(':created_by', $created_by); $stmt->bindParam(':created_by', $created_by);
// $stmt->execute(); $stmt->execute();
} else { } else {
throw new PDOException('檔案上傳失敗:' . $msg); throw new PDOException('檔案上傳失敗:' . $msg);
} }
@ -158,7 +279,7 @@ if (isset($_POST["contractno"]) && $_POST["contractno"] != "" && isset($_POST['c
$stmt->bindParam(":created_at", $created_at); $stmt->bindParam(":created_at", $created_at);
$stmt->bindParam(":created_by", $created_by); $stmt->bindParam(":created_by", $created_by);
$stmt->bindParam(":qc", $qc); $stmt->bindParam(":qc", $qc);
// $stmt->execute(); $stmt->execute();
$result = $conn->commit(); $result = $conn->commit();
@ -194,6 +315,15 @@ function T8Insert($data, $facilityno, $connT8)
$createTime = str_replace('-', '', $createAt); $createTime = str_replace('-', '', $createAt);
$signing_date = intval(str_replace("-", '', $data['signing_date'])); //簽訂日期 $signing_date = intval(str_replace("-", '', $data['signing_date'])); //簽訂日期
// echo // echo
// $pay_kind = [
// '1' => '簽約',
// '2' => '二次款',
// '3' => '貨抵工地',
// '4' => '材料其他',
// '5' => '試車完工', //安裝完畢
// '6' => '交車' //交車
// ];
$pay_kind = [ $pay_kind = [
'1' => '簽約', '1' => '簽約',
'2' => '二次款', '2' => '二次款',
@ -228,7 +358,6 @@ function T8Insert($data, $facilityno, $connT8)
$stmt->bindParam(':TaxNo', $vat); $stmt->bindParam(':TaxNo', $vat);
$stmt->bindParam(':EnterpriseName', $partyA); //企業名稱 $stmt->bindParam(':EnterpriseName', $partyA); //企業名稱
$stmt->bindParam(':ContactAddress', $partyAaddress); $stmt->bindParam(':ContactAddress', $partyAaddress);
// $stmt->bindParam(':EMail', $email);
$stmt->bindParam(':CreatorId', $user_id); $stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime); $stmt->bindParam(':CreateTime', $createTime);
$stmt->execute(); $stmt->execute();
@ -236,8 +365,8 @@ function T8Insert($data, $facilityno, $connT8)
$sql = "INSERT INTO comCustomer $sql = "INSERT INTO comCustomer
(OrgId,BizPartnerTypeId,CurrId,BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime,InvoiceId) (OrgId,BizPartnerTypeId,ConditionId,CurrId,BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime,InvoiceId)
VALUES('1000','10','TWD',:BizPartnerId,:PersonId,:CreatorId,1,:InvoiceAddress,:CreateTime,'35')"; VALUES('1000','10','TWD','0008',:BizPartnerId,:PersonId,:CreatorId,1,:InvoiceAddress,:CreateTime,'35')";
// $sql = "INSERT INTO comCustomer // $sql = "INSERT INTO comCustomer
// (OrgId,BizPartnerTypeId,CurrId,BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime,InvoiceId) // (OrgId,BizPartnerTypeId,CurrId,BizPartnerId,PersonId,CreatorId,IsInUsed,InvoiceAddress,CreateTime,InvoiceId)
// VALUES('1000','10','TWD','$contractno','$salesman','$user_id',1,'$partyAaddress','$createTime','35')"; // VALUES('1000','10','TWD','$contractno','$salesman','$user_id',1,'$partyAaddress','$createTime','35')";
@ -253,6 +382,7 @@ function T8Insert($data, $facilityno, $connT8)
// // 若客戶資料不為空,更新該客戶資訊。 // // 若客戶資料不為空,更新該客戶資訊。
$sql = "UPDATE comCustomer SET $sql = "UPDATE comCustomer SET
PersonId=:PersonId, PersonId=:PersonId,
ConditionId='0008',
InvoiceAddress=:InvoiceAddress, InvoiceAddress=:InvoiceAddress,
LastOperatorId=:LastOperatorId, LastOperatorId=:LastOperatorId,
LastOperateTime=:LastOperateTime LastOperateTime=:LastOperateTime
@ -306,176 +436,208 @@ function T8Insert($data, $facilityno, $connT8)
$stmt->bindParam(':CreatorId', $user_id); $stmt->bindParam(':CreatorId', $user_id);
$stmt->execute(); $stmt->execute();
} }
$sql = "SELECT * FROM salSalesOrder WHERE BillNo = :BillNo";
foreach ($elevators as $index => $elevator) { $stmt = $connT8->prepare($sql);
$count = 1; $stmt->bindParam(':BillNo', $contractno);
// 產品集成維護 $contractT8 = $stmt->fetch(PDO::FETCH_ASSOC);
$facility_no = $facilityno[$index]; if (empty($contractT8)) {
$MaterialName = "$partyA($facility_no)"; foreach ($elevators as $index => $elevator) {
$sql = "INSERT INTO comMaterial $count = 1;
// 產品集成維護
$facility_no = $facilityno[$index];
$MaterialName = "$partyA($facility_no)";
$contract_arrival_a = $elevator['contract_arrival_date'];
$sql = "INSERT INTO comMaterial
(FOrgid,MaterialId,MaterialTypeId,MaterialCategoryId,CreatorId,CreateTime,IsInUsed) (FOrgid,MaterialId,MaterialTypeId,MaterialCategoryId,CreatorId,CreateTime,IsInUsed)
VALUES ('1000',:MaterialId,'10','A',:CreatorId,:CreateTime,1)"; VALUES ('1000',:MaterialId,'10','A',:CreatorId,:CreateTime,1)";
$stmt = $connT8->prepare($sql); $stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facility_no); $stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':CreatorId', $user_id); $stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime); $stmt->bindParam(':CreateTime', $createTime);
$stmt->execute(); $stmt->execute();
$sql = "INSERT INTO comMaterialGroup $sql = "INSERT INTO comMaterialGroup
(MaterialTypeId,MaterialId,MaterialName,MaterialCategoryId,IsInUsed,UnitId,CreatorId,CreateTime) (MaterialTypeId,MaterialId,MaterialName,MaterialCategoryId,IsInUsed,UnitId,CreatorId,CreateTime)
VALUES ('10',:MaterialId,:MaterialName,'A',1,'SET',:CreatorId,:CreateTime)"; VALUES ('10',:MaterialId,:MaterialName,'A',1,'SET',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql); $stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facility_no); $stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':MaterialName', $MaterialName); $stmt->bindParam(':MaterialName', $MaterialName);
$stmt->bindParam(':CreatorId', $user_id); $stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime); $stmt->bindParam(':CreateTime', $createTime);
$stmt->execute(); $stmt->execute();
$sql = "INSERT INTO comMaterialPurchases $sql = "INSERT INTO comMaterialPurchases
(Orgid,MaterialTypeId,MaterialId,CurrId,SUnitId,TaxId,CreatorId,CreateTime) (Orgid,MaterialTypeId,MaterialId,CurrId,SUnitId,TaxId,CreatorId,CreateTime)
VALUES ('1000','10',:MaterialId,'TWD','SET','ST005',:CreatorId,:CreateTime)"; VALUES ('1000','10',:MaterialId,'TWD','SET','ST005',:CreatorId,:CreateTime)";
$stmt = $connT8->prepare($sql); $stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facility_no); $stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':CreatorId', $user_id); $stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime); $stmt->bindParam(':CreateTime', $createTime);
$stmt->execute(); $stmt->execute();
$sql = "INSERT INTO plsMaterialPlanData $sql = "INSERT INTO plsMaterialPlanData
(PlanRangeId,MaterialId,FOrgId,MaterialTypeId,CreatorId,CreateTime,DefaultDemandOrg) VALUES (PlanRangeId,MaterialId,FOrgId,MaterialTypeId,CreatorId,CreateTime,DefaultDemandOrg) VALUES
(1000,:MaterialId,1000,10,:CreatorId,:CreateTime,1000) (1000,:MaterialId,1000,10,:CreatorId,:CreateTime,1000)
"; ";
$stmt = $connT8->prepare($sql); $stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facility_no); $stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':CreatorId', $user_id); $stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime); $stmt->bindParam(':CreateTime', $createTime);
$stmt->execute(); $stmt->execute();
$sql = "INSERT INTO comMaterialSales $sql = "INSERT INTO comMaterialSales
(OrgId,MAterialTypeId,MaterialId,CurrId,SUnitId,SupplyOrgId,CreatorId,CreateTime,IsInUsed) VALUES (OrgId,MAterialTypeId,MaterialId,CurrId,SUnitId,SupplyOrgId,CreatorId,CreateTime,IsInUsed) VALUES
(1000,10,:MaterialId,'TWD','SET',1000,:CreatorId,:CreateTime,1) (1000,10,:MaterialId,'TWD','SET',1000,:CreatorId,:CreateTime,1)
"; ";
$stmt = $connT8->prepare($sql); $stmt = $connT8->prepare($sql);
$stmt->bindParam(':MaterialId', $facility_no); $stmt->bindParam(':MaterialId', $facility_no);
$stmt->bindParam(':CreatorId', $user_id); $stmt->bindParam(':CreatorId', $user_id);
$stmt->bindParam(':CreateTime', $createTime); $stmt->bindParam(':CreateTime', $createTime);
$stmt->execute(); $stmt->execute();
// 階段收款資訊
$salOrderStagePay_row = [];
$equipment_total = 0;
$install_total = 0;
$equipment_total = $pay_arr['equipment_total'];
$install_total = $pay_arr['install_total'];
$count_a = 0;
$count_month = 1;
foreach ($pay_arr['elevotor_pay_detail'] as $key => $detail) {
if ($detail['kind'] == 3) {
$PlanPayDate = $contract_arrival_a;
} else if ($detail['kind'] > 3) {
$PlanPayDate = date("Y-m-d", strtotime($contract_arrival_a . '+' . $count_month . ' month'));
$count_month++;
} else {
$PlanPayDate = $signing_date;
$count_a++;
if ($count_a == 1) {
$PlanPayDate = date("Y-m-d", strtotime($signing_date . '+' . $count_a . ' month'));
}
}
$contract_arrival_date = intval(str_replace("-", '', $PlanPayDate)); //貨到工地日
$PayStage = $pay_kind[$detail['kind']];
$PlanPercentage = intval($detail['pay_scale']) / 100;
$rows = [
"PayStage" => "$PayStage", //收款階段
"PlanPercentage" => $PlanPercentage, //計劃收款比例(%)
"PlanPayAmt" => $detail['amount'], //計劃收款金額
"PlanPayDate" => $contract_arrival_date, //計劃收款日期 1.第一筆都是簽約日
"BillNo" => "$contractno",
"RowCode" => $key + 1,
"RowNo" => $key + 1,
"UnWriteOffOAmount" => $detail['amount'] //未核銷金額
];
$salOrderStagePay_row[] = $rows;
}
// 階段收款資訊 // 設備
$salOrderStagePay_row = []; $row1 = [
$equipment_total = 0; "TaxId" => "ST005",
$install_total = 0; "RequirementDate" => $signing_date, //出貨日期
$equipment_total = $pay_arr['equipment_total']; "ConsignmentDate" => $signing_date, //發貨日期
$install_total = $pay_arr['install_total']; "BillNo" => "$contractno", //合約號
foreach ($pay_arr['elevotor_pay_detail'] as $key => $detail) { "RowCode" => $count, //全部筆數排列
$PayStage = $pay_kind[$detail['kind']]; "ItemType" => 1,
$PlanPercentage = intval($detail['pay_scale']) / 100; "MaterialId" => "A40001", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
$rows = [ "SUnitId" => "SET",
"PayStage" => "$PayStage", //收款階段 "SQuantity" => 1, //交易數量
"PlanPercentage" => $PlanPercentage, //計劃收款比例(%) "SPrice" => $equipment_total, //交易價格
"PlanPayAmt" => $detail['amount'], //計劃收款金額 "CU_MaterialId" => $facility_no
"PlanPayDate" => 20240101, //計劃收款日期 1.第一筆都是簽約日 ];
"BillNo" => "$contractno", $count++;
"RowCode" => $key + 1, // 安裝
"RowNo" => $key + 1, $row2 = [
"UnWriteOffOAmount" => $detail['amount'] //未核銷金額 "TaxId" => "ST005",
"RequirementDate" => $signing_date, //出貨日期
"ConsignmentDate" => $signing_date, //發貨日期
"BillNo" => "$contractno", //合約號
"RowCode" => $count, //全部筆數排列
"ItemType" => 1,
"MaterialId" => "A40008", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
"SUnitId" => "SET",
"SQuantity" => 1, //交易數量
"SPrice" => $install_total, //交易價格
"CU_MaterialId" => $facility_no
]; ];
$salOrderStagePay_row[] = $rows; $count++;
// 產品(作番)
$row3 = [
"TaxId" => "ST005",
"RequirementDate" => $signing_date, //出貨日期
"ConsignmentDate" => $signing_date, //發貨日期
"BillNo" => "$contractno", //合約號
"RowCode" => $count, //全部筆數排列
"ItemType" => 0,
"MaterialId" => "$facility_no", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
"SUnitId" => "SET",
"SQuantity" => 1, //交易數量
"SPrice" => 0, //交易價格
"CU_MaterialId" => $facility_no // 歸屬作番號
];
$count++;
$SubOrder_row[] = $row1;
$SubOrder_row[] = $row2;
$SubOrder_row[] = $row3;
$count++;
} }
$MainSalesOrder_row = [
// 設備 "BillNo" => "$contractno", //合約單號
$row1 = [ "BillDate" => $signing_date, //簽約日期
"TypeId" => "SO", //
"FOrgId" => "1000",
"OrgId" => "1000",
"ModeId" => "M", // T汰改 M新梯
"BizPartnerId" => "$contractno", //客戶代碼
"CurrId" => "TWD",
"CurrOAmount" => 1,
"CurrLAmount" => 1,
"PersonId" => "$salesman", //業務人員
"DueToId" => "$contractno", //債務方
"TradeConditionId" => "",
"TaxId" => "ST005", "TaxId" => "ST005",
"RequirementDate" => $signing_date, //出貨日期 "CreditorCompId" => "1001",
"ConsignmentDate" => $signing_date, //發貨日期 "CreditorOrgId" => "1000",
"BillNo" => "$contractno", //合約號 "CreatorId" => "$user_id"
"RowCode" => $count, //全部筆數排列 // "CompId" => "1001",
"ItemType" => 1, // "CreditorCurrOAmount" => 1,
"MaterialId" => "A40001", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番) // "CreditorCurrLAmount" => 1
"SUnitId" => "SET",
"SQuantity" => 1, //交易數量
"SPrice" => $equipment_total //交易價格
]; ];
$count++; $MainSalesOrder = [
// 安裝 "name" => "MainSalesOrder",
$row2 = [ 'rows' => [$MainSalesOrder_row]
"TaxId" => "ST005",
"RequirementDate" => $signing_date, //出貨日期
"ConsignmentDate" => $signing_date, //發貨日期
"BillNo" => "$contractno", //合約號
"RowCode" => $count, //全部筆數排列
"ItemType" => 1,
"MaterialId" => "A40008", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
"SUnitId" => "SET",
"SQuantity" => 1, //交易數量
"SPrice" => $install_total //交易價格
]; ];
$count++; $SubOrder = [
// 產品(作番) "name" => "SubOrder",
$row3 = [ "rows" => $SubOrder_row
"TaxId" => "ST005", ];
"RequirementDate" => $signing_date, //出貨日期 $salOrderStagePay = [
"ConsignmentDate" => $signing_date, //發貨日期 "name" => "salOrderStagePay",
"BillNo" => "$contractno", //合約號 "rows" => $salOrderStagePay_row
"RowCode" => $count, //全部筆數排列
"ItemType" => 0,
"MaterialId" => "$facility_no", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
"SUnitId" => "SET",
"SQuantity" => 1, //交易數量
"SPrice" => 0 //交易價格
]; ];
$count++;
$SubOrder_row[] = $row1;
$SubOrder_row[] = $row2;
$SubOrder_row[] = $row3;
$count++;
}
$MainSalesOrder_row = [
"BillNo" => "$contractno", //合約單號
"BillDate" => $signing_date, //簽約日期
"TypeId" => "SO", //
"FOrgId" => "1000",
"OrgId" => "1000",
"ModeId" => "M", // T汰改 M新梯
"BizPartnerId" => "$contractno", //客戶代碼
"CurrId" => "TWD",
"CurrOAmount" => 1,
"CurrLAmount" => 1,
"PersonId" => "$user_id", //業務人員
"DueToId" => "$contractno", //債務方
"TradeConditionId" => "",
"TaxId" => "ST005",
"CreditorCompId" => "1001",
"CreditorOrgId" => "1000",
// "CompId" => "1001",
// "CreditorCurrOAmount" => 1,
// "CreditorCurrLAmount" => 1
];
$MainSalesOrder = [
"name" => "MainSalesOrder",
'rows' => [$MainSalesOrder_row]
];
$SubOrder = [
"name" => "SubOrder",
"rows" => $SubOrder_row
];
$salOrderStagePay = [
"name" => "salOrderStagePay",
"rows" => [$salOrderStagePay_row]
];
$API_body = []; $API_body = [];
$API_body[] = $MainSalesOrder; $API_body[] = $MainSalesOrder;
$API_body[] = $SubOrder; $API_body[] = $SubOrder;
$API_body[] = $salOrderStagePay; $API_body[] = $salOrderStagePay;
echo "<pre>"; echo "<pre>";
print_r(json_encode($API_body, JSON_UNESCAPED_UNICODE)); print_r(json_encode($API_body, JSON_UNESCAPED_UNICODE));
echo "</pre>"; echo "</pre>";
$api_url = "https://erp.masada.com.tw:780/twWebAPI/V1/SALSALESORDER/PostERPData"; $api_url = "https://erp.masada.com.tw:780/twWebAPI/V1/SALSALESORDER/PostERPData";
$result = T8salIncomeApply($API_body, $api_url); $result = T8salIncomeApply($API_body, $api_url);
echo "<pre>"; // echo "<pre>";
print_r($result); // print_r($result);
echo "</pre>"; // echo "</pre>";
if ($result['Status'] == 'Fails' || $result['Status'] == 'Error') {
echo $result['ErrorMsg'];
}
} else {
echo '資料已新增過,請洽資訊人員';
}
$connT8->commit(); $connT8->commit();
} catch (PDOException $e) { } catch (PDOException $e) {
$connT8->rollback(); $connT8->rollback();
@ -487,153 +649,168 @@ function T8Insert($data, $facilityno, $connT8)
function BounsCount($data, $conn, $facilityno) function BounsCount($data, $conn, $facilityno)
{ {
// echo '<pre>'; try {
// print_r($facilityno); require_once("../../bonus/elevator_new/elevator_new_deal_bonus.php");
// echo '</pre>'; $dailyNecessities = [
// exit; 'MAE100' => 'passenger', //小機房
require_once("../../bonus/elevator_new/elevator_new_deal_bonus.php"); 'MAM200' => 'passenger', //無機房
$dailyNecessities = [ 'MAH100' => 'dumbwaiter', //小電梯
'MAE100' => 'passenger', //小機房 'MAQ100' => 'positive_drive', //強趨梯
'MAM200' => 'passenger', //無機房 'MAF100' => 'cargo', //貨梯
'MAH100' => 'dumbwaiter', //小電梯 'MAP100' => 'flatbase', // 平台踢
'MAQ100' => 'positive_drive', //強趨梯 ];
'MAF100' => 'cargo', //貨梯 $contractType = [
'MAP100' => 'flatbase', // 平台踢 '1' => 'strategy_customer',
]; '2' => 'general_customer'
$contractType = [ ];
'1' => 'strategy_customer', $signing_date = $data['signing_date'];
'2' => 'general_customer' $bonus_v1_0_date = '2024-01-02';
]; $bonus_v2_0_date = '2024-01-03';
$signing_date = $data['signing_date']; $contract_type = $data['contract_type'];
$bonus_v1_0_date = '2024-01-02'; $total = $data['price_total'];
$bonus_v2_0_date = '2024-01-03'; $type = $contractType[$contract_type]; //戰略客戶 or 一般客戶
$contract_type = $data['contract_type']; // $elevator_knockdown_price = $data['price_total']; //受價總額
$total = $data['price_total']; $elevators = json_decode($data['elevators_detail_arr'], true);
$type = $contractType[$contract_type]; //戰略客戶 or 一般客戶 $contract_no = $data['contractno'];
// $elevator_knockdown_price = $data['price_total']; //受價總額 $salesman = $data['salesman'];
$elevators = json_decode($data['elevators_detail_arr'], true); $manager = $data['manager'];
$contract_no = $data['contractno']; $contract_kind = 1;
$salesman = $data['salesman']; $create_id = $data['user_id'];
$manager = $data['manager']; $create_at = date("Y-m-d H:i:s");
$contract_kind = 1; $status = 1;
$create_id = $data['user_id'];
$create_at = date("Y-m-d H:i:s");
$status = 1;
$result_bonus = [];
$result_bonus_arr = [];
if ($signing_date <= $bonus_v1_0_date) {
$result_bonus = []; $ver = '1.0';
$result_bonus_arr = []; foreach ($elevators as $key => $elevator) {
if ($signing_date <= $bonus_v1_0_date) {
$ver = '1.0'; $elevator_knockdown_price = $elevator['elevator_price']; // 單台電梯售價
foreach ($elevators as $key => $elevator) { $elevator_list_price = $elevator['option_other_price'] + $elevator['option_price'] + $elevator['elevator_price']; //牌價
$result_bonus = elevator_new_deal_bonus_v1_0($ver, $type, $elevator_knockdown_price, $salesman, $manager);
$elevator_knockdown_price = $elevator['elevator_price']; // 單台電梯售價 $facility_no = $facilityno[$key];
$elevator_list_price = $elevator['option_other_price'] + $elevator['option_price'] + $elevator['elevator_price']; //牌價 $bonus_json = [
$result_bonus = elevator_new_deal_bonus_v1_0($ver, $type, $elevator_knockdown_price, $salesman, $manager); 'contract_type' => $type,
$facility_no = $facilityno[$key]; 'total' => $elevator_list_price,
$bonus_json = [ 'fee_per_st' => $elevator_knockdown_price
'contract_type' => $type, ];
'total' => $elevator_list_price,
'fee_per_st' => $elevator_knockdown_price
];
if (!empty($result_bonus)) { if (!empty($result_bonus)) {
if ($result_bonus['result_status'] != "error") { if ($result_bonus['result_status'] != "error") {
foreach ($result_bonus['bonus_array'] as $i => $result) { foreach ($result_bonus['bonus_array'] as $i => $result) {
$bonus_type = explode('-', $result['bonus_type']); $bonus_type = explode('-', $result['bonus_type']);
$pay_man_type = $bonus_type[0]; //發放類別 $pay_man_type = $bonus_type[0]; //發放類別
$bonus_kind = $bonus_type[1]; $bonus_kind = $bonus_type[1];
$amount = $result['bonus_amount']; //獎金水庫 $amount = $result['bonus_amount']; //獎金水庫
$bonus_receiver = $result['bonus_receiver']; //發放人員 $bonus_receiver = $result['bonus_receiver']; //發放人員
$bonus_json['payment_schedul_due'] = $result['payment_schedul_due']; $bonus_json['payment_schedul_due'] = $result['payment_schedul_due'];
$bonus_json['payment_schedul_regulation'] = $result['payment_schedul_regulation']; $bonus_json['payment_schedul_regulation'] = $result['payment_schedul_regulation'];
$bonus_json['bonus_kind'] = $bonus_kind; $bonus_json['bonus_kind'] = $bonus_kind;
$a = json_encode($bonus_json, JSON_UNESCAPED_UNICODE); $a = json_encode($bonus_json, JSON_UNESCAPED_UNICODE);
$sql = "INSERT INTO bonus $sql = "INSERT INTO bonus
(bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,status,bonus_json,create_id,create_at) VALUES (bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,status,bonus_json,create_id,create_at) VALUES
($pay_man_type,'$ver','$contract_no',$contract_kind,'$facility_no',$amount,'$bonus_receiver',$status,'$a','$create_id','$create_at') ($pay_man_type,'$ver','$contract_no',$contract_kind,'$facility_no',$amount,'$bonus_receiver',$status,'$a','$create_id','$create_at')
"; ";
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$stmt->execute(); $stmt->execute();
}
$request = [
"status" => "1",
"data" => "Success"
];
return $request;
} }
$request = [ $request = [
"status" => "1", "status" => "2",
"data" => "Success" "data" => "create_bonus_error"
]; ];
return $request; return $request;
} }
$request = [
"status" => "2",
"data" => "create_bonus_error"
];
return $request;
} }
} } else if ($signing_date >= $bonus_v2_0_date) {
} else if ($signing_date >= $bonus_v2_0_date) { $ver = '2.0';
$ver = '2.0'; foreach ($elevators as $key => $elevator) {
foreach ($elevators as $key => $elevator) { $option_other_price = !empty($elevator['option_other_price']) ? intval($elevator['option_other_price']) : 0;
$elevator_type = $dailyNecessities[$elevator['spec']]; $elevator_type = $dailyNecessities[$elevator['spec']];
$elevator_list_price = $elevator['option_other_price'] + $elevator['option_price'] + $elevator['elevator_price']; $elevator_list_price = $option_other_price + $elevator['option_price'] + $elevator['elevator_price'];
$elevator_knockdown_price = $elevator['elevator_price']; $elevator_knockdown_price = $elevator['elevator_price'];
$commission_fee = $elevator['commission_fee']; $commission_fee = $elevator['commission_fee'];
$result_bonus = elevator_new_deal_bonus_v2_0( $result_bonus = elevator_new_deal_bonus_v2_0(
$ver, $ver,
$type, $type,
$elevator_type, $elevator_type,
$elevator_list_price, $elevator_list_price,
$elevator_knockdown_price, $elevator_knockdown_price,
$salesman, $salesman,
$manager $manager
); );
// echo '<pre>'; // echo '<pre>';
// print_r($result_bonus); // print_r($result_bonus);
// echo '</pre>'; // echo '</pre>';
$facility_no = $facilityno[$key]; $facility_no = $facilityno[$key];
$bonus_json = [ $bonus_json = [
'contract_type' => $type, 'contract_type' => $type,
'total' => $elevator_list_price, 'total' => $elevator_list_price,
'fee_per_st' => $elevator_knockdown_price 'fee_per_st' => $elevator_knockdown_price
]; ];
if (!empty($result_bonus)) { if (!empty($result_bonus)) {
if ($result_bonus['result_status'] != "error") { if ($result_bonus['result_status'] != "error") {
foreach ($result_bonus['bonus_array'] as $i => $result) { foreach ($result_bonus['bonus_array'] as $i => $result) {
$bonus_type = explode('-', $result['bonus_type']); $bonus_type = explode('-', $result['bonus_type']);
$pay_man_type = $bonus_type[0]; //發放類別 $pay_man_type = $bonus_type[0]; //發放類別
$bonus_kind = $bonus_type[1]; $bonus_kind = $bonus_type[1];
$amount = $result['bonus_amount']; //獎金水庫 $amount = $result['bonus_amount']; //獎金水庫
$bonus_receiver = $result['bonus_receiver']; //發放人員 $bonus_receiver = $result['bonus_receiver']; //發放人員
$bonus_json['payment_schedul_due'] = $result['payment_schedul_due']; $bonus_json['payment_schedul_due'] = $result['payment_schedul_due'];
$bonus_json['payment_schedul_regulation'] = $result['payment_schedul_regulation']; $bonus_json['payment_schedul_regulation'] = $result['payment_schedul_regulation'];
$bonus_json['bonus_kind'] = $bonus_kind; $bonus_json['bonus_kind'] = $bonus_kind;
$a = json_encode($bonus_json, JSON_UNESCAPED_UNICODE); $a = json_encode($bonus_json, JSON_UNESCAPED_UNICODE);
$sql = "INSERT INTO bonus $sql = "INSERT INTO bonus
(bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,status,bonus_json,create_id,create_at) VALUES (bonus_type,bonus_verson,contract_no,contract_type,facility_no,amount,receiver,status,bonus_json,create_id,create_at) VALUES
($pay_man_type,'$ver','$contract_no',$contract_kind,'$facility_no',$amount,'$bonus_receiver',$status,'$a','$create_id','$create_at') ($pay_man_type,'$ver','$contract_no',$contract_kind,'$facility_no',$amount,'$bonus_receiver',$status,'$a','$create_id','$create_at')
"; ";
$stmt = $conn->prepare($sql); $stmt = $conn->prepare($sql);
$stmt->execute(); $stmt->execute();
}
} }
$request = [
"status" => "1",
"data" => "Success"
];
} else {
$request = [
"status" => "2",
"data" => "create_bonus_error"
];
} }
$request = [
"status" => "1",
"data" => "Success"
];
} else {
$request = [
"status" => "2",
"data" => "create_bonus_error"
];
} }
} }
} return $request;
return $request;
try {
} catch (PDOException $e) { } catch (PDOException $e) {
header("HTTP/1.1 500 Internal Server Error"); header("HTTP/1.1 500 Internal Server Error");
die('Error!:' . $e->getMessage()); die('Error!:' . $e->getMessage());
} }
} }
function do_wws_assign1($user_id, $form_id, $flow_code, $conn)
{
$tds = date("Y-m-d H:i:s");
$sql = "select appwms.nextval('form_key') form_key";
$stmt = $conn->prepare($sql);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
$form_key = $result['form_key'];
$sql = "INSERT INTO flow (system_id, flow_id, form_key, form_id,flow_code) VALUES ('wws', 'wws01', '$form_key', '$form_id','$flow_code');";
$stmt = $conn->prepare($sql);
$stmt->execute();
$sql = "INSERT INTO subflow (form_key, seq, current_assigner, create_date) VALUES ('$form_key', '1', '$user_id', '$tds');";
$stmt = $conn->prepare($sql);
$stmt->execute();
}

407
wms/contract/api/test copy.json

@ -3,22 +3,23 @@
"name": "MainSalesOrder", "name": "MainSalesOrder",
"rows": [ "rows": [
{ {
"BillNo": "M24020076", "BillNo": "M23110121",
"BillDate": 20240305, "BillDate": 20240313,
"TypeId": "SO", "TypeId": "SO",
"FOrgId": "1000", "FOrgId": "1000",
"OrgId": "1000", "OrgId": "1000",
"ModeId": "M", "ModeId": "M",
"BizPartnerId": "M24020076", "BizPartnerId": "M23110121",
"CurrId": "TWD", "CurrId": "TWD",
"CurrOAmount": 1, "CurrOAmount": 1,
"CurrLAmount": 1, "CurrLAmount": 1,
"PersonId": "M0225", "PersonId": "M0042",
"DueToId": "M24020076", "DueToId": "M23110121",
"TradeConditionId": "", "TradeConditionId": "",
"TaxId": "ST005", "TaxId": "ST005",
"CreditorCompId": "1001", "CreditorCompId": "1001",
"CreditorOrgId": "1000" "CreditorOrgId": "1000",
"CreatorId": "M0225"
} }
] ]
}, },
@ -27,87 +28,371 @@
"rows": [ "rows": [
{ {
"TaxId": "ST005", "TaxId": "ST005",
"RequirementDate": 20240305, "RequirementDate": 20240313,
"ConsignmentDate": 20240305, "ConsignmentDate": 20240313,
"BillNo": "M24020076", "BillNo": "M23110121",
"RowCode": 1, "RowCode": 1,
"ItemType": 1, "ItemType": 1,
"MaterialId": "A40001", "MaterialId": "A40001",
"SUnitId": "SET", "SUnitId": "SET",
"SQuantity": 1, "SQuantity": 1,
"SPrice": 910000 "SPrice": 3904000,
"CU_MaterialId": "4MH00836"
}, },
{ {
"TaxId": "ST005", "TaxId": "ST005",
"RequirementDate": 20240305, "RequirementDate": 20240313,
"ConsignmentDate": 20240305, "ConsignmentDate": 20240313,
"BillNo": "M24020076", "BillNo": "M23110121",
"RowCode": 2, "RowCode": 2,
"ItemType": 1, "ItemType": 1,
"MaterialId": "A40008", "MaterialId": "A40008",
"SUnitId": "SET", "SUnitId": "SET",
"SQuantity": 1, "SQuantity": 1,
"SPrice": 390000 "SPrice": 976000,
"CU_MaterialId": "4MH00836"
}, },
{ {
"TaxId": "ST005", "TaxId": "ST005",
"RequirementDate": 20240305, "RequirementDate": 20240313,
"ConsignmentDate": 20240305, "ConsignmentDate": 20240313,
"BillNo": "M24020076", "BillNo": "M23110121",
"RowCode": 3, "RowCode": 3,
"ItemType": 0, "ItemType": 0,
"MaterialId": "4MW00705", "MaterialId": "4MH00836",
"SUnitId": "SET", "SUnitId": "SET",
"SQuantity": 1, "SQuantity": 1,
"SPrice": 0 "SPrice": 0,
"CU_MaterialId": "4MH00836"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 1,
"ItemType": 1,
"MaterialId": "A40001",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 3904000,
"CU_MaterialId": "4MH00837"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 2,
"ItemType": 1,
"MaterialId": "A40008",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 976000,
"CU_MaterialId": "4MH00837"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 3,
"ItemType": 0,
"MaterialId": "4MH00837",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 0,
"CU_MaterialId": "4MH00837"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 1,
"ItemType": 1,
"MaterialId": "A40001",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 3904000,
"CU_MaterialId": "4MH00838"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 2,
"ItemType": 1,
"MaterialId": "A40008",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 976000,
"CU_MaterialId": "4MH00838"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 3,
"ItemType": 0,
"MaterialId": "4MH00838",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 0,
"CU_MaterialId": "4MH00838"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 1,
"ItemType": 1,
"MaterialId": "A40001",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 3904000,
"CU_MaterialId": "4MH00839"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 2,
"ItemType": 1,
"MaterialId": "A40008",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 976000,
"CU_MaterialId": "4MH00839"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 3,
"ItemType": 0,
"MaterialId": "4MH00839",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 0,
"CU_MaterialId": "4MH00839"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 1,
"ItemType": 1,
"MaterialId": "A40001",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 3904000,
"CU_MaterialId": "4MH00840"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 2,
"ItemType": 1,
"MaterialId": "A40008",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 976000,
"CU_MaterialId": "4MH00840"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 3,
"ItemType": 0,
"MaterialId": "4MH00840",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 0,
"CU_MaterialId": "4MH00840"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 1,
"ItemType": 1,
"MaterialId": "A40001",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 3904000,
"CU_MaterialId": "4MH00841"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 2,
"ItemType": 1,
"MaterialId": "A40008",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 976000,
"CU_MaterialId": "4MH00841"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 3,
"ItemType": 0,
"MaterialId": "4MH00841",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 0,
"CU_MaterialId": "4MH00841"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 1,
"ItemType": 1,
"MaterialId": "A40001",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 3904000,
"CU_MaterialId": "4MH00842"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 2,
"ItemType": 1,
"MaterialId": "A40008",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 976000,
"CU_MaterialId": "4MH00842"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 3,
"ItemType": 0,
"MaterialId": "4MH00842",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 0,
"CU_MaterialId": "4MH00842"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 1,
"ItemType": 1,
"MaterialId": "A40001",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 3904000,
"CU_MaterialId": "4MH00843"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 2,
"ItemType": 1,
"MaterialId": "A40008",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 976000,
"CU_MaterialId": "4MH00843"
},
{
"TaxId": "ST005",
"RequirementDate": 20240313,
"ConsignmentDate": 20240313,
"BillNo": "M23110121",
"RowCode": 3,
"ItemType": 0,
"MaterialId": "4MH00843",
"SUnitId": "SET",
"SQuantity": 1,
"SPrice": 0,
"CU_MaterialId": "4MH00843"
} }
] ]
}, },
{ {
"name": "salOrderStagePay", "name": "salOrderStagePay",
"rows": [ "rows": [
[ {
{ "PayStage": "簽約",
"PayStage": "簽約", "PlanPercentage": 0.2,
"PlanPercentage": 0.2, "PlanPayAmt": 976000,
"PlanPayAmt": 260000, "PlanPayDate": 20240413,
"PlanPayDate": 20240101, "BillNo": "M23110121",
"BillNo": "M24020076", "RowCode": 1,
"RowCode": 0, "RowNo": 1,
"RowNo": 0, "UnWriteOffOAmount": 976000
"UnWriteOffOAmount": 260000 },
}, {
{ "PayStage": "二次款",
"PayStage": "貨抵工地", "PlanPercentage": 0.4,
"PlanPercentage": 0.5, "PlanPayAmt": 1952000,
"PlanPayAmt": 650000, "PlanPayDate": 20240313,
"PlanPayDate": 20240101, "BillNo": "M23110121",
"BillNo": "M24020076", "RowCode": 2,
"RowCode": 1, "RowNo": 2,
"RowNo": 1, "UnWriteOffOAmount": 1952000
"UnWriteOffOAmount": 650000 },
}, {
{ "PayStage": "貨抵工地",
"PayStage": "試車完工", "PlanPercentage": 0.2,
"PlanPercentage": 0.2, "PlanPayAmt": 976000,
"PlanPayAmt": 260000, "PlanPayDate": 20241104,
"PlanPayDate": 20240101, "BillNo": "M23110121",
"BillNo": "M24020076", "RowCode": 3,
"RowCode": 2, "RowNo": 3,
"RowNo": 2, "UnWriteOffOAmount": 976000
"UnWriteOffOAmount": 260000 },
}, {
{ "PayStage": "試車完工",
"PayStage": "交車", "PlanPercentage": 0.1,
"PlanPercentage": 0.1, "PlanPayAmt": 488000,
"PlanPayAmt": 130000, "PlanPayDate": 20241204,
"PlanPayDate": 20240101, "BillNo": "M23110121",
"BillNo": "M24020076", "RowCode": 4,
"RowCode": 3, "RowNo": 4,
"RowNo": 3, "UnWriteOffOAmount": 488000
"UnWriteOffOAmount": 130000 },
} {
] "PayStage": "交車",
"PlanPercentage": 0.1,
"PlanPayAmt": 488000,
"PlanPayDate": 20250104,
"BillNo": "M23110121",
"RowCode": 5,
"RowNo": 5,
"UnWriteOffOAmount": 488000
}
] ]
} }
] ]

2
wms/contract/api/test.json

@ -27,7 +27,7 @@
] ]
}, },
{ {
//salSalesOrderDetail // salSalesOrderDetail
"name": "SubOrder", "name": "SubOrder",
"rows": [ "rows": [
{ {

127
wms/contract/api/testT8API.php

@ -1,9 +1,5 @@
<?php <?php
// [
// {
// //salSalesOrder
// "name": "MainSalesOrder",
// "rows": [
// { // {
// "BillNo": "Z001", //合約單號 // "BillNo": "Z001", //合約單號
// "BillDate": 20210420, //簽約日期 // "BillDate": 20210420, //簽約日期
@ -70,27 +66,55 @@ require_once("../../T8_Authorization_from_bpm.php");
$api_url = "https://erp.masada.com.tw:780/twWebAPI/V1/SALSALESORDER/PostERPData"; $api_url = "https://erp.masada.com.tw:780/twWebAPI/V1/SALSALESORDER/PostERPData";
$validation = get_Auth(); $validation = get_Auth();
// $header = [
// "CHI_Authorization :" . $validation,
// "GroupId:TEST"
// ];
// $url = "https://erp.masada.com.tw:780/twWebAPI/V1/GLFEEWRITEOFF/DeleteERPData?pkValue=M24020032";
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
// $response = curl_exec($ch);
// if ($response === false) {
// echo 'Curl error: ' . curl_error($ch);
// } else {
// $result = json_decode($response, true);
// // 若 API 傳入失敗。
// if ($result['Status'] == 'Erroe') {
// echo 'API傳入失敗,' . $result['ErrorMsg'];
// print_r($result);
// } else {
// // print_r($result);
// print_r($result);
// }
// print_r($result);
// }
// curl_close($ch);
// exit();
$contract_no = "M24020003";
// $contract_no = "M24010109";
$MainSalesOrder_row = [ $MainSalesOrder_row = [
"BillNo" => "M24020076", //合約單號 "BillNo" => "$contract_no", //合約單號
"BillDate" => 20210420, //簽約日期 "BillDate" => 20210420, //簽約日期
"TypeId" => "SO", // "TypeId" => "SO", //
"FOrgId" => "1000", "FOrgId" => "1000",
"OrgId" => "1000", "OrgId" => "1000",
"ModeId" => "M", // T汰改 M新梯 "ModeId" => "M", // T汰改 M新梯
"BizPartnerId" => "M24020076", //客戶代碼 "BizPartnerId" => "$contract_no", //客戶代碼
"CurrId" => "TWD", "CurrId" => "TWD",
"CurrOAmount" => 1, "CurrOAmount" => 1,
"CurrLAmount" => 1, "CurrLAmount" => 1,
"PersonId" => "M0225", //業務人員 "PersonId" => "M0177", //業務人員
"DueToId" => "M24020076", //債務方 "DueToId" => "$contract_no", //債務方
"TradeConditionId" => "", "TradeConditionId" => "",
"TaxId" => "ST005", "TaxId" => "ST005",
"CreditorCompId" => "1001", "CreditorCompId" => "1001",
"CreditorOrgId" => "1000", "CreditorOrgId" => "1000",
// "CompId" => "1001", "CreatorId" => "M0225"
// "CreditorCurrOAmount" => 1,
// "CreditorCurrLAmount" => 1
]; ];
// //salSalesOrderDetail // //salSalesOrderDetail
// $SubOrder_row = []; // $SubOrder_row = [];
@ -104,13 +128,13 @@ for ($i = 0; $i < 3; $i++) {
"ConsignmentDate" => 20210420, //發貨日期 "ConsignmentDate" => 20210420, //發貨日期
// "DispatchCompId" => "1001", // "DispatchCompId" => "1001",
// "DispatchOrgId" => "1000", // "DispatchOrgId" => "1000",
"BillNo" => "M24020076", //合約號 "BillNo" => "$contract_no", //合約號
"RowCode" => $i, //全部筆數排列 "RowCode" => $i, //全部筆數排列
"ItemType" => 1, "ItemType" => 1,
"MaterialId" => "A40001", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番) "MaterialId" => "A40001", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
"SUnitId" => "SET", "SUnitId" => "SET",
"SQuantity" => 1, //交易數量 "SQuantity" => 1, //交易數量
"SPrice" => 50000 //交易價格 "SPrice" => 100000 //交易價格
]; ];
} }
if ($i == 1) { if ($i == 1) {
@ -122,25 +146,21 @@ for ($i = 0; $i < 3; $i++) {
"ConsignmentDate" => 20210420, //發貨日期 "ConsignmentDate" => 20210420, //發貨日期
// "DispatchCompId" => "1001", // "DispatchCompId" => "1001",
// "DispatchOrgId" => "1000", // "DispatchOrgId" => "1000",
"BillNo" => "M24020076", //合約號 "BillNo" => "$contract_no", //合約號
"RowCode" => $i, //全部筆數排列 "RowCode" => $i, //全部筆數排列
"ItemType" => 1, "ItemType" => 1,
"MaterialId" => "A40008", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番) "MaterialId" => "A40008", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
"SUnitId" => "SET", "SUnitId" => "SET",
"SQuantity" => 1, //交易數量 "SQuantity" => 1, //交易數量
"SPrice" => 700000 //交易價格 "SPrice" => 650000 //交易價格
]; ];
} }
if ($i == 2) { if ($i == 2) {
$row = [ $row = [
// "SupplyCompId" => "1001",
// "SupplyOrgId" => "1000",
"TaxId" => "ST005", "TaxId" => "ST005",
"RequirementDate" => 20210420, //出貨日期 "RequirementDate" => 20210420, //出貨日期
"ConsignmentDate" => 20210420, //發貨日期 "ConsignmentDate" => 20210420, //發貨日期
// "DispatchCompId" => "1001", "BillNo" => "$contract_no", //合約號
// "DispatchOrgId" => "1000",
"BillNo" => "M24020076", //合約號
"RowCode" => $i, //全部筆數排列 "RowCode" => $i, //全部筆數排列
"ItemType" => 0, "ItemType" => 0,
"MaterialId" => "4MH00669", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番) "MaterialId" => "4MH00669", //1.設備(A40001)、2.安裝(A4008)、3.作番號(作番)
@ -152,65 +172,14 @@ for ($i = 0; $i < 3; $i++) {
$SubOrder_row[] = $row; $SubOrder_row[] = $row;
} }
// // $salOrderStagePay_row = [];
// // // for ($i = 0; $i < 2; $i) {
// // // if ($i == 0) {
// // // $row = [
// // // "BillNo" => "M24010201",
// // // "RowCode" => 1,
// // // "RowNo" => 1,
// // // "PayStage" => "簽約", //收款階段
// // // "PlanPercentage" => 0.10, //計劃收款比例(%)
// // // "PlanPayAmt" => 100000, //計劃收款金額
// // // "PlanPayDate" => 20240101, //計劃收款日期 1.第一筆都是簽約日
// // // "UnWriteOffOAmount" => 100000 //未核銷金額
// // // ];
// // // }
// // // if ($i == 1) {
// // // $row = [
// // // "BillNo" => "M24010201",
// // // "RowCode" => 1,
// // // "RowNo" => 1,
// // // "PayStage" => "貨抵工地", //收款階段
// // // "PlanPercentage" => 0.40, //計劃收款比例(%)
// // // "PlanPayAmt" => 100000, //計劃收款金額
// // // "PlanPayDate" => 20240101, //計劃收款日期 1.第一筆都是簽約日
// // // "UnWriteOffOAmount" => 100000 //未核銷金額
// // // ];
// // // }
// // // if ($i == 2) {
// // // $row = [
// // // "BillNo" => "M24010201",
// // // "RowCode" => 1,
// // // "RowNo" => 1,
// // // "PayStage" => "試車完工", //收款階段
// // // "PlanPercentage" => 0.30, //計劃收款比例(%)
// // // "PlanPayAmt" => 100000, //計劃收款金額
// // // "PlanPayDate" => 20240101, //計劃收款日期 1.第一筆都是簽約日
// // // "UnWriteOffOAmount" => 100000 //未核銷金額
// // // ];
// // // }
// // // if ($i == 3) {
// // // $row = [
// // // "BillNo" => "M24010201",
// // // "RowCode" => 1,
// // // "RowNo" => 1,
// // // "PayStage" => "交車", //收款階段
// // // "PlanPercentage" => 0.20, //計劃收款比例(%)
// // // "PlanPayAmt" => 100000, //計劃收款金額
// // // "PlanPayDate" => 20240101, //計劃收款日期 1.第一筆都是簽約日
// // // "UnWriteOffOAmount" => 100000 //未核銷金額
// // // ];
// // // }
// // // $salOrderStagePay_row[] = $row;
// // // }
$salOrderStagePay_row = []; $salOrderStagePay_row = [];
$roww = [ $roww = [
"PayStage" => "簽約", //收款階段 "PayStage" => "簽約", //收款階段
"PlanPercentage" => 0.5, //計劃收款比例(%) "PlanPercentage" => 0.5, //計劃收款比例(%)
"PlanPayAmt" => 375000, //計劃收款金額 "PlanPayAmt" => 375000, //計劃收款金額
"PlanPayDate" => 20240101, //計劃收款日期 1.第一筆都是簽約日 "PlanPayDate" => 20240101, //計劃收款日期 1.第一筆都是簽約日
"BillNo" => "M24020076", "BillNo" => "$contract_no",
"RowCode" => 1, "RowCode" => 1,
"RowNo" => 1, "RowNo" => 1,
"UnWriteOffOAmount" => 375000 //未核銷金額 "UnWriteOffOAmount" => 375000 //未核銷金額
@ -220,12 +189,14 @@ $roww2 = [
"PlanPercentage" => 0.5, "PlanPercentage" => 0.5,
"PlanPayAmt" => 375000, "PlanPayAmt" => 375000,
"PlanPayDate" => 20240101, "PlanPayDate" => 20240101,
"BillNo" => "M24020076", "BillNo" => "$contract_no",
"RowCode" => 2, "RowCode" => 2,
"RowNo" => 2, "RowNo" => 2,
"UnWriteOffOAmount" => 375000 "UnWriteOffOAmount" => 375000
]; ];
$salOrderStagePay_row[] = $roww; $salOrderStagePay_row[] = $roww;
$salOrderStagePay_row[] = $roww2;
$MainSalesOrder = [ $MainSalesOrder = [
"name" => "MainSalesOrder", "name" => "MainSalesOrder",
@ -250,9 +221,9 @@ $APIbody[] = $salOrderStagePay;
// print_r($data); // print_r($data);
// echo "</pre>"; // echo "</pre>";
// echo "<pre>"; echo "<pre>";
// print_r(json_encode($APIbody, JSON_UNESCAPED_UNICODE)); print_r(json_encode($APIbody, JSON_UNESCAPED_UNICODE));
// echo "</pre>"; echo "</pre>";
// exit(); // exit();
$header = [ $header = [

14
wms/contract/contract-newelevator-input.php

@ -134,7 +134,17 @@ $persons = array_map(function ($person) {
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="vertical-align: middle">區域</td>
<td>
<select id="area_no" name="area_no" x-model="data.area_no">
<option value="">請選擇</option>
<option value="N">北區</option>
<option value="Y">宜蘭</option>
<option value="T">桃園</option>
<option value="C">中區</option>
<option value="K">南區</option>
</select>
</td>
</tr> </tr>
</tbody> </tbody>
</template> </template>
@ -187,7 +197,7 @@ $persons = array_map(function ($person) {
<tr> <tr>
<td style="vertical-align: middle">QC和官檢</td> <td style="vertical-align: middle">QC和官檢</td>
<td> <td>
<select class="" id="qc" x-model="data.qc"> <select class="" id="qc" x-model="elevator.qc">
<option value="">請選擇QC或官檢</option> <option value="">請選擇QC或官檢</option>
<option value="Q">只需QC</option> <option value="Q">只需QC</option>
<option value="O">只需官檢</option> <option value="O">只需官檢</option>

13
wms/contract/js/alpine.js

@ -829,6 +829,8 @@ const contractNewInput = () => {
elevators_detail_arr: [], // 電梯台數 Array elevators_detail_arr: [], // 電梯台數 Array
pay_arr: [], //電梯付款種類 pay_arr: [], //電梯付款種類
nums: 0, //電梯數量 nums: 0, //電梯數量
area_no: 'T',
contract_arrival_date: ''
}, },
step: 1, step: 1,
isLoading: false, isLoading: false,
@ -868,14 +870,15 @@ const contractNewInput = () => {
this.data.elevators_detail_arr[i].longitude = ''; // 緯度 this.data.elevators_detail_arr[i].longitude = ''; // 緯度
this.data.elevators_detail_arr[i].manage = ''; // 工地負責人 this.data.elevators_detail_arr[i].manage = ''; // 工地負責人
this.data.elevators_detail_arr[i].qc = ''; // QC和官檢 this.data.elevators_detail_arr[i].qc = ''; // QC和官檢
this.data.elevators_detail_arr[i].contract_arrival_date = ''; //合約交期(到工地) this.data.elevators_detail_arr[i].contract_arrival_date = this.data.contract_arrival_date; //合約交期(到工地)
// this.data.elevators_detail_arr[i].area_no = ''; //區域
} }
this.step = 3; this.step = 3;
this.isLoading = false; this.isLoading = false;
} else if (this.step == 3) { } else if (this.step == 3) {
console.log(this.data.elevators_detail_arr); console.log(this.data.elevators_detail_arr);
this.step = 4; // this.step = 4;
this.isLoading = false; // this.isLoading = false;
} }
}, },
getContractDate() { getContractDate() {
@ -889,7 +892,7 @@ const contractNewInput = () => {
return return
} }
if (!this.customize) { if (!this.customize) {
console.log(res.data); console.log(res.data.customer);
this.data.customer = res.data.company this.data.customer = res.data.company
this.data.manager = res.data.manager this.data.manager = res.data.manager
this.data.vat = res.data.uscc this.data.vat = res.data.uscc
@ -904,6 +907,7 @@ const contractNewInput = () => {
this.data.elevators_detail_arr = res.data.elevators_detail_arr; this.data.elevators_detail_arr = res.data.elevators_detail_arr;
this.data.nums = res.data.nums; this.data.nums = res.data.nums;
this.data.pay_arr = res.data.pay_arr; this.data.pay_arr = res.data.pay_arr;
this.data.contract_arrival_date = res.data.facilitok_date;
} }
this.step = 2 this.step = 2
this.isLoading = false this.isLoading = false
@ -919,6 +923,7 @@ const contractNewInput = () => {
form.append('customer', this.data.customer); form.append('customer', this.data.customer);
form.append('manager', this.data.manager); form.append('manager', this.data.manager);
form.append('vat', this.data.vat); form.append('vat', this.data.vat);
form.append('area_no', this.data.area_no);
form.append('case_name', this.data.case_name); form.append('case_name', this.data.case_name);
form.append('linkman', this.data.linkman); form.append('linkman', this.data.linkman);
form.append('lm_tel', this.data.lm_tel); form.append('lm_tel', this.data.lm_tel);

Loading…
Cancel
Save