diff --git a/app/Jobs/RunReport.php b/app/Jobs/RunReport.php index 110a7d2672..e48cffeee6 100644 --- a/app/Jobs/RunReport.php +++ b/app/Jobs/RunReport.php @@ -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(); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 2ffc21cfc3..b994ee6988 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -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', diff --git a/resources/views/reports/report_builder.blade.php b/resources/views/reports/report_builder.blade.php index 6fe4109004..16cc65ed52 100644 --- a/resources/views/reports/report_builder.blade.php +++ b/resources/views/reports/report_builder.blade.php @@ -358,6 +358,16 @@
+ {!! 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)