Skip to content

[ES] Codeunit 7000000 CarteraManagement - Refactor the Functions InsertReceivableDocs and InsertPayableDocs  #30068

@cesarbs77

Description

@cesarbs77

Why do you need this change?

We need to use the standar functions for InsertReceivableDocs or InsertPayableDocs in batch mode without open a form for select the "Cartera Docs." to insert

Describe the request

We nee taht the code will be Refactor using new functions creating a new function with the code after the Run of the page, for use externally, like this:

Old Code
if CarteraDocuments.RunModal() <> ACTION::LookupOK then
exit;
CarteraDocuments.GetSelected(CarteraDoc);
Clear(CarteraDocuments);
if not CarteraDoc.Find('-') then
exit;

New Code

if CarteraDocuments.RunModal() <> ACTION::LookupOK then
exit;

CarteraDocuments.GetSelected(CarteraDoc);
Clear(CarteraDocuments);

InsertSelectedCarteraDocs(GroupNo, BillGr, CarteraDoc)
end;

procedure InsertSelectedCarteraDocs(GroupNo: Code[20]; var BillGr: Record "Bill Group"; var CarteraDoc: Record "Cartera Doc.")
var
BankAcc: Record "Bank Account";
CarteraSetup: Record "Cartera Setup";
CustLedgEntry: Record "Cust. Ledger Entry";
CheckDiscCreditLimit: Page "Check Discount Credit Limit";
SelectedAmount: Decimal;
begin
if not CarteraDoc.Find('-') then
exit;

Internal work item: AB#635592

Metadata

Metadata

Assignees

No one assigned

    Labels

    FinanceGitHub request for Finance arearequest-for-externalRequest for exposing a function for extension development

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions