Zen Cart Logo
Forums / Bug Reports / [Done v1.3.9a] Customers Orders - Total - Sometimes Wrong

[Done v1.3.9a] Customers Orders - Total - Sometimes Wrong

Locked

Views: 1,855

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
5 Sep 2008, 7:24 PM
#1
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

[Done v1.3.9a] Customers Orders - Total - Sometimes Wrong

The amounts shown in Customers Orders - Total are not always correct. For example, one of my customers is showing in the report with an order total of $580, but when I check his actual order history, he's only made one order of about $83.

There are several incorrect entries like that.

ZC 1.38a

7 Sep 2008, 4:14 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.9a] Customers Orders - Total - Sometimes Wrong

The report is not including shipping ... is that the difference you are seeing?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

7 Sep 2008, 2:53 PM
#3
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: [Done v1.3.9a] Customers Orders - Total - Sometimes Wrong

I seem to have made a mistake...

There were a few entries off by an insignificant amount, and maybe the shipping charge could account for that.

But the biggest discrepancy was a customer who was showing an order history of $580, but his account showed only one order of about $80.

When I do a search on the customer's name, I find he has created 3 accounts, and it's this total that is showing in the report.

But this raises the question - How does the Best Customer Orders-Total report gather data? Is it on Customer's last name or full name? I use this report for creating group discounts for loyal customers.

It would be better for me, and easier to track, if the report was based on customer number. That way I could avoid giving discounts to people who create multiple account to take advantage of my new customer discount.

7 Sep 2008, 3:17 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v1.3.9a] Customers Orders - Total - Sometimes Wrong

The SELECT statement for that report is:

  $customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price)+sum(op.onetime_charges)  as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC";

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

26 Nov 2009, 10:11 AM
#5
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: [Done v1.3.9a] Customers Orders - Total - Sometimes Wrong

It's an old topic, but this appears to be a bug (in Zen Cart version 1.3.8a):

$customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price)+sum(op.onetime_charges) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_firstname, c.customers_lastname order by ordersum DESC";

Should probably be:

$customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, sum(op.products_quantity * op.final_price)+sum(op.onetime_charges) as ordersum from " . TABLE_CUSTOMERS . " c, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where c.customers_id = o.customers_id and o.orders_id = op.orders_id group by c.customers_id order by ordersum DESC";