From 59379de7a775f9245afc5f87f041ef9b78aed252 Mon Sep 17 00:00:00 2001 From: Ellin Date: Tue, 21 Nov 2023 17:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B2=BB=E7=94=A8=E5=A0=B1?= =?UTF-8?q?=E9=8A=B7=E5=96=AEBUG(=E5=A2=9E=E5=8A=A0=E8=B2=A1=E6=9C=83?= =?UTF-8?q?=E4=BA=BA=E5=93=A1=E5=AF=A9=E6=A0=B8=E9=9A=8E=E6=AE=B5=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=88=AA=E9=99=A4=E6=AC=8A=E9=99=90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wms/rib01-check.php | 3 ++ wms/rib02-create.php | 7 ++-- wms/rib02-submit.php | 82 ++++++++++++++++++++++++++++++-------------- wms/rib03-submit.php | 6 ++-- 4 files changed, 66 insertions(+), 32 deletions(-) diff --git a/wms/rib01-check.php b/wms/rib01-check.php index c95ea203..c27b5e32 100644 --- a/wms/rib01-check.php +++ b/wms/rib01-check.php @@ -383,6 +383,9 @@ $feetype = mysqli_fetch_all($feetype_query, MYSQLI_ASSOC); + + + diff --git a/wms/rib02-create.php b/wms/rib02-create.php index 7eca2d8e..3a77e4d9 100644 --- a/wms/rib02-create.php +++ b/wms/rib02-create.php @@ -258,7 +258,7 @@ $materials = $conn->query($sql_Material);
- @@ -266,7 +266,7 @@ $materials = $conn->query($sql_Material);
- @@ -276,7 +276,7 @@ $materials = $conn->query($sql_Material);
- $value) { ?> @@ -636,6 +636,7 @@ $materials = $conn->query($sql_Material); if ($user_id == "M0056" || $user_id == "M0209") { ?> $("#OTax").prop("disabled", false); $("#LTax").prop("disabled", false); + $("#CurrLAmount").prop("disabled", false); $("#OAmountUnWithTax").prop("disabled", false); $("#LAmountUnWithTax").prop("disabled", false); $("#LAmount").prop("disabled", false); diff --git a/wms/rib02-submit.php b/wms/rib02-submit.php index 21061f47..dcf669ce 100644 --- a/wms/rib02-submit.php +++ b/wms/rib02-submit.php @@ -12,7 +12,7 @@ $BizPartner = $conn->query($sql_Biz); foreach ($BizPartner as $biz) { $bizKey = $biz['BizPartnerId']; $bizValue = $biz['BizPartnerName']; - $BusinessPartner[$bizKey]=$bizValue; + $BusinessPartner[$bizKey] = $bizValue; } $RowCode = $_POST['RowCode']; @@ -35,6 +35,7 @@ $VoucherCount = empty($_POST['VoucherCount']) ? 1 : $_POST['VoucherCount']; $VoucherType = isset($_POST['VoucherType']) ? $_POST['VoucherType'] : 0; $InvoiceNo = empty($_POST['InvoiceNo']) ? NULL : $_POST['InvoiceNo']; $CurrId = empty($_POST['CurrId']) ? null : $_POST['CurrId']; +$CurrLAmount = empty($_POST['CurrLAmount']) ? null : $_POST['CurrLAmount']; // $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName']; $FromSourceTag = 0; $TaxRate = ($TaxId == "ST005") ? 0.05 : 0; @@ -44,12 +45,12 @@ $OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? $_POST['OAmountUnWithTax $LAmountUnWithTax = isset($_POST['LAmountUnWithTax']) ? $_POST['LAmountUnWithTax'] : null; $LAmount = isset($_POST['LAmount']) ? $_POST['LAmount'] : null; $TaxNo = empty($_POST['TaxNo']) ? '' : $_POST['TaxNo']; -if (empty($TaxNo)){ +if (empty($TaxNo)) { $comSupplierName = "雜項請款用"; -}else{ - if (isset($BusinessPartner[$TaxNo])){ - $comSupplierName= $BusinessPartner[$TaxNo]; - }else{ +} else { + if (isset($BusinessPartner[$TaxNo])) { + $comSupplierName = $BusinessPartner[$TaxNo]; + } else { $comSupplierName = "雜項請款用"; } } @@ -70,31 +71,59 @@ if (isset($comSupplierName) && ($comSupplierName != "雜項請款用")) { $SQL1 = ""; if ($submit == "add") { - $SQL1 = "INSERT INTO rib_sub (`RowCode`,`rib_id`,`RowNo`,`FeeDate`,`FeeTypeId`,`WriteOffType`, + if (($user_id == "M0056" )|| ($user_id == "M0209")) { + $SQL1 = "INSERT INTO rib_sub (`RowCode`,`rib_id`,`RowNo`,`FeeDate`,`FeeTypeId`,`WriteOffType`, + `BizOrgId`,`WriteOffId`,`FeeOrgId`,`FeeDeptId`,`FeeCompanyId`,`UnitId`,`Quantity`, + `Price`,`OAmount`,`FeeNoteShow`,`CurrId`,`SupplyOrgId`,`CurrOAmount`,`FromSourceTag`,`TaxId`,`IsCounteract`,`InvoiceId`,`TaxRate`,`CreatorId`,`TaxNo`,`CurrentLAmount`,`OTax`,`LTax`, + `OAmountUnWithTax`,`LAmountUnWithTax`,`LAmount`"; + $SQL1 .= empty($ProjectId) ? "" : ",`ProjectId`"; + $SQL1 .= isset($FeeTypeGen) ? ",`FeeTypeGen`" : ""; + $SQL1 .= empty($CU_MaterialId) ? "" : ",`CU_MaterialId`"; + $SQL1 .= empty($VoucherCount) ? "" : ",`VoucherCount`"; + $SQL1 .= isset($VoucherType) ? ",`VoucherType`" : ""; + $SQL1 .= empty($InvoiceNo) ? "" : ",`InvoiceNo`"; + $SQL1 .= empty($comSupplierName) ? "" : ",`comSupplierName`"; + $SQL1 .= empty($comSupplierId) ? ",`comSupplierId`" : ",`comSupplierId`"; + + $SQL2 = ") VALUES ($RowCode, $rib_id, $RowCode,$FeeDate,'$FeeTypeId',2, + '1000','$WriteOffId','1000','$FeeDeptId','1000','$UnitId',$Quantity, + $Price,$OAmount,'$FeeNoteShow','$CurrId','1000',1,0,'$TaxId',$IsCounteract,'$InvoiceId',$TaxRate,'$user_id','$TaxNo',$CurrLAmount,$OTax,$LTax, + $OAmountUnWithTax,$LAmountUnWithTax,$LAmount"; + $SQL2 .= empty($ProjectId) ? "" : ",'" . $ProjectId . "'"; + $SQL2 .= isset($FeeTypeGen) ? "," . $FeeTypeGen : ""; + $SQL2 .= empty($CU_MaterialId) ? "" : ",'" . $CU_MaterialId . "'"; + $SQL2 .= empty($VoucherCount) ? "" : "," . $VoucherCount; + $SQL2 .= isset($VoucherType) ? "," . $VoucherType : ""; + $SQL2 .= empty($InvoiceNo) ? "" : ",'" . $InvoiceNo . "'"; + $SQL2 .= empty($comSupplierName) ? "" : ",'" . $comSupplierName . "'"; + $SQL2 .= empty($comSupplierId) ? ",' '" : ",'" . $comSupplierId . "'"; + $SQL2 .= ")"; + } else { + $SQL1 = "INSERT INTO rib_sub (`RowCode`,`rib_id`,`RowNo`,`FeeDate`,`FeeTypeId`,`WriteOffType`, `BizOrgId`,`WriteOffId`,`FeeOrgId`,`FeeDeptId`,`FeeCompanyId`,`UnitId`,`Quantity`, `Price`,`OAmount`,`FeeNoteShow`,`CurrId`,`SupplyOrgId`,`CurrOAmount`,`FromSourceTag`,`TaxId`,`IsCounteract`,`InvoiceId`,`TaxRate`,`CreatorId`,`TaxNo`"; - $SQL1 .= empty($ProjectId) ? "" : ",`ProjectId`"; - $SQL1 .= isset($FeeTypeGen) ? ",`FeeTypeGen`" : ""; - $SQL1 .= empty($CU_MaterialId) ? "" : ",`CU_MaterialId`"; - $SQL1 .= empty($VoucherCount) ? "" : ",`VoucherCount`"; - $SQL1 .= isset($VoucherType) ? ",`VoucherType`" : ""; - $SQL1 .= empty($InvoiceNo) ? "" : ",`InvoiceNo`"; - $SQL1 .= empty($comSupplierName) ? "" : ",`comSupplierName`"; - $SQL1 .= empty($comSupplierId) ? ",`comSupplierId`" : ",`comSupplierId`"; + $SQL1 .= empty($ProjectId) ? "" : ",`ProjectId`"; + $SQL1 .= isset($FeeTypeGen) ? ",`FeeTypeGen`" : ""; + $SQL1 .= empty($CU_MaterialId) ? "" : ",`CU_MaterialId`"; + $SQL1 .= empty($VoucherCount) ? "" : ",`VoucherCount`"; + $SQL1 .= isset($VoucherType) ? ",`VoucherType`" : ""; + $SQL1 .= empty($InvoiceNo) ? "" : ",`InvoiceNo`"; + $SQL1 .= empty($comSupplierName) ? "" : ",`comSupplierName`"; + $SQL1 .= empty($comSupplierId) ? ",`comSupplierId`" : ",`comSupplierId`"; - $SQL2 = ") VALUES ($RowCode, $rib_id, $RowCode,$FeeDate,'$FeeTypeId',2, + $SQL2 = ") VALUES ($RowCode, $rib_id, $RowCode,$FeeDate,'$FeeTypeId',2, '1000','$WriteOffId','1000','$FeeDeptId','1000','$UnitId',$Quantity, $Price,$OAmount,'$FeeNoteShow','$CurrId','1000',1,0,'$TaxId',$IsCounteract,'$InvoiceId',$TaxRate,'$user_id','$TaxNo'"; - $SQL2 .= empty($ProjectId) ? "" : ",'" . $ProjectId . "'"; - $SQL2 .= isset($FeeTypeGen) ? "," . $FeeTypeGen : ""; - $SQL2 .= empty($CU_MaterialId) ? "" : ",'" . $CU_MaterialId . "'"; - $SQL2 .= empty($VoucherCount) ? "" : "," . $VoucherCount; - $SQL2 .= isset($VoucherType) ? "," . $VoucherType : ""; - $SQL2 .= empty($InvoiceNo) ? "" : ",'" . $InvoiceNo . "'"; - $SQL2 .= empty($comSupplierName) ? "" : ",'" . $comSupplierName . "'"; - $SQL2 .= empty($comSupplierId) ? ",' '" : ",'" . $comSupplierId . "'"; - $SQL2 .= ")"; - + $SQL2 .= empty($ProjectId) ? "" : ",'" . $ProjectId . "'"; + $SQL2 .= isset($FeeTypeGen) ? "," . $FeeTypeGen : ""; + $SQL2 .= empty($CU_MaterialId) ? "" : ",'" . $CU_MaterialId . "'"; + $SQL2 .= empty($VoucherCount) ? "" : "," . $VoucherCount; + $SQL2 .= isset($VoucherType) ? "," . $VoucherType : ""; + $SQL2 .= empty($InvoiceNo) ? "" : ",'" . $InvoiceNo . "'"; + $SQL2 .= empty($comSupplierName) ? "" : ",'" . $comSupplierName . "'"; + $SQL2 .= empty($comSupplierId) ? ",' '" : ",'" . $comSupplierId . "'"; + $SQL2 .= ")"; + } $SQL1 .= $SQL2; //上傳資料庫 mysqli_query($link, $SQL1); @@ -107,6 +136,7 @@ if ($submit == "add") { $SQL1 = str_replace("'", '', $SQL1); $sql_rib = "UPDATE rib SET LastOperatorId = '$user_id', LastOperation='$SQL1' WHERE rib_id=$rib_id"; mysqli_query($link, $sql_rib); + ?>