
Hi There,
I am Creating a report which bring Tax Amount for Free Text Invoices, but i cant find the relation in between CustInvoiceLine table and TaxTrans Table.
Kindly help me to how to link the above tables
Thanks.
*This post is locked for comments
I have the same question (0)Hi,
You can check the method displayTaxAmount of table CustInvoiceLine to see how table custInvoiceTable & taxTrans are related and how tax is getting calculated. Below code provides you the required relationship.
static void AXC_CustInvoiceTable(Args _args)
{
CustInvoiceTable custInvoiceTable;
TaxTrans taxTrans;
CustInvoiceTrans custInvoiceTrans;
CustInvoiceLine custInvoiceLine;
while select taxTrans
join LineNum, InvoiceId, InvoiceDate, RecId from custInvoiceTrans
where taxTrans.SourceRecId == custInvoiceTrans.RecId
&& taxTrans.SourceTableId == custInvoiceTrans.TableId
join custInvoiceLine
where custInvoiceTrans.LineNum == custInvoiceLine.LineNum
join custInvoiceTable
where custInvoiceTable.RecId == custInvoiceLine.ParentRecId
&& custInvoiceTrans.InvoiceId == custInvoiceTable.InvoiceId
&& custInvoiceTrans.InvoiceDate == custInvoiceTable.InvoiceDate
{
info(strFmt("InvoiceId: %1, TaxCode: %2", custInvoiceTable.InvoiceId, taxTrans.TaxCode));
}
}