Jump to content
  • 0

Billing overview


jarek

Question

5 answers to this question

Recommended Posts

  • 0

You would have to update the Billing Overview plugin source code in order to set those dates. If you change them, they will be overridden when you upgrade Blesta so you will need to remember to re-add your changes back in afterward.

  1. Open /plugins/billing_overview/controllers/admin_main.php
  2. Look for the following toward the top of the file:
    $dates = [
    	'today_start' => $this->Date->cast($datetime, 'Y-m-d 00:00:00'),
    	'today_end' => $this->Date->cast($datetime, 'Y-m-d 23:59:59'),
    	'month_start' => $this->Date->cast($datetime, 'Y-m-01 00:00:00'),
    	'month_end' => $this->Date->cast($datetime, 'Y-m-t 23:59:59'),
    	'year_start' => $this->Date->cast($datetime, 'Y-01-01 00:00:00'),
    	'year_end' => $this->Date->cast($datetime, 'Y-12-31 23:59:59')
    ];

     

  3. Replace that with:
    $month = $this->Date->format('n');
    $new_fiscal_year = ($month >= 4);
    $datetime_last_year = $this->Date->format('c', date('c', strtotime('now -1 year')));
    $datetime_next_year = $this->Date->format('c', date('c', strtotime('now +1 year')));
    $dates = [
    	'today_start' => $this->Date->cast($datetime, 'Y-m-d 00:00:00'),
    	'today_end' => $this->Date->cast($datetime, 'Y-m-d 23:59:59'),
    	'month_start' => $this->Date->cast($datetime, 'Y-m-01 00:00:00'),
    	'month_end' => $this->Date->cast($datetime, 'Y-m-t 23:59:59'),
    	'year_start' => $this->Date->cast(($new_fiscal_year ? $datetime : $datetime_last_year), 'Y-04-01 00:00:00'),
    	'year_end' => $this->Date->cast(($new_fiscal_year ? $datetime_next_year : $datetime), 'Y-03-31 23:59:59')
    ];

     

  4. Save
Link to comment
Share on other sites

  • 0
2 hours ago, jarek said:

Hi,

I would like to change the date range in Billing at a glance --> Revenue this Year. I know it's showing calendar year but I would like to have my fiscal year (1 April - 31 March).

Is it possible?

Thank you,

Jarek

you have got me a idea to our stats & reports plugin. we will add it to our next release .

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
Answer this question...

×   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.

Loading...
×
×
  • Create New...