Change the next due date or the next invoice date for a client in WHMCS

There’s a time when you need to change the due date for multiple products. You can easily do that for one product. It is difficult to do that for multiple products. You have to change it one at a time and the WHMCS is not very user friendly doing that. You have to navigate through 4 clicks for every product. That’s very time consuming. You should be able to change the due date for a client or set of products for that client within the client’s profile dashboard. Until then, the fastest way to do that is through phpMyAdmin or by running a SQL command.

Navigate to the tblhosting table in your phpMyAdmin. You normally find phpMyAdmin in the cPanel Databases section.

The command is simple when you need to change the due date for every product for a particular client. You first need to find out the unique client id. You can easily find it by heading over to the clients page. Next run the SQL command to update the nextduedate record for that client:

UPDATE `tblhosting` SET `nextduedate` = '2018-03-01' WHERE `tblhosting`.`userid` = 2;

To change the next invoice date, which sometimes can get out of sync with next due date, change the nextduedate in the command line to the nextinvoicedate like the following example:

UPDATE `tblhosting` SET `nextinvoicedate` = '2018-03-01' WHERE `tblhosting`.`userid` = 2;

And that’s it. Every product for client with id of 2 is due at new date.

You can tweak the same command to change prices based on set of products but not all of them. For example, you want to change the due date, or the price for one product for one client. First find the id of the product. You can do that by navigating to Setp>Product/Services>Product/Services and click edit on the product you want the price changed. Look at the number at the end of the url, that’s the id for that product: …/admin/configproducts.php?action=edit&id=19. Once you have the id of the product and the client, the SQL command looks like this:

UPDATE `tblhosting` SET `nextduedate` = '2018-03-03' WHERE `tblhosting`.`userid` = 2 AND `tblhosting`.`packageid` = 19;

As you can see it’s fairly simple to change records of products for a client.