Jump to content

How to safely set new custom quote number to begin with higher numbers?


tallship

Recommended Posts

Hello,

 

I looked on the forums and found only two posts dating back to 2009 or so related to how I can change the default autoincrement number for the next quote that I create.

 

Those two old threads are located HERE and HERE

 

For whatever reason, in only one of those threads, two tables were mentioned, but I don't wish to break anything on my production system and no instructions were actually offered by any of the respondents, although there were people replying with off-topic suggestions such as, "...why don't you do this because..." - which weren't helpful at all to the OPs of those topics, or me - as the licensee and operator of my own billing system, I know what reasons I have for wishing to start my quote numbers at a higher number than say, "1".

 

To be clear, the current quote number is '8', the next one sent out will appear to the customer as '9', and I want to change the next quote number to, for example, 1024.

 

Here's what my database looks like at the moment:

 

MariaDB [db666]> select id,quoteid from tblquoteitems;
+----+---------+
| id | quoteid |
+----+---------+
|  1 |       3 |
|  2 |       3 |
|  3 |       4 |
|  4 |       4 |
|  5 |       4 |
|  6 |       5 |
|  7 |       5 |
|  8 |       6 |
|  9 |       6 |
| 10 |       7 |
| 11 |       7 |
| 12 |       8 |
| 13 |       8 |
+----+---------+
13 rows in set (0.00 sec)

MariaDB [db666]> select id from tblquotes;
+----+
| id |
+----+
|  3 |
|  4 |
|  5 |
|  6 |
|  7 |
|  8 |
+----+
6 rows in set (0.00 sec)

 

I would prefer to just have an insert or update statement I could use in the mysql cli, for example, changing the next quote number to '123456' instead of '9', but instructions for PhpMyAdmin will do I suppose (I would prefer to just do the update or insert and be done with it forever instead of having to install PhpMyAdmin).

 

Do I need to update or insert into one or both of the tables above, and are there other considerations I need to make with regards to other tables in the database?

 

Also, if you have a handy insert or update statement for me to just change the latest id and/or quoteid I can basically cut and paste that would be great! (Yes of course I'll do a mysqldump prior to testing :)

 

Thanks, in advance, for any assistance you can provide!

Link to comment
Share on other sites

it will be a variation on the code in the post below...

 

https://forum.whmcs.com/showthread.php?41404-Change-next-affiliate-ID&p=199011#post199011

ALTER TABLE tblquotes AUTO_INCREMENT = 1000;

after you run the above command, the next quote will be 1000 (or whatever value you use in the above line), the one after that will be 1001 and so on... :idea:

 

aKVtGFk.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated