Jump to content

Resetting invoice number every year


Recommended Posts

The controller has this logic, that validates if the new number is less than the last used number. 

 

You can remove this logic from the controller if you would like to try it.  I cannot say how this is going to work, that is something you are going to have to test.  I'm sure there is a reason that they are trying to prevent you from doing this, that is something you will likely find out in your testing.

 

You also do not say which version of Prestashop you are using, so I'm assuming PS v1.6.0.9

 

Edit controllers\admin\AdminInvoicesController.php

 

Locate line 251 which has the following code

    public function beforeUpdateOptions()
    {
        if ((int)Tools::getValue('PS_INVOICE_START_NUMBER') != 0 && (int)Tools::getValue('PS_INVOICE_START_NUMBER') <= Order::getLastInvoiceNumber())
            $this->errors[] = $this->l('Invalid invoice number.').Order::getLastInvoiceNumber().')';
    }

and remove those lines and perform your testing.

Link to comment
Share on other sites

×
×
  • Create New...