Jump to content

Changing Billing Years


ConorBradley

Recommended Posts

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;
    }
}
 

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