Jump to content

Invalid invoice number


Recommended Posts

Prestashop : 1.2.5, 1.3.0

Error : Invalid invoice number
This error will appear after you confirm a payment method.

Background info :
A default install does not give this error but it will after truncating some tables.
After creating my shop i had over 50 test orders which i wanted to delete. It is not possible in the back-end to
delete an order (why not?). So i searched on the forum and found some answers (although contradicting each other).
There there is a 'module' out there that truncates even more tables..
I tried them all, but nothing helped to solve the problem.

Now i know that truncating tables is not advised, but how to delete the order without messing up the shop...

There has been previous threads about this 'problem' but none presented a solution. So i would like to kick
off this discussion to get a definitive answer.

Previous (confusing/wrong/pick one) posts

http://www.prestashop.com/forums/viewthread/14711/help_installation___upgrade/solved_invalid_new_order_state

http://www.prestashop.com/forums/viewthread/7828/#111721

And a "potentially dangerous" module from Shaiss (Prestashop v1.1.0.5)
http://www.prestashop.com/forums/viewthread/24710/

And the latest post from myself that is related
http://www.prestashop.com/forums/viewthread/42180/modules___development/hack_attempt_orderhistory__id_order_state_is_empty_with_a_copied_payment_module

Lets kick it off

Link to comment
Share on other sites

I found another post and a nice solution to delete orders.
I have tested this on my shop and the ordering/invoices are not messed up.

open ….admin/tabs/AdminOrders.php

Find

$this->table = 'order';
      $this->className = 'Order';
      $this->view = 'noActionColumn';
      $this->colorOnBackground = true;



and include “$this->delete = true;”

$this->table = 'order';
      $this->className = 'Order';
      $this->view = 'noActionColumn';
      $this->colorOnBackground = true;
      [color=red]$this->delete = true;[/color]



now you have this feature enable in the admin/orders page

IT works

Link to comment
Share on other sites

I FOUND IT !!!!

The solution to this damned error which keeps messing up things.
It is the invoice number setting in the back-end (Orders > Invoices).
Here you can change the invoice number (to zero for example).

When you do that all orders will fail with a "Invalid Order Number".
The order will still be processed and the cart goes empty.....

Finally !!!!
So now the solution? I dont know who developed the invoice code, but they might need to check it
so it works properly.
Anybody has an idea?

18050_MnJUGX2FXSqAXCD1amgj_t

Link to comment
Share on other sites

  • 1 month later...
I found another post and a nice solution to delete orders.
I have tested this on my shop and the ordering/invoices are not messed up.

open ….admin/tabs/AdminOrders.php

Find
$this->table = 'order';
      $this->className = 'Order';
      $this->view = 'noActionColumn';
      $this->colorOnBackground = true;



and include “$this->delete = true;”

$this->table = 'order';
      $this->className = 'Order';
      $this->view = 'noActionColumn';
      $this->colorOnBackground = true;
      [color=red]$this->delete = true;[/color]



now you have this feature enable in the admin/orders page

IT works



this is great =) ty
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...