Hello, can you please add a new Event OnPrepareCustLedgerEntryForApplicationOnBeforeSetAmountToApply in codeunit 1250 "Match General Journal Lines"?
procedure PrepareCustLedgerEntryForApplication(var CustLedgerEntry: Record "Cust. Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")
begin
CustLedgerEntry.CalcFields("Remaining Amount", "Remaining Amt. (LCY)");
OnPrepareCustLedgerEntryForApplicationOnBeforeSetAmountToApply(CustLedgerEntry);
CustLedgerEntry."Applies-to ID" := GenJournalLine."Document No.";
if Abs(CustLedgerEntry."Remaining Amt. (LCY)") < Abs(GenJournalLine."Amount (LCY)") then
CustLedgerEntry."Amount to Apply" := CustLedgerEntry."Remaining Amount"
else
CustLedgerEntry."Amount to Apply" := -GenJournalLine.Amount;
CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", CustLedgerEntry);
end;
[IntegrationEvent(false, false)]
local procedure OnPrepareCustLedgerEntryForApplicationOnBeforeSetAmountToApply(var CustLedgerEntry: Record "Cust. Ledger Entry")
begin
end;
Additional context
We have additional values to calculate the Remaining Amount and need to recalculate it before being allocated and the record being modified.
Internal work item: AB#547389
Describe the request
Hello, can you please add a new Event OnPrepareCustLedgerEntryForApplicationOnBeforeSetAmountToApply in codeunit 1250 "Match General Journal Lines"?
Additional context
We have additional values to calculate the Remaining Amount and need to recalculate it before being allocated and the record being modified. Internal work item: AB#547389