Jump to content

Server Revenue Forecasts


Recommended Posts



I have changed this report a little bit, such as it reflects as well income for dedicated/VPS hosting, while before it reflected only shared hosting income.


To properly report dedicated and VPS expenses, I have entered every dedicated server into the Configuration, Manage Servers list (as a Dedicated server group). The report expects that the IP of the server will be the IP assigned to that user, and then matches income and expenses.


//  Server revenue Forecast v0.2 - 2007-12-21 Quel: Added Dedicated and VPS revenue
//  Server revenue Forecast v0.2 - 2007-12-22 Quel: Added Dedicated and VPS expenses by matching the ip on the user's Dedicated hosting package and the IP of the server into the Manage Servers configuration. 
//Questions: please ask them onto the whmcs forum.  

$reportdata["title"] = "Server Revenue Forecasts";
$reportdata["description"] = "This report shows income broken down into each payment term period for each of your servers.  It then uses the monthly cost entered for each server to calculate the gross profit.";

$reportdata["tableheadings"] = array("Server Income","Monthly","Quarterly","Semi-Annual","Annual","Biennial","Monthly Costs","Annual Gross Profit");

$query = "SELECT * FROM tblservers ORDER BY name ASC";
while ($data = mysql_fetch_array($result)) {
$id = $data["id"];
$name = $data["name"];
$monthlycost = $data["monthlycost"];
$monthly = 0;
$quarterly = 0;
$semiannually = 0;
$annually = 0;
$biennially = 0;

if( $data["ipaddress"]=='') $dedicated=""; else $dedicated=" OR dedicatedip='". $data["ipaddress"]."' ";
$query2 = "SELECT * FROM tblhosting WHERE (server='$id' $dedicated) AND domainstatus='Active' AND billingcycle!='Free Account' AND billingcycle!='One Time'"; 

while($data = mysql_fetch_array($result2)){
	$amount = $data["amount"];
	$billingcycle = $data["billingcycle"];
$reportdata["tablevalues"][] = array("$name",$CONFIG["CurrencySymbol"]."$monthly",$CONFIG["CurrencySymbol"]."$quarterly",$CONFIG["CurrencySymbol"]."$semiannually",$CONFIG["CurrencySymbol"]."$annually",$CONFIG["CurrencySymbol"]."$biennially",$CONFIG["CurrencySymbol"]."$monthlycost",$CONFIG["CurrencySymbol"]."$servertotal");

$data["footertext"]="<B>Total Income:</B> ".$CONFIG["CurrencySymbol"]."$totalincome<br><B>Total Expenses:</B> ".$CONFIG["CurrencySymbol"]."$totalexpenditure</br><B>Gross Profit:</B> ".$CONFIG["CurrencySymbol"]."$totalgrossprofit";






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.

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