How to Show GST % and values line level in PO report

Hi All,

I want to show GST % and values in PO report line level. In total i can show by below code:

purchTable = purchTable::find(‘02-000164’);
taxDocument = TaxBusinessService::getTaxDocumentBySource(purchTable.TableId, purchTable.RecId);

if(taxDocument)
{
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));
}
}

The above code shows GST applied against the whoe PO, But Line level I don’t know how to show.

Please Suggest.

Have you tried using \Classes\TaxBusinessService\getTaxDocumentLineBySource?

Hi Kranthi,
thanks for the reply.

while select * from purchLine where purchLine.PurchId == ‘02-000160’
{
taxDocument = TaxBusinessService::getTaxDocumentLineBySource(tableNum(purchLine),purchLine.RecId);
if(taxDocument)
{
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));
}
}
}

I tried like this, but throwing error in the below line:
taxDocument = TaxBusinessService::getTaxDocumentLineBySource(tableNum(purchLine),purchLine.RecId);

Error : Operand types are not compatible with the operator.

What is taxDocument type? It should be ITaxDocumentLine

I used ITaxDocumentLine and the result is coming in Infolog as:

Component IGST ,Rate 18.00, Amount90.00
Component IGST ,Rate 12.00, Amount120.00

I have 2 lines in PO with different Tax value.

based on above Infolog Msg, how to know which line is belongs to which PO Lines(Item)?

Try printing the purchLine.Item/PurchLine.InventTransId in the info.

Yeah got it…

Thanks Kranthi.