Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

Tax amount calculation for Sales order

$
0
0

I am Customize the sales Invoice Report Morphx Report In ax 2012, 

I am Writing the code to get the total tax amount and Individual Tax amount for Particular Sales order

Below code  and call in the fetch method.

public real TaxAmountLoc3(SalesLine saleLine)
{
TmpTaxWorkTrans tmpTax;
SalesTotals salesTotals;
CustInvoiceJour _CustInvoiceJourLoc;
TaxData taxData;

;
_CustInvoiceJourLoc = element.args().record();
salesTotals = salesTotals::construct(salesTable);

// Calculate Tax
salesTotals.calc();

// Load tmpTaxWorkTrans
tmpTax.setTmpData(salesTotals.tax().tmpTaxWorkTrans());

// Showing taxes with tax value
while
select tmpTax
{
select taxTable
where taxTable.TaxCode == tmpTax.TaxCode
join taxData
where taxData.TaxCode == TaxTable.TaxCode;
if(taxTable.TaxType_IN == TaxType_IN::None)
{
None += tmpTax.TaxAmount;
}
if(taxTable.TaxType_IN == TaxType_IN::Excise)
{
Excise += tmpTax.TaxAmount;
ExciseValue += taxData.TaxValue;
}
if(taxTable.TaxType_IN == TaxType_IN::VAT)
{
Vat += tmpTax.TaxAmount;
VatValue += taxData.TaxValue;
}
if(taxTable.TaxType_IN == TaxType_IN::SalesTax)
{
CST += tmpTax.TaxAmount;
CSTValue += taxData.TaxValue;
}
/*if(taxTable.TaxType_IN == TaxType_IN::ServiceTax)
{
ServiceTax += tmpTax.TaxAmount;
}*/
}
return None+Excise+Vat+CST;

}

But the Problem is If Tax amount is setup for the Particular Sales order it is running and tax amount is calculated.

Suppose  "tax is not setup" in the Sales order it is Throwing the below Error.

"A currency to convert from is required to retrieve exchange rate information."

How to solve this Please Help me.


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>