Page 67 of 87 FirstFirst ... 1757656667686977 ... LastLast
Results 661 to 670 of 869
  1. #661
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Sales report 2.0

    So I'm pretty sure the math is done in includes/admin/classes/sales_report.php to answer my own question.

    Does anyone know my states sales tax causes a "DON'T MATCH!" with the Output Order Total Validation Column checked? Aside from maybe the obvious of the order total not including the sales tax... like DON'T MATCH! 5.99 : 6.41 (We have 7% sales tax in PA)

  2. #662
    Join Date
    Sep 2012
    Posts
    253
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    I'm not following you exactly but I think you are saying that your totals don't match correctly. If so you have the same problem I had. I ended up changing the table orders over to the table orders_total to pul the report. This made everything line up perfectly. The issue I saw was that this report recalculated every order. I have a bunch of attributes on every order and was off several dollars every day. By switching this to pull data from the other table instead of recalculating every order I eliminated this variance. It's been quite a while since I did this with help of others so I'm not 100% certain where we modified the original report. After it was correct I heavily modified it to give me a more detailed report for my specific needs. Orders_total is the table that the customer emailed receipt is saved to. So the data in that table is exactly what the customer pays from.
    I think this is what you may need from the admin/includes/classes/sales_report.php
    PHP Code:
    // pull shipping, discounts, tax, and gift certificates used from orders_total table
          
    $totals $db->Execute("select * from " TABLE_ORDERS_TOTAL " where orders_id = '" $oID "'");
          while (!
    $totals->EOF) {
            
    $class $totals->fields['class'];
            
    $value $totals->fields['value'];
            if (
    $class != "ot_total1" && $class != "ot_subtotal1") {
              if(
    $class == "ot_gv") {
                
    $order_gc_used += $value;
                
    $this->timeframe[$id]['total']['gc_used'] += $value;
                
    $this->build_li_orders($oID'gc_used'$value);

                
    $this->timeframe[$id]['total']['gc_used_qty']++;
                
    $this->build_li_orders($oID'gc_used_qty'1);
              }
              elseif (
    $class == "ot_coupon" || $class == "ot_group_pricing" || $class == "ot_better_together" || $class == "ot_reward_points" || $class == "ot_quantity_discount" || $class == "ot_gv") {  
                
    $order_discount += $value;
                
    $this->timeframe[$id]['total']['discount'] += $value;
                
    $this->build_li_orders($oID'discount'$value);

                
    $this->timeframe[$id]['total']['discount_qty']++;
                
    $this->build_li_orders($oID'discount_qty'1);
              }
              elseif (
    $class == "ot_tip") {
                
    $order_discount += $value;
                
    $this->timeframe[$id]['total']['ot_tip'] += $value;
                
    $this->build_li_orders($oID'ot_tip'$value);

                
    $this->timeframe[$id]['total']['tip_qty']++;
                
    $this->build_li_orders($oID'tip_qty'1);
              }
              elseif (
    $class == "ot_cashback") {
                
    $order_discount += $value;
                
    $this->timeframe[$id]['total']['discount'] += $value;
                
    $this->build_li_orders($oID'discount'$value);

                
    $this->timeframe[$id]['total']['discount_qty']++;
                
    $this->build_li_orders($oID'discount_qty'1);
              }
              elseif (
    $class == "ot_tax") {
                
    $order_recorded_tax += $value;
                
    $this->timeframe[$id]['total']['order_recorded_tax'] += $value;
                
    $this->build_li_orders($oID'order_recorded_tax'$value);
              }
              elseif (
    $class == "ot_shipping") {
                
    $order_shipping += $value;
                
    $this->timeframe[$id]['total']['shipping'] += $value;
                
    $this->build_li_orders($oID'shipping'$value);
              }
              elseif (
    $class == "ot_subtotal") {
                
    $order_shipping += $value;
                
    $this->timeframe[$id]['total']['subtotal'] += $value;
                
    $this->build_li_orders($oID'subtotal'$value);
              }
              elseif (
    $class == "ot_total") {
                
    $order_shipping += $value;
                
    $this->timeframe[$id]['total']['totalsales'] += $value;
                
    $this->build_li_orders($oID'totalsales'$value);
              }
              
    // this allows for a custom discount, a la Super Orders
              
    elseif ($value 0) {
                
    $order_discount += abs($value);
                
    $this->timeframe[$id]['total']['discount'] += abs($value);
                
    $this->build_li_orders($oID'discount'abs($value) );

                
    $this->timeframe[$id]['total']['discount_qty']++;
                
    $this->build_li_orders($oID'discount_qty'1);
              }
            }

            
    $totals->MoveNext();
          } 

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

    Default Re: Sales report 2.0

    Thanks southshorepizza.

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

    Default Re: Sales report 2.0

    So I've been trying to teach myself php using this add-on and I'm attempting to add product cost to the report (pulling from the product cost fields created by the profit margin calculator add-on for 1.3.9f) and I was able to integrate the product cost into the report for the product line stats. However, I'm unsure as to how to do the math to add a profit field line by line for each product.

    I also don't know how to add the costs together for the timeframe total at the top of the product lines report.

    Nor can I seem to figure out how to calculate total profit for each order because there isn't a total cost field in the database for each order, like a total rev and/or total sub-total. Should I attempt to add this database field and have it calculate in check out somehow, or have the script tabulate it?

    Does anyone have any suggestions on how I might learn to do this, or the method I should go about trying to do this?

    Thanks,
    b

  5. #665
    Join Date
    Aug 2009
    Location
    Greeneville, TN USA
    Posts
    52
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    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.

  6. #666
    Join Date
    Apr 2008
    Posts
    150
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Hi wolfderby, I'm curious if you ever got anywhere with this? I've been misssing this feature for years, but I'm not really a programmer. I was thinking of installing the "Product Cost Display" (http://www.zen-cart.com/downloads.php?do=file&id=1444) or something similar to get my product costs into Zen Cart. Did you ever manage to get Sales Report to calculate the product costs correctly?

    Best regards

    Peter

    Quote Originally Posted by wolfderby View Post
    So I've been trying to teach myself php using this add-on and I'm attempting to add product cost to the report (pulling from the product cost fields created by the profit margin calculator add-on for 1.3.9f) and I was able to integrate the product cost into the report for the product line stats. However, I'm unsure as to how to do the math to add a profit field line by line for each product.

    I also don't know how to add the costs together for the timeframe total at the top of the product lines report.

    Nor can I seem to figure out how to calculate total profit for each order because there isn't a total cost field in the database for each order, like a total rev and/or total sub-total. Should I attempt to add this database field and have it calculate in check out somehow, or have the script tabulate it?

    Does anyone have any suggestions on how I might learn to do this, or the method I should go about trying to do this?

    Thanks,
    b

  7. #667
    Join Date
    Dec 2013
    Posts
    17
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Not sure if anyone still checks up on this thread, but

    I installed this add-on on my 1.5.1 installation, but when i click the "show me the money" button, nothing happens.
    I've made sure i installed each file in its correct location (triple checked!), read through the readme again (i didnt complete any of the optional steps), and checked back about 15 pages in this thread.

    Anyone have any idea whats going on?

  8. #668
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,363
    Plugin Contributions
    94

    Default Re: Sales report 2.0

    Quote Originally Posted by PopularCrustacean View Post
    Not sure if anyone still checks up on this thread, but

    I installed this add-on on my 1.5.1 installation, but when i click the "show me the money" button, nothing happens.
    I've made sure i installed each file in its correct location (triple checked!), read through the readme again (i didnt complete any of the optional steps), and checked back about 15 pages in this thread.

    Anyone have any idea whats going on?
    There's a checkbox just above "Show me the money" that defaults to checked (much to my chagrin) and causes the result of the report to open in a new window.

  9. #669
    Join Date
    Dec 2013
    Posts
    17
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Quote Originally Posted by lat9 View Post
    There's a checkbox just above "Show me the money" that defaults to checked (much to my chagrin) and causes the result of the report to open in a new window.
    Whether the "open in a new window" box is checked or not, nothing happens.
    I tried disabling all my add-ons, that didnt work. I also tried it in firefox as well as chrome, neither works.

  10. #670
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,363
    Plugin Contributions
    94

    Default Re: Sales report 2.0

    Any debug-log files in your /logs directory?

 

 
Page 67 of 87 FirstFirst ... 1757656667686977 ... LastLast

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