Forums / Addon Admin Tools / Sales report 2.0

Sales report 2.0

Started by blindside on 29 Aug 2006, 2:41 AM · Views: 248,184

Results 221 to 240 of 882
10 Sep 2007, 1:43 AM
#221
hauruapai avatar

hauruapai

New Zenner

Join Date:
Sep 2007
Posts:
36
Plugin Contributions:
0

Sales report 2.0

hmm, this is now working - not too sure what I did except when I put it on a producation server, it worked - just wouldn't on my own pc.

11 Oct 2007, 4:12 PM
#222
bhunted avatar

bhunted

New Zenner

Join Date:
Mar 2007
Location:
NJ
Posts:
68
Plugin Contributions:
0

Re: Sales report 2.0

Great mod!

Question... Think maybe a bug?

I find that when it grabs the lined items and shows the sales tax collected, that it doesn't depict the correct tax and total of the order.

But, it does show in the totals line, the correct tax. Any ideas why?

The Tax Collected was $4.48 and it rounded it down to $4.00 in the order line.

Thanks!

Regards,

John

15 Oct 2007, 6:44 AM
#223
hqarrse2 avatar

hqarrse2

New Zenner

Join Date:
Oct 2007
Posts:
18
Plugin Contributions:
0

Re: Sales report 2.0

I am also getting this problem since a site reinstall but I can't work out where the error is.

On a report of the month everything still shows OK up until the date of the reinstall, but immediately afterwards I see the rounded down tax problem described by bhunted above.

On a report only of days since the reinstall, the tax is not shown at all, even though the orders themselves are still fine with tax added correctly.

I will try to get to the bottom of this this week and will of course post if I manage it, but mean time any ideas would be appreciated.

15 Oct 2007, 9:38 AM
#224
hqarrse avatar

hqarrse

New Zenner

Join Date:
Jun 2005
Posts:
1
Plugin Contributions:
0

Re: Sales report 2.0

Just found a clue. At the point of change (unfortunately I don't know if it was at this point that I switched to 1.3.7 or whether I had done that before), I have found a change in the orders_total table.

Any entry in the orders_total table used to be 4 rows per order_id:
"Sub-Total".
Shipping Method description
"(Incl VAT)"
"Total"

The "(Incl VAT)" entry for each order no longer appears against any of my orders.

I notice in the sales_report class code the following:


    // future code - currently being pulled from orders_total table for better accuracy
    // calculate tax values
    //$this->timeframe[$id]['total']['tax'] += zen_calculate_tax($onetime_charges, $tax);
    //$this->timeframe[$id]['total']['tax'] += zen_calculate_tax(($final_price * $quantity), $tax);

Uncommenting these lines does give me a tax figure in the total rows of the report, but it is still being rounded down.

I am fiddling beyond my capability here, and hope this means something to someone fore familiar with sales_report and ZC tax.

I wonder if the loss of my orders_total row is a change in 1.3.7 (I can't remembered when I upgraded unfortunately) or a setting somewhere else in my new shop install.

Help appreciated.

15 Oct 2007, 10:32 AM
#225
guillermozx avatar

guillermozx

New Zenner

Join Date:
Jul 2007
Posts:
1
Plugin Contributions:
1

Re: Sales report 2.0

Thanks a lot!
It works perfect on zencart v.1.3.7!!

15 Oct 2007, 3:55 PM
#226
bhunted avatar

bhunted

New Zenner

Join Date:
Mar 2007
Location:
NJ
Posts:
68
Plugin Contributions:
0

Re: Sales report 2.0

Hi.... just an FYI.... I only ever had ZC 1.3.7 and SR 2.0
So I don't think it's anything you did... maybe just a bug or maybe it only works properly in 1.3.6...
Dunno... hopefully the author will give us some insight soon...

hqarrse:

Just found a clue. At the point of change (unfortunately I don't know if it was at this point that I switched to 1.3.7 or whether I had done that before), I have found a change in the orders_total table.

Any entry in the orders_total table used to be 4 rows per order_id:
"Sub-Total".
Shipping Method description
"(Incl VAT)"
"Total"

The "(Incl VAT)" entry for each order no longer appears against any of my orders.

I notice in the sales_report class code the following:


// future code - currently being pulled from orders_total table for better accuracy
// calculate tax values
//$this->timeframe[$id]['total']['tax'] += zen_calculate_tax($onetime_charges, $tax);
//$this->timeframe[$id]['total']['tax'] += zen_calculate_tax(($final_price * $quantity), $tax);


Uncommenting these lines does give me a tax figure in the total rows of the report, but it is still being rounded down.

I am fiddling beyond my capability here, and hope this means something to someone fore familiar with sales_report and ZC tax.

I wonder if the loss of my orders_total row is a change in 1.3.7 (I can't remembered when I upgraded unfortunately) or a setting somewhere else in my new shop install.

Help appreciated.

Regards,

John

22 Oct 2007, 5:34 AM
#227
murrah avatar

murrah

New Zenner

Join Date:
Oct 2007
Posts:
12
Plugin Contributions:
0

Re: Sales report 2.0

Hi,

I run Zencart 1.3.7.1.

I just installed Sales Report 2.0 and all the files seem to be in the correct places.

When I select "Sales report" from the Reports menu in Admin I get the following error:

Parse error: syntax error, unexpected $end in C:\PHPSites\ZenCart\admin\stats_sales_report.php on line 1187

By the look of the path in the error message it seems that the right file is being found. So, what could be wrong ?

Thanks,
Murray

23 Oct 2007, 3:18 AM
#228
murrah avatar

murrah

New Zenner

Join Date:
Oct 2007
Posts:
12
Plugin Contributions:
0

Re: Sales report 2.0

murrah:

Hi,

When I select "Sales report" from the Reports menu in Admin I get the following error:

Parse error: syntax error, unexpected $end in C:\PHPSites\ZenCart\admin\stats_sales_report.php on line 1187

OK. Here is the solution:

The script \admin\stats_sales_report.php has 2 places where it uses short_tags ie <? instead of <?php. If your php config has short_tags off (as mine did) the script will fall over (as mine did). So, change any <? to <?php. In the version of Sales Report 2.0 I am using, these occur on lines 693 and 1029. It is better NOT to use short_tags for just this reason - you never know what the config on the target server will be.

There is another problem you need to fix:
File \admin\includes\javascript\sales_report.js.php has javascript errors caused by numerous <?php// and //?> instances. Do a search and replace to change both these to just // ie these are just javascript comments, you dont need the <?php or ?> at all.

Hope that helps others.

Now, let me test the module itself !

Cheers,
Murray

23 Oct 2007, 3:19 AM
#229
murrah avatar

murrah

New Zenner

Join Date:
Oct 2007
Posts:
12
Plugin Contributions:
0

Re: Sales report 2.0

murrah:

Hi,

When I select "Sales report" from the Reports menu in Admin I get the following error:

Parse error: syntax error, unexpected $end in C:\PHPSites\ZenCart\admin\stats_sales_report.php on line 1187

OK. Here is the solution:

The script \admin\stats_sales_report.php has 2 places where it uses short_tags ie <? instead of <?php. If your php config has short_tags off (as mine did) the script will fall over (as mine did). So, change any <? to <?php. In the version of Sales Report 2.0 I am using, these occur on lines 693 and 1029. It is better NOT to use short_tags for just this reason - you never know what the config on the target server will be.

There is another problem you need to fix:
File \admin\includes\javascript\sales_report.js.php has javascript errors caused by numerous <?php// and //?> instances. Do a search and replace to change both these to just // ie these are just javascript comments, you dont need the <?php or ?> at all.

Hope that helps others.

Now, let me test the module itself !

Cheers,
Murray

23 Oct 2007, 1:54 PM
#230
rcrosier avatar

rcrosier

Zen Follower

Join Date:
Dec 2006
Location:
Vermont
Posts:
128
Plugin Contributions:
0

Re: Sales report 2.0

I may have found a bug in S/R 2.0 b104 (that's what I downloaded, but in the file, it says b103)... Also, something to watch out for if you have the "Better Together" contrib installed.

If you run a report using date ranges (ie; 1/1/07 to 10/23/07), AND you select a Manufacturer filter, the values for Num Orders, Num Products, Shipping $, Discounts $, Discounts Qty are all totaled up for the entire year, for all orders, NOT just for the manufacturer.

Anyone know where/how to fix this?

Regarding the B/T issue, the discounts don't include this Order Total module, so to fix it, you need to change this line:

          elseif ($class == "ot_coupon" || $class == "ot_group_pricing") {

to this:

          elseif ($class == "ot_coupon" || $class == "ot_group_pricing" || $class == "ot_better_together") {

If you have OTHER discounts, you need to add them the same way.

Thanks.

VTstuff.com, Quality gifts and products from Vermont.

23 Oct 2007, 9:13 PM
#231
murrah avatar

murrah

New Zenner

Join Date:
Oct 2007
Posts:
12
Plugin Contributions:
0

Re: Sales report 2.0

Hi,

I seem to have fixed the problem where the tax on the order lines was rounding to 00 instead of showing the cents rounded to 2 places. This is the case where the user selects the +Product Line Items option.

See my post at

http://www.zen-cart.com/forum/showpost.php?p=449573&postcount=3

for details.

I am still working on the other rounding issues (something to do with the way the tax calculations are done on the report). Will let you know what I work out.

Cheers,
Murray

28 Oct 2007, 6:04 AM
#232
craigw avatar

craigw

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: Sales report 2.0

murrah:

I seem to have fixed the problem where the tax on the order lines was rounding to 00 ...

Thanks Murray, your a legend. That fixed the Tax on mine that was also rounding to 0.

What are the other rounding problems you are talking about when using Product Line Items option? I've noticed that when there is an item with quantity greater than 1, the calculation for "Total" is incorrect due to the fact that the "Base Price" is not rounded before multiplying by the quantity. I just added PHP round function to the calculation for 'total' array value.

I also changed 'base_price' array value to use $final_price instead of $products->fields['products_price']. This fixes my problem with products that are priced by attribute.

See code below for changes.

admin/includes/classes/sales_report.php - lines 330 - 337

          $this_product = array('id' => $pID,
                                'name' => $products->fields['products_name'],
                                'model' => $model,
                                'base_price' => $final_price,
                                'quantity' => $quantity,
                                'tax' => $product_tax,
                                'onetime_charges' => $onetime_charges,
                                'total' => ( (round($final_price,2) * $quantity) + $onetime_charges) );

I'm still testing Sales Reports. I've got to make some changes to the calculations for Order Line Items as well. My shipping value on my site includes Tax, so for Sales Reports I will need to remove tax for it's calculations. This will only affect you if you have setup your store like mine.

Also watch the admin console timing out. Sales Reports makes no indication that it has happened, it just stops returning new data, just keeps returning the same old stale data.

28 Oct 2007, 7:01 AM
#233
murrah avatar

murrah

New Zenner

Join Date:
Oct 2007
Posts:
12
Plugin Contributions:
0

Re: Sales report 2.0

Hi Craig,

Thanks for that.

What are the other rounding problems you are talking about when using Product Line Items option?

Well, I noticed that the tax didnt add up but havent had a chance to look at it yet. I will be back onto it tomorrow so your tips will be very helpful.

Once we sort these out it would be good to make an update for the Sales Reports contribution, I reckon.

Thanks again,
Murray

28 Oct 2007, 10:08 AM
#234
craigw avatar

craigw

New Zenner

Join Date:
Aug 2007
Posts:
36
Plugin Contributions:
0

Re: Sales report 2.0

I'm happy with it now.

I just put in a calculation on the shipping to remove tax from the amount. I added a check to see if there is tax, if not, then it does not remove tax. If that makes sense.

Some of my modifications are specific to me, but not those rounding problems and your fix for 00 tax.

It's not perfect, but certainly a very handy module. I can appreciate the work that's gone into it so far.

29 Oct 2007, 9:05 AM
#235
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Sales report 2.0

Hi,

murrah:

I am still working on the other rounding issues (something to do with the way the tax calculations are done on the report). Will let you know what I work out.

I noticed rounding problems with this module about 8 months ago so rewrote the module slightly to introduce a "check" column which could be used to highlight any errors.

I think I also added automatic support for UK dates etc.

I'll see if I can get a bit of time this week to package up my changes and release them as a new version of the module. I've been meaning to do so for a very long time now but no-one else had mentioned the rounding errors so I thought maybe only my client was having any real problems with this module. A quick search today found your recent comments and it seems silly for me not to save you a bit of work by releasing the updated code. :)

As I said, hopefully I get some time this week to do so... I'll post again here soon if I do!

All the best...

Conor
Ceon

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 Oct 2007, 10:23 AM
#236
murrah avatar

murrah

New Zenner

Join Date:
Oct 2007
Posts:
12
Plugin Contributions:
0

Re: Sales report 2.0

Hi,

conor:

A quick search today found your recent comments and it seems silly for me not to save you a bit of work by releasing the updated code. :)

As I said, hopefully I get some time this week to do so... I'll post again here soon if I do!
Ceon

That would be great if you can. Apart from the tax rounding to 00 issue, I have some mods I needed to make to get it to work at all in the first place. Can we colloborate on making a new version or should we do it sequentially?

See: http://www.zen-cart.com/forum/showpost.php?p=449496&postcount=230

Thanks again,
Murray

29 Oct 2007, 9:48 PM
#237
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Sales report 2.0

Hi Murray,

How are you?

murrah:

Can we colloborate on making a new version or should we do it sequentially?

See: http://www.zen-cart.com/forum/showpost.php?p=449496&postcount=230

The updates I've made include those parsing problems you've listed in the above thread.. I too have short tags disabled and had to fix those errors also. :)

I'll see if I can get a new version up tomorrow. :smile:

All the best...

Conor
Ceon

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

30 Oct 2007, 12:01 AM
#238
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Sales report 2.0

Hi,

Argh, you got me thinking so I went ahead and did this now...! :)

Rather than upload this directly to the downloads area I thought I'd upload a version here so that people can test it as it has been quite a long time since I made the modifications to the module and I am not totally confident that all the necessary work is complete. Also, I think it's probably best to try and get on contact with the original author to ask his permission to upload to the main downloads area, so once some of you have tested this and we've fixed any bugs one of us can do that! :)

I feel that this version works much better than 2.0 1.0.4.

I've given the version as "2.2.0RC1" as I feel this versioning convention is much more useful and easier to read...

I.e. this is release candidate 1 of version 2.2.0, the "point 2" indicating that new features have been added to the module and that this version is "stable". After bringing this to a final release of 2.2.0, subsequent bug fix releases would be 2.2.1, 2.2.2 etc.

Changes in 2.2.0RC1

[ADDED] Support for UK date formats added. Module now supports DD/MM/YYYY format as well as MM/DD/YYYY.
[UPDATED] Tax column renamed to "Goods Tax". The tax for this column is now calculated directly from the product information for the order, in the same manner as the order class calculates the tax.
[ADDED] A second tax column, "Order Recorded Tax" has been added so that a comparison can be made with the calculated tax so that any rounding errors can be identified.
[ADDED] Validation Column added for Order Total in " + Order Line Items" view. If enabled, an extra column is displayed which highlights any orders for which the tax recorded doesn't match that calculated based on the products' prices and tax rates. This should aid those who are finding that their official order totals don't quite match up with the order totals reported by the Sales Report module (and therefore avoid annoying their accountants!). This is a rare problem but seems to appear from time to time with very slight (0.01) rounding errors.
[UPDATED] If no order information exists for a particular day in a report, no row is generated for that day. (Previously an empty row was displayed which is of little use to anyone!).
[BUGFIX] Parsing problems with short tags disabled fixed.
[BUGFIX] Currencies class wasn't being loaded at an appropriate point in the main script.
[ADDED] Order ID in " + Order Line Items" view now links directly to the order edit functionality of the admin for the order. Allows quick and easy look ups of the detailed order information.
[ADDED] Support for That Software Guy's "Better Together" order total module added.
[ADDED] Support for Ceon's "Cashback" order total module added.

Please test this and let me know what you think! :)

To upgrade, just copy the files in the archive over your existing files... that's it! :)

All the best...

Conor
Ceon

.

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

30 Oct 2007, 1:06 PM
#239
rcrosier avatar

rcrosier

Zen Follower

Join Date:
Dec 2006
Location:
Vermont
Posts:
128
Plugin Contributions:
0

Re: Sales report 2.0

Hi,

I just downloaded and installed this RC1 version. The order total works fine for the B/T contrib, however, an unrelated problem, but one that's been there all along still exists.

If you select a Manufacturer to report on, the totals are not correct for the data (manufacturer) selected. They are for ALL sales for the time span selected.

From what I can check in my data, Num Products & Shipping are wrong.

I can't figure out how to fix this yet. Anyone have a suggestion where it is?

VTstuff.com, Quality gifts and products from Vermont.

30 Oct 2007, 5:36 PM
#240
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Sales report 2.0

Hi,

rcrosier:

If you select a Manufacturer to report on, the totals are not correct for the data (manufacturer) selected. They are for ALL sales for the time span selected.

Sorry but filtering by manufacturer works perfectly here. Are you sure you are reading/doing things right?

If so, please list **exactly **what settings you are using and what is happening (or not as it would seem! ;) ).

All the best...

Conor

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.