Skip to content

[Extensibility Request][FEC Audit File] new integration events on codeunit 10826 "Generate File FEC" #11005

Description

Why do you need this change?

Related to #10598
Currently the "FEC Audit File" extension lacks integration events, specifically in codeunit 10826 "Generate File FEC". Due to business requirements, we need to adjust several values during the audit file export process.

Describe the request

We suggest adding integration events on codeunit 10826 "Generate File FEC". For our business case only Party Name and G/L Account No. need to be adjusted.

1. OnAfterSetCustomerData — in GetLedgerEntryDataForCustVend, after the customer party data is resolved (GLSourceType::Customer branch):

 procedure GetLedgerEntryDataForCustVend(TransactionNo: Integer; SourceType: Enum "Gen. Journal Source Type"; var PartyNo: Code[20]; var PartyName: Text[100]; var FCYAmount: Text[250]; var CurrencyCode: Code[10]; var DocNoSet: Text; var DateApplied: Date)
 begin
     case SourceType of
         GLSourceType::Customer:
             // ...
                     PartyNo := CustLedgerEntry."Customer No.";
                     PartyName := CustLedgerEntry."Customer Name";
+                    OnAfterSetCustomerData(CustLedgerEntry, PartyName);
                     PayRecAccount := GetReceivablesAccount(CustLedgerEntry."Customer Posting Group");
             // ...
 end;

2. OnAfterSetVendorData — in the same GetLedgerEntryDataForCustVend procedure (GLSourceType::Vendor branch):

         GLSourceType::Vendor:
             // ...
                     PartyNo := VendorLedgerEntry."Vendor No.";
                     PartyName := VendorLedgerEntry."Vendor Name";
+                    OnAfterSetVendorData(VendorLedgerEntry, PartyName);
                     PayRecAccount := GetPayablesAccount(VendorLedgerEntry."Vendor Posting Group");
             // ...

3. OnWriteDetailedGLAccountBySourceOnBeforeAppendLine — in WriteDetailedGLAccountBySource, before appending the line:

 local procedure WriteDetailedGLAccountBySource(GLAccountNo: Code[20]; GLAccountName: Text[100]; SourceNo: Code[20]; PartyName: Text[100]; Amount: Decimal)
 begin
     // ...
     if Amount > 0 then
         DebitAmt := Amount
     else
         CreditAmt := -Amount;

+    OnWriteDetailedGLAccountBySourceOnBeforeAppendLine(GLAccountNo);
     AppendLine('00000|' +
       'BALANCE OUVERTURE|' +
       // ...
 end;

4. OnWriteGLAccountOnBeforeAppendLine — in WriteGLAccount, before appending the line:

 local procedure WriteGLAccount(GLAccountNo: Code[20]; GLAccountName: Text[100]; OpeningBalance: Decimal)
 begin
     if OpeningBalance > 0 then
         DebitAmount := OpeningBalance
     else
         CreditAmount := Abs(OpeningBalance);

+    OnWriteGLAccountOnBeforeAppendLine(GLAccountNo);
     AppendLine('00000|' +
       'BALANCE OUVERTURE|' +
       // ...
 end;

5. OnWriteGLEntryToFileOnBeforeAppendLine — in WriteGLEntryToFile, before writing the entry line:

 local procedure WriteGLEntryToFile(var GLEntry: Record "G/L Entry"; ProgressiveNo: Integer; GLRegisterCreationDate: Date; PartyNo: Code[20]; PartyName: Text[100]; FCYAmount: Text[250]; CurrencyCode: Code[10]; DocNoSet: Text; DateApplied: Date)
 begin
     GLEntry.CalcFields(GLEntry."G/L Account Name");

+    OnWriteGLEntryToFileOnBeforeAppendLine(GLEntry);
     AppendLine(
       GetSourceCode(GLEntry) + '|' +
       // ...
 end;

Event declarations:

+    [IntegrationEvent(false, false)]
+    local procedure OnAfterSetCustomerData(CustLedgerEntry: Record "Cust. Ledger Entry"; var PartyName: Text[100])
+    begin
+    end;
+
+    [IntegrationEvent(false, false)]
+    local procedure OnAfterSetVendorData(VendorLedgerEntry: Record "Vendor Ledger Entry"; var PartyName: Text[100])
+    begin
+    end;
+
+    [IntegrationEvent(false, false)]
+    local procedure OnWriteDetailedGLAccountBySourceOnBeforeAppendLine(var GLAccountNo: Code[20])
+    begin
+    end;
+
+    [IntegrationEvent(false, false)]
+    local procedure OnWriteGLAccountOnBeforeAppendLine(var GLAccountNo: Code[20])
+    begin
+    end;
+
+    [IntegrationEvent(false, false)]
+    local procedure OnWriteGLEntryToFileOnBeforeAppendLine(var GLEntry: Record "G/L Entry")
+    begin
+    end;

Provide an implementation (optional)

  • I will provide the implementation for this extensibility request

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions