Why do you need this change?
Within the Data Dynamic AG construct, there is a requirement to calculate the VAT amount based on custom business logic. For this reason, the event described below is needed.
Describe the request
- Add IntegrationEvent in codeunit 6200 "Non-Deductible VAT"
- Change procedure
CalcRevChargeVATAmountInPurchLine in codeunit 6201 "Non-Ded. VAT Impl.".
New IntegrationEvent in codeunit 6200 "Non-Deductible VAT":
[IntegrationEvent(false, false)]
local procedure OnBeforeCalcRevChargeVATAmountInPurchLine(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var VATAmount: Decimal)
begin
end;
Invoke the new event in the local procedure CalcRevChargeVATAmountInPurchLine in codeunit 6201 "Non-Ded. VAT Impl.".
local procedure CalcRevChargeVATAmountInPurchLine(PurchaseLine: Record "Purchase Line") VATAmount: Decimal;
var
VATPostingSetup: Record "VAT Posting Setup";
Currency: Record Currency;
IsHandled: Boolean;
begin
//Add new IntegrationEvent begin
NonDeductibleVAT.OnBeforeCalcRevChargeVATAmountInPurchLine(PurchaseLine, IsHandled, VATAmount);
If IsHandled then
exit(VATAmount);
//Add new IntegrationEvent end
VATPostingSetup.Get(PurchaseLine."VAT Bus. Posting Group", PurchaseLine."VAT Prod. Posting Group");
Currency.Initialize(PurchaseLine."Currency Code", true);
VATAmount :=
Round(
PurchaseLine.Amount * VATPostingSetup."VAT %" / 100,
Currency."Amount Rounding Precision", Currency.VATRoundingDirection());
end;
Internal work item: AB#632747
Why do you need this change?
Within the Data Dynamic AG construct, there is a requirement to calculate the VAT amount based on custom business logic. For this reason, the event described below is needed.
Describe the request
CalcRevChargeVATAmountInPurchLinein codeunit 6201 "Non-Ded. VAT Impl.".New IntegrationEvent in codeunit 6200 "Non-Deductible VAT":
Invoke the new event in the local procedure
CalcRevChargeVATAmountInPurchLinein codeunit 6201 "Non-Ded. VAT Impl.".Internal work item: AB#632747