Jump to content

Problem with shipping tax value on invoice


mr.dipi

Recommended Posts

Hello,

 

I have small problem.

 

When I generate invoice to order there is a small mistake in tax details.

 

I'm sorry that example is in Polish but I disabled English in my shop, but I will try to explain everything.

 

SO:

 

in tax details (marked with red square) we can see following positions:

  1. Products -> tax rate (23%) -> tax amount ( 62,64 zl)  -> THIS IS CORRECT
  2. Shipping -> tax rate (23%) -> tax amount (1,31 zl) -> THIS IS WRONG
  3. (position without name) - > tax rate (23%) (1,31 zl) -> THIS IS WRONG

Shipping price without tax is correct (green square) = 11,38 zl

 

Tax value for shipping should be 2,62 zl

 

As we can see presta is splitting VAT on half because total result of tax is correct (1,31+1,31 = 2,62)

 

Rest of invoice is correct too.

 

I was trying to disable modules which may be connected with this (ship2pay and dhl assistant) but it is still not working correctly. I even turned off all non prestashop modules off, but no result.

 

I was trying to get help on Polish forum also but it seems that no one has any idea how to solve it.

 

I can try anything - just please give me any idea how to solve it....

 

Presta 1.6.1.13

 

Thanks for help

000016-2017 example.pdf

Edited by mr.dipi (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hello,

 

I think I found the reason - mayby someone will be able to help me now.

 

I did some tests in this way:

 

I've made clean install o 1.6.15 with clean database on test sub domain.

 

I transferd all files from my main shop and conect it to clean database (in this way I have 2 shops with same core files in theory but different databases)

 

In main shop I still have problem which I described in first post.

 

In test shop I don't have this problem (same modules and etc.)

 

Only difference is in statuses - in clean copy I have default statuses, in main shop I hav e some custom statuses (for. ex. create invoice -> only status when invoice should be generated)

 

 

In main shop when I place an order new element appears in "prestaorder_invoice_tax" and later when I change status to "create invoice" it is  adding same values one more time so it looks like this:

 

id_order_invoice                type                       id_tax                  amount

          11                       shipping                     32                     2.617400

          11                       shipping                     32                     2.617400

 

 

 

In test shop (clean) when I place order NOTHING appears in the same column. Value appears when I change status to "delivered" (because it is creating an invoice) and later I have only one value connected to this order:

 

id_order_invoice        type              id_tax           amount

            2                  shipping           1            1.610000

 

So, if we have same modules, same core files and two different results it seems that somrthing is wrong with statuses or settings of presta which are stored in database.

 

 

 

Next test I did: I created new status for test shop - "create invoice" and set it to generate invoice.

 

Result was the same - only one new position in database.

 

id_order_invoice                 type                       id_tax                      amount

             2                      shipping                      1                         1.610000

             3                      shipping                      1                         1.610000

 

 

 

 

So I found mistake in database I think. Question is - how it happens and how we can fix it?

 

 

Edited by mr.dipi (see edit history)
Link to comment
Share on other sites

I cleaned sho by ps cleaner from all old orders and invoices and customers to make sure that everything works corectly.

 

After cleaning everything I spotted one more strange thing:

 

When I place order in main shop it is adding new value in prestaorder_invoice.

 

In test shop it is not happening.

 

In test shop new value appears when I want to create invoice.

 

Mistake is somewhere there. But I have no idea what can cause it.

Link to comment
Share on other sites

"When I place order in main shop it is adding new value in prestaorder_invoice."

 

Under normal circumstances, the invoice is created according to the settings in your order states.

What is your order state when you create a new order?

When you go to backoffice - orders - order states:

 

What has this specific state as settings?

Especially the second last thickbox referring to "order is paid"?

Link to comment
Share on other sites

What the state of your database concerns:

 

My impression is you have double entries in  your table order_invoice_tax.

Check other orders as well. Do you have double entries for them as well?

Did you copy / move your database or install new modules?

 

If yes, I have to delete them manually. Unfortunately, ps cleaner IS NOT ABLE to correct this double entries. It is just checking referential integrity but this case goes beyond what the module can do for you.

Link to comment
Share on other sites

status depends on payment method, but I checked all possible and all have "order is paid" unticked / not active

 

"order is paid" I have only in:

 

Payment accepted (few statuses for different payment methods)

Shipped

Delivered

Link to comment
Share on other sites

Yes I have few modules installed.

 

But on the begining it was working corectly problems started later.

 

I've already contacted ROCK POS developer because it is the biggest module connected to selling which I have. Rest shouldn't have influence on it.

 

Yes I have double entries in order_invoice_tax - I wrote about it in previous post.

 

I added new status - Create Invoice (because I want to choose if I want create invoice for particular order or not because I don't have tu - I can make normal bill) and it is only status with "show invoice to customer" activeted

 

It is working like this now:

 

1. I place an order

2. new value is added to order_invoice and order_invoice_tax (which is in my opinion not correct)

3. in BO in have order with payment status (for ex. waiting for bank wire)

4. I change status for accept payment

5. I change status to "create invoice"

6. Same value like before is added to order_invoice_tax

 

So in total I have one order_invoice and two order_invoice_tax related.

 

But right now it seems like developer of ROCK POS is doing something (right now :D )  because problem disappeared - I will write in one hour to check if problem is solved.

 

 

Link to comment
Share on other sites

If PS Cleaner removes ALL values, it's not good either. Removing all would mean, your are loosing all tax values.

What I figured out quickly:

 

I manually inserted a "faulty" duplicate record into ps_order_invoice_tax.

I run PS Cleaner twice with both last options available there.

 

And PS Cleaner did not remove the faulty duplicate. It can't. PS Cleaner can only detect problems with referential integrity, i.E. table contents where a main key is missing somewhere and then deletes records in tables assosiated since the main record is missing. But this case is different.

Edited by Scully (see edit history)
Link to comment
Share on other sites

Hello,

 

Ok for one invoice it started to work with cache disabled and customert not assgined to groups (mistake on import :D )

 

Later when i turned on everything resut came back..

 

 

Which tables I should clear to have clean database?

Link to comment
Share on other sites

Depend on what you want to achieve? Your posts aren't clear in this matter.

 

You can truncate. But there are some IFs.

If you truncate ps_invoice_tax only, you still have order data but every invoice shown is wrong because of missing tax data.

You can truncate more tables (delete all order data) you have in your system. In this scenario you'll loose all order data but you also have no wrong data.

Edited by Scully (see edit history)
Link to comment
Share on other sites

Hello,

 

I'm coming back to issue...

 

Other developers tested the shop and.....

 

All order invoices generated by them were correct. Shipping tax and ect. were calculated good. 

 

They created temporary user made 3 orders and all of them had invoice generated correctly.

 

I don't know if it is important but developer is from US.

 

I'm not getting it at all. How it can happen?

Link to comment
Share on other sites

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...