Tax calculation for SO or PO

Hi,
To calculate the tax amount of SO,
Tax Calculation USING Tax class:

void clicked()
{
real tax1;
;
super();
tax1 = Tax::calcTaxAmount(Salesline.TaxGroup, Salesline.TaxItemGroup, Systemdateget(), Salesline.CurrencyCode, Salesline.LineAmount, TaxModuleType::Sales);

info(strfmt(“%1”, tax1));
}

Tax calculation through normal coding:
void clicked()
{
TaxOnItem TaxOnItem;
TaxGroupData TaxGroupData, TaxGroupData_1;
real TaxAmount = 0, TaxAmount_1 = 0;
TaxValue TaxValue = 0, TaxValue_1 = 0;
;
bp();
super();

if(Salesline.TaxItemGroup && Salesline.TaxGroup && Salesline.LineAmount != 0)
{
while select TaxOnItem
where TaxOnItem.TaxItemGroup == salesline.TaxItemGroup
{
if(TaxOnItem)
{
while select TaxGroupData
where TaxGroupData.TaxGroup == Salesline.TaxGroup
&& TaxGroupData.TaxCode == TaxOnItem.TaxCode
{
if(TaxGroupData)
{
TaxValue = TaxData::find(TaxOnItem.TaxCode, Systemdateget(), 0).TaxValue;
TaxValue_1 += TaxValue;
TaxAmount = (Salesline.LineAmount * TaxValue)/100;
TaxAmount_1 += TaxAmount;
}
}
}
}
info(strfmt(“%1”, TaxAmount_1));
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s