How to Calculate Purchase order confirmation tax details (IGST,CGST,SGST) in Dynamics Ax 2012


Description : How to calculate the GST taxes on purchase order confirmation. Here i am sharing some code to get Taxes details (IGST/CGST/SGST) in AX.

static void GSTTotal(Args _args)
{
    vendPurchOrderJour vendPurchOrderJour;
    ITaxDocument taxDocument;
    ITaxDocumentComponentLineEnumerator componentLineEnumerator;
    ITaxDocumentComponentLine componentLineObject;
    ITaxDocumentMeasureEnumerator measureEnumerator;
    TaxAmount taxAmount,taxValue;
    TaxComponent_IN taxComponent;
    ;
    vendPurchOrderJour = vendPurchOrderJour::findRecId(5637291565); //Need to pass Confirmation journal recid
    taxDocument = TaxBusinessService::getTaxDocumentBySource(vendPurchOrderJour.TableId, vendPurchOrderJour.RecId);

    componentLineEnumerator = taxDocument.componentLines();

    while(componentLineEnumerator.moveNext())
    {
        componentLineObject = componentLineEnumerator.current();

        taxComponent = componentLineObject.metaData().taxComponent();
        taxValue = componentLineObject.getMeasure("Rate").value().value() * 100;
        taxAmount = componentLineObject.getMeasure("Tax Amount").value().value();

        info(strFmt("Component %1 ,Rate %2, Amount%3",taxComponent,taxValue,taxAmount));
    }
}

 

Related Posts

Previous
Next Post »

9 comments

comments
August 31, 2017 at 5:34:00 PM GMT+5:30 delete

Where you get an error?

when you are checking GST Confirmation time or Invoice time ?

Reply
avatar
Anonymous
November 20, 2017 at 12:09:00 PM GMT+5:30 delete

How to get GST rate and amount line wise?

Reply
avatar
November 24, 2017 at 11:16:00 AM GMT+5:30 delete

Hi,
if you want to get GST Details line wise you can check in below link.

http://dynamicsuser.blogspot.in/2017/09/sql-query-to-get-purchase-invoice-gst.html

Reply
avatar
August 10, 2018 at 10:48:00 PM GMT+5:30 delete

Hi,

In the above code it is only through code to get the GST calculation at the time of Purchase order. But, I need to know the tables which will store the GST data/values at the time of Purchase order/Purchase order confirmation. The TaxDocument button on the PO form will show the data, but I need the table details.

Thank you.

Reply
avatar
November 27, 2020 at 3:33:00 PM GMT+5:30 delete

Hi,

In the above code it is only through code to get the GST calculation at the time of Purchase order. But, I need to know the tables which will store the GST data/values at the time of Purchase order/Purchase order confirmation. The TaxDocument button on the PO form will show the data, but I need the table details.

Thank you.

Reply
avatar

Thanks for comments.....