Topic: rep103 function getTransactions() error
In the file reporting/rep103.php, the function getTransactions() sums up the invoice value along with the credit notes instead of subtracting the credit note from the invoice amounts. The taxes are not taken into consideration here.
Line 92 in it:
$sql = "SELECT SUM((ov_amount+ov_freight+ov_discount)*rate) AS Turnover
shouldn't it be:
$sql = "SELECT SUM((ov_amount+ov_freight+ov_discount)*rate*IF(type=".ST_CUSTCREDIT.", -1, 1)) AS Turnover
In the above case, the min value needs be -0.001 to work correctly unless an absolute value of the Turnover is used or the credit be done away with. The anomaly here would be to distinguish between a payment by the customer and a credit note given for adjustment or for return of goods.
Furthermore, the Turnover does not display in the above report unless a min or max value of the invoice is specified.