From 76a8dafbaa2e3bf458fde905ca432d3db7b99312 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 10 May 2024 22:24:55 +1000 Subject: [PATCH] Task Rounding --- VERSION.txt | 2 +- app/Repositories/TaskRepository.php | 3 +++ config/ninja.php | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index cc5a1231e025..e774ed209dba 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.54 \ No newline at end of file +5.8.55 \ No newline at end of file diff --git a/app/Repositories/TaskRepository.php b/app/Repositories/TaskRepository.php index 2eb402d097b5..c95207c25a1b 100644 --- a/app/Repositories/TaskRepository.php +++ b/app/Repositories/TaskRepository.php @@ -262,6 +262,9 @@ class TaskRepository extends BaseRepository if($this->task_round_up) return $start_time + (int)ceil($interval/$this->task_round_to_nearest)*$this->task_round_to_nearest; + if($interval <= $this->task_round_to_nearest) + return $start_time; + return $start_time - (int)floor($interval/$this->task_round_to_nearest) * $this->task_round_to_nearest; } diff --git a/config/ninja.php b/config/ninja.php index c2b2ee858378..5e2a012c5796 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.54'), - 'app_tag' => env('APP_TAG', '5.8.54'), + 'app_version' => env('APP_VERSION', '5.8.55'), + 'app_tag' => env('APP_TAG', '5.8.55'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false),