|
|
@ -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 = empty($_POST['OTax']) ? null : $_POST['OTax']; |
|
|
|
$LTax = empty($_POST['LTax']) ? null : $_POST['LTax']; |
|
|
|
$OAmountUnWithTax = empty($_POST['OAmountUnWithTax']) ? null : $_POST['OAmountUnWithTax']; |
|
|
|
$LAmountUnWithTax = empty($_POST['LAmountUnWithTax']) ? null : $_POST['LAmountUnWithTax']; |
|
|
|
$LAmount = empty($_POST['LAmount']) ? null : $_POST['LAmount']; |
|
|
|
$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,16 +113,17 @@ if ($submit == "add") { |
|
|
|
$SQL1 .= empty($InvoiceNo) ? "" : ",InvoiceNo='$InvoiceNo'"; |
|
|
|
$SQL1 .= empty($comSupplierName) ? ",comSupplierName=' '" : ",comSupplierName='$comSupplierName'"; |
|
|
|
$SQL1 .= empty($comSupplierId) ? ",comSupplierId=' '" : ",comSupplierId='$comSupplierId'"; |
|
|
|
$SQL1 .= empty($OTax) ? "" : ",OTax=$OTax"; |
|
|
|
$SQL1 .= empty($LTax) ? "" : ",LTax=$LTax"; |
|
|
|
$SQL1 .= empty($OAmountUnWithTax) ? "" : ",OAmountUnWithTax=$OAmountUnWithTax"; |
|
|
|
$SQL1 .= empty($LAmountUnWithTax) ? "" : ",LAmountUnWithTax=$LAmountUnWithTax"; |
|
|
|
$SQL1 .= empty($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"; |
|
|
|
} |
|
|
|
$SQL1 .= " WHERE ribsub_id = $ribsub_id"; |
|
|
|
echo $SQL1; |
|
|
|
//上傳資料庫--表身 |
|
|
|
mysqli_query($link, $SQL1); |
|
|
|
if (mysqli_affected_rows($link)) { |
|
|
@ -159,11 +160,7 @@ if ($submit == "add") { |
|
|
|
$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); |
|
|
|
|
|
|
|
?> |
|
|
|
<script> |
|
|
|
window.location.href = "rib01-check.php?id=<?php echo $rib_id ?>&state=1&<?= $token_link ?>"; |
|
|
|
</script> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
$SQL1 = str_replace("'", '', $SQL1); |
|
|
|
$sql_rib = "UPDATE rib SET LastOperatorId = '$user_id', LastOperation='$SQL1' WHERE rib_id=$rib_id"; |
|
|
|