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)); } }
No comments:
Post a Comment