advance the invoice number

  • Posts: 89
  • Thank you received: 1
11 years 2 months ago #92045

Hi
perhaps something has happened since the last update

does not advance the invoice number

See the attached image

thanks

Fabio


Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
11 years 2 months ago #92069

Hi,

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:

					$order->order_invoice_id = $this->database->loadResult();
					$order->order_invoice_number = hikashop_encode($order, 'invoice');
					$order->order_invoice_created = time(); // Add this line
						$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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 89
  • Thank you received: 1
11 years 1 month ago #93601

Hi,

I did this change

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

Regards
Fabio


Configuration:
Joomla: 2.5.9
Hikashop: 2.1.1
Hikamarket: 1.1.2

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #93718

Hi,

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")

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.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 11 years 1 month ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
11 years 1 month ago #93789

i have set monthly reset and it is not working will this solution work for this?

Please Log in or Create an account to join the conversation.

  • Posts: 26008
  • Thank you received: 4004
  • MODERATOR
11 years 1 month ago #93850

Hi,

Yes, the two modifications are required.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum