In the class order (administrator/components/com_hikashop/classes/order.php) there is two references to "$order->order_invoice_id".
Please update the file with these two new indicated lines:
Code:
$order->order_invoice_id = $this->database->loadResult();
$order->order_invoice_number = hikashop_encode($order, 'invoice');
$order->order_invoice_created = time(); // Add this line
Code:
$order->order_invoice_id = $order->order_id;
$order->order_invoice_number = $order->order_number;
$order->order_invoice_created = time(); // Add this line
It should fix your problem with the new option "invoice_reset_frequency".
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
if in the settings choose "Invoice number reset frequency" = "every years" the counter of the invoice does not feed (remains locked to a number lower than the last)
As if "Invoice number reset frequency" = no
counter order_invoice_id runs normally
It is because the last one does not have the right value in the column "order_invoice_created". So the algorithm does not use the value of this order because it does not see this order as an order generated this year.
You have to update your orders of this year by copying the value of "order_created" to "order_invoice_created".
You can use this SQL query (replace "#_" with you database prefix, like "jos")
Code:
UPDATE #__hikashop_order SET order_invoice_created = order_created WHERE order_invoice_id > 0 AND (order_invoice_created IS NULL OR order_invoice_created = 0);
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.