Po Line Sales Tax calculation

Hello All,

Working on a x++ code to calculate Sales tax , sales percent and sales tax code for a Purchase order using following x++ code

Tax::calcTaxAmount(purchLineRecord.TaxGroup, purchLineRecord.TaxItemGroup,

Systemdateget

(), purchLineRecord.CurrencyCode, purchLineRecord.LineAmount, TaxModuleType::purch);

On " All Purchase order Form" clicking on “Sales tax Button” gives a summary of sales tax for selected purchase order.

Even if a purchase order has single Purchase Line Sales summary form showing multiple lines.

Kindly help to get the exact same sales Tax for a purchase order per purchase line.

Ax Version : 2012 .

Thanks

Really helpfull, tnx

Hi Isani,

Tried the code above. Did not always give the correct numbers. I am using the following display method on the PurchLine table instead.

public display TaxAmountCur totalTaxAmount(boolean _adjustTaxSign = true, boolean _includeUseTax = false)
{
    PurchTotals     purchTotals;
    TaxAmountCur    taxAmountCur;

    purchTotals     = PurchTotals::newPurchTable(this.purchTable());
    purchTotals.calc();
    purchTotals.tax().sourceSingleLine(true, true);
    taxAmountCur    = purchTotals.tax().totalTaxAmountSingleLine(this.TableId, this.RecId, _adjustTaxSign, _includeUseTax);

    return taxAmountCur;
}
  • Mohammed Pasha