project QadFinancials > class BVAT > method GetTaxEnvironmentAndCalculateTax
Description
Calculate the tax amounts to post, based on an input amount with or without tax
Parameters
icShipFromTaxZone | input | character | |
icShipToTaxZone | input | character | |
icTxclTaxCls | input | character | |
icCurrencyCode | input | character | Tax Currency |
icTransactionType | input | character | Transaction Type |
icDocumentReference | input | character | Document Reference : invoice number, voucher number, ... |
icDocumentNumber | input | character | Document Number : eg po number, payment number, ... |
ilTaxIsIncluded | input | logical | is the Amount with taxes or without ? |
itTaxPointDate | input | date | tax point date |
itPostingDate | input | date | posting date |
icTaxUsageCode | input | character | Tax Usage |
idAmountTC | input | decimal | Amount TC : invoice amount with or without taxes, you can indicate that by setting the input parameter ilTaxIsIncluded |
idExchangeRateScale | input | decimal | Scale factor of the exchange rate |
idExchangeRate | input | decimal | exchange rate |
icCompanyCode | input | character | Company code of the invoice |
icPaymentCondition | input | character | Payment condition : necessary to get the discount percentage |
ilIsTaxInCityFromCompany | input | logical | In city flag from the Headoffice address of the company |
ilIsTaxInCityFromShipTo | input | logical | In city flag from the headoffice address of the ship to |
ilIsTaxable | input | logical | Taxable flag |
idAdjustmentFactor | input | decimal | Adjustment Factor |
iiShipFromAddressID | input | integer | |
iiShipToAddressID | input | integer | |
icCustomerCode | input | character | |
icInvoiceType | input | character | |
tTaxDetail | input-output | temp-table | output records with all tax lines to post in it |
tTaxParametersExtVAT | output | temp-table | |
ocTxenvTaxEnv | output | character | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program7/bvat.p)
<I-1 {bFcStartAndOpenInstance
&CLASS = "PGTM"}>
<M-2 run GetTaxEnvironment
(input false (ilStartAndOpenPGTM),
input icShipFromTaxZone (icShipFromTaxZone),
input icShipToTaxZone (icShipToTaxZone),
input icTxclTaxCls (icTxclTaxCls),
output ocTxenvTaxEnv (ocTxenvTaxEnv),
output viFcReturnSuper (oiReturnStatus)) in BVAT>
if viFcReturnSuper >= 0
then do:
<M-3 run CalculateTax
(input false (ilStartAndOpenPGTM),
input icCurrencyCode (icCurrencyCode),
input icTransactionType (icTransactionType),
input icDocumentReference (icDocumentReference),
input icDocumentNumber (icDocumentNumber),
input ilTaxIsIncluded (ilTaxIsIncluded),
input itTaxPointDate (itTaxPointDate),
input itPostingDate (itPostingDate),
input ocTxenvTaxEnv (icTaxEnvCode),
input icShipFromTaxZone (icFromTaxZoneCode),
input icShipToTaxZone (icToTaxZoneCode),
input icTxclTaxCls (icTaxClassCode),
input icTaxUsageCode (icTaxUsageCode),
input idAmountTC (idAmountTC),
input idExchangeRateScale (idExchangeRateScale),
input idExchangeRate (idExchangeRate),
input icCompanyCode (icCompanyCode),
input icPaymentCondition (icPaymentCondition),
input ilIsTaxInCityFromCompany (ilIsTaxInCityFromCompany),
input ilIsTaxInCityFromShipTo (ilIsTaxInCityFromShipTo),
input ilIsTaxable (ilIsTaxable),
input idAdjustmentFactor (idAdjustmentFactor),
input iiShipToAddressID (iiShipToAddressID),
input iiShipFromAddressID (iiShipFromAddressID),
input icCustomerCode (icCustomerCode),
input icInvoiceType (icInvoiceType),
input-output tTaxDetail (tTaxDetail),
output tTaxParametersExtVAT (tTaxParametersExtVAT),
output viFcReturnSuper (oiReturnStatus)) in BVAT>
end.
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
<I-4 {bFcCloseAndStopInstance
&CLASS = "PGTM"}>