Hi everyone,
We are working on a PO invoice report where we're trying to fetch tax-related information from vendor invoice transactions by constructing a TaxableDocumentObject. However, for some invoices, we are getting a null value for the ITaxDocumentLine field, even though the taxes are calculated correctly and the postings for the invoice are accurate.
Below is the code snippet
vendInvoiceInfoTable = VendInvoiceInfoTable::findPurchInvFromVendInvoiceJour(vendInvoiceJour.PurchId,vendInvoiceJour.InvoiceId,vendInvoiceJour.ParmId);
PurchTotals localPurchTotals = PurchTotals::newParmTable(vendInvoiceInfoTable, PurchUpdate::All, vendInvoiceInfoTable.ParmId, '', DocumentStatus::Invoice);
localPurchTotals.calc(true);
taxableDocument = TaxableDocumentObject::construct(localPurchTotals.parmTaxableDocumentDescriptor());
taxDocumentObject =TaxBusinessService::calculateTax(taxableDocument);
if (taxDocumentObject)
{
taxDocumentLine = taxDocumentObject.findLineBySource(tableNum(VendInvoiceTrans), _vendInvoiceTrans.RecId); //returning null for some invoices
// Calculation of Tax amount for Tax type GST and Tax component SGST
if(taxDocumentLine)
{
}
}
Has anyone faced a similar issue or can provide insights into why this might be happening? Any suggestions on how to resolve this would be greatly appreciated!
Thanks in advance!

Report
All responses (
Answers (