From 83b65e046e18f7813402436a6103606e3dff4acd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 25 Mar 2024 15:19:46 +1100 Subject: [PATCH] v5.8.38 --- VERSION.txt | 2 +- app/Http/Requests/Report/ProductSalesReportRequest.php | 8 +++++++- app/Http/Requests/Report/ProfitLossRequest.php | 1 + config/ninja.php | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 5c637b26e9..b7e4264e52 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.37 \ No newline at end of file +5.8.38 \ No newline at end of file diff --git a/app/Http/Requests/Report/ProductSalesReportRequest.php b/app/Http/Requests/Report/ProductSalesReportRequest.php index 4ecf3ed98c..28e2c5b2fd 100644 --- a/app/Http/Requests/Report/ProductSalesReportRequest.php +++ b/app/Http/Requests/Report/ProductSalesReportRequest.php @@ -11,8 +11,10 @@ namespace App\Http\Requests\Report; +use App\Utils\Ninja; use App\Http\Requests\Request; use App\Utils\Traits\MakesHash; +use Illuminate\Auth\Access\AuthorizationException; class ProductSalesReportRequest extends Request { @@ -32,13 +34,17 @@ class ProductSalesReportRequest extends Request public function rules() { + + /** @var \App\Models\User $user */ + $user = auth()->user(); + return [ 'date_range' => 'bail|required|string', 'end_date' => 'bail|required_if:date_range,custom|nullable|date', 'start_date' => 'bail|required_if:date_range,custom|nullable|date', 'report_keys' => 'bail|present|array', 'send_email' => 'bail|required|bool', - 'client_id' => 'bail|nullable|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id.',is_deleted,0', + 'client_id' => 'bail|nullable|sometimes|exists:clients,id,company_id,'.$user->company()->id.',is_deleted,0', ]; } diff --git a/app/Http/Requests/Report/ProfitLossRequest.php b/app/Http/Requests/Report/ProfitLossRequest.php index 48bc5956e3..4cd2155b1f 100644 --- a/app/Http/Requests/Report/ProfitLossRequest.php +++ b/app/Http/Requests/Report/ProfitLossRequest.php @@ -11,6 +11,7 @@ namespace App\Http\Requests\Report; +use App\Utils\Ninja; use App\Http\Requests\Request; use Illuminate\Auth\Access\AuthorizationException; diff --git a/config/ninja.php b/config/ninja.php index 35b1eb1e05..80ddd773f2 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.37'), - 'app_tag' => env('APP_TAG', '5.8.37'), + 'app_version' => env('APP_VERSION', '5.8.38'), + 'app_tag' => env('APP_TAG', '5.8.38'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false),