Year At Bill id Invoice

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
mrtsilva
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 03 Jun 2011, 18:29

Year At Bill id Invoice

Post by mrtsilva »

Hi,

Many companies restart the invoice count number at each New Year and I will sugest a way to solve your problems ( like it solve my :) ).

Imagine that at the start of 2011 Year you wish to have invoice numbered by the following
2011XXXXX
The first invoice will be 2011000001, the second 2011000002 and so on.

If you wish to have this to Invoice, Receipt and Delivery Notes you need to make some little changes in the database:

Change the AutoIncrement Start Counter:
ALTER TABLE jos_vm_bills AUTO_INCREMENT = 2011000001;
ALTER TABLE jos_vm_deliveries AUTO_INCREMENT = 2011000001;
ALTER TABLE jos_vm_orders AUTO_INCREMENT = 2011000001;

Change the index order :
jos_vm_deliveries - Change the order Primary Index (vendor_id, delivery_id) to Primary Index ( delivery_id, vendor_id)
jos_vm_bills - Change the order Primary Index (vendor_id, bill_id) to Primary Index (bill_id, vendor_id)

I check several other posts that require something like this. Hope this can help someone.

Bye
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Year At Bill id Invoice

Post by Jan »

Hi, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
ardase
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 31 Aug 2008, 17:11

Re: Year At Bill id Invoice

Post by ardase »

hi how too this:


Change the index order :
jos_vm_deliveries - Change the order Primary Index (vendor_id, delivery_id) to Primary Index ( delivery_id, vendor_id)
jos_vm_bills - Change the order Primary Index (vendor_id, bill_id) to Primary Index (bill_id, vendor_id)

I check several other posts that require something like this. Hope this can help someone.

i novice :oops:

Howw too change?? any idea
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48386
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Year At Bill id Invoice

Post by Jan »

Hi, no experiences with this :-(

Jan
If you find Phoca extensions useful, please support the project
mrtsilva
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 03 Jun 2011, 18:29

Re: Year At Bill id Invoice

Post by mrtsilva »

Dear ardose,

You can install something in joomla to help you manage the database, phpMyAdmin or Artadminer or via console.
Then you must run the following sql commands

Code: Select all

ALTER TABLE `jos_vm_deliveries` ADD PRIMARY KEY ( `delivery_id`,`vendor_id`), DROP INDEX `PRIMARY`
ALTER TABLE `jos_vm_bills` ADD PRIMARY KEY ( `bill_id`,`vendor_id`), DROP INDEX `PRIMARY`
Best Regards,
Miguel
Post Reply