From b79f798f5bd77a14512bcc2f3d18a8266df21a3e Mon Sep 17 00:00:00 2001 From: Ellin Date: Thu, 26 Oct 2023 13:32:37 +0800 Subject: [PATCH] =?UTF-8?q?rib=E9=82=84=E5=8E=9F=E7=82=BA=E8=88=87?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E4=B8=8A=E7=B7=9A=E7=89=88=E4=B8=80=E6=A8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + wms/database.php | 24 +++++------------------- wms/rib02-edit.php | 45 ++++++++++++++++++++++----------------------- 3 files changed, 28 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index f778a02d..b8796383 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ wms/mkt/pricereview-uploads/ .gitignore /vendor/ /pdfs/ +wms/database.php diff --git a/wms/database.php b/wms/database.php index 621fd3ff..d7b4a949 100644 --- a/wms/database.php +++ b/wms/database.php @@ -1,23 +1,9 @@ " . mysqli_connect_error(); } -?> +?> \ No newline at end of file diff --git a/wms/rib02-edit.php b/wms/rib02-edit.php index eec268f2..6a8827bb 100644 --- a/wms/rib02-edit.php +++ b/wms/rib02-edit.php @@ -33,7 +33,8 @@ try { } $personid = $man['PersonId']; $depart = $man['DeptId']; - array_push($member["$personid"], "$depart"); + if(isset($member["$personid"])){ + array_push($member["$personid"], "$depart");} } //取得部門代碼 @@ -46,25 +47,6 @@ try { echo $e->getMessage(); } - -// 找出使用者的部門 -// $mydepart_sql = "SELECT department_id from account Where accountid = '$user_id'"; -// $mydepart = mysqli_query($link, $mydepart_sql); -// foreach ($mydepart as $dep) { -// $mydepart = $dep['department_id']; -// } - -// 取得部門代碼 -// $sql_depid = "SELECT DISTINCT department_id, name from department"; -// $dept_query = mysqli_query($link, $sql_depid); -// $deptype = mysqli_fetch_all($dept_query, MYSQLI_ASSOC); - -// 取得人員名單 -// $sql_deptmem = "select * from account WHERE accounttype NOT IN ('A','X')"; -// $deptmem = mysqli_query($link, $sql_deptmem); -// $deptmem = mysqli_fetch_all($deptmem, MYSQLI_ASSOC); - - //取得計量單位 $sql_unit = "SELECT * FROM unit"; $unit_query = mysqli_query($link, $sql_unit); @@ -623,7 +605,7 @@ try { $("#OAmount").val($("#Quantity").val() * $("#Price").val()); $("#LAmount").val($("#OAmount").val() * $("#CurrLAmount").val()); if ($("#TaxId").val() === "ST005") { - $("#OTax").val($("#OAmount").val() * 0.05); + $("#OTax").val($("#OAmount").val()-($("#OAmount").val() /1.05)); $("#LTax").val($("#OTax").val() * $("#CurrLAmount").val()); $("#OAmountUnWithTax").val($("#OAmount").val() / 1.05); $("#LAmountUnWithTax").val($("#OAmountUnWithTax").val() * $("#CurrLAmount").val()); @@ -638,8 +620,24 @@ try { $("#Quantity").change(function() { $("#OAmount").val($("#Quantity").val() * $("#Price").val()); $("#LAmount").val($("#OAmount").val() * $("#CurrLAmount").val()); - if ($("#TaxId") === "ST005") { - $("#OTax").val($("#OAmount").val() * 0.05); + if ($("#TaxId").val() === "ST005") { + $("#OTax").val($("#OAmount").val()-($("#OAmount").val()/ 1.05)); + $("#LTax").val($("#OTax").val() * $("#CurrLAmount").val()); + $("#OAmountUnWithTax").val($("#OAmount").val() / 1.05); + $("#LAmountUnWithTax").val($("#OAmountUnWithTax").val() * $("#CurrLAmount").val()); + + } else { + $("#OTax").val(0); + $("#LTax").val(0); + $("#OAmountUnWithTax").val($("#OAmount").val()); + $("#LAmountUnWithTax").val($("#OAmount").val() * $("#CurrLAmount").val()); + } + }); + $("#TaxId").change(function() { + $("#OAmount").val($("#Quantity").val() * $("#Price").val()); + $("#LAmount").val($("#OAmount").val() * $("#CurrLAmount").val()); + if ($("#TaxId").val() === "ST005") { + $("#OTax").val($("#OAmount").val()-($("#OAmount").val()/ 1.05)); $("#LTax").val($("#OTax").val() * $("#CurrLAmount").val()); $("#OAmountUnWithTax").val($("#OAmount").val() / 1.05); $("#LAmountUnWithTax").val($("#OAmountUnWithTax").val() * $("#CurrLAmount").val()); @@ -724,6 +722,7 @@ try { $("#OAmountUnWithTax").prop("disabled", false); $("#LAmountUnWithTax").prop("disabled", false); $("#LAmount").prop("disabled", false); + $("#OAmount").prop("disabled", false); $('#ribsubeditform').submit(); }