microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
748 stars 600 forks source link

Codeunit 5988 - OnPostDocumentLinesBeforeInvoiceRounding #26773

Closed LaChris123 closed 4 days ago

LaChris123 commented 6 days ago

Describe the request

The following events are required for this object:

[IntegrationEvent(false, false)]
local procedure OnPostDocumentLinesBeforeInvoiceRounding(var ServiceHeader: Record "Service Header"; var ServiceLine: Record "Service Line"; var TotalServiceLine: Record "Service Line"; var ServAmountsMgt: Codeunit "Serv-Amounts Mgt."; var LastLineRetrieved: Boolean; BiggestLineNo: Integer; var IsHandled: Boolean)
begin
end;

Additional context

             procedure PostDocumentLines(var Window: Dialog)
             var
             begin

             OnPostDocumentLinesOnAfterFillInvPostingBuffer(ServHeader, ServLine, ServiceLineACY);

                // prepare posted document lines
                if Ship then
                    PrepareShipmentLine(TempServiceLine, WarrantyNo);
                if Invoice then
                    if "Document Type" in ["Document Type"::Order, "Document Type"::Invoice] then
                        PrepareInvoiceLine(TempServiceLine)
                    else
                        PrepareCrMemoLine(TempServiceLine);

                if Invoice or Consume then
                    CollectValueEntryRelation;

                if ServAmountsMgt.RoundingLineInserted then
                    LastLineRetrieved := true
                else begin
                    BiggestLineNo := ServAmountsMgt.MAX(ServAmountsMgt.GetLastLineNo(ServLine), "Line No.");
                    LastLineRetrieved := Next() = 0; // ServLine
                    //EVENT REQUEST
                    IsHandled := false;
                    OnPostDocumentLinesBeforeInvoiceRounding(ServHeader, ServLine, TotalServiceLine, ServAmountsMgt, LastLineRetrieved, BiggestLineNo, IsHandled);
                    if not IsHandled then
                        //EVENT REQUEST
                        if LastLineRetrieved and SalesSetup."Invoice Rounding" then
                            ServAmountsMgt.InvoiceRounding(ServHeader, ServLine, TotalServiceLine,
                              LastLineRetrieved, false, BiggestLineNo);
                end;
            end; // With ServLine

Internal work item: AB#539933

JesperSchulz commented 4 days ago

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: 21513.