X7ROOT File Manager
Current Path:
/home/mysptejz/public_html/billing/modules/reports
home
/
mysptejz
/
public_html
/
billing
/
modules
/
reports
/
ðŸ“
..
📄
affiliates_overview.php
(2.59 KB)
📄
aging_invoices.php
(4.57 KB)
📄
annual_income_report.php
(3.26 KB)
📄
client.php
(4.66 KB)
📄
client_sources.php
(4.58 KB)
📄
client_statement.php
(6.88 KB)
📄
clients.php
(5.8 KB)
📄
clients_by_country.php
(2.22 KB)
📄
credits_reviewer.php
(6.06 KB)
📄
customer_retention_time.php
(9.07 KB)
📄
daily_performance.php
(4.96 KB)
📄
direct_debit_processing.php
(2.95 KB)
📄
disk_usage_summary.php
(3.19 KB)
📄
domain_renewal_emails.php
(6.09 KB)
📄
domains.php
(8.4 KB)
📄
income_by_product.php
(8.92 KB)
📄
income_forecast.php
(4.26 KB)
📄
index.php
(42 B)
📄
invoices.php
(10.36 KB)
📄
monthly_orders.php
(3.45 KB)
📄
monthly_transactions.php
(4.05 KB)
📄
new_customers.php
(4.36 KB)
📄
pdf_batch.php
(4.43 KB)
📄
product_suspensions.php
(1.55 KB)
📄
promotions_usage.php
(3.53 KB)
📄
sales_tax_liability.php
(5.65 KB)
📄
server_revenue_forecasts.php
(3.63 KB)
📄
services.php
(9.7 KB)
📄
smarty_compatibility.php
(4.35 KB)
📄
ssl_certificate_monitoring.php
(7.92 KB)
📄
support_ticket_replies.php
(2.23 KB)
📄
ticket_feedback_comments.php
(5.31 KB)
📄
ticket_feedback_scores.php
(4.5 KB)
📄
ticket_ratings_reviewer.php
(4.11 KB)
📄
ticket_tags.php
(2.99 KB)
📄
top_10_clients_by_income.php
(2.36 KB)
📄
transactions.php
(7.08 KB)
📄
vat_moss.php
(6.98 KB)
Editing: server_revenue_forecasts.php
<?php use WHMCS\Database\Capsule; if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } $reportdata["title"] = "Server Revenue Forecasts"; $reportdata["description"] = "This report shows income broken down by billing cycle for each of your servers." . " It then uses the monthly cost entered for each server to estimate the annual gross profit for" . " each server."; $reportdata["tableheadings"] = [ "Server Income", "Monthly", "Quarterly", "Semi-Annual", "Annual", "Biennial", "Triennial", "Monthly Costs", "Annual Gross Profit" ]; $currency = getCurrency(null, 1); $results = Capsule::table('tblservers') ->where('disabled', '=', '0') ->orderBy('name', 'asc') ->get() ->all(); foreach ($results as $result) { $id = $result->id; $name = $result->name; $monthlycost = $result->monthlycost; $monthly = $quarterly = $semiannually = $annually = $biennially = $triennially = 0; $services = Capsule::table('tblhosting') ->select( 'tblhosting.billingcycle', Capsule::raw('tblhosting.amount/tblcurrencies.rate AS reportamt') ) ->join('tblclients', 'tblclients.id', '=', 'tblhosting.userid') ->join('tblcurrencies', 'tblcurrencies.id', '=', 'tblclients.currency') ->where('server', '=', (int) $id) ->whereIn('domainstatus', ['Active', 'Suspended']) ->whereNotIn('billingcycle', ['Free Account', 'One Time']) ->get() ->all(); foreach ($services as $service) { $amount = $service->reportamt; $billingcycle = $service->billingcycle; if ($billingcycle == "Monthly") { $monthly += $amount; } elseif ($billingcycle == "Quarterly") { $quarterly += $amount; } elseif ($billingcycle == "Semi-Annually") { $semiannually += $amount; } elseif ($billingcycle == "Annually") { $annually += $amount; } elseif ($billingcycle == "Biennially") { $biennially += $amount; } elseif ($billingcycle == "Triennially") { $triennially += $amount; } } $monthly = number_format($monthly, 2, ".", ""); $quarterly = number_format($quarterly, 2, ".", ""); $semiannually = number_format($semiannually, 2, ".", ""); $annually = number_format($annually, 2, ".", ""); $biennially = number_format($biennially, 2, ".", ""); $triennially = number_format($triennially, 2, ".", ""); $totalserverincome = ( ($monthly * 12) + ($quarterly * 4) + ($semiannually * 2) + $annually + ($biennially / 2) + ($triennially / 3) ); $totalserverexpenditure = ($monthlycost * 12); $servertotal = number_format(($totalserverincome - $totalserverexpenditure), 2, ".", ""); $totalincome += $totalserverincome; $totalexpenditure += $totalserverexpenditure; $totalgrossprofit += $servertotal; $reportdata["tablevalues"][] = [ "$name", formatCurrency($monthly), formatCurrency($quarterly), formatCurrency($semiannually), formatCurrency($annually), formatCurrency($biennially), formatCurrency($triennially), formatCurrency($monthlycost), formatCurrency($servertotal) ]; } $totalincome = formatCurrency($totalincome); $totalexpenditure = formatCurrency($totalexpenditure); $totalgrossprofit = formatCurrency($totalgrossprofit); $data["footertext"] = "<strong>Total Income:</strong> {$totalincome}<br />" . "<strong>Total Expenses:</strong> {$totalexpenditure}<br />" . "<strong>Gross Profit:</strong> {$totalgrossprofit}";
Upload File
Create Folder