From 1fb6d04172b82f656685c60290ddf52a7410fb53 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 8 Mar 2017 11:41:24 +0200 Subject: [PATCH] Group task report by project --- app/Models/Task.php | 2 +- app/Ninja/Reports/AbstractReport.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Models/Task.php b/app/Models/Task.php index 782f1668dc04..139627f46a24 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -205,7 +205,7 @@ class Task extends EntityModel public function scopeDateRange($query, $startDate, $endDate) { $query->whereRaw('cast(substring(time_log, 3, 10) as unsigned) >= ' . $startDate->format('U')); - $query->whereRaw('cast(substring(time_log, 3, 10) as unsigned) <= ' . $endDate->format('U')); + $query->whereRaw('cast(substring(time_log, 3, 10) as unsigned) <= ' . $endDate->modify('+1 day')->format('U')); return $query; } diff --git a/app/Ninja/Reports/AbstractReport.php b/app/Ninja/Reports/AbstractReport.php index c1983b3e47b3..df2d4cb42397 100644 --- a/app/Ninja/Reports/AbstractReport.php +++ b/app/Ninja/Reports/AbstractReport.php @@ -25,6 +25,7 @@ class AbstractReport public function run() { + } public function results() @@ -66,7 +67,7 @@ class AbstractReport if (strpos($field, 'date') !== false) { $class[] = 'group-date-' . (isset($this->options['group_dates_by']) ? $this->options['group_dates_by'] : 'monthyear'); - } elseif (in_array($field, ['client', 'vendor', 'product', 'method', 'category'])) { + } elseif (in_array($field, ['client', 'vendor', 'product', 'method', 'category', 'project'])) { $class[] = 'group-letter-100'; } elseif (in_array($field, ['amount', 'paid', 'balance'])) { $class[] = 'group-number-50';