Author Topic: Wrong Invoice Number - ends with 01  (Read 2270 times)

sprachrohr

  • Beginner
  • *
  • Posts: 38
Wrong Invoice Number - ends with 01
« 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

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3067
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Wrong Invoice Number - ends with 01
« Reply #1 on: May 22, 2020, 10:06:16 am »
Quote
Invoice numbers are created correct,

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

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

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9833
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Wrong Invoice Number - ends with 01
« Reply #2 on: May 22, 2020, 10:59:55 am »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sprachrohr

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #3 on: May 22, 2020, 11:03:32 am »
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

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #4 on: May 22, 2020, 11:35:05 am »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9833
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Wrong Invoice Number - ends with 01
« Reply #5 on: May 22, 2020, 14:20:39 pm »
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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sprachrohr

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #6 on: May 22, 2020, 14:56:37 pm »
Thank you very much, but now i'm confused.
I hoped someone else has this problem too.


Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Wrong Invoice Number - ends with 01
« Reply #7 on: May 22, 2020, 15:39:36 pm »
could it be, that you create a replacing invoice? You can also use the german forum btw, makes it maybe easier. forum.virtuemart.de
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sprachrohr

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #8 on: May 22, 2020, 15:53:33 pm »
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

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #9 on: May 28, 2020, 11:15:46 am »
Has nobody an idea anymore? I would be very grateful!

sprachrohr

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #10 on: May 28, 2020, 13:05:08 pm »
I just figured out, that this behavior even exists on a blank new installation.
Nobody else has this problem?

sprachrohr

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #11 on: May 29, 2020, 17:52:43 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Wrong Invoice Number - ends with 01
« Reply #12 on: June 09, 2020, 19:05:23 pm »
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
Code: [Select]
} else if(empty($orderDetails['virtuemart_order_id'])){

against
Code: [Select]
} else if(empty($orderDetails['virtuemart_order_id']) or empty($orderDetails['virtuemart_vendor_id'])){
That solves the problem without touching the form
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sprachrohr

  • Beginner
  • *
  • Posts: 38
Re: Wrong Invoice Number - ends with 01
« Reply #13 on: June 11, 2020, 09:48:53 am »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Wrong Invoice Number - ends with 01
« Reply #14 on: June 15, 2020, 10:02:21 am »
Of course, already merged. :-) Thanks for keep posting
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/