Results 1 to 10 of 869

Threaded View

  1. #35
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Sales report 2.0

    Quote Originally Posted by bbsbcastle View Post
    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.
    Last edited by wolfderby; 7 Jun 2017 at 05:59 AM. Reason: clarity

 

 

Similar Threads

  1. v139b Sales Report
    By irishshopper in forum General Questions
    Replies: 1
    Last Post: 26 Jan 2014, 01:00 AM
  2. Sales Report
    By jgold723 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Nov 2011, 05:58 PM
  3. Sales report
    By tlahtine in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 27 Dec 2010, 10:01 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR