bforte@itsolutionsnow.com Posted November 8, 2011 Share Posted November 8, 2011 I am looking for a script/cron job to auto-close the account after the customer has either no products or they are all cancelled/terminated? 0 Quote Link to comment Share on other sites More sharing options...
wsa Posted November 9, 2011 Share Posted November 9, 2011 can you email me at whmcs (at) hostthebest.com 0 Quote Link to comment Share on other sites More sharing options...
wsa Posted November 9, 2011 Share Posted November 9, 2011 To let you know i have done one already 0 Quote Link to comment Share on other sites More sharing options...
EasyWHMCS Posted November 9, 2011 Share Posted November 9, 2011 There is a free one on the forums somewhere i think, As i used to use it on one of my businesses 0 Quote Link to comment Share on other sites More sharing options...
Troy Posted November 9, 2011 Share Posted November 9, 2011 Here's a sql query we run daily, which will set a customer to inactive if they have no services, domains, open invoices, and are not affiliates. You can change 'Inactive' to 'Closed'. update tblclients c set status = 'Inactive' where status = 'Active' and not exists (select 1 from tblhosting where userid = c.id and domainstatus in ('Active', 'Pending', 'Suspended')) and not exists (select 1 from tbldomains where userid = c.id and status in ('Active', 'Pending', 'Pending Transfer')) and not exists (select 1 from tblinvoices where userid = c.id and status = 'Unpaid') and not exists (select 1 from tblaffiliates where clientid = c.id); 1 Quote Link to comment Share on other sites More sharing options...
wsa Posted November 10, 2011 Share Posted November 10, 2011 I am looking for a script/cron job to auto-close the account after the customer has either no products or they are all cancelled/terminated? here what you looking of http://www.hostthebest.com/close_account.php 0 Quote Link to comment Share on other sites More sharing options...
Dedigeeks-Sean Posted November 25, 2011 Share Posted November 25, 2011 Here's a sql query we run daily, which will set a customer to inactive if they have no services, domains, open invoices, and are not affiliates. You can change 'Inactive' to 'Closed'. update tblclients c set status = 'Inactive' where status = 'Active' and not exists (select 1 from tblhosting where userid = c.id and domainstatus in ('Active', 'Pending', 'Suspended')) and not exists (select 1 from tbldomains where userid = c.id and status in ('Active', 'Pending', 'Pending Transfer')) and not exists (select 1 from tblinvoices where userid = c.id and status = 'Unpaid') and not exists (select 1 from tblaffiliates where clientid = c.id); This is exactly what I am after, works perfectly for me and did what I wanted it to do. Is there a way this can be implemented in to a script, or can we simply just run this as a daily task...? 0 Quote Link to comment Share on other sites More sharing options...
wsa Posted November 25, 2011 Share Posted November 25, 2011 new update be up in hrs that now you can disable closed account 0 Quote Link to comment Share on other sites More sharing options...
Dedigeeks-Sean Posted December 2, 2011 Share Posted December 2, 2011 new update be up in hrs that now you can disable closed account Actually didn't work very well after paying for it, I set it to "CLOSE" accounts after 365 days and set them inactive from periods before that date after they no longer had active services with us, surprisingly it closed random accounts and left accounts inactive way back from 2009 0 Quote Link to comment Share on other sites More sharing options...
wsa Posted December 3, 2011 Share Posted December 3, 2011 Did you try the new version 1.3? if not pls email me at support (at) hosttthebest.com 0 Quote Link to comment Share on other sites More sharing options...
Dave96 Posted December 3, 2011 Share Posted December 3, 2011 @Troy, thanks for query! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.