private Percent calcSalesLineTaxPercent(Salesline _salesline)
{
TaxOnItem taxOnItem;
TaxGroupData taxGroupData;
TaxValue taxValue;
if(_salesline.TaxItemGroup && _salesline.TaxGroup && _salesline.LineAmount != 0)
{
select firstonly TaxOnItem
where TaxOnItem.TaxItemGroup == _salesline.TaxItemGroup
join TaxGroupData
where TaxGroupData.TaxGroup == _salesline.TaxGroup
&& TaxGroupData.TaxCode == TaxOnItem.TaxCode;
if(TaxGroupData)
{
TaxValue = TaxData::find(TaxOnItem.TaxCode, DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()), 0).TaxValue;
}
}
return TaxValue;
}
No comments:
Post a Comment