Jump to content

monsterit

Senior Member
  • Content Count

    50
  • Joined

  • Last visited

Community Reputation

0 Neutral

About monsterit

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Great thank you. I've changed a part below too as it was clients, so changed that to count. 🙂 <?php add_hook('AdminHomeWidgets', 1, function() { return new InvoicesWidget(); }); use WHMCS\Carbon; use WHMCS\Clients; use WHMCS\Module\AbstractWidget; use WHMCS\Module\Queue as ModuleQueue; use WHMCS\Orders; use WHMCS\Billing\Invoice; use WHMCS\User\Client; /** * Badges Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class InvoicesWidget extends \WHMCS\Module\AbstractWidget { protected $title = "Invoices Widget"; protected $description = 'Invoices'; protected $columns = 3; protected $weight = 0; protected $wrapper = false; protected $cache = false; protected $cacheExpiry = 120; protected $draggable = false; public function getData() { $incomeStats = getAdminHomeStats('income'); foreach ($incomeStats['income'] as $key => $value) { $incomeStats['income'][$key] = $value->toPrefixed(); } return array( 'activeCount' => Client::where('status', '=', 'Active')->count('id'), 'unpaidInvoices' => Invoice::unpaid()->count('id'), 'overdueInvoices' => Invoice::overdue()->count('id'), 'incomestats' => $incomeStats, ); } public function generateOutput($data) { $activeCount = (int) $data['activeCount']; $unpaidInvoices = (int) $data['unpaidInvoices']; $overdueInvoices = (int) $data['overdueInvoices']; $incomeThisMonth = $data['incomestats']['income']['thismonth']; return <<<EOF <div class="row home-status-badge-row"> <div class="col-sm-3"> <div class="health-status-block status-badge-red clearfix"> <div class="icon"> <a href="clients.php?status=Active"> <i class="fas fa-user-friends"></i> </a> </div> <div class="detail"> <a href="clients.php?status=Active"> <span class="count">{$activeCount}</span> <span class="desc">Active Clients</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-purple clearfix"> <div class="icon"> <a href="invoices.php"> <i class="fas fa-file-invoice-dollar"></i> </a> </div> <div class="detail"> <a href="invoices.php?status=Unpaid"> <span class="count">{$unpaidInvoices}</span> <span class="desc">Unpaid Invoices</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-teal clearfix"> <div class="icon"> <a href="invoices.php"> <i class="fas fa-business-time"></i> </a> </div> <div class="detail"> <a href="invoices.php?status=Overdue"> <span class="count">{$overdueInvoices}</span> <span class="desc">Overdue Invoices</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-gold clearfix"> <div class="icon"> <a href="modulequeue.php"> <i class="fas fa-wallet"></i> </a> </div> <div class="detail"> <a href="modulequeue.php"> <span class="count">{$incomeThisMonth}</span> <span class="desc">Income This Month</span> </a> </div> </div> </div> </div> EOF; } } all working perfectly. Thank you once again.
  2. Sorry ignore the above one. i've managed to put alot in but for some reason it's only showing one module counting and i cannot put my finger on it. see the image below. Heres my very long winded coding section. (complete). <?php add_hook('AdminHomeWidgets', 1, function() { return new InvoicesWidget(); }); use WHMCS\Carbon; use WHMCS\Clients; use WHMCS\Module\AbstractWidget; use WHMCS\Module\Queue as ModuleQueue; use WHMCS\Orders; use WHMCS\Billing\Invoice; use WHMCS\User\Client; /** * Badges Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class InvoicesWidget extends \WHMCS\Module\AbstractWidget { protected $title = "Invoices Widget"; protected $description = 'Invoices'; protected $columns = 3; protected $weight = 0; protected $wrapper = false; protected $cache = true; protected $cacheExpiry = 120; protected $draggable = false; public function getData() { $clients = new Clients(); $orders = new Orders(); $incomeStats = getAdminHomeStats('income'); foreach ($incomeStats['income'] as $key => $value) { $incomeStats['income'][$key] = $value->toPrefixed(); } return $incomeStats; return array( 'activeCount' => (int) Client::where('status', '=', 'Active')->count(), 'unpaidInvoices' => (int) Invoice::where('status', '=', 'Unpaid')->count(), 'overdueInvoices' => (int) Invoice::where('status', '=', 'Overdue')->count(), ); } public function generateOutput($data) { $activeClients = number_format((int) $data['activeCount']); $unpaidInvoices = (int) $data['unpaidInvoices']; $overdueInvoices = (int) $data['overdueInvoices']; $incomeThisMonth = $data['income']['thismonth']; return <<<EOF <div class="row home-status-badge-row"> <div class="col-sm-3"> <div class="health-status-block status-badge-green clearfix"> <div class="icon"> <a href="clients.php?status=Active"> <i class="fas fa-user-friends"></i> </a> </div> <div class="detail"> <a href="clients.php?status=Active"> <span class="count">{$activeClients}</span> <span class="desc">Active Clients</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-pink clearfix"> <div class="icon"> <a href="invoices.php"> <i class="fas fa-file-invoice-dollar"></i> </a> </div> <div class="detail"> <a href="invoices.php?status=Unpaid"> <span class="count">{$unpaidInvoices}</span> <span class="desc">Unpaid Invoices</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-orange clearfix"> <div class="icon"> <a href="invoices.php"> <i class="fas fa-business-time"></i> </a> </div> <div class="detail"> <a href="invoices.php?status=Overdue"> <span class="count">{$overdueInvoices}</span> <span class="desc">Overdue Invoices</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-cyan clearfix"> <div class="icon"> <a href="modulequeue.php"> <i class="fas fa-wallet"></i> </a> </div> <div class="detail"> <a href="modulequeue.php"> <span class="count">{$incomeThisMonth}</span> <span class="desc">Income This Month</span> </a> </div> </div> </div> </div> EOF; } }
  3. This is my whole output. <?php add_hook('AdminHomeWidgets', 1, function() { return new InvoicesWidget(); }); use WHMCS\Carbon; use WHMCS\Clients; use WHMCS\Module\AbstractWidget; use WHMCS\Module\Queue as ModuleQueue; use WHMCS\Orders; use WHMCS\Billing\Invoice; /** * Badges Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class InvoicesWidget extends \WHMCS\Module\AbstractWidget { protected $title = "Invoices Widget"; protected $description = 'Invoices'; protected $columns = 3; protected $weight = 0; protected $wrapper = false; protected $cache = true; protected $cacheExpiry = 120; protected $draggable = false; public function getData() { $clients = new Clients(); $orders = new Orders(); return array( 'pendingOrders' => $orders->getPendingCount(), 'unpaidInvoices' => (int) Invoice::where('status', '=', 'Unpaid')->count(), 'overdueInvoices' => (int) Invoice::where('status', '=', 'Overdue')->count(), 'moduleQueueCount' => ModuleQueue::incomplete()->count(), ); } public function generateOutput($data) { $pendingOrders = (int) $data['pendingOrders']; $unpaidInvoices = (int) $data['unpaidInvoices']; $overdueInvoices = (int) $data['overdueInvoices']; $moduleQueueCount = (int) $data['moduleQueueCount']; return <<<EOF <div class="row home-status-badge-row"> <div class="col-sm-3"> <div class="health-status-block status-badge-green clearfix"> <div class="icon"> <a href="orders.php"> <i class="fas fa-shopping-cart"></i> </a> </div> <div class="detail"> <a href="orders.php?status=Pending"> <span class="count">{$pendingOrders}</span> <span class="desc">Active Clients</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-pink clearfix"> <div class="icon"> <a href="invoices.php"> <i class="fas fa-file-invoice-dollar"></i> </a> </div> <div class="detail"> <a href="invoices.php?status=Unpaid"> <span class="count">{$unpaidInvoices}</span> <span class="desc">Unpaid Invoices</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-orange clearfix"> <div class="icon"> <a href="invoices.php"> <i class="fas fa-business-time"></i> </a> </div> <div class="detail"> <a href="invoices.php?status=Overdue"> <span class="count">{$overdueInvoices}</span> <span class="desc">Overdue Invoices</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-cyan clearfix"> <div class="icon"> <a href="modulequeue.php"> <i class="fas fa-ban"></i> </a> </div> <div class="detail"> <a href="modulequeue.php"> <span class="count">{$moduleQueueCount}</span> <span class="desc">Pending Module Actions</span> </a> </div> </div> </div> </div> EOF; } } I can see unpaid invoices now but no over invoices. above is the code and below is my screen shot.
  4. im editing the badges-new.php but struggling with it. tbh.everytime i edit it i loose everything.
  5. @brian! So far i've got it looking like this. <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Clients; use WHMCS\Module\AbstractWidget; use WHMCS\Module\Queue as ModuleQueue; use WHMCS\Orders; use WHMCS\Billing\Invoice; /** * Badges Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Badges extends AbstractWidget { protected $title = 'Badges'; protected $description = ''; protected $columns = 3; protected $weight = 0; protected $wrapper = false; protected $cache = true; protected $cacheExpiry = 120; protected $draggable = false; public function getData() { $clients = new Clients(); $orders = new Orders(); $ticketCounts = localApi('GetTicketCounts', array()); return array( 'pendingOrders' => $orders->getPendingCount(), 'unpaidOrders' => (int) Invoice::where('status', '=', 'Unpaid')->count(), 'cancellations' => $clients->getNumberOfOpenCancellationRequests(), 'moduleQueueCount' => ModuleQueue::incomplete()->count(), ); } public function generateOutput($data) { $pendingOrders = (int) $data['pendingOrders']; $unpaidOrders = (int) $data['unpaidOrders']; $pendingCancellations = (int) $data['cancellations']; $moduleQueueCount = (int) $data['moduleQueueCount']; return <<<EOF <div class="row home-status-badge-row"> <div class="col-sm-3"> <div class="health-status-block status-badge-green clearfix"> <div class="icon"> <a href="orders.php"> <i class="fas fa-shopping-cart"></i> </a> </div> <div class="detail"> <a href="orders.php?status=Pending"> <span class="count">{$pendingOrders}</span> <span class="desc">Pending Orders</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-pink clearfix"> <div class="icon"> <a href="invoices.php?status=Unpaid"> <i class="fas fa-file-invoice-dollar"></i> </a> </div> <div class="detail"> <a href="invoices.php?status=Unpaid"> <span class="count">{$unpaidOrders}</span> <span class="desc">Unpaid Orders</span> </a> </div> </div> </div>
  6. @brian! whats the string i need to view unpaid invoices?
  7. Thank you Brian, i'll check it out.
  8. Hi, is it possible to change these so instead of tickets waiting we can have unpaid invoices? just a though to make things easier for us. as we do not use the ticketing system at all. we are using 7.9.1 and have setup a custom admin theme.
  9. sorted i've used the custom.css to do all the editing visually.
  10. Hi All, I'm getting "Invalid Request: Invalid Payment ID" When a customer trys to pay via stripe. Any help would be great. Thank you. Then on pay we get "Unrecognized request URL (GET: /v1/payment_methods/). If you are trying to list objects, remove the trailing slash. If you are trying to retrieve an object, make sure you passed a valid (non-empty) identifier in your code. Please see https://stripe.com/docs or we can help at https://support.stripe.com/."
  11. Hi, We have some linear gradients in our theme files. section#main-body { margin: 0; padding: 20px 0; min-height: 350px; background: linear-gradient(to bottom, #30e9da , #0957fd); } this is all.css however in the new all.css it coming up an error that it's not supported. Does anyone know how to change the heading and footer to gradients please?
  12. How can i check which version my theme is running from? As i copied six at some point then configured it as how we wanted it. But it's showing version 3.3.7 which is not right in the css style sheet. Any the current is 3.4.7 so i'm a little confused.
  13. i've disabled google recaptcha invisible and its now working.
  14. Hi All, We are using 7.7.1 after a few issues with 7.8.1 however our clients cannot login they are greeted with the same login page they just tried. I have delete .htacess file, i've checked the whmcs login url. We are using a custom template so does any hooks need updating for it to work? nothing that i can see in the error logs either. 😢
×
×
  • 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