Friday 11 November 2016

Calculate tax for project invoice using x++ code Ax 2012

static void projectinvoiceTax(Args _args)
{
    ProjInvoiceJour         projInvoiceJour;
    TmpTaxWorkTrans         taxWorkTrans;
    ProjProposalTotals      ProjProposalTotals;
    TaxTable                taxTable;
    tax                     tax;
 
    projInvoiceJour     = ProjInvoiceJour::findRecId(5637146078); //projInvoiceJour.recid
    ProjProposalTotals  = new  ProjProposalTotals(ProjProposaljour::find( projInvoiceJour.ProposalId));
    ProjProposalTotals.calc();
    tax = ProjProposalTotals.tax();
   
    taxWorkTrans.setTmpData(tax.tmpTaxWorkTrans());
    while select taxWorkTrans
        join taxTable
        where taxTable.taxcode == taxWorkTrans.taxcode
    {
        info (strFmt('%1        %2     %3', taxWorkTrans.TaxCode, taxTable.showTaxValue(), taxWorkTrans.TaxAmount));

     
    }
 
}

1 comment:

  1. Hi,
    Thanks for the useful information.

    I have one problem in the sales tax calculation.

    I have a project invoice amount of 507,173.65 USD & 5% of tax amount.

    When i open the sales tax form through Project Invoice proposal - total sales tax amount shows 25358.69. Actually, When i calculate through calculator it is 25358.6825 if we do rounding with 2 decimal also - it should be 25358.68 USD tax only.

    I have a difference of .01 USD. How the standard sales tax shows 25358.69?

    can you please check that?

    Thanks,
    Muthusamy V

    ReplyDelete