ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] table 5902 "Service Line" - OnAfterCalcInvDiscToInvoice

Open iltererdogan opened this issue 5 years ago • 1 comments

Hi,

Is it possible to add OnAfterCalcInvDiscToInvoice publisher to service line table?

local procedure CalcInvDiscToInvoice()
var
    OldInvDiscAmtToInv: Decimal;
begin
    GetServHeader;
    OldInvDiscAmtToInv := "Inv. Disc. Amount to Invoice";
    if (Quantity = 0) or (CalcChargeableQty = 0) then
        Validate("Inv. Disc. Amount to Invoice", 0)
    else
        Validate(
          "Inv. Disc. Amount to Invoice",
          Round(
            "Inv. Discount Amount" * "Qty. to Invoice" / CalcChargeableQty,
            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"));

    // <<new
    OnAfterCalcInvDiscToInvoice(Rec, OldInvDiscAmtToInv);
    // >>new
end;

// <<new
[IntegrationEvent(false, false)]
local procedure OnAfterCalcInvDiscToInvoice(var ServiceLine: Record "Service Line"; OldInvDiscAmtToInv: Decimal)
begin
end;
// >>new

iltererdogan avatar Nov 22 '21 14:11 iltererdogan

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.

JesperSchulz avatar Nov 29 '21 06:11 JesperSchulz