VirtueMart Forum
VirtueMart 2 + 3 => Virtuemart Development and bug reports => Topic started by: sprachrohr on May 22, 2020, 09:17:29 am
-
Hi,
is there a bug in creating invoice numbers?
I'm using VM 3.8.2 an Joomla 3.9.18. Invoice numbers are created correct, if i update the order satus from the orders list view.
When i update the order status from the order details view, i allways get an invoice number ending with 01.
Is this a bug? Did i miss something? Can anyone confirm?
Thanks for your help!
Best regards
-
Invoice numbers are created correct,
What does this mean ? Order number is not the same as invoice number.
When i update the order status from the order details view, i allways get an invoice number ending with 01
Invoice should only be created one time right ? This means same invoive number or a, am I wrong ?
Are You using any plugin for the order and invoise numbers ?
Jörgen @ Kreativ Fotografi
-
if u keep flipping between the status set for invoice creation a new invoice is created
If u go C -> P > C etc - is this what u mean?
-
Hi,
thanks for your answers. No, i dont use any Plugin.
Ok, let me explain again. I'm not talking of order numbers. I mean invoice numbers.
My Invoices are created on satus shipped. There are two views where an status might be changed. Order details view and orders list view.
For example:
My last invoice number ends with: 21 --> expected behavior for the next invoice number is ending with 22.
If i change order status from orders list view, then my next invoice would end with 22.
BUT: If i change the status in order details view, then it would end with 01.
I can see this behavior on every generated invoice. If i do it in list view, numbers are correct. If i do it in details view, number is not correct (01). It doesn't depend on flipping between status.
Best regards
-
Here is a screenshot of my invoice numbers... the invoice ending with 01 was created from details view. all others were created in list view.
-
I don't get this effect
in the screenshot the top one was created in the detail view, the bottom one in the orders view .. the last 2 digits are consecutive
VirtueMart 3.8.0 10311
-
Thank you very much, but now i'm confused.
I hoped someone else has this problem too.
-
could it be, that you create a replacing invoice? You can also use the german forum btw, makes it maybe easier. forum.virtuemart.de
-
Hi Milbo,
thanks for your answer.
This happens for new invoices and replacing invoices as well.
Some days ago i wanted to delete all testorders. For that, i deleted all invoices stored in database (cleared table virtuemart_invoices). After that i deleted all orders in backend. Might this be my problem?
next time i will use the german forum ;)
-
Has nobody an idea anymore? I would be very grateful!
-
I just figured out, that this behavior even exists on a blank new installation.
Nobody else has this problem?
-
Hi,
i just did a fresh install again on MAMP. This time i used sample data. Same behavior.
Here is what i've done.
I installed joomla 3.9.18. Then i installed VM 3.8.2.10325_package. Then i installed sample data. In configuration i have set the safe-path. Then i made a new menu entry pointing to a vm category.
Nothing else!
I did three orders of the same product.
I changed order status for the first two orders to confirmed in detail-view. Both invoices end with 01.
The third order i changed the status to confirmed in orders list view. Invoice ends with 03.
Screenshot attached!
This was a absolute clean install. No configuration by myselfe.
Could someone else please do the same thing?
Thanks a lot!
-
Thank you Sprachrohr.
I was able to reproduce the problem and I also found the reason and wrote the fix
Open the invoice model and go to line 197 in function createStoreNewInvoiceNumberById replace the existing
} else if(empty($orderDetails['virtuemart_order_id'])){
against
} else if(empty($orderDetails['virtuemart_order_id']) or empty($orderDetails['virtuemart_vendor_id'])){
That solves the problem without touching the form
-
Thank you Milbo... the fix works for me too!
I nearly thought I was too stupid...
You will merge it in the next release?
Again... thank you and best regards!
-
Of course, already merged. :-) Thanks for keep posting