News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to customize Invoice number to remove random part.

Started by annpaul, May 27, 2023, 18:38:41 PM

Previous topic - Next topic

annpaul

Using VM 4.0.12 on Joomla 4.2.6

I need to tweak VM invoice number generation a little bit. I don't want the random part in it. In which file may I find the logic of invoice number generation? I am guessing that all I need to do is comment out the part that generates the random sequence. Right?


annpaul

Well, it seems I just need to modify the following line in administrator/components/com_virtuemart/models/invoice.php

$data['invoice_number'] = str_replace('-', '', substr($date,2,8)).vmCrypt::getHumanToken(4).'0'.$count;


Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Gingerweb

Quote from: annpaul on May 27, 2023, 19:29:29 PM
Well, it seems I just need to modify the following line in administrator/components/com_virtuemart/models/invoice.php

$data['invoice_number'] = str_replace('-', '', substr($date,2,8)).vmCrypt::getHumanToken(4).'0'.$count;

Hi - Can you tell me how you modified this file? I also need consecutive numbering and the VM plugin Milbo mentioned doesnt have any instructions so having bought it, i cant get it to work!

Milbo

The main instruction is in the plugin directly. I also fixed the docs problem. The main problem is, that the old SEF worked with Ids, but the new page has new ids, so the old links do not work anylonger. http://extensions.virtuemart.net/all-tutorials/shopper-fields-plugins/automated-numbers

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/