Sales Integrity Check Ignores Discount - SOLVED
Z_SalesIntegrityCheck.php
This script does not take into account discountpercent so it shows an issue where non exists.
Fixed by changing line 145
FROM:
$sumsql = "SELECT SUM( qtyinvoiced * unitprice ) AS InvoiceTotal
TO:
$sumsql = "SELECT SUM(qtyinvoiced * unitprice * (1 - discountpercent)) AS InvoiceTotal
To further tidy it up try:
$sumsql = "SELECT ROUND(SUM(qtyinvoiced * unitprice * (1 - discountpercent)), 3) AS InvoiceTotal
https://www.linkedin.com/in/eclipsepaulbecker
|