Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] Codeunit 367 - "CheckManagement".UnApplyVendInvoices - OnBeforeUnApplyVendInvoices #27829

Open
GiangLNT56 opened this issue Dec 18, 2024 · 0 comments
Labels
event-request Request for adding an event Finance GitHub request for Finance area

Comments

@GiangLNT56
Copy link

GiangLNT56 commented Dec 18, 2024

Describe the request

Dear team,
Could we get the event OnBeforeUnApplyVendInvoices on Codeunit 367 - "CheckManagement"?

local procedure UnApplyVendInvoices(var CheckLedgEntry: Record "Check Ledger Entry"; VoidDate: Date): Boolean
    var
        BankAccountLedgerEntry: Record "Bank Account Ledger Entry";
        OrigPaymentVendorLedgerEntry: Record "Vendor Ledger Entry";
        PayDetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry";
        GenJournalLine3: Record "Gen. Journal Line";
        AppliesID: Code[50];
        **Result: Boolean;
        IsHandled: Boolean;**
    begin
        **IsHandled := false;
        OnBeforeUnApplyVendInvoices(CheckLedgEntry, VoidDate, IsHandled, Result);
        If IsHandled then
            exit(Result);**

        BankAccountLedgerEntry.Get(CheckLedgEntry."Bank Account Ledger Entry No.");
        if CheckLedgEntry."Bal. Account Type" = CheckLedgEntry."Bal. Account Type"::Vendor then begin
            OrigPaymentVendorLedgerEntry.SetCurrentKey("Transaction No.");
            OrigPaymentVendorLedgerEntry.SetRange("Transaction No.", BankAccountLedgerEntry."Transaction No.");
            OrigPaymentVendorLedgerEntry.SetRange("Document No.", BankAccountLedgerEntry."Document No.");
            OrigPaymentVendorLedgerEntry.SetRange("Posting Date", BankAccountLedgerEntry."Posting Date");
            if not OrigPaymentVendorLedgerEntry.FindFirst() then
                exit(false);
        end
        else
            exit(false);
 
        AppliesID := CheckLedgEntry."Document No.";
    ...
[IntegrationEvent(false, false)]
local procedure OnBeforeUnApplyVendInvoices(var CheckLedgEntry: Record "Check Ledger Entry"; VoidDate: Date; var IsHandled: Boolean; var Result: Boolean);
begin
end;

Thank you in advance!

Additional context

I'd like to have logic added here.
Internal work item: AB#561106

@haoranpb haoranpb added event-request Request for adding an event Finance GitHub request for Finance area labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event Finance GitHub request for Finance area
Projects
None yet
Development

No branches or pull requests

2 participants