0% found this document useful (0 votes)
33 views2 pages

GSTOFASSign

The document defines variables for working with tax documents and lines in AX. It retrieves a tax document and line based on a purchase order journal record. It then iterates through the tax document components and lines to extract GST rate and amount values for CGST, SGST, and IGST and assign them to a temporary purchase order line record for further processing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

GSTOFASSign

The document defines variables for working with tax documents and lines in AX. It retrieves a tax document and line based on a purchase order journal record. It then iterates through the tax document components and lines to extract GST rate and amount values for CGST, SGST, and IGST and assign them to a temporary purchase order line record for further processing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

ITaxDocument taxDocument;

ITaxDocumentComponentLineEnumerator componentLineEnumerator;
ITaxDocumentComponentLine componentLineObject;
ITaxDocumentMeasureEnumerator measureEnumerator;
PurchLineAllVersions purchLineAllVersions2;

real taxTotalGTE;

ITaxDocumentLine line;
ITaxDocumentLineEnumerator lineEnumerator;

TaxComponent_IN taxComponent;

select sum(LineAmount) from purchLineAllVersions2


where purchLineAllVersions2.PurchId == _vendPurchOrderJour.PurchId
&& purchLineAllVersions2.PurchTableVersionRecId ==
_vendPurchOrderJour.PurchTableVersion;

taxDocument =
TaxBusinessService::getTaxDocumentBySource(_vendPurchOrderJour.TableId,
_vendPurchOrderJour.RecId);
line =
TaxBusinessService::getTaxDocumentLineBySource(_vendPurchOrderJour.TableId,
_vendPurchOrderJour.RecId);
//Tax Document not null,GST Apply start
if(taxDocument != null)
{
taxTotalGTE =
taxDocument.getTotalTax().amountTransactionCurrency();
//wsplPurchaseNicOrderLineTmp.InvoiceAmount = taxTotalGTE +
purchLineAllVersions2.LineAmount;

componentLineEnumerator = taxDocument.componentLines();
lineEnumerator = taxDocument.lines();
//Tax Document not null,GST Apply start-1
if (taxDocument)
{
//lineEnumerator for Current line taxDocument start
lineEnumerator = taxDocument.lines();

while(lineEnumerator.moveNext())
{
//Getting Current line RecId for GST start
line = lineEnumerator.current();

line.setTaxDocument(taxDocument);

if(line.originSourceRecId() != 0 && line.getInvoiceTax().value() !=


0 && line)
{
p++;
//componentLineEnumerator for Getting GST Rate,Amount start
while(componentLineEnumerator.moveNext())
{
componentLineObject = componentLineEnumerator.current();
taxComponent =
componentLineObject.metaData().taxComponent();
//GST Calculation start
if(taxComponent == "CGST")
{
purchOrderLineTmp.RateCGST =
componentLineObject.getMeasure("Rate").value().value() * 100;
purchOrderLineTmp.AmountCGST =
componentLineObject.getMeasure("Tax Amount").value().value();

}
if(taxComponent == "SGST")
{
purchOrderLineTmp.RateSGST =
componentLineObject.getMeasure("Rate").value().value() * 100;
purchOrderLineTmp.AmountSGST =
componentLineObject.getMeasure("Tax Amount").value().value();

break;
}
if(taxComponent == "IGST")
{
purchOrderLineTmp.RateIGST =
componentLineObject.getMeasure("Rate").value().value() * 100;
purchOrderLineTmp.AmountIGST =
componentLineObject.getMeasure("Tax Amount").value().value();

break;
}

if(taxComponent == "CESS")
{
//wsplPurchaseNicOrderLineTmp.RateCESS =
componentLineObject.getMeasure("Rate").value().value() * 100;
//wsplPurchaseNicOrderLineTmp.AmountCESS =
componentLineObject.getMeasure("Tax Amount").value().value();

break;
}
//GST Calculation end

}
//purchOrderLineTmp.RefNu = p;
//wsplPurchaseNicOrderLineTmp.insert();

}
}
}
}

You might also like