ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] table 39 "Purchase Line" - OnAfterCalcInvDiscToInvoice
Hi,
Is it possible to add OldInvDiscAmtToInv to OnAfterCalcInvDiscToInvoice publisher?
procedure CalcInvDiscToInvoice()
var
OldInvDiscAmtToInv: Decimal;
begin
GetPurchHeader();
OldInvDiscAmtToInv := "Inv. Disc. Amount to Invoice";
if Quantity = 0 then
Validate("Inv. Disc. Amount to Invoice", 0)
else
Validate(
"Inv. Disc. Amount to Invoice",
Round(
"Inv. Discount Amount" * "Qty. to Invoice" / Quantity,
Currency."Amount Rounding Precision"));
if OldInvDiscAmtToInv <> "Inv. Disc. Amount to Invoice" then begin
"Amount Including VAT" := "Amount Including VAT" - "VAT Difference";
"VAT Difference" := 0;
end;
NotifyOnMissingSetup(FieldNo("Inv. Discount Amount"));
// <<old
OnAfterCalcInvDiscToInvoice(Rec);
// >>old
// <<new
OnAfterCalcInvDiscToInvoice(Rec,OldInvDiscAmtToInv);
// >>new
end;
[IntegrationEvent(false, false)]
// <<old
local procedure OnAfterCalcInvDiscToInvoice(var PurchaseLine: Record "Purchase Line")
// >>old
// <<new
local procedure OnAfterCalcInvDiscToInvoice(var PurchaseLine: Record "Purchase Line"; OldInvDiscAmtToInv: Decimal)
// >>new
begin
end;
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.