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)); } }
9 comments
commentsThanks.
ReplyIt's not working
ReplyWhere you get an error?
Replywhen you are checking GST Confirmation time or Invoice time ?
Nice Article
ReplyHow to get GST rate and amount line wise?
ReplyHi,
Replyif 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
Thank you.
ReplyHi,
ReplyIn 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.
Hi,
ReplyIn 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.
Thanks for comments.....