Jump to content

New customers status as inactive.


ADz83

Recommended Posts

Well in my case its when a customer purchases a product, I process order, send email with logins and then go into pending orders and manually accept the order at which point the client should be set as active by system because he has active service. However they are not automatically been set as active I have to manually edit them.

 

Or is it set by cron?

Link to comment
Share on other sites

As I can seen, Cron set accounts without active services to "inactive", seems that is correct. BUT, when such user place a new order and paid it, his account remain inactive regardless he have active order! And only on next Daily Cron runs this account will be set to "Active". So I do not think this is a bug, but this should be enhanced, that account set to "active" just after accepted order.

Edited by vdswin.com
Link to comment
Share on other sites

  • WHMCS CEO

I can confirm this but it's no mistake. The client status will now be automatically switched from Active to Inactive based on active products/services. So if there are none they will show as inactive. If they've placed a new order but not paid, then as soon as the cron runs again following payment their status would change back to active. This helps give you a much truer reflection of active clients via the system overview widget on the admin homepage.

 

Matt

Link to comment
Share on other sites

Matt,

 

Is there a way to disable this?

 

I manage a custom system built on top of WHMCS for a client and this will cause some issues because we don't use the product/services feature that is built into WHMCS so every client is going to get marked as inactive. We haven't upgraded yet but I can see this causing some major issues for us.

 

Thanks,

Link to comment
Share on other sites

I need that to be disabled too. I don't know which clients was inactive before. You should give heads up on these things before updating. I had my own system to set clients inactive, I've set clients inactive that doesn't want to get any promotion emails from us but now I don't know who was active or inactive. Why change something like that after years of habits? Really, 5.1.2 update was a disaster. Too many things are broken(including cronjobs). This update simply messed everything up. I think that update was released somehow in a rush or maybe you've changed your coder team? You have too many web hosting companies as your clients and releasing an update without testing it properly is nonsense. Can't get reply to tickets for many days etc.. we are not playing games here, please remember that.

Link to comment
Share on other sites

That is a nice feature, but I have to agree, that should be an optional feature, and should probably be disabled by default. I also think that WHMCS should never introduce such new behavior that is by default enabled without properly informing us of new behavior.

 

Also default behavior for this should be to also treat clients with Pending services as Active, or we should have options to choose how this should behave.

Link to comment
Share on other sites

That is a nice feature, but I have to agree, that should be an optional feature, and should probably be disabled by default.

 

I completely agree with you. Please Matt, this is important. We need something which allows us to disable this feature.

 

Regards,

Marco

Link to comment
Share on other sites

I would also have to agree. We have customers that have domain registration and renewal only with no other product that are being marked as inactive. Now I see the justification and importance if they have no products or domains at all but I consider domains to be an active service.

 

So the system should be checking for domains not just products.

Link to comment
Share on other sites

We're finding the system is marking clients "inactive" that have "Pending" products in the account. We use the "Pending" status for clients routinely as a Fiber to the Premise provider as the fiber builds can take time to complete.

 

I agree that this needs to have an on/off function but I'd like to see it further definable. Also, this type of significant change should be pre-set to disabled during upgrades.

 

I'd like to see if refined based on a ranked list:

- IF 'no active' products set to "Inactive"

- IF 'no pending' products set to "Inactive" (overrides 'no active')

- IF 'no activity' for 'x' days set to "Inactive" (by activity I mean no client log ins or tickets)

 

I'm sure others may have some thoughts on variables here.

 

Cheers,

Ryan

Link to comment
Share on other sites

We're finding the system is marking clients "inactive" that have "Pending" products in the account. We use the "Pending" status for clients routinely as a Fiber to the Premise provider as the fiber builds can take time to complete.

 

I agree that this needs to have an on/off function but I'd like to see it further definable. Also, this type of significant change should be pre-set to disabled during upgrades.

 

I'd like to see if refined based on a ranked list:

- IF 'no active' products set to "Inactive"

- IF 'no pending' products set to "Inactive" (overrides 'no active')

- IF 'no activity' for 'x' days set to "Inactive" (by activity I mean no client log ins or tickets)

 

I'm sure others may have some thoughts on variables here.

 

Cheers,

Ryan

 

That is exactly what we need...

 

There should be one main switch to enable disable that behavior (disabled by default)....

 

... and there should be a checkbox for each domain and each product status. For example...

 

Don't swith to inactive clients that have products with one of the following status...

 

x Active

x Pending

x Suspended

- Terminated

...

 

Don't swith to inactive clients that have domains with one of the following status...

 

x Active

x Pending

x Pending Transfer

- Expired

- Cancelled

...

 

 

We can't upgrade to new version because of this.

 

This should really be resolved asap.

 

Thank you.

Link to comment
Share on other sites

  • 6 months later...

I upgraded to WHMCS 5.1.3, and had the situation where a ton of my clients were set to inactive, yet they have active reoccurring billable items. I bill many of my clients, using billable items, for custom services. So, I created the following script to run, after the admin cron job runs each day. It will set clients to active, that have active billable items (not set to "Don't Invoice for Now"). I named the following script statusupdate.php:

 

<?php

##### CONFIG BEGIN (Only change this section) #####
include '/home/username/public_html/whmcs/configuration.php'; # path to WHMCS configuration file
$url = 'http://www.yourdomain.com/whmcs/includes/api.php'; # URL to WHMCS API file
$whmcsadmin = 'admin'; # WHMCS admin account for API
##### CONFIG END #####

# Open database connection
$conn = mysql_connect($db_host, $db_username, $db_password);
if (! $conn ){
 die('Could not connect: ' . mysql_error());
}

# Select the WHMCS database
mysql_select_db($db_name, $conn);

# Query the database for the WHMCS admin password
$mysqlquery1 = mysql_query("SELECT username, password FROM tbladmins WHERE username = '" . $whmcsadmin . "'");

# Set variables from database query results
while($row = mysql_fetch_array($mysqlquery1)) {
 $username = $row['username'];
 $password = $row['password'];
}

# Query database for active billable items (NOT marked as Don't Invoice for Now)
$mysqlquery2 = mysql_query("SELECT tblclients.id, tblclients.status FROM tblclients INNER JOIN tblbillableitems ON tblclients.id = tblbillableitems.userid WHERE tblbillableitems.invoiceaction <> '0'");

while($row = mysql_fetch_array($mysqlquery2)) {

 # Set variables from database query results
 $clientid = $row['id'];
 $status = $row['status'];

 if ($status = "Inactive"){

   # If client has an active billable item and is Inactive, set to Active via API
   $postfields["username"] = $username;
   $postfields["password"] = $password;
   $postfields["action"] = "updateclient";
   $postfields["clientid"] = $clientid;
   $postfields["status"] = "Active";

   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, $url);
   curl_setopt($ch, CURLOPT_POST, 1);
   curl_setopt($ch, CURLOPT_TIMEOUT, 100);
   curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
   $data = curl_exec($ch);
   curl_close($ch);

   $data = explode(";",$data);
   foreach ($data AS $temp) {
     $temp = explode("=",$temp);
     if (isset($temp[1])){
       $results[$temp[0]] = $temp[1];
     }
   }

   if ($results["result"]=="success") {
     # Result was OK!
   } else {
     # An error occured
     echo "The following error occured: ".$results["message"];
   }

 }

}

# Close database connection
mysql_close($conn);

?>

 

I wrap my admin cron script and the statusupdate.php script in a single shell script, so that statusupdate.php will run right after the admin cron job runs. I named the shell script runcrons.sh:

 

#!/bin/bash
/usr/local/bin/php -q /home/username/public_html/whmcs/admin/cron.php
/usr/local/bin/php -q /home/username/public_html/whmcs/crons/statusupdate.php

 

I placed both statusupdate.php, and runcrons.sh in my admin/crons folder. I then replaced my admin cron line, in crontab, to run the runcrons.sh script instead. So, it will run the admin cron job first, then immediately run my statusupdate.php job. You can modify the statusupdate.php script to meet your specific needs. You will need to make sure the paths are correct in both scripts (including the path to php in runcrons.sh). You will probably have to set the perms on scripts to 755. I HIGHLY suggest testing this on a test copy of your database, before running it in production. I offer this script as a free contribution, and take no responsibility for any data issues. I run these scripts, daily, on my main production WHMCS implementation. I hope this helps anyone who needs it...

 

Sean

Edited by SeanP
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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