Hello, i am having issues with calculation field on my sales invoice report.
So what is actually happening is calculation in my report of many lines is different, what i mean is a line will have the calculation correct, while other line will be wrong.

As u can see, in line 2, the taxable amount calculation is wrong. the calculation is (UnitPRICE*QTY)-LineDisc% - totalDisc%
but for line 3, if u apply this formula, the calculation is correct.
What i am mapping on the taxable amount field is the field SourceBaseAmountCur FROM taxTrans table, and my field name is Ex_TaxBaseCur which is the EDT of SourceBaseAmountCur, and my table is salesinvoicetmp.
here is my code on salesinvoicedp extension class:
select taxTrans where taxTrans.InventTransId == _custInvoiceTrans.InventTransId;
if(taxTrans)
{
salesInvoiceTmp.Ex_TaxBaseCur = abs(taxTrans.SourceBaseAmountCur); // abs is used to show positive values.
}
else
{
salesInvoiceTmp.Ex_TaxBaseCur = 0;
}
}
i have been stuck with this issue for long, because if my issue is with the code it would give wrong value for all lines not one line correct and other wrong, it doesnt make sense.
anyone can help?