From e7c1311974e17c58f322f5722e15bf4d7795909f Mon Sep 17 00:00:00 2001 From: Ellin Date: Tue, 5 Dec 2023 18:51:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=87=89=E6=94=B6=E5=B8=B3=E6=AC=BE(?= =?UTF-8?q?=E6=96=B0=E6=A2=AF)=E7=B3=BB=E7=B5=B1index=E8=B7=9Fcheck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/account-receivable-check.php | 159 +++++++++++++++++++++ wms/account-receivable-index.php | 149 +++++++++++++------ wms/account-receivable-received-create.php | 4 + 3 files changed, 265 insertions(+), 47 deletions(-) create mode 100644 wms/account-receivable-check.php create mode 100644 wms/account-receivable-received-create.php diff --git a/wms/account-receivable-check.php b/wms/account-receivable-check.php new file mode 100644 index 00000000..24bc868c --- /dev/null +++ b/wms/account-receivable-check.php @@ -0,0 +1,159 @@ + + +
+ +
+ + + +
+ +
+
+
+

+
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
簽約款二次款貨抵工地款安裝款試車款官檢款交車款目前應收已收金額
+
+
+ + + + 新增收款紀錄 + + +
+ + + + + + + + + + + + + + + + + + + + + + +
發票日期發票金額收款日期收款金額說明功能
+ + + + + + +
+
\ No newline at end of file diff --git a/wms/account-receivable-index.php b/wms/account-receivable-index.php index b6d56bcf..1aafb519 100644 --- a/wms/account-receivable-index.php +++ b/wms/account-receivable-index.php @@ -20,7 +20,8 @@ $receivable_array = []; // $deptype = mysqli_fetch_all($dept_query, MYSQLI_ASSOC); -$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt,s.BizPartnerId,c.BizPartnerName FROM salOrderStagePay AS a +$sql_contract = "SELECT a.BillNo, a.PayStage, a.PlanPayAmt,s.BizPartnerId,c.BizPartnerName, +c.EnterpriseName, c.TaxNo, c.ContactAddress FROM salOrderStagePay AS a LEFT JOIN salSalesOrder AS s on a.BillNo = s.BillNo LEFT JOIN comBusinessPartner as c ON s.BizPartnerId=c.BizPartnerId WHERE s.ModeId = 'M' AND (s.CurrentState=2 OR s.CurrentState=4) "; @@ -38,6 +39,9 @@ foreach ($contract as $cont) { $PayStage = $cont['PayStage']; $PayAmount = $cont['PlanPayAmt']; $partnerName = $cont['BizPartnerName']; + $EnterpriseName = $cont['EnterpriseName']; + $TaxNo = $cont['TaxNo']; + $ContactAddress = $cont['ContactAddress']; //4 簽約 5 二次款 6 貨抵工地 7 安裝 8 試車 9官檢 10 交車 if (isset($arrayData[$BillNo])) { if (stristr($PayStage, '二次款') || stristr($PayStage, '出貨前') || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60')) { @@ -60,6 +64,9 @@ foreach ($contract as $cont) { } else { $arrayData[$BillNo] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; $arrayData[$BillNo][3] = $partnerName; + $arrayData[$BillNo][13] = $EnterpriseName; + $arrayData[$BillNo][14] = $TaxNo; + $arrayData[$BillNo][15] = $ContactAddress; if (stristr($PayStage, '二次款') || stristr($PayStage, '出貨前') || stristr($PayStage, '簽約後') || stristr($PayStage, '簽訂後') || stristr($PayStage, '建照核發時') || stristr($PayStage, '簽約60')) { $arrayData[$BillNo][5] = $PayAmount; } elseif ($PayStage == '簽約' || stristr($PayStage, '簽定') || stristr($PayStage, '簽訂') || stristr($PayStage, '訂金')) { @@ -130,42 +137,43 @@ ON d.department_id = tmp2.department_id"; $value[1] = $wip['manager_name']; $value[2] = $wip['name']; if ($wip['delivery_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交) , \n"; + $facitities .= $wip['facilityno'] . " (" . $wip['delivery_date'] . "已移交)
"; $total_facility_num += 1; $arrive_num += 1; $tryrun_num += 1; $official_num += 1; $delivery_num += 1; } elseif ($wip['official_check_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢) , \n"; + $facitities .= $wip['facilityno'] . " (" . $wip['official_check_date'] . "官檢完畢)
"; $total_facility_num += 1; $arrive_num += 1; $tryrun_num += 1; $official_num += 1; } elseif ($wip['tryrun_end_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢) , \n"; + $facitities .= $wip['facilityno'] . " (" . $wip['tryrun_end_date'] . "試車完畢)
"; $total_facility_num += 1; $arrive_num += 1; $tryrun_num += 1; } elseif ($wip['install_end_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢) , \n"; + $facitities .= $wip['facilityno'] . " (" . $wip['install_end_date'] . "安裝完畢)
"; $total_facility_num += 1; $arrive_num += 1; } elseif ($wip['real_arrival_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地) , \n"; + $facitities .= $wip['facilityno'] . " (" . $wip['real_arrival_date'] . "貨抵工地)
"; $total_facility_num += 1; $arrive_num += 1; } elseif ($wip['actual_tofactory_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['actual_tofactory_date'] . "實際到觀音日) , \n"; + $facitities .= $wip['facilityno'] . " (" . $wip['actual_tofactory_date'] . "實際到觀音日)
"; $total_facility_num += 1; } elseif ($wip['estimated_shipping_date'] != NULL) { - $facitities .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計到港) , \n"; + $facitities .= $wip['facilityno'] . " (" . $wip['estimated_shipping_date'] . "預計到港)
"; $total_facility_num += 1; } else { - $facitities .= $wip['facilityno'] . " (預計到港日待確認) , \n"; + $facitities .= $wip['facilityno'] . " (預計到港日待確認)
"; $total_facility_num += 1; } } + $receivable_budget=0; //這是錢 4 簽約 5 二次款 6 貨抵工地 7 安裝 8 試車 9官檢 10 交車 //這是數量 arrive_num 貨抵工地 tryrun_num 試車安裝完畢 official_num 官檢完畢 delivery_num 移交 if ($total_facility_num > 0) { @@ -173,30 +181,70 @@ ON d.department_id = tmp2.department_id"; ($value[7] + $value[8]) * ($tryrun_num / $total_facility_num) + ($value[9]) * ($official_num / $total_facility_num) + ($value[10]) * ($delivery_num / $total_facility_num); } - array_push($receivable_array, [$key, $value[0], $value[1], $value[2], $value[3], $value[4], $value[5], $value[6], $value[7], $value[8], $value[9], $value[10], $receivable_budget, $facitities]); + // array_push($receivable_array, [$key, $value[0], $value[1], $value[2], $value[3], $value[4], $value[5], $value[6], $value[7], $value[8], $value[9], $value[10], $receivable_budget, $facitities]); + $receivable_array[$key] = [$key, $value[0], $value[1], $value[2], $value[3], $value[4], $value[5], $value[6], $value[7], $value[8], $value[9], $value[10], $receivable_budget, $facitities, $value[13],$value[14],$value[15]]; // echo $key . ";" . $value[0] . ";" . $value[1] . ";" . $value[2] . ";" . $value[3] . ";" . $value[4] . ";" . $value[5] . ";" . $value[6] . ";" . $value[7] . ";" . $value[8] . ";" . $value[9].";" . $value[10] . ";" . $receivable_budget . ";" . $total_facility_num . ";" . $arrive_num . ";". $tryrun_num . ";" .$official_num.";". $delivery_num . ";" . $facitities . "
"; } +$data = json_encode($receivable_array); // echo "合約號;部門;經理;營業員;客戶名稱;簽約款;二次款;貨抵工地款;安裝款;試車款;官檢款;交車款;目前應收;總作番數;貨抵;安裝試車;官檢;移交數;狀態
"; ?> -
- + +
+
- - - - + + + + - - - - - - - - + + + @@ -209,15 +257,17 @@ ON d.department_id = tmp2.department_id"; - - - - - - - - + + +
合約號部門經理營業員合約號部門經理營業員 客戶名稱簽約款二次款貨抵工地款安裝款試車款官檢款交車款目前應收目前應收 狀態操作
+
- - \ No newline at end of file + \ No newline at end of file diff --git a/wms/account-receivable-received-create.php b/wms/account-receivable-received-create.php new file mode 100644 index 00000000..73d41d06 --- /dev/null +++ b/wms/account-receivable-received-create.php @@ -0,0 +1,4 @@ + Date: Wed, 6 Dec 2023 19:08:06 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=87=89=E6=94=B6=E5=B8=B3=E6=AC=BE(?= =?UTF-8?q?=E6=96=B0=E6=A2=AF);=20rib01-check=E4=BF=AE=E6=92=A4=E5=9B=9E?= =?UTF-8?q?=E6=8C=89=E9=88=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 48 ++++++++ wms/account-receivable-check.php | 70 +++++++++--- wms/account-receivable-index.php | 86 +++++++++++---- wms/account-receivable-received-create.php | 121 ++++++++++++++++++++- wms/account-receivable-received-edit.php | 121 +++++++++++++++++++++ wms/account-receivable-received-submit.php | 84 ++++++++++++++ wms/rib01-check.php | 2 +- 7 files changed, 495 insertions(+), 37 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 wms/account-receivable-received-edit.php create mode 100644 wms/account-receivable-received-submit.php diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..9dc6b4df --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,48 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003 + }, + { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 0, + "runtimeArgs": [ + "-dxdebug.start_with_request=yes" + ], + "env": { + "XDEBUG_MODE": "debug,develop", + "XDEBUG_CONFIG": "client_port=${port}" + } + }, + { + "name": "Launch Built-in web server", + "type": "php", + "request": "launch", + "runtimeArgs": [ + "-dxdebug.mode=debug", + "-dxdebug.start_with_request=yes", + "-S", + "localhost:0" + ], + "program": "", + "cwd": "${workspaceRoot}", + "port": 9003, + "serverReadyAction": { + "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", + "uriFormat": "http://localhost:%s", + "action": "openExternally" + } + } + ] +} \ No newline at end of file diff --git a/wms/account-receivable-check.php b/wms/account-receivable-check.php index 24bc868c..1e373b52 100644 --- a/wms/account-receivable-check.php +++ b/wms/account-receivable-check.php @@ -3,7 +3,7 @@ include "./header.php"; //企業名稱 統一編號 聯絡地址 $Bill = $_POST['Bill']; $Bill = json_decode($Bill, true); -$sql_received = "SELECT * from account_received where BillNo = '$Bill[0]'"; +$sql_received = "SELECT * from account_received where BillNo = '$Bill[0]' ORDER BY `pay_id` ASC"; $pay_received = mysqli_query($link, $sql_received); $had_received = 0; if (mysqli_num_rows($pay_received) == 0) { @@ -11,8 +11,8 @@ if (mysqli_num_rows($pay_received) == 0) { $had_received += $received['received_amount']; } } -// echo $Bill[2]; - +$unreceived = $Bill[12] - $had_received; +$data = json_encode($Bill); ?>