при генерации номера счета пишется invoice_id в базу (таблица `order`).
на выводе (в шаблонах) используется "$invoice_prefix.$invoice_id".
чтобы invoice_id был равен номеру заказа, надо проделать следующее:
в файле
admin/model/sale/order.phpзаменить функцию
public function generateInvoiceId($order_id) {
$query = $this->db->query("SELECT MAX(invoice_id) AS invoice_id FROM `" . DB_PREFIX . "order` WHERE invoice_prefix = '" . $this->db->escape($this->config->get('config_invoice_prefix')) . "'");
if ($query->row['invoice_id']) {
$invoice_id = (int)$query->row['invoice_id'] + 1;
} elseif ($this->config->get('config_invoice_id')) {
$invoice_id = $this->config->get('config_invoice_id');
} else {
$invoice_id = 1;
}
$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 . "'");
return $this->config->get('config_invoice_prefix') . $invoice_id;
}на
public function generateInvoiceId($order_id) {
/*
$query = $this->db->query("SELECT MAX(invoice_id) AS invoice_id FROM `" . DB_PREFIX . "order` WHERE invoice_prefix = '" . $this->db->escape($this->config->get('config_invoice_prefix')) . "'");
if ($query->row['invoice_id']) {
$invoice_id = (int)$query->row['invoice_id'] + 1;
} elseif ($this->config->get('config_invoice_id')) {
$invoice_id = $this->config->get('config_invoice_id');
} else {
$invoice_id = 1;
}
*/
$invoice_id = $order_id;
$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 . "'");
return $this->config->get('config_invoice_prefix') . $invoice_id;
}