From 2377f4be2bdd94f07e5388dfd18323c18ea06df4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 14:41:15 +1000 Subject: [PATCH 1/3] Static Analysis Cleanup --- app/Http/Controllers/ImportController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index e8d9a49cf5..f46e35133b 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -172,6 +172,9 @@ class ImportController extends Controller public function import(ImportRequest $request) { + /** @var \App\Models\User $user */ + $user = auth()->user(); + $data = $request->all(); if (empty($data['hash'])) { @@ -187,7 +190,7 @@ class ImportController extends Controller } unset($data['files']); - CSVIngest::dispatch($data, auth()->user()->company()); + CSVIngest::dispatch($data, $user->company()); return response()->json(['message' => ctrans('texts.import_started')], 200); } From a946cf346d9f3c74fd74a1e866fcbb2845e2cb06 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 23:49:19 +1000 Subject: [PATCH 2/3] Fixes for e-invoices --- app/Jobs/Entity/CreateRawPdf.php | 2 +- app/Models/BaseModel.php | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/Jobs/Entity/CreateRawPdf.php b/app/Jobs/Entity/CreateRawPdf.php index 921879021c..593566577b 100644 --- a/app/Jobs/Entity/CreateRawPdf.php +++ b/app/Jobs/Entity/CreateRawPdf.php @@ -220,7 +220,7 @@ class CreateRawPdf implements ShouldQueue */ private function checkEInvoice(string $pdf): string { - if(!$this->entity instanceof Invoice) + if(!$this->entity instanceof Invoice || !$this->company->getSetting('enable_e_invoice')) return $pdf; $e_invoice_type = $this->entity->client->getSetting('e_invoice_type'); diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php index eb4c177223..20f119b0c9 100644 --- a/app/Models/BaseModel.php +++ b/app/Models/BaseModel.php @@ -105,22 +105,22 @@ class BaseModel extends Model return $value; } - public function __call($method, $params) - { - $entity = strtolower(class_basename($this)); + // public function __call($method, $params) + // { + // $entity = strtolower(class_basename($this)); - if ($entity) { - $configPath = "modules.relations.$entity.$method"; + // if ($entity) { + // $configPath = "modules.relations.$entity.$method"; - if (config()->has($configPath)) { - $function = config()->get($configPath); + // if (config()->has($configPath)) { + // $function = config()->get($configPath); - return call_user_func_array([$this, $function[0]], $function[1]); - } - } + // return call_user_func_array([$this, $function[0]], $function[1]); + // } + // } - return parent::__call($method, $params); - } + // return parent::__call($method, $params); + // } /** * @param \Illuminate\Database\Eloquent\Builder $query From 059424f994ca9d72dbd3e4ada01063a2b15ccd56 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 23:49:38 +1000 Subject: [PATCH 3/3] v5.7.10 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index ef0ff16408..ca69410c4a 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.7.9 \ No newline at end of file +5.7.10 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index cac415703b..bf67009c94 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -15,8 +15,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.7.9'), - 'app_tag' => env('APP_TAG','5.7.9'), + 'app_version' => env('APP_VERSION','5.7.10'), + 'app_tag' => env('APP_TAG','5.7.10'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),