Lpeek Posted July 23, 2010 Share Posted July 23, 2010 I’m just wondering if there is a way to make the order number, invoice number and delivery slip number the same?at the minute they all auto-increment at their own pace, which means if they will only stay in order if I generate the documents in the exact order that the orders were placed. This isn’t convinient, as some orders are ready before others.Is there no way to make all the document numbers the same? so:order #1 has an invoice #1 and delivery slip #1at the minute I have:order #60 has invoice #61 and delivery #59Thanks! Link to comment Share on other sites More sharing options...
ruben6 Posted September 29, 2010 Share Posted September 29, 2010 I'm also looking for a solution for this. Link to comment Share on other sites More sharing options...
5ummer5 Posted October 9, 2010 Share Posted October 9, 2010 I would like to also like to know this. Link to comment Share on other sites More sharing options...
shokinro Posted October 9, 2010 Share Posted October 9, 2010 I think that it is nature to have different order/invoice/delivery numbers. I can understand that current PrestaShop is doing correct job. Think of some order may have more than one delivery(even it is rare to some store owner, but it happens).If you really want to make all those numbers to be the same, you have an option to do so in following way.The point is:1. Keep invoice/delivery ID as it is in database2. Use order # for other (invoice/delivery) numbers when display on UI or generate PDF document.This approach is not recommended, but doable with some code changes. Link to comment Share on other sites More sharing options...
Kenik Posted November 22, 2010 Share Posted November 22, 2010 for me work:classes/Order.php public function setInvoice() { // Set invoice number // $number = intval(Configuration::get('PS_INVOICE_NUMBER')); $number = intval($this->id); if (!intval($number)) die(Tools::displayError('Invalid invoice number')); $this->invoice_number = $number; //Configuration::updateValue('PS_INVOICE_NUMBER', $number + 1); // Set invoice date $this->invoice_date = date('Y-m-d H:i:s'); // Save $this->update(); } public function setDelivery() { // Set delivery number //$number = intval(Configuration::get('PS_DELIVERY_NUMBER')); $number = intval($this->id); if (!intval($number)) die(Tools::displayError('Invalid delivery number')); $this->delivery_number = $number; //Configuration::updateValue('PS_DELIVERY_NUMBER', $number + 1); // Set delivery date $this->delivery_date = date('Y-m-d H:i:s'); // Update object $this->update(); } Link to comment Share on other sites More sharing options...
Recommended Posts