Hello everyone, i want to add some missing fields to the sales invoice report.
In the sales invoice report, we have 3 datasets:SalesInvoiceHeaderFooterTmp, SalesInvoiceLocalizationTmp and SalesInvoiceDS
1.tables that i have added the missing fields: SalesInvoiceHeaderFooterTmp and SalesInvoiceLocalizationTmp (Extension)
2. i added the fields Ex_PreparedBy, Ex_ReceivedBy, Ex_Salesperson, Ex_BankAddress and Ex_Beneficary to the table SalesInvoiceHeaderFooterTmp and the fields Ex_TaxRate and Ex_VAT to the table SalesInvoiceLocalizationTmp
3. Data type of fields: Ex_TaxRate (String), Ex_VAT(String),Ex_Beneficiary(String),Ex_BankAddress(String),Ex_PreparedBy(String),Ex_ReceivedBy(String), Ex_SalesPerson(Int64),
Now i need to do extension of the original data provider class which is SalesInvoiceDP (use extension of ) to add these fields.
but im facing some issue with coding this class. Is there some missing step i forgot to configure?
Hi, I just checked your query and have replied in new thread. Please Mark the answer/s that helped you in this thread for other fields and lets discuss TaxAmount in new thread.
Hello mohit, as u can see in the screenshot, im facing an issue with the selected fields, the calculation is coming wrong for my sales invoice report. also the tax rate is coming blank even after i did the class for it. i will share it with u.
This class is related to showing the tax rate which i am mapping from the taxtrans table and the taxvalue field.
please i am facing challenges with the calculation of the fields also. hope u can help .
But im facing an issue, im trying to read the packing slip id from custpackingslipjour table into my table and field, what i did is :
CustPackingSlipJour custpackingslipjourLocal = custpackingslipjour::findRecId(_packingSlipJourRecId);
headerFooterTmp.Ex_PackingSlip = custpackingslipjour.PackingSlipId;
i think my problem is with the method , can u help?
actually regarding these fields, i was able to fix it. here's how i did it:
BankAccountTable bankAccountTableLocal = BankAccountTable::find(companyinfoLocal.Bank);
LogisticsPostalAddress bankAddress = bankAccountTableLocal.postalAddress();
headerFooterTmp.SwiftNumber = bankAccountTableLocal.SWIFTNo; // Swift
headerFooterTmp.Iban = bankAccountTableLocal.IBAN; // Iban
headerFooterTmp.CompanyBankName = bankAccountTableLocal.Name; // bank name
headerFooterTmp.CompanyBankAccount = bankAccountTableLocal.AccountID; // bank account
headerFooterTmp.Ex_BankAddress = bankAddress.Street; // bank address
Hi Mounir, As mentioned before, I have written the code for reference. IBAN, Swift and bank name fields are already in BankAccountTable. Please use below code and if faced any issue then let us know what steps you have done to fix it.
Note: Please change YourSwiftNoField and YourIBANField to actual field names.
headerFooterTmp.Ex_BankAddress = bankAccountTableLocal.postalAddress().Address; headerFooterTmp.YourIBANFIeld = bankAccountTableLocal.IBAN; headerFooterTmp.YourSwiftNoField = bankAccountTableLocal.SWIFTNo; headerFooterTmp.CompanyBankName = bankAccountTableLocal.Name;
Then first check what is there in expression of those fields in report. Because sometimes those expressions may get removed. If expression is correct then check, if data is coming to temp table via SSMS because mostly for standard temp tables, they will have regular tables only.
If above doesn't give you progress then find reference on this fields from temp table and check where the code is getting overridden.
Please let us know an update on this.
for the other 3 fields, these fields are already found in the table and are created by microsoft, but for some reasons they are reading data while the field in the bank account has data.
For type conversion error, you can check what to map or how to convert.
For other 3 fields which are empty, have you given the same SQL query and tried that in SSMS? If yes, is it showing data? If not then first try getting data in SSMS and replicate the same in vs.
Please let us know if you face any issues.
after i pasted the same logic of ur code, only the bank account field is getting data, for the bank address, i got this error : "Cannot implicitly convert from type 'LogisticsPostalAddress' to type 'str'."
while for bank name, iban and swift code they still empty.
[DataEventHandler(tableStr(SalesInvoiceHeaderFooterTmp), DataEventType::Inserting)] public static void SalesInvoiceHeaderFooterTmp_onInserting(Common sender, DataEventArgs e) { SalesInvoiceHeaderFooterTmp headerFooterTmp = sender as SalesInvoiceHeaderFooterTmp; CompanyInfo companyinfoLocal = CompanyInfo::find(); BankAccountTable bankAccountTableLocal = BankAccountTable::find(companyinfoLocal.Bank); headerFooterTmp.CompanyBankAccount = bankAccountTableLocal.AccountID; // bank acount headerFooterTmp.Ex_BankAddress = bankAccountTableLocal.postalAddress(); // bank address }
You can try leveraging below code. Please note that I have not compiled the code and written it for your reference.
André Arnaud de Cal...
292,074
Super User 2025 Season 1
Martin Dráb
230,900
Most Valuable Professional
nmaenpaa
101,156