From bc76424fd7951d78425c575f988d4d084fa8ef6b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Apr 2022 08:51:14 +1000 Subject: [PATCH] FIxes for approve with no conversion from AP --- app/Http/Requests/Client/UpdateClientRequest.php | 6 +++++- app/Services/Quote/TriggeredActions.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/Client/UpdateClientRequest.php b/app/Http/Requests/Client/UpdateClientRequest.php index ccc6af785c47..0d4661321278 100644 --- a/app/Http/Requests/Client/UpdateClientRequest.php +++ b/app/Http/Requests/Client/UpdateClientRequest.php @@ -158,7 +158,11 @@ class UpdateClientRequest extends Request unset($settings->{$key}); } - if($key == 'default_task_rate'){ + //26-04-2022 - In case settings are returned as array instead of object + if($key == 'default_task_rate' && is_array($settings)){ + $settings['default_task_rate'] = floatval($value); + } + elseif($key == 'default_task_rate' && is_object($settings)) { $settings->default_task_rate = floatval($value); } } diff --git a/app/Services/Quote/TriggeredActions.php b/app/Services/Quote/TriggeredActions.php index 3ee104670288..4b9fbe5fbff7 100644 --- a/app/Services/Quote/TriggeredActions.php +++ b/app/Services/Quote/TriggeredActions.php @@ -51,7 +51,7 @@ class TriggeredActions extends AbstractService } if ($this->request->has('approve') && $this->request->input('approve') == 'true' && in_array($this->quote->status_id, [Quote::STATUS_SENT, Quote::STATUS_DRAFT])) { - $this->quote = $this->quote->service()->convert()->save(); + $this->quote = $this->quote->service()->approveWithNoCoversion()->save(); }