ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[EVENT REQUEST] - Codeunit 60 Sales-Calc. Discount

Open aismel87 opened this issue 3 years ago • 3 comments

Dear Al Development Team,

In codeunit 60, local function CalculateInvoiceDiscount, we need an event here:

image

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.

aismel87 avatar Sep 20 '23 10:09 aismel87

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)

AleksandricMarko avatar Sep 21 '23 13:09 AleksandricMarko

Hello AL Dev Team!

The code must be here (line 174):

image

// 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

aismel87 avatar Sep 21 '23 15:09 aismel87

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.

JesperSchulz avatar Oct 03 '23 08:10 JesperSchulz