Page 1 of 1
How to set invoice number manually?
Posted: Sat Mar 17, 2012 4:29 pm
by robynice
You know, most operators already has a invoice system so they can't release opencart wrong invoice numbers because are not synchronized to each other. Any clue about that? Thanks.
Re: How to set invoice number manually?
Posted: Sat Mar 17, 2012 4:49 pm
by allenshea
Yeah, back to 1.4, I remember I can change below code to make easy modification.
1. EDIT: admin\model\sale\order.php
Code: Select all
$this->db->query("UPDATE `" . DB_PREFIX . "order` SET invoice_id = '" . (int)$invoice_id . "', invoice_prefix = '" . $this->db->escape($this->config->get('config_invoice_prefix')) . "', invoice_date = NOW(), date_modified = NOW() WHERE order_id = '" . (int)$order_id . "'");
2. Change to:
Code: Select all
$this->db->query("UPDATE `" . DB_PREFIX . "order` SET invoice_id = order_id, invoice_prefix = '" . $this->db->escape($this->config->get('config_invoice_prefix')) . "', invoice_date = NOW(), date_modified = NOW() WHERE order_id = '" . (int)$order_id . "'");
But in 1.5, I have to use phpMyAdmin and manually adjust every Invoice ID. Because database already saved invoice_prefix. This is really bad.
Re: How to set invoice number manually?
Posted: Sat Mar 17, 2012 5:03 pm
by robynice
Hi, thanks for reply, you are welcome. I'am testing the last version of OCv1.5.1.3.
However, the problem is that it's NOT useful to have everytime wrong invoice number because of out of sync. So the question is: is it possible to have a specific text field in OC's admin order section, a number to set/modify manually the right number stuff? Also should be nice to see the last invoice number associated to a order. Now you can't see anything on order list: you can't see if a specific order has it's own invoice released or not (and the last invoice number released too). So it's difficult to manage invoice order numbers.