Page 1 of 1

Bug discovered? Invoicing

Posted: Mon Dec 19, 2022 5:25 am
by kevc978
Hi,

I tried to change my Invoices to help with accounting and also because its a new business i dont really want orders starting from #0
I changed the INVOICE ID in Settings>(Site)>Checkout to UKPHARMA-2023-1468
So now when i create an invoice id expect the next order to be UKPHARMA-2023-1469
However when i login to a customer account and make an order in the Order history area it only shows as Order ID #1
When i go to the admin area and look at the orders (Sales>Orders) and open order id #1 if i click on the view button and then the cog beside Invoice it THEN labels the order as UKPHARMA-2023-14681
So thats kind of sorted it although i dont see why i should need to click on the cog to create the invoice ID..
The Issue is though is that when i go back to the client area and view the order again it now shows as:
Invoice No.: UKPHARMA-2023-14681
Order ID: #1

I thought Order ID and Invoice ID should be matching? and if not, how do i change order ID to match Invoice ID? as i dont really need both

Using Opencart version 4.0.2.0 although latest shows as 4.0.1.1?

WEIRD!

Thanks for any help

Re: Bug discovered? Invoicing

Posted: Mon Dec 19, 2022 6:01 pm
by IP_CAM
It has been mentioned many times around this forum, that OC v.4.x is still in a developing stage, and it should not yet be used as production Code.

Re: Bug discovered? Invoicing

Posted: Mon Dec 19, 2022 6:06 pm
by ADD Creative
Order IDs and invoice numbers are two different things. Order ID are generated for every order, even if that order didn't complete, maybe because payment failed. A unique order ID is needed to match the order to the payment, so a new order ID will generate on on each checkout attempt.

In some countries, by law the invoice number must be sequential without gaps, so you could not use the order ID for this. OpenCart gives the option of using a separate unique and sequential invoice number.

If you don't require sequential invoice numbers without gaps, you could skip the generate invoice and just use the order ID as the invoice number.

Re: Bug discovered? Invoicing

Posted: Thu Jan 05, 2023 11:43 am
by MadControl
But does the customer even see that extra ID number anyway or is it just an internal (admin) number?

Re: Bug discovered? Invoicing

Posted: Thu Jan 05, 2023 11:45 am
by MadControl
I see that indeed the customer does see it...

Re: Bug discovered? Invoicing

Posted: Thu Jan 05, 2023 9:04 pm
by grgr
You can also reset the auto increment number on the order table. Though order id and invoice number still won't for reasons stated above.

ALTER TABLE oc_order AUTO_INCREMENT = 1468;