Noticed in SelectSupplier.php the following line:
PHP Code:
$SQL = "SELECT SUM(-ovamount) AS total FROM supptrans WHERE supplierno = '" . $_SESSION['SupplierID'] . "' and type != '20'";
Consider the following:
Entered invoice (incorrectly) (Type 20)
Entered Debit Note to cancel invoice and allocated (Type 21)
Entered Correct invoice (Type 20)
Paid with Check. (Type 22)
System shows incorrect total spend, essentially double.
Fix is to make code:
PHP Code:
$SQL = "SELECT SUM(-ovamount) AS total FROM supptrans WHERE supplierno = '" . $_SESSION['SupplierID'] . "' and type = '22'";
Make sense? If so I can commit to trunk