Hi everyone, I’m trying to map the bank details for our LE on the free text invoice, but I can’t find the fields in F&O this is supposed to map to. I’ve updated the bank details under the legal entity as well as under Cash & Bank Mngmt, but the data is not in the ddsp when I generate it.
We have more than one bank account under C&BM.
On the LE bank setup not all the fields are available, and some are not editable after creating the company.
Hi @Nicky ,
Welcome to the community!
I managed to quickly do some test and I am able to get the Bank information to the DDSP when I print FreeTextInvoice.Report:
<BankAccount Bank="USMF OPER" CurrencyCode="USD" Giro="" IBAN="" Name="Operating account - USD" SWIFT="UNCRUS99324" />
This data is configured in Cash and Bank management > Bank accounts:
Hi Semir,
Thank you, I tested it again and it pulls the data on the free text invoice. We would need to add the bank account number field though.
Hi Nicky,
That is correct. You can add this method into your DSP class to add data in the Bank Account node.
Here is an example you can use:
protected void addGeneralDataSectionBaseCompanyInfo(DocXmlRecord _currentCompanyDataRecord, CompanyInfo _currentCompanyInfo)
{
BankAccountTable bankAccount;
DocXmlRecord bankAccountDataRecord;
super(_currentCompanyDataRecord, _currentCompanyInfo);
select firstOnly BankCompanyStatementName, BankDestinationName, BankGroupId from bankAccount
where bankAccount.dataAreaId == _currentCompanyInfo.DataArea &&
bankAccount.AccountID == _currentCompanyInfo.Bank;
// Add additional data fields to the BankAccount data record, a child record of CurrentCompany.
bankAccountDataRecord = _currentCompanyDataRecord.getFirstChildRecordByName('BankAccount');
bankAccountDataRecord.addCalculatedField('CompanyStatementName', bankAccount.BankCompanyStatementName, literalStr("@SYS95023"));
bankAccountDataRecord.addCalculatedField('DestinationName', bankAccount.BankDestinationName, literalStr("@SYS23725"));
bankAccountDataRecord.addCalculatedField('Group', BankGroup::find(bankAccount.BankGroupId).Name, literalStr("@SYS54424"));
}
This example shows how to add CompanyStatementName, DestinationName and Group fields to the BankAccount node.