static void purchsalestax(Args _args)
{
TaxOnItem TaxOnItem;
TaxGroupData TaxGroupData;
real TaxAmount;
TaxValue TaxValue;
PurchLine PurchLine;
;
select firstOnly PurchLine where PurchLine.PurchId == '00002622'
&& PurchLine.LineNumber == 1;
if(PurchLine.TaxItemGroup && PurchLine.TaxGroup && PurchLine.LineAmount != 0)
{
while select TaxOnItem
where TaxOnItem.TaxItemGroup == PurchLine.TaxItemGroup
join TaxGroupData
where TaxGroupData.TaxGroup == PurchLine.TaxGroup
&& TaxGroupData.TaxCode == TaxOnItem.TaxCode
{
if(TaxGroupData)
{
TaxValue = TaxData::find(TaxOnItem.TaxCode, Systemdateget(), 0).TaxValue;
TaxAmount = (PurchLine.LineAmount * TaxValue) / 100;
info(strFmt("Rate = %1, Tax Amount = %2",TaxValue,TaxAmount));
}
}
}
}
{
TaxOnItem TaxOnItem;
TaxGroupData TaxGroupData;
real TaxAmount;
TaxValue TaxValue;
PurchLine PurchLine;
;
select firstOnly PurchLine where PurchLine.PurchId == '00002622'
&& PurchLine.LineNumber == 1;
if(PurchLine.TaxItemGroup && PurchLine.TaxGroup && PurchLine.LineAmount != 0)
{
while select TaxOnItem
where TaxOnItem.TaxItemGroup == PurchLine.TaxItemGroup
join TaxGroupData
where TaxGroupData.TaxGroup == PurchLine.TaxGroup
&& TaxGroupData.TaxCode == TaxOnItem.TaxCode
{
if(TaxGroupData)
{
TaxValue = TaxData::find(TaxOnItem.TaxCode, Systemdateget(), 0).TaxValue;
TaxAmount = (PurchLine.LineAmount * TaxValue) / 100;
info(strFmt("Rate = %1, Tax Amount = %2",TaxValue,TaxAmount));
}
}
}
}
No comments:
Post a Comment