News:

Looking for documentation? Take a look on our wiki

Main Menu

Wrong Invoice Number - ends with 01

Started by sprachrohr, May 22, 2020, 09:17:29 AM

Previous topic - Next topic

sprachrohr

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

Jörgen

QuoteInvoice numbers are created correct,

What does this mean ? Order number is not the same as invoice number.

QuoteWhen 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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

GJC Web Design

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?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sprachrohr

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


sprachrohr

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.

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sprachrohr

Thank you very much, but now i'm confused.
I hoped someone else has this problem too.


Milbo

could it be, that you create a replacing invoice? You can also use the german forum btw, makes it maybe easier. forum.virtuemart.de
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sprachrohr

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

sprachrohr

Has nobody an idea anymore? I would be very grateful!

sprachrohr

I just figured out, that this behavior even exists on a blank new installation.
Nobody else has this problem?

sprachrohr

#11
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!

Milbo

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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sprachrohr

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!

Milbo

Of course, already merged. :-) Thanks for keep posting
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/