Hello, can you please add a new Event OnPrepareVendorLedgerEntryForApplicationOnBeforeSetAmountToApply in codeunit 1250 "Match General Journal Lines"?
local procedure PrepareVendorLedgerEntryForApplication(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")
begin
VendorLedgerEntry.CalcFields("Remaining Amount", "Remaining Amt. (LCY)");
OnPrepareVendorLedgerEntryForApplicationOnBeforeSetAmountToApply(VendorLedgerEntry);
VendorLedgerEntry."Applies-to ID" := GenJournalLine."Document No.";
if Abs(VendorLedgerEntry."Remaining Amt. (LCY)") < Abs(GenJournalLine."Amount (LCY)") then
VendorLedgerEntry."Amount to Apply" := VendorLedgerEntry."Remaining Amount"
else
VendorLedgerEntry."Amount to Apply" := -GenJournalLine.Amount;
CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", VendorLedgerEntry);
end;
[IntegrationEvent(false, false)]
local procedure OnPrepareVendorLedgerEntryForApplicationOnBeforeSetAmountToApply(var VendorLedgerEntry: Record "Vendor 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#547387
Describe the request
Hello, can you please add a new Event OnPrepareVendorLedgerEntryForApplicationOnBeforeSetAmountToApply 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#547387