February 20, 2014

Get Tax Amount On Purchase Order

Get "Tax Amount" in Purchase Order in AX 2012 is so easy. This is the method to get it :
static void CalculatePurchaseTax(Args _args)
{
    PurchTable     _purchTable = PurchTable::find("PO1312-0001");
    PurchTotals    purchTotals;

    purchTotals   = PurchTotals::newPurchTable(_purchTable);
    purchTotals.calc();
    purchTotals.tax().sourceSingleLine(true, false);
  
    info(strFmt("Tax : %1", purchTotals.taxTotal()));
}

0 comments:

Post a Comment