Friday, June 11, 2021

Get tax in free text invoice through x++ code

Code :- 

TaxAmount           taxAmount;

CustInvoiceTrans    CustInvoiceTrans;


CustInvoiceTrans =  CustInvoiceTrans::findRecId(5637144576);

taxAmount = Tax::calcTaxAmount(CustInvoiceTrans.TaxGroup, CustInvoiceTrans.TaxItemGroup, CustInvoiceTrans.InvoiceDate,CustInvoiceTrans.CurrencyCode, CustInvoiceTrans.LineAmount, TaxModuleType::FreeTxtInvoice);


info(strfmt("Tax is %1", taxAmount));