Jump to content

Recommended Posts

I know I can't be the only person with this issue... Prestashop does not report any sales tax information! Sure, you can collect it, but when its time to pay the tax man you don't even know what you've collected and what you owe! I could not even find a paid module for this. How has nobody had this problem? Does no USA user get far enough with prestashop to owe sales taxes or something?

 

This module was designed for USA users.

 

Gives gross products, shipping, discounts, and total receipts. Same for taxable states. Gives actual tax collected as well as calculated numbers in case you've misconfigured your tax settings somewhere.

 

Viewable under stats tab in backoffice.statstaxes.zip

  • Like 3

Share this post


Link to post
Share on other sites

What version of prestashop is this for?

 

Getting this error on the stats page:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as fix_date, COUNT(DISTINCT o.id_order) as countOrders, SUM(od.product_qua' at line 2

 

 

SELECT

as fix_date,

COUNT(DISTINCT o.id_order) as countOrders,

SUM(od.product_quantity) as countProducts,

SUM(od.product_price * od.product_quantity / o.conversion_rate) as totalProducts

FROM ps_orders o

LEFT JOIN ps_order_detail od ON o.id_order = od.id_order

LEFT JOIN ps_product p ON od.product_id = p.id_product

WHERE o.valid = 1

AND o.invoice_date BETWEEN '2012-01-01 00:00:00' AND '2012-12-31 23:59:59'

GROUP BY

ORDER BY fix_date

Share this post


Link to post
Share on other sites

What version of prestashop is this for?

 

Getting this error on the stats page:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as fix_date, COUNT(DISTINCT o.id_order) as countOrders, SUM(od.product_qua' at line 2

 

 

 

SELECT

as fix_date,

COUNT(DISTINCT o.id_order) as countOrders,

SUM(od.product_quantity) as countProducts,

SUM(od.product_price * od.product_quantity / o.conversion_rate) as totalProducts

FROM ps_orders o

LEFT JOIN ps_order_detail od ON o.id_order = od.id_order

LEFT JOIN ps_product p ON od.product_id = p.id_product

WHERE o.valid = 1

AND o.invoice_date BETWEEN '2012-01-01 00:00:00' AND '2012-12-31 23:59:59'

GROUP BY

ORDER BY fix_date

 

This wasn't meant to be a nice clean final product, it was a quick fix to solve a problem that I'm sure many others here also have had...

 

It probably has more do with your php/mysql configuration not liking my formatting. Try plugging that query directly into phpmyadmin and wrap the tables with back ticks (ie. replace o.invoice_date with o.`invoice_date`) and see if it will return data. If it does then you gotta update the queries in the module.

Share this post


Link to post
Share on other sites

This is a good clean looking module the only thing missing is a column showing wholesale costs of products sold so that i can easily work out my cost of sales and profit margin. What are the chances you could add this?

Share this post


Link to post
Share on other sites

Thanks, enigma32. This is indeed one of the big gaping omissions in prestashop. I can confirm this module works well with prestashop 1.4.7.0. The currency displayed is always indicated as '$' but is actually the store's default currency, so it also works in Euros and other currencies.

 

Now I still have to figure out how to fix the voucher / tax issue you've mentioned on the stats page of your module.. Possibly the 1000th fix I'm adding to my prestashop installation :(

Share this post


Link to post
Share on other sites

Thank you sooo much for this!!!

I was doing everything by hand and it was taking me for ever!!!

This module is a life saver!!!

It should be added to the full version of presta

Share this post


Link to post
Share on other sites

This is a good clean looking module the only thing missing is a column showing wholesale costs of products sold so that i can easily work out my cost of sales and profit margin. What are the chances you could add this?

 

I could do it, but that is outside the purpose of this module. This is for sales tax reports.

Share this post


Link to post
Share on other sites

Thanks, enigma32. This is indeed one of the big gaping omissions in prestashop. I can confirm this module works well with prestashop 1.4.7.0. The currency displayed is always indicated as '$' but is actually the store's default currency, so it also works in Euros and other currencies.

 

Now I still have to figure out how to fix the voucher / tax issue you've mentioned on the stats page of your module.. Possibly the 1000th fix I'm adding to my prestashop installation :(

 

Which voucher / tax issue? I have all the tax issues fixed so I may be able to help..

 

I just have not organized all my fixes as overrides yet. I just keep coremodding, manually patching, and backporting things as necessary on my 1.4.4.1

Share this post


Link to post
Share on other sites

thanks for your reply, enigma. If you get the urge to do it, let me know. My taxation arrangement in Australia uses the wholesale cost in calculating my return on taxes and would be handy information.

Share this post


Link to post
Share on other sites

Thanks, enigma32. This is indeed one of the big gaping omissions in prestashop. I can confirm this module works well with prestashop 1.4.7.0. The currency displayed is always indicated as '$' but is actually the store's default currency, so it also works in Euros and other currencies.

 

Now I still have to figure out how to fix the voucher / tax issue you've mentioned on the stats page of your module.. Possibly the 1000th fix I'm adding to my prestashop installation :(

 

Here, these are from my core mods notes (since i haven't made overrides) so the line #'s are going to be approximate for you..

 

FILE:  /classes/Product.php
line 1827 (line 1850 on 1.4.4) replace with:
$reduc = Tools::ps_round(!$use_tax ? $reduction_amount : $reduction_amount, 2);

// bug fix: price reductions should not be taxed!  Only fixes % reductions i believe.
FILE:  /classes/Cart.php
line 878 replace:
$total_price = ($total_price - $total_ecotax) * (1 + (float)(Tax::getProductTaxRate((int)$product['id_product'], (int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')})) / 100);

with:
//$total_price = ($total_price - $total_ecotax) * (1 + (float)(Tax::getProductTaxRate((int)$product['id_product'], (int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')})) / 100);

line 950 insert:

if ($withTaxes) {
  $order_total = $order_total *
  (1 + (float)(Tax::getProductTaxRate((int)$product['id_product'], (int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')})) / 100); 
  }

FILE:  /classes/Discount.php
line 322 replace:
$this->value = abs($this->value / (1 + $taxDiscount * 0.01));

with:
//$this->value = abs($this->value / (1 + $taxDiscount * 0.01));

// bug fix: prestashop deducting tax from absolute value coupons

Share this post


Link to post
Share on other sites

thanks for your reply, enigma. If you get the urge to do it, let me know. My taxation arrangement in Australia uses the wholesale cost in calculating my return on taxes and would be handy information.

 

Unfortunately I shouldn't even be doing as much coding as I am already, but I can't find a decent coder that is familiar with prestashop.

 

If anybody wants to pick this up and improve upon it though, that is why I shared it. Just return the favor and share it again with everyone else!

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 3 months later...

I'm sorry, it's beena long day:

 

I have installed the module on 1.4.8, but I can't seem to locate it (please save hazing for another time) ;)

 

I am on the Stats page, but don't see a change in anything.

 

Johnny

Share this post


Link to post
Share on other sites
  • 5 months later...

Hi

 

I know I'm out of topic but can I ask help from you guys on where to find a module that can automatically calculate sales tax in california and counties?

 

A link to a forum thread or website would be highly appreciated - thank you!

Share this post


Link to post
Share on other sites
  • 2 months later...

Hi all

 

This module looks ideal for my tax man issue and like it should work a treat. Perhaps i haven't configured something properly but the output is showing gross sales ex-tax correctly but nothing in the product tax, shipping or collected fields! Can anyone suggest what i've done wrong please? Screenshot attached from a single test order i placed today.

 

James

post-341015-0-98530100-1364482939_thumb.png

Edited by jpryce (see edit history)

Share this post


Link to post
Share on other sites

Hi all

 

This module looks ideal for my tax man issue and like it should work a treat. Perhaps i haven't configured something properly but the output is showing gross sales ex-tax correctly but nothing in the product tax, shipping or collected fields! Can anyone suggest what i've done wrong please? Screenshot attached from a single test order i placed today.

 

James

 

I am having the same issue. Can anyone help with this?

Share this post


Link to post
Share on other sites

Thanks for this. I'm having the same problem in no tax is showing in any of the 'taxable sales' columns.

 

Are the $taxable[products] etc codes in statstaxes.php correct for v1.4.4 ? The other people having the same problems - what version are you using?

 

Also, does the module only begin to collect tax info after it is installed?

 

Anyone wishing to replace the $ dollar symbol on the stats page with your own currency can replace the $ with € or £ in lines: 99-102, 126-129, 151-154 in statstaxes.php where the $ is displayed. Edit only the $ that are inside the inverted commas " "

Edited by Lee (see edit history)

Share this post


Link to post
Share on other sites
  • 3 weeks later...

I am using Presta 1.4.8 and I am not getting anything under the taxable sales. I do get the numbers on the Gross sales but everything else is blank. Please help. My tax man would really like this.

 

Thank you.

post-424705-0-34295500-1367442848_thumb.jpg

Edited by tuff_cowboy (see edit history)

Share this post


Link to post
Share on other sites
  • 2 months later...
  • 1 month later...
  • 3 months later...

Under 1.5.6 it shows the sales information, but no tax information. 

 

I will try looking at the source code to see if I can figure it out. Now that we're approaching tax season, i'm a little disappointed I didn't look into this before switching to Prestashop this year and doing a LOT of sales. :(

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 5 months later...

Has anybody been able to make this module work on PrestaShop 1.5.X.X?

 

I tried the module from Business Tech, called "Advanced sales, tax, profit and profit margin reports"

But it does not work, when you have tax rules set...f.ex. if a shop in California sells to a customer in CA, then 7,5% is added, which works well in that module, but if I sell to a customer in my own county (Santa Rosa) then I had to set up a zip code tax rule in PS so that a special rate is added for that zip code, which is 1,5% (example).

 

So I am really looking for a tax reporting module that can handle when an order has base tax + tax rule calculation.

Share this post


Link to post
Share on other sites
  • 5 months later...
  • 1 year later...
  • 1 month later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More