saverio.cannilla Posted January 16, 2017 Share Posted January 16, 2017 (edited) 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): Now, I have two distinct problems: 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) 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 January 17, 2017 by saverio.cannilla (see edit history) Link to comment Share on other sites More sharing options...
saverio.cannilla Posted January 17, 2017 Author Share Posted January 17, 2017 Hello Everybody, I just wanted to inform that I found the solution to my problem; there was another module I was unaware of, that was re-writing the same files. The thread can be closed, thanks. Best regards, Saverio Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now