Jump to content

[PS 1.6.1.4] problem with invoice number (SOLVED)


Recommended Posts

Hello Everybody,

I am a complete newbye for what concerns PrestShop - I've been working with it for less than two weeks - and I have a problem with the invoice numbers I am not able to solve.

 

My employer uses PrestShop module "ba_prestashop_invoice", which is configured to generate invoice numers looking like this: #FA[6-digit progressive number]/[year] (e.g. #FA000001/2007). Here it is a screenshot of the configuration module page (sorry, it is in Italian):

screenshot_01.png

 

 

Now, I have two distinct problems:

  1. The invoices we generate do not follow the "counter"; the next invoice is not going to be #FA000024/2007 but #FA000998/2007 and I have absolutely no idea where that "998" comes from (I checked the "order_invoice" table and there is no record with a value >= 900 for the "number" column)
  2. Althougn in the back-end I can see the correct format for the invoice number (#FA[6-digit progressive number]/[year]) on the invoice PDF itself the invoice number is indicated just as #FA[6-digit progressive number] - without the /[year]

For the seconf issue I tried to modify the file "/modules/ba_prestashop_invoice/override/classes/pdf/HTMLTemplateInvoice.php" (ines 399-400), as follow:

 

ORIGINAL CODE
$invoiceNumber=Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop)
    .sprintf('%06d', $this->order_invoice->number);
MODIFIED CODE
$invoiceNumber=Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop)
    .sprintf('%06d', $this->order_invoice->number)
    .sprintf('/', date('Y', strtotime($this->order_invoice->date_add)));
 
Can anybody help me, please?
 
Thank you very much for yourt kind attention and apologies for the long post.
Edited by saverio.cannilla (see edit history)
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...