Skip to content

[Event Change Request] codeunit 12170 "Recall Customer Bill" - InitGenJnlLine procedure #30255

@salifmbaye28

Description

@salifmbaye28

Why do you need this change?

Dear support, in codeunit 12170 "Recall Customer Bill" we need to add the global variable CustomerBillLine as a parameter in the OnAfterInitGenJnlLine event for a client implementation that we need to migrate from Navision to BC.

Describe the request

[Changes between **]

[IntegrationEvent(false, false)]
local procedure OnAfterInitGenJnlLine(var GenJournalLine: Record "Gen. Journal Line"; var CustLedgerEntry: Record "Cust. Ledger Entry"; ** CustBillLine: Record "Customer Bill Line"; ** var AccountNo: Code[20])
begin
end;

[Changes between **]

procedure InitGenJnlLine(AccountNo: Code[20])
begin
    GenJnlLine.Init();
    GenJnlLine.Validate("Posting Date", WorkDate());
    GenJnlLine."Document Date" := WorkDate();
    GenJnlLine."Document Type" := GenJnlLine."Document Type"::" ";
    GenJnlLine."Document No." := CustLedgEntry."Document No.";

    Window.Update(3, GenJnlLine."Document No.");

    GenJnlLine."External Document No." := CustLedgEntry."External Document No.";
    GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
    GenJnlLine.Validate("Account No.", CustLedgEntry."Customer No.");
    GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"G/L Account";
    GenJnlLine.Validate("Bal. Account No.", AccountNo);
    GenJnlLine.Description := SalesSetup."Recall Bill Description";
    GenJnlLine."Source Code" := CustLedgEntry."Source Code";
    GenJnlLine."Reason Code" := CustLedgEntry."Reason Code";
    GenJnlLine."Shortcut Dimension 1 Code" := CustLedgEntry."Global Dimension 1 Code";
    GenJnlLine."Shortcut Dimension 2 Code" := CustLedgEntry."Global Dimension 2 Code";
    GenJnlLine."Dimension Set ID" := CustLedgEntry."Dimension Set ID";

    CustLedgEntry.CalcFields("Remaining Amount");
    GenJnlLine.Amount := -CustLedgEntry."Remaining Amount";
    GenJnlLine.Validate("Currency Code", CustLedgEntry."Currency Code");
    GenJnlLine."Amount (LCY)" := -CustLedgEntry."Remaining Amt. (LCY)";
    GenJnlLine."Allow Application" := true;
    GenJnlLine."Bank Receipt" := CustLedgEntry."Bank Receipt";
    GenJnlLine."Applies-to Doc. Type" := CustLedgEntry."Document Type";
    GenJnlLine."Applies-to Doc. No." := CustLedgEntry."Document No.";
    GenJnlLine."Applies-to Occurrence No." := CustLedgEntry."Document Occurrence";
    GenJnlLine."Document Type to Close" := CustLedgEntry."Document Type to Close";
    GenJnlLine."Document No. to Close" := CustLedgEntry."Document No. to Close";
    GenJnlLine."Document Occurrence to Close" := CustLedgEntry."Document Occurrence to Close";
    OnAfterInitGenJnlLine(GenJnlLine, CustLedgEntry, ** CustomerBillLine, ** AccountNo);
end;

Internal work item: AB#638181

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance areaevent-requestRequest for adding an event

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions