1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Scheduled Reports - Add ranges with quarters

Signed-off-by: Kristián Feldsam <feldsam@gmail.com>
This commit is contained in:
Kristián Feldsam 2019-04-28 17:29:53 +02:00
parent 258b5c6453
commit ec9f77b53d
3 changed files with 19 additions and 0 deletions

View File

@ -46,6 +46,14 @@ class RunReport extends Job
$startDate = Carbon::now()->subMonth()->firstOfMonth()->toDateString();
$endDate = Carbon::now()->subMonth()->lastOfMonth()->toDateString();
break;
case 'this_quarter':
$startDate = Carbon::now()->firstOfQuarter()->toDateString();
$endDate = Carbon::now()->lastOfQuarter()->toDateString();
break;
case 'last_quarter':
$startDate = Carbon::now()->subMonth(3)->firstOfQuarter()->toDateString();
$endDate = Carbon::now()->subMonth(3)->lastOfQuarter()->toDateString();
break;
case 'this_year':
$startDate = Carbon::now()->firstOfYear()->toDateString();
$endDate = Carbon::now()->lastOfYear()->toDateString();

View File

@ -135,6 +135,7 @@ $LANG = array(
'status' => 'Status',
'invoice_total' => 'Invoice Total',
'frequency' => 'Frequency',
'range' => 'Range',
'start_date' => 'Start Date',
'end_date' => 'End Date',
'transaction_reference' => 'Transaction Reference',

View File

@ -358,6 +358,16 @@
<div id="scheduleHelp"></div>
</center>
{!! Former::select('range')
->addOption(trans('texts.none'), '')
->addOption(trans('texts.this_month'), 'this_month')
->addOption(trans('texts.last_month'), 'last_month')
->addOption(trans('texts.current_quarter'), 'this_quarter')
->addOption(trans('texts.last_quarter'), 'last_quarter')
->addOption(trans('texts.this_year'), 'this_year')
->addOption(trans('texts.last_year'), 'last_year')
->value('') !!}
{!! Former::select('frequency')
->addOption(trans('texts.freq_daily'), REPORT_FREQUENCY_DAILY)
->addOption(trans('texts.freq_weekly'), REPORT_FREQUENCY_WEEKLY)