
Originally Posted by
bbsbcastle
I know this is a bit old, but I was running into the same problem. The issue is, the report is deducting the sales tax from the product sales, which it should not.
In admin/includes/classes/sales_report.php line 385, I changed it from
$product_price_inc_tax = (zen_add_tax($final_price, $tax) * $quantity) + zen_add_tax($onetime_charges, $tax);
to
$product_price_exc_tax = ($product_price_inc_tax - $product_tax);
Now it calculates correctly. It's a quick hack, but it works. Someone could take the time to make a more elegant solution. I don't understand why it's doing this since Sales Tax is clearly additive to the total.
...so the zen_add_tax( function (see admin/includes/functions/general.php) only adds the price in, if you have DISPLAY_PRICE_WITH_TAX_ADMIN set...
so if you have your zen-cart set-up so that DISPLAY_PRICE_WITH_TAX_ADMIN is 0 or off, your sales tax will appear to be deducted twice, when in fact it was just never really added in admin/includes/classes/sales_report.php line 385
Code:
$product_price_inc_tax = (zen_add_tax($final_price, $tax) * $quantity) + zen_add_tax($onetime_charges, $tax);
I changed line 385 to the following
Code:
$product_price_inc_tax = zen_round($final_price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($final_price, $tax);
$product_price_inc_tax += zen_round($onetime_charges, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + zen_calculate_tax($onetime_charges, $tax);
Now I get VALID instead of DON'T MATCH and my tax revenue does not appear to be missing from the report.
Bookmarks