diff --git a/VERSION.txt b/VERSION.txt index 5c637b26e9b1..b7e4264e5292 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 4ecf3ed98c6b..28e2c5b2fdca 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 48bc5956e3c8..4cd2155b1f28 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 35b1eb1e05e3..80ddd773f262 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),