diff --git a/wms/rib01-business-check.php b/wms/rib01-business-check.php index da9ccee9..37d97f87 100644 --- a/wms/rib01-business-check.php +++ b/wms/rib01-business-check.php @@ -3,16 +3,11 @@ include "./header.php"; $BillNo = $_GET['BillNo']; $state = $_GET['state']; //取得表頭數據 -$date_sql = "SELECT BillNo from rib_business WHERE (BillNo LIKE '$sqlname%')"; +$date_sql = "SELECT * from rib_business WHERE (BillNo='$BillNo')"; $query_rib = mysqli_query($link, $date_sql); -$myNo = mysqli_fetch_all($query_rib); -foreach ($myNo as $thisMyNo) { - $thisMyNo = (int)substr($thisMyNo[0], -2); - if ($thisMyNo > $MaxBillNo) { - $MaxBillNo = $thisMyNo; - } +foreach ($query_rib as $q) { + $rib = $q; } -$BillNo = $sqlname; // 連線T8MASADA try { $conn = new PDO("sqlsrv:Server=60.244.87.101;Database=T8MASADA", "masada", "ZXCVasdf1234"); @@ -52,17 +47,12 @@ try { echo "fail"; echo $e->getMessage(); } -$MaxBillNo += 1; -if ($MaxBillNo < 10) { - $BillNo .= "0" . strval($MaxBillNo); -} else { - $BillNo .= strval($MaxBillNo); -} + ?>
+ + + +
+ + + + + + + +There is no record!"; +endif; + +include "./footer.php"; +?> \ No newline at end of file diff --git a/wms/rib02-submit.php b/wms/rib02-submit.php index f1e44f4a..229dea2b 100644 --- a/wms/rib02-submit.php +++ b/wms/rib02-submit.php @@ -29,11 +29,11 @@ $CurrId = empty($_POST['CurrId']) ? null : $_POST['CurrId']; $comSupplierName = empty($_POST['comSupplierName']) ? null : $_POST['comSupplierName']; $FromSourceTag = 0; $TaxRate = ($TaxId == "ST005") ? 0.05 : 0; -$OTax = isset($_POST['OTax']) ? $_POST['OTax']:NULL; -$LTax = isset($_POST['LTax']) ? $_POST['LTax']:NULL; -$OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? $_POST['OAmountUnWithTax']:null; -$LAmountUnWithTax = isset($_POST['LAmountUnWithTax']) ? $_POST['LAmountUnWithTax']:null; -$LAmount = isset($_POST['LAmount']) ? $_POST['LAmount']:null; +$OTax = isset($_POST['OTax']) ? $_POST['OTax'] : NULL; +$LTax = isset($_POST['LTax']) ? $_POST['LTax'] : NULL; +$OAmountUnWithTax = isset($_POST['OAmountUnWithTax']) ? $_POST['OAmountUnWithTax'] : null; +$LAmountUnWithTax = isset($_POST['LAmountUnWithTax']) ? $_POST['LAmountUnWithTax'] : null; +$LAmount = isset($_POST['LAmount']) ? $_POST['LAmount'] : null; $TaxNo = empty($_POST['TaxNo']) ? '' : $_POST['TaxNo']; if (isset($comSupplierName) && ($comSupplierName != "雜項請款用")) { @@ -113,11 +113,11 @@ if ($submit == "add") { $SQL1 .= empty($InvoiceNo) ? "" : ",InvoiceNo='$InvoiceNo'"; $SQL1 .= empty($comSupplierName) ? ",comSupplierName=' '" : ",comSupplierName='$comSupplierName'"; $SQL1 .= empty($comSupplierId) ? ",comSupplierId=' '" : ",comSupplierId='$comSupplierId'"; - $SQL1 .= isset($OTax) ? ",OTax=$OTax":""; - $SQL1 .= isset($LTax) ? ",LTax=$LTax":""; - $SQL1 .= isset($OAmountUnWithTax) ? ",OAmountUnWithTax=$OAmountUnWithTax":""; - $SQL1 .= isset($LAmountUnWithTax) ? ",LAmountUnWithTax=$LAmountUnWithTax":""; - $SQL1 .= isset($LAmount) ? ",LAmount=$LAmount":""; + $SQL1 .= isset($OTax) ? ",OTax=$OTax" : ""; + $SQL1 .= isset($LTax) ? ",LTax=$LTax" : ""; + $SQL1 .= isset($OAmountUnWithTax) ? ",OAmountUnWithTax=$OAmountUnWithTax" : ""; + $SQL1 .= isset($LAmountUnWithTax) ? ",LAmountUnWithTax=$LAmountUnWithTax" : ""; + $SQL1 .= isset($LAmount) ? ",LAmount=$LAmount" : ""; if ($user_id == "M0056" && $state == 1) { $SQL1 .= ",FeeBalance=$LAmountUnWithTax"; $SQL1 .= ",WriteOffAmount=$OAmount"; @@ -159,6 +159,11 @@ if ($submit == "add") { $SQL1 = str_replace("'", '', $SQL1); $sql_rib = "UPDATE rib SET OAmountWithTax=$OAmountWithTax, LAmountWithTax= $LAmountWithTax, LAmount=$LAmount,OAmount =$OAmount, UnPayOAmount=$OAmountWithTax, Balance = $OAmountWithTax, LBalance= $UnPayLAmount ,UnPaymentLAmt=$UnPayLAmount, UnPayLAmount=$UnPayLAmount,OTax=$OTax, LTax=$LTax, WriteOffAmount=$WriteOffAmount, LastOperatorId='$user_id' WHERE rib_id = $rib_id"; mysqli_query($link, $sql_rib); + ?> + +