[EVENT REQUEST] - Codeunit 60 Sales-Calc. Discount
Dear Al Development Team,
In codeunit 60, local function CalculateInvoiceDiscount, we need an event here:
OLD CODE:
GLSetup.Get();
if GLSetup."Payment Discount Type" <> GLSetup."Payment Discount Type"::"Calc. Pmt. Disc. on Lines"
then
SalesLine2.SetRange("Allow Invoice Disc.", true);
. .
NEW CODE: . . //Init new code OnCalculateInvoiceDiscountOnBeforeGetGLSetup(CustInvDisc, SalesHeader); //end new code GLSetup.Get(); if GLSetup."Payment Discount Type" <> GLSetup."Payment Discount Type"::"Calc. Pmt. Disc. on Lines" then SalesLine2.SetRange("Allow Invoice Disc.", true);
. .
New publisher: [IntegrationEvent(false, false)] local procedure OnCalculateInvoiceDiscountOnBeforeGetGLSetup(var CustInvoiceDisc: Record "Cust. Invoice Disc."; var SalesHeader: Record "Sales Header") begin end;
Thanks.
Hello @aismel87 Please review your request, as, now code is not same like on the image. If this is some of localization, please point us in the right one. Be aware that we are adding new events just in latest version of app (currently BC23)
Hello AL Dev Team!
The code must be here (line 174):
// Init New Code
OnCalculateInvoiceDiscountOnBeforeGetGLSetup(CustInvDisc, SalesHeader);
// End New Code
GLSetup.Get();
if GLSetup."Payment Discount Type" <> GLSetup."Payment Discount Type"::"Calc. Pmt. Disc. on Lines"
then
SalesLine2.SetRange("Allow Invoice Disc.", true);
New publisher:
[IntegrationEvent(false, false)]
local procedure OnCalculateInvoiceDiscountOnBeforeGetGLSetup(var CustInvoiceDisc: Record "Cust. Invoice Disc."; var SalesHeader: Record "Sales Header")
begin
end;
Regards,
Ismael
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.
Build ID: 12672.