ConorBradley Posted December 30, 2021 Share Posted December 30, 2021 Hi, Is it possible to change WHMCS billing widget years from 1st Jan - December to something like April 2021 to April 22. In the UK our financial years are different and it would be good to see this in the current financial year. Thanks, Conor 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted January 2, 2022 Share Posted January 2, 2022 Widgets are open-source. Go to ‘modules/widgets/‘ and change what you want. 0 Quote Link to comment Share on other sites More sharing options...
ConorBradley Posted January 2, 2022 Author Share Posted January 2, 2022 11 hours ago, pRieStaKos said: Widgets are open-source. Go to ‘modules/widgets/‘ and change what you want. Thank you for your help, I've found the file but still not sure how to change it to that date range. <?php namespace WHMCS\Module\Widget; use WHMCS\Module\AbstractWidget; /** * Billing Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2021 * @license https://www.whmcs.com/eula/ WHMCS Eula */ class Billing extends AbstractWidget { protected $title = 'Billing'; protected $description = 'An overview of billing.'; protected $weight = 150; protected $cache = true; protected $requiredPermission = 'View Income Totals'; public function getData() { $incomeStats = getAdminHomeStats('income'); foreach ($incomeStats['income'] as $key => $value) { $incomeStats['income'][$key] = $value->toPrefixed(); } return $incomeStats; } public function generateOutput($data) { $incomeToday = $data['income']['today']; $incomeThisMonth = $data['income']['thismonth']; $incomeThisYear = $data['income']['thisyear']; $incomeAllTime = $data['income']['alltime']; return <<<EOF <div class="row"> <div class="col-sm-6 bordered-right"> <div class="item"> <div class="data color-green">{$incomeToday}</div> <div class="note">Today</div> </div> </div> <div class="col-sm-6"> <div class="item"> <div class="data color-orange">{$incomeThisMonth}</div> <div class="note">This Month</div> </div> </div> <div class="col-sm-6 bordered-right bordered-top"> <div class="item"> <div class="data color-pink">{$incomeThisYear}</div> <div class="note">This Year</div> </div> </div> <div class="col-sm-6 bordered-top"> <div class="item"> <div class="data">{$incomeAllTime}</div> <div class="note">All Time</div> </div> </div> </div> EOF; } } 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted January 2, 2022 Share Posted January 2, 2022 (edited) You need to substitute $incomeStats with capsule query you want or just query the stats you want and override to desired value in getData() function. Edited January 2, 2022 by pRieStaKos 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.