|
|
@ -224,13 +224,13 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
$WriteOffDescribe = empty($rib['WriteOffDescribe']) ? null : $rib['WriteOffDescribe']; |
|
|
|
$DeptId = $rib['DeptId']; |
|
|
|
$CostCenterId = empty($rib['CostCenterId']) ? Null : $rib['CostCenterId']; |
|
|
|
$HadPayOAmount = $rib['HadPayOAmount']; |
|
|
|
$HadPayLAmount = $rib['HadPayLAmount']; |
|
|
|
$UnPayOAmount = $rib['UnPayOAmount']; |
|
|
|
$UnPayLAmount = $rib['UnPayLAmount']; |
|
|
|
$HadPayOAmount = $CurrId=="TWD"? round($rib['HadPayOAmount']):round($rib['HadPayOAmount'],2); |
|
|
|
$HadPayLAmount = $CurrId=="TWD"? round($rib['HadPayLAmount']):round($rib['HadPayLAmount'],2); |
|
|
|
$UnPayOAmount = $CurrId=="TWD"? round($rib['UnPayOAmount']):round($rib['UnPayOAmount'],2); |
|
|
|
$UnPayLAmount = $CurrId=="TWD"? round($rib['UnPayLAmount']):round($rib['UnPayLAmount'],2); |
|
|
|
$PaymentState = $rib['PaymentState']; |
|
|
|
$Balance = $rib['Balance']; |
|
|
|
$LBalance = $rib['LBalance']; |
|
|
|
$Balance = $CurrId=="TWD"? round($rib['Balance']):round($rib['Balance'],2); |
|
|
|
$LBalance = $CurrId=="TWD"? round($rib['LBalance']):round($rib['LBalance'],2); |
|
|
|
$GatheringPersonId = $rib['GatheringPersonId']; |
|
|
|
$GatheringPersonDescribe = empty($rib['GatheringPersonDescribe']) ? Null : $rib['GatheringPersonDescribe']; |
|
|
|
$BankId = empty($rib['BankId']) ? Null : $rib['BankId']; |
|
|
@ -241,19 +241,20 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
$BankAccount = empty($rib['BankAccount']) ? Null : $rib['BankAccount']; |
|
|
|
$BankAccountName = empty($rib['BankAccountName']) ? Null : $rib['BankAccountName']; |
|
|
|
$IsTaxBill = $rib['IsTaxBill']; |
|
|
|
$OAmount = $rib['OAmount']; |
|
|
|
$LAmount = $rib['LAmount']; |
|
|
|
$OTax = $rib['OTax']; |
|
|
|
$LTax = $rib['LTax']; |
|
|
|
$LAmountWithTax = $rib['LAmountWithTax']; |
|
|
|
$OAmountWithTax = $rib['OAmountWithTax']; |
|
|
|
$OAmount = $CurrId=="TWD"? round($rib['OAmount']):round($rib['OAmount'],2); |
|
|
|
$LAmount = $CurrId=="TWD"? round($rib['LAmount']):round($rib['LAmount'],2); |
|
|
|
$OTax = $CurrId=="TWD"? round($rib['OTax']):round($rib['OTax'],2); |
|
|
|
$LTax = $CurrId=="TWD"? round($rib['LTax']):round($rib['LTax'],2); |
|
|
|
$LAmountWithTax = $CurrId=="TWD"? round($rib['LAmountWithTax']):round($rib['LAmountWithTax'],2); |
|
|
|
$OAmountWithTax = $CurrId=="TWD"? round($rib['OAmountWithTax']):round($rib['OAmountWithTax'],2); |
|
|
|
$IsContainTax = $rib['IsContainTax']; |
|
|
|
$AdvanceOAmount = $rib['AdvanceOAmount']; |
|
|
|
$AdvanceLAmount = $rib['AdvanceLAmount']; |
|
|
|
$AdvanceOAmount = $CurrId=="TWD"? round($rib['AdvanceOAmount']):round($rib['AdvanceOAmount'],2); |
|
|
|
$AdvanceLAmount = $CurrId=="TWD"? round($rib['AdvanceLAmount']):round($rib['AdvanceLAmount'],2); |
|
|
|
$PrePayWriteOffAmount = $rib['PrePayWriteOffAmount']; |
|
|
|
$WriteOffAmount = $rib['WriteOffAmount']; |
|
|
|
$WriteOffAmount = $CurrId=="TWD"? round($rib['WriteOffAmount']):round($rib['WriteOffAmount'],2); |
|
|
|
$TelNo = empty($rib['TelNo']) ? Null : $rib['TelNo']; |
|
|
|
$UnPaymentLAmt = empty($rib['UnPaymentLAmt']) ? null : $rib['UnPaymentLAmt']; |
|
|
|
$UnPaymentLAmt = empty($rib['UnPaymentLAmt']) ? null : ($CurrId=="TWD"? round($rib['UnPaymentLAmt']):round($rib['UnPaymentLAmt'],2)); |
|
|
|
$CreatorId = $rib['CreatorId']; |
|
|
|
|
|
|
|
|
|
|
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
|
|
@ -262,14 +263,14 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
HadPayOAmount,HadPayLAmount,UnPayOAmount,UnPayLAmount,PaymentState,Balance,LBalance, |
|
|
|
FillUp,GatheringBizOrgId, GatheringPersonId, IsTaxBill, OAmount,LAmount,OTax,LTax,LAmountWithTax,OAmountWithTax, |
|
|
|
IsContainTax,AdvanceOAmount,AdvanceLAmount,PrePayWriteOffAmount,WriteOffAmount, |
|
|
|
CompId,UnPaymentOAmt,UnPaymentLAmt,IsPayment, CurrentState,PermitState"; |
|
|
|
CompId,UnPaymentOAmt,UnPaymentLAmt,IsPayment, CurrentState,PermitState,CreatorId"; |
|
|
|
|
|
|
|
$sql2 = ") VALUES ('$BillNo',$BillDate,'1000','1000','$TypeId','1000', |
|
|
|
'$CurrId','$TransactId',$WriteOffType,'1000','$WriteOffId','$DeptId', |
|
|
|
$HadPayOAmount,$HadPayLAmount,$UnPayOAmount,$UnPayLAmount,$PaymentState,$Balance,$LBalance, |
|
|
|
0,'1000','$GatheringPersonId',$IsTaxBill,$OAmount,$LAmount,$OTax,$LTax,$LAmountWithTax,$OAmountWithTax, |
|
|
|
$IsContainTax,$AdvanceOAmount,$AdvanceLAmount,$PrePayWriteOffAmount,$WriteOffAmount, |
|
|
|
'1001',$WriteOffAmount,$UnPaymentLAmt,0,2,0"; |
|
|
|
'1001',$WriteOffAmount,$UnPaymentLAmt,0,2,0,'$CreatorId'"; |
|
|
|
|
|
|
|
$sql .= empty($CostCenterId) ? "" : ",CostCenterId"; |
|
|
|
$sql2 .= empty($CostCenterId) ? "" : ",'" . $CostCenterId . "'"; |
|
|
@ -309,18 +310,18 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
$CostCenterId = empty($ribsub['CostCenterId']) ? Null : $ribsub['CostCenterId']; |
|
|
|
$UnitId = $ribsub['UnitId']; |
|
|
|
$Quantity = $ribsub['Quantity']; |
|
|
|
$Price = $ribsub['Price']; |
|
|
|
$CurrOAmount = $ribsub['CurrOAmount']; |
|
|
|
$CurrLAmount = $ribsub['CurrentLAmount']; |
|
|
|
$Price = $CurrId=="TWD"? round($ribsub['Price']) : round($ribsub['Price'],2); |
|
|
|
$CurrOAmount = $CurrId=="TWD"? round($ribsub['CurrOAmount']) : round($ribsub['CurrOAmount'],2); |
|
|
|
$CurrLAmount = $CurrId=="TWD"? round($ribsub['CurrentLAmount']): round($ribsub['CurrentLAmount'],2); |
|
|
|
$TaxId = $ribsub['TaxId']; |
|
|
|
$TaxRate = $ribsub['TaxRate']; |
|
|
|
$OTax = $ribsub['OTax']; |
|
|
|
$LTax = $ribsub['LTax']; |
|
|
|
$LAmountUnWithTax = $ribsub['LAmountUnWithTax']; |
|
|
|
$OAmountUnWithTax = $ribsub['OAmountUnWithTax']; |
|
|
|
$OAmount = $ribsub['OAmount']; |
|
|
|
$LAmount = $ribsub['LAmount']; |
|
|
|
$FeeBalance = $ribsub['FeeBalance']; |
|
|
|
$OTax = $CurrId=="TWD"? round($ribsub['OTax']): round($ribsub['OTax'],2); |
|
|
|
$LTax = $CurrId=="TWD"? round($ribsub['LTax']): round($ribsub['LTax'],2); |
|
|
|
$LAmountUnWithTax = $CurrId=="TWD"? round($ribsub['LAmountUnWithTax']): round($ribsub['LAmountUnWithTax'],2); |
|
|
|
$OAmountUnWithTax = $CurrId=="TWD"? round($ribsub['OAmountUnWithTax']): round($ribsub['OAmountUnWithTax'],2); |
|
|
|
$OAmount = $CurrId=="TWD"? round($ribsub['OAmount']): round($ribsub['OAmount'],2); |
|
|
|
$LAmount = $CurrId=="TWD"? round($ribsub['LAmount']): round($ribsub['LAmount'],2); |
|
|
|
$FeeBalance = $CurrId=="TWD"? round($ribsub['FeeBalance']): round($ribsub['FeeBalance'],2); |
|
|
|
$VoucherCount = $ribsub['VoucherCount']; |
|
|
|
|
|
|
|
$FeeNoteShow = empty($ribsub['FeeNoteShow']) ? Null : $ribsub['FeeNoteShow']; |
|
|
@ -341,13 +342,13 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
$sqlsub = "INSERT INTO glFeeWriteOffSub (BillNo, RowCode,RowNo,FeeDate,FeeTypeId, WriteOffType, |
|
|
|
BizOrgId, WriteOffId, FeeOrgId, FeeDeptId, FeeCompanyId, UnitId , |
|
|
|
Quantity, Price, CurrOAmount,CurrLAmount,TaxId,TaxRate,OTax,LTax,LAmountUnWithTax |
|
|
|
,OAmountUnWithTax,OAmount,LAmount,FeeBalance,VoucherCount,CurrId,WriteOffAmount,SupplyOrgId,IsCounteract,IsKeyByFeeInfo,CreatorId |
|
|
|
,OAmountUnWithTax,OAmount,LAmount,FeeBalance,VoucherCount,CurrId,WriteOffAmount,SupplyOrgId,IsCounteract,IsKeyByFeeInfo |
|
|
|
"; |
|
|
|
|
|
|
|
$sqlsub2 = ") VALUES ('$BillNo',$RowCode, $RowNo,$FeeDate,'$FeeTypeId',$WriteOffType, |
|
|
|
'1000','$WriteOffId','1000','$FeeDeptId','1000','$UnitId', |
|
|
|
$Quantity, $Price, $CurrOAmount, $CurrLAmount,'$TaxId',$TaxRate,$OTax,$LTax,$LAmountUnWithTax |
|
|
|
,$OAmountUnWithTax,$OAmount,$LAmount,$FeeBalance,$VoucherCount,'$CurrId',$WriteOffAmount,'1000',$IsCounteract,0,$CreatorId |
|
|
|
,$OAmountUnWithTax,$OAmount,$LAmount,$FeeBalance,$VoucherCount,'$CurrId',$WriteOffAmount,'1000',$IsCounteract,0 |
|
|
|
"; |
|
|
|
|
|
|
|
$sqlsub .= empty($WriteOffDescribe) ? "" : ",WriteOffDescribe"; |
|
|
@ -374,7 +375,6 @@ OAmount =$OAmount, UnPayOAmount=$UnPayOAmount, Balance = $OAmountWithTax, LBalan |
|
|
|
|
|
|
|
$sqlsub .= $sqlsub2; |
|
|
|
$sqlsub .= ")"; |
|
|
|
|
|
|
|
$result2 = $conn->query($sqlsub); |
|
|
|
} |
|
|
|
|
|
|
|