microsoft / ALAppExtensions

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

[Event request] codeunit 444 "Purchase-Post Prepayments": BuildInvLineBuffer procedure #26948

Closed tguyonnet closed 3 weeks ago

tguyonnet commented 1 month ago

Describe the request

` var PrepmtInvLineBuf2: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferDummy: Record "Prepayment Inv. Line Buffer"; PurchSetup: Record "Purchases & Payables Setup"; // >>>>>>>> IsHandled: Boolean; // <<<<<<<< begin TempGlobalPrepmtInvLineBuf.Reset(); TempGlobalPrepmtInvLineBuf.DeleteAll(); TempPurchaseLine.Reset(); TempPurchaseLine.DeleteAll(); PurchSetup.Get(); ApplyFilter(PurchHeader, DocumentType, PurchLine); if PurchLine.Find('-') then repeat // >>>>>>>> IsHandled := false; OnBeforePrepmtAmountOnBuildInvLineBuffer(PurchHeader, PurchLine, PrepmtInvLineBuf2, PrepmtInvLineBuf, TempPurchaseLine); if not IsHandled then // <<<<<<<<

            if PrepmtAmount(PurchLine, DocumentType) <> 0 then begin
                FillInvLineBuffer(PurchHeader, PurchLine, PrepmtInvLineBuf2);
                if UpdateLines then
                    TempGlobalPrepmtInvLineBuf.CopyWithLineNo(PrepmtInvLineBuf2, PurchLine."Line No.");
                PrepmtInvLineBuf.InsertInvLineBuffer(PrepmtInvLineBuf2);
                if PurchSetup."Invoice Rounding" then
                    RoundAmounts(
                      PurchHeader, PrepmtInvLineBuf2, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferDummy);
                TempPurchaseLine := PurchLine;
                TempPurchaseLine.Insert();
            end;
        until PurchLine.Next() = 0;

`

// >>>>>>>> [IntegrationEvent(false, false)] local procedure OnBeforePrepmtAmountOnBuildInvLineBuffer(PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TempPurchaseLineSource: Record "Purchase Line" temporary); begin end; // <<<<<<<<

Additional context

Transfert from purch order to purch invoice lines with type = " " Internal work item: AB#543569

azure-boards[bot] commented 1 month ago

✅ Successfully linked to Azure Boards work item(s):

AleksandricMarko commented 1 month ago

Hello @tguyonnet Does this structure fit your need image

tguyonnet commented 4 weeks ago

yes it fit, perfect!

JesperSchulz commented 3 weeks 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: 23098.