Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

RE: Link CustInvoiceLine table and TaxTrans Table

$
0
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));
    }
}

Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>