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)
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— inGetLedgerEntryDataForCustVend, after the customer party data is resolved (GLSourceType::Customerbranch):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 sameGetLedgerEntryDataForCustVendprocedure (GLSourceType::Vendorbranch):GLSourceType::Vendor: // ... PartyNo := VendorLedgerEntry."Vendor No."; PartyName := VendorLedgerEntry."Vendor Name"; + OnAfterSetVendorData(VendorLedgerEntry, PartyName); PayRecAccount := GetPayablesAccount(VendorLedgerEntry."Vendor Posting Group"); // ...3.
OnWriteDetailedGLAccountBySourceOnBeforeAppendLine— inWriteDetailedGLAccountBySource, 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— inWriteGLAccount, 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— inWriteGLEntryToFile, 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:
Provide an implementation (optional)