microsoft / microsoft/BCApps

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

Open
#10,598 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved missing-info Team: Finance
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Describe the issue

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.

Expected behavior

We suggest adding integration events and changing the Access property 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;
Steps to reproduce

.

Additional context

No response

I will provide a fix for a bug
  • I will provide a fix for a bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in codeunit 10826 "Generate File FEC" and inspect GetLedgerEntryDataForCustVend, WriteDetailedGLAccountBySource, WriteGLAccount, and WriteGLEntryToFile. Review nearby integration-event declarations and add the five requested extension points at the indicated locations, with mutable values where shown. Done means subscribers can adjust Party Name, G/L Account No., and related line values during FEC export.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.