Re: Sales report 2.0 - a Tax Rounding Problem SOLUTION
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/showpo...73&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
Re: Sales report 2.0 - a Tax Rounding Problem SOLUTION
Quote:
Originally Posted by
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
Code:
$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.
Re: Sales report 2.0 - a Tax Rounding Problem SOLUTION
Hi,
Quote:
Originally Posted by
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
Re: Sales report 2.0 - a Tax Rounding Problem SOLUTION
Hi,
Quote:
Originally Posted by
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/showpo...&postcount=230
Thanks again,
Murray
Re: Sales report 2.0 - a Tax Rounding Problem SOLUTION
Hi Murray,
How are you?
Quote:
Originally Posted by
murrah
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
1 Attachment(s)
NEW VERSION! Sales Report 2.2.0RC1
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
.