microsoft / ALAppExtensions

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

[Event Request] codeunit 108 "Net Cust/Vend Balances Mgt." - OnNetBalancesBeforeSetVendorRemainingAmount #27204

Closed RZ440 closed 3 weeks ago

RZ440 commented 1 month ago

Describe the request

Hello, can you please add a new Event OnNetBalancesBeforeSetVendorRemainingAmount codeunit 108 "Net Cust/Vend Balances Mgt."?

    local procedure NetBalances(var VendLedgEntry: Record "Vendor Ledger Entry"; var CustLedgEntry: Record "Cust. Ledger Entry"; var VendorRemainingAmount: Decimal; var CustomerRemainingAmount: Decimal; var TempNetAmount: Decimal);
    var
        MinNetAmount: Decimal;
    begin
        NetAmount := NetAmount - TempNetAmount;
        if VendorRemainingAmount = 0 then
            VendLedgEntry.FindFirst();
        if CustomerRemainingAmount = 0 then
            CustLedgEntry.FindFirst();
        repeat
            if VendorRemainingAmount <= 0 then begin
                SetOnHold(VendLedgEntry);
                VendLedgEntry.CalcFields("Remaining Amount");
                OnNetBalancesBeforeSetVendorRemainingAmount(VendLedgEntry);
                VendorRemainingAmount := -VendLedgEntry."Remaining Amount";
                InsertGenJnlLine(VendorGenJnlLine, VendLedgEntry, CustLedgEntry, true);
            end;
    [IntegrationEvent(false, false)]
    local procedure OnNetBalancesBeforeSetVendorRemainingAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")
    begin
    end;

Additional context

We have additional values to calculate the Remaining Amount of the Vendor Ledger Entry and need to recalculate it before being allocated. Internal work item: AB#547390

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

JesperSchulz commented 3 weeks ago

Availability update: We will publish a fix for this issue in the next update for release 25.

Build ID to track: 24487.