[SOLVED] Invoicing number starts from 0

  • Posts: 60
  • Thank you received: 1
10 years 9 months ago #142693

-- HikaShop version -- : Business 2.2.3
-- Joomla version -- : 3.2.1
-- PHP version -- : 5.3.28

How to start invoicing number from 1?

Thanks in advance

Last edit: 10 years 9 months ago by mitchie.

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

  • Posts: 2334
  • Thank you received: 403
10 years 9 months ago #142699

Hi,

How about create an order and delete it?
Next order will start from 1.

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

  • Posts: 60
  • Thank you received: 1
10 years 9 months ago #142702

Hi Eliot,
thanks for your reply.

As in Europe we need to restate numbering each year, it requires to make a new order each 1st january?

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

  • Posts: 2334
  • Thank you received: 403
10 years 9 months ago #142709

It's a solution.
You can also change the database structure. The table key_hikashop_order as a column order_invoice_id and you can change the default value from 0 to 1.

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

  • Posts: 60
  • Thank you received: 1
10 years 9 months ago #142720

What about to edit the function?

I wonder how many countries require to start invoicing number from 0 to not make it by default?

Or, even better, add an option to set the starting number to fit every local laws (please, keep in mind these are not personal desires)

Last edit: 10 years 9 months ago by mitchie.

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

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
10 years 9 months ago #142876

The system should start at 1 not 0.
We did some tests and there is a bug.
You should add the line:
if(empty($order->order_invoice_id)) $order->order_invoice_id = 1;
after the line:
$order->order_invoice_id = $this->database->loadResult();
in the file administrator/components/com_hikashop/classes/order.php and that will fix the problem.

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

  • Posts: 60
  • Thank you received: 1
10 years 9 months ago #142882

GREAT!
Thank you.

I've fixed it by myself but I don't like to hack the core component, so this is a great news!

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

Time to create page: 0.052 seconds
Powered by Kunena Forum