With that, I want to print the total tax amount based on the tax type like GST and tax components like CGST, SGST ,IGST etc.
Here i am sharing the code to get total GST amount value.
You may pass a different Header level table's objects instead of PurchTable objects like SalesTable,CustConfirmJour,PurchReqTable,PurchRFQCaseTable.
You may pass a different Header level table's objects instead of PurchTable objects like SalesTable,CustConfirmJour,PurchReqTable,PurchRFQCaseTable.
ITaxDocumentComponentLineEnumerator componentLineEnumerator;
ITaxDocument taxDocument;
ITaxDocumentComponentLine componentLineObject;
PurchTable objPurchTable;
ITaxDocumentLineEnumerator lineEnumerator;
real _CGST,_CRate,_SGST,_SRate,_IGST,_IRate;
TaxComponent_IN taxComponent;
objPurchTable = PurchTable::find('AP-000004');
taxDocument=
TaxBusinessService::getTaxDocumentBySource(objPurchTable.TableId,
objPurchTable.RecId);
if(taxDocument
!= null)
{
componentLineEnumerator =
taxDocument.componentLines();
while(componentLineEnumerator.moveNext())
{
componentLineObject =
componentLineEnumerator.current();
taxComponent =
componentLineObject.metaData().taxComponent();
if(taxComponent
=="CGST")
{
_CGST +=
componentLineObject.getMeasure("Tax
Amount").value().value();
_CRate
+=componentLineObject.getMeasure("Rate").value().value()
* 100;
}
else
if(taxComponent =="SGST")
{
_SGST +=
componentLineObject.getMeasure("Tax
Amount").value().value();
_SRate
+=componentLineObject.getMeasure("Rate").value().value()
* 100;
}
else
if(taxComponent =="IGST")
{
_IGST +=
componentLineObject.getMeasure("Tax
Amount").value().value();
_IRate
+=componentLineObject.getMeasure("Rate").value().value()
* 100;
}
}
}
info(strFmt("%1 %2 %3",_CGST,_SGST,_IGST));
1 comments:
Write commentsNice article...
ReplyEmoticonEmoticon