From 367aa3b70d40ca25949393aa427cde5c22092b2d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Sep 2023 13:08:31 +1000 Subject: [PATCH 01/11] Static Analysis --- app/Models/CreditInvitation.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Models/CreditInvitation.php b/app/Models/CreditInvitation.php index ca5d8a2fb27b..2f8926700e40 100644 --- a/app/Models/CreditInvitation.php +++ b/app/Models/CreditInvitation.php @@ -106,40 +106,40 @@ class CreditInvitation extends BaseModel } /** - * @return mixed + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function credit() + public function credit(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Credit::class)->withTrashed(); } /** - * @return mixed + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function entity() + public function entity(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Credit::class)->withTrashed(); } /** - * @return mixed + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function contact() + public function contact(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(ClientContact::class, 'client_contact_id', 'id')->withTrashed(); } /** - * @return mixed + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function user() + public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(User::class)->withTrashed(); } /** - * @return BelongsTo + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ - public function company() + public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Company::class); } From 74300d0b881062979c767898f587282c81bdf90e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Sep 2023 13:34:49 +1000 Subject: [PATCH 02/11] Add filters for expense categories --- app/Filters/ExpenseFilters.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Filters/ExpenseFilters.php b/app/Filters/ExpenseFilters.php index 22298105da27..0ea17a80e895 100644 --- a/app/Filters/ExpenseFilters.php +++ b/app/Filters/ExpenseFilters.php @@ -38,7 +38,10 @@ class ExpenseFilters extends QueryFilters ->orWhere('custom_value1', 'like', '%'.$filter.'%') ->orWhere('custom_value2', 'like', '%'.$filter.'%') ->orWhere('custom_value3', 'like', '%'.$filter.'%') - ->orWhere('custom_value4', 'like', '%'.$filter.'%'); + ->orWhere('custom_value4', 'like', '%'.$filter.'%') + ->orWhereHas('category', function ($q) use ($filter) { + $q->where('name', 'like', '%'.$filter.'%'); + }); }); } From 3fcce909f5d32938d91dd6243c1fb627c643b5fb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Sep 2023 14:02:39 +1000 Subject: [PATCH 03/11] Improve sorting of expense listrs --- app/Filters/ExpenseFilters.php | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Filters/ExpenseFilters.php b/app/Filters/ExpenseFilters.php index 0ea17a80e895..a2ddc98e3cd0 100644 --- a/app/Filters/ExpenseFilters.php +++ b/app/Filters/ExpenseFilters.php @@ -169,16 +169,27 @@ class ExpenseFilters extends QueryFilters return $this->builder; } - if ($sort_col[0] == 'client_id') { - return $this->builder->orderBy(\App\Models\Client::select('name') + if ($sort_col[0] == 'client_id' && in_array($sort_col[1], ['asc', 'desc'])) { + return $this->builder + ->orderByRaw('ISNULL(client_id), client_id '. $sort_col[1]) + ->orderBy(\App\Models\Client::select('name') ->whereColumn('clients.id', 'expenses.client_id'), $sort_col[1]); } - if ($sort_col[0] == 'vendor_id') { - return $this->builder->orderBy(\App\Models\Vendor::select('name') + if ($sort_col[0] == 'vendor_id' && in_array($sort_col[1], ['asc', 'desc'])) { + return $this->builder + ->orderByRaw('ISNULL(vendor_id), vendor_id '. $sort_col[1]) + ->orderBy(\App\Models\Vendor::select('name') ->whereColumn('vendors.id', 'expenses.vendor_id'), $sort_col[1]); + } + if ($sort_col[0] == 'category_id' && in_array($sort_col[1], ['asc', 'desc'])) { + return $this->builder + ->orderByRaw('ISNULL(category_id), category_id '. $sort_col[1]) + ->orderBy(\App\Models\ExpenseCategory::select('name') + ->whereColumn('expense_categories.id', 'expenses.category_id'), $sort_col[1]); + } if (is_array($sort_col) && in_array($sort_col[1], ['asc', 'desc']) && in_array($sort_col[0], ['public_notes', 'date', 'id_number', 'custom_value1', 'custom_value2', 'custom_value3', 'custom_value4'])) { return $this->builder->orderBy($sort_col[0], $sort_col[1]); From ddc949c260de332c00b1e5bd3ef277648fe6c1a5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Sep 2023 15:12:49 +1000 Subject: [PATCH 04/11] Fixes for group settings parser --- .../GroupSetting/UpdateGroupSettingRequest.php | 13 ++++++++----- app/Repositories/GroupSettingRepository.php | 13 +++++++++++-- app/Utils/Traits/ClientGroupSettingsSaver.php | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php b/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php index 09540e878026..84120cc3475a 100644 --- a/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php +++ b/app/Http/Requests/GroupSetting/UpdateGroupSettingRequest.php @@ -24,16 +24,19 @@ class UpdateGroupSettingRequest extends Request */ public function authorize() : bool { - return auth()->user()->can('edit', $this->group_setting); + /** @var \App\Models\User $user */ + $user = auth()->user(); + + return $user->can('edit', $this->group_setting); } public function rules() { - $rules['settings'] = new ValidClientGroupSettingsRule(); + + return [ + 'settings' => [new ValidClientGroupSettingsRule()], + ]; -// $rules['name'] = 'unique:group_settings,name,'.$this->id.',id,company_id,'.$this->group_setting->company_id; - - return $rules; } public function prepareForValidation() diff --git a/app/Repositories/GroupSettingRepository.php b/app/Repositories/GroupSettingRepository.php index f89356ef3ca4..aee61e2a1573 100644 --- a/app/Repositories/GroupSettingRepository.php +++ b/app/Repositories/GroupSettingRepository.php @@ -18,6 +18,15 @@ class GroupSettingRepository extends BaseRepository { public function save($data, GroupSetting $group_setting) :?GroupSetting { + + if(isset($data['settings']['translations'])) { + unset($data['settings']['translations']); + } + + if(isset($data['settings']['pdf_variables'])) { + unset($data['settings']['pdf_variables']); + } + $group_setting->fill($data); $group_setting->save(); @@ -25,16 +34,16 @@ class GroupSettingRepository extends BaseRepository $settings = $group_setting->settings; unset($settings->company_logo); $group_setting->settings = $settings; - $group_setting->save(); } if (! array_key_exists('settings', $data) || count((array) $data['settings']) == 0) { $settings = new \stdClass; $settings->entity = Client::class; $group_setting->settings = $settings; - $group_setting->save(); } + $group_setting->save(); + return $group_setting; } } diff --git a/app/Utils/Traits/ClientGroupSettingsSaver.php b/app/Utils/Traits/ClientGroupSettingsSaver.php index 50afb4e09131..b778bb6f6891 100644 --- a/app/Utils/Traits/ClientGroupSettingsSaver.php +++ b/app/Utils/Traits/ClientGroupSettingsSaver.php @@ -46,6 +46,14 @@ trait ClientGroupSettingsSaver unset($settings[$field]); } + + foreach(['translations','pdf_variables'] as $field) { + if (isset($settings[$field])) { + unset($settings[$field]); + } + } + + /* * for clients and group settings, if a field is not set or is set to a blank value, * we unset it from the settings object @@ -86,6 +94,12 @@ trait ClientGroupSettingsSaver unset($settings->translations); } + foreach(['translations','pdf_variables'] as $key){ + if (property_exists($settings, $key)) { + unset($settings->{$key}); + } + } + //18-07-2022 removed || empty($settings->{$key}) from this check to allow "0" values to persist foreach ($settings as $key => $value) { if (! isset($settings->{$key}) || (! is_object($settings->{$key}) && strlen($settings->{$key}) == 0)) { From 0ac294eaf05cbbda71b7bab33ec5c36f088dff02 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Sep 2023 16:13:37 +1000 Subject: [PATCH 05/11] Minor Fixes --- app/Http/Controllers/ClientPortal/InvoiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 265cc5f8961e..80a51e0a6658 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -89,7 +89,7 @@ class InvoiceController extends Controller $data = Cache::get($hash); $invitation = false; - match($data['entity_type']){ + match($data['entity_type'] ?? false){ 'invoice' => $invitation = InvoiceInvitation::withTrashed()->find($data['invitation_id']), 'quote' => $invitation = QuoteInvitation::withTrashed()->find($data['invitation_id']), 'credit' => $invitation = CreditInvitation::withTrashed()->find($data['invitation_id']), From ed63d56a3166f1d30d4ef693dac0d549719c0611 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Sep 2023 16:22:24 +1000 Subject: [PATCH 06/11] Fixes for settings savers --- app/Utils/Traits/ClientGroupSettingsSaver.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/Utils/Traits/ClientGroupSettingsSaver.php b/app/Utils/Traits/ClientGroupSettingsSaver.php index b778bb6f6891..abfb40989107 100644 --- a/app/Utils/Traits/ClientGroupSettingsSaver.php +++ b/app/Utils/Traits/ClientGroupSettingsSaver.php @@ -46,14 +46,6 @@ trait ClientGroupSettingsSaver unset($settings[$field]); } - - foreach(['translations','pdf_variables'] as $field) { - if (isset($settings[$field])) { - unset($settings[$field]); - } - } - - /* * for clients and group settings, if a field is not set or is set to a blank value, * we unset it from the settings object From 3fd78e1074e114c3851d3cfa1bec4421aaf7eb9b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Sep 2023 17:29:36 +1000 Subject: [PATCH 07/11] Hints for imports --- app/Http/Controllers/ImportController.php | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index ee953dcf35eb..e8d9a49cf530 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -91,16 +91,73 @@ class ImportController extends Controller $csv_array = $this->getCsvData($contents); $class_map = $this->getEntityMap($entityType); + + $hints = $this->setImportHints($entityType, $class_map::importable(), $csv_array[0]); $data['mappings'][$entityType] = [ 'available' => $class_map::importable(), 'headers' => array_slice($csv_array, 0, 2), + 'hints' => $hints, ]; } return response()->json($data); } + private function setImportHints($entity_type, $available_keys, $headers): array + { + $hints = []; + + $translated_keys = collect($available_keys)->map(function ($value,$key){ + + $parts = explode(".", $value); + $index = $parts[0]; + $label = $parts[1] ?? $parts[0]; + + return ['key' => $key, 'index' => ctrans("texts.{$index}"), 'label' => ctrans("texts.{$label}")]; + + })->toArray(); + + + foreach($headers as $key => $value) { + + $hit = false; + $unsetKey = false; + + foreach($translated_keys as $tkey => $tvalue) + { + + if($this->testMatch($value, $tvalue['label'])) { + $hit = $available_keys[$tvalue['key']]; + $unsetKey = $tkey; + } + elseif($this->testMatch($value, $tvalue['index'])) { + $hit = $available_keys[$tvalue['key']]; + $unsetKey = $tkey; + } + + } + + if($hit) { + $hints[$key] = $hit; + unset($translated_keys[$unsetKey]); + } else { + $hints[$key] = null; + } + + + } + + return $hints; + } + + private function testMatch($haystack, $needle): bool + { nlog("needle = {$needle}"); + nlog("haystack = {$haystack}"); + + return stripos($haystack, $needle) !== false; + } + private function convertEncoding($data) { From 7e8b09b14622e5409f923f7f16238847e4492566 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 00:03:45 +1000 Subject: [PATCH 08/11] Minor fixes for imports --- app/Http/Controllers/ImportController.php | 15 ++++++++------- public/storage/.htaccess | 4 ++++ storage/app/public/.gitignore | 0 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 public/storage/.htaccess mode change 100755 => 100644 storage/app/public/.gitignore diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php index e8d9a49cf530..6677d9839afa 100644 --- a/app/Http/Controllers/ImportController.php +++ b/app/Http/Controllers/ImportController.php @@ -123,6 +123,7 @@ class ImportController extends Controller $hit = false; $unsetKey = false; + // array_multisort(array_column($translated_keys, 'label'), SORT_ASC, $translated_keys); foreach($translated_keys as $tkey => $tvalue) { @@ -131,10 +132,10 @@ class ImportController extends Controller $hit = $available_keys[$tvalue['key']]; $unsetKey = $tkey; } - elseif($this->testMatch($value, $tvalue['index'])) { - $hit = $available_keys[$tvalue['key']]; - $unsetKey = $tkey; - } + // elseif($this->testMatch($value, $tvalue['index'])) { + // $hit = $available_keys[$tvalue['key']]; + // $unsetKey = $tkey; + // } } @@ -148,13 +149,13 @@ class ImportController extends Controller } + nlog($translated_keys); + return $hints; } private function testMatch($haystack, $needle): bool - { nlog("needle = {$needle}"); - nlog("haystack = {$haystack}"); - + { return stripos($haystack, $needle) !== false; } diff --git a/public/storage/.htaccess b/public/storage/.htaccess new file mode 100644 index 000000000000..377516b7230a --- /dev/null +++ b/public/storage/.htaccess @@ -0,0 +1,4 @@ + +Order deny,Allow +Deny from all + diff --git a/storage/app/public/.gitignore b/storage/app/public/.gitignore old mode 100755 new mode 100644 From 25739a912e1cf49de008fa7f774a205175760423 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 08:47:48 +1000 Subject: [PATCH 09/11] Updated filters --- app/Filters/InvoiceFilters.php | 26 ++++++++++++ app/Filters/PaymentFilters.php | 30 +++++++++++++- tests/Feature/InvoiceTest.php | 65 ++++++++++++++++++++++++++++- tests/Feature/PaymentTest.php | 75 +++++++++++++++++++++++++++++++++- 4 files changed, 193 insertions(+), 3 deletions(-) diff --git a/app/Filters/InvoiceFilters.php b/app/Filters/InvoiceFilters.php index 8ade4be3a6a1..91e426192fde 100644 --- a/app/Filters/InvoiceFilters.php +++ b/app/Filters/InvoiceFilters.php @@ -229,6 +229,32 @@ class InvoiceFilters extends QueryFilters return $this->builder->where('due_date', '>=', $date); } + public function date_range(string $date_range = ''): Builder + { + $parts = explode(",", $date_range); + + if (count($parts) != 3) { + return $this->builder; + } + + if(!in_array($parts[0], ['date','due_date'])) { + return $this->builder; + } + + try{ + + $start_date = Carbon::parse($parts[1]); + $end_date = Carbon::parse($parts[2]); + + return $this->builder->whereBetween($parts[0], [$start_date, $end_date]); + } + + catch(\Exception $e){ + return $this->builder; + } + + return $this->builder; + } /** * Sorts the list based on $sort. diff --git a/app/Filters/PaymentFilters.php b/app/Filters/PaymentFilters.php index b6c82430baad..af094202aaed 100644 --- a/app/Filters/PaymentFilters.php +++ b/app/Filters/PaymentFilters.php @@ -12,8 +12,9 @@ namespace App\Filters; use App\Models\Payment; -use Illuminate\Contracts\Database\Eloquent\Builder as EloquentBuilder; +use Illuminate\Support\Carbon; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Contracts\Database\Eloquent\Builder as EloquentBuilder; /** * PaymentFilters. @@ -177,6 +178,33 @@ class PaymentFilters extends QueryFilters return $this->builder->orderBy($sort_col[0], $sort_col[1]); } + public function date_range(string $date_range = ''): Builder + { + $parts = explode(",", $date_range); + + if (count($parts) != 3) { + return $this->builder; + } + + if(!in_array($parts[0], ['date'])) { + return $this->builder; + } + + try{ + + $start_date = Carbon::parse($parts[1]); + $end_date = Carbon::parse($parts[2]); + + return $this->builder->whereBetween($parts[0], [$start_date, $end_date]); + } + + catch(\Exception $e){ + return $this->builder; + } + + return $this->builder; + } + /** * Filters the query by the users company ID. * diff --git a/tests/Feature/InvoiceTest.php b/tests/Feature/InvoiceTest.php index 8730566b12b0..e0530f5b2056 100644 --- a/tests/Feature/InvoiceTest.php +++ b/tests/Feature/InvoiceTest.php @@ -48,6 +48,70 @@ class InvoiceTest extends TestCase $this->makeTestData(); } + public function testInvoiceGetDatesBetween() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/invoices?date_range=date,2023-01-01,2023-01-01', ) + ->assertStatus(200); + } + + public function testInvoiceGetDatesBetween2() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/invoices?date_range=date', ) + ->assertStatus(200); + } + + public function testInvoiceGetDatesBetween3() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/invoices?date_range=x', ) + ->assertStatus(200); + } + + public function testInvoiceGetDatesBetween4() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/invoices?date_range=date,2023223123,312312321', ) + ->assertStatus(200); + } + + public function testInvoiceGetDatesBetween5() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/invoices?date_range=date,x,23423', ) + ->assertStatus(200); + } + + public function testInvoiceGetDatesBetween6() + { + Invoice::factory()->count(10)->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'client_id' => $this->client->id, + 'date' => '1971-01-02', + ]); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/invoices?date_range=date,1971-01-01,1971-01-03', ) + ->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(10, $arr['data']); + } public function testInvoiceGetPaidReversedInvoice() { @@ -66,7 +130,6 @@ class InvoiceTest extends TestCase $this->assertCount(1, $arr['data']); } - public function testInvoiceGetPaidInvoices() { $response = $this->withHeaders([ diff --git a/tests/Feature/PaymentTest.php b/tests/Feature/PaymentTest.php index 7a69e0b0a3ab..25cd22f894b2 100644 --- a/tests/Feature/PaymentTest.php +++ b/tests/Feature/PaymentTest.php @@ -60,7 +60,80 @@ class PaymentTest extends TestCase ); } - public function testPatymentGetClientStatus() + public function testPaymentGetBetweenQuery1() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/payments?date_range=date,2023-01-01,2023-02-01'); + + $response->assertStatus(200); + } + + public function testPaymentGetBetweenQuery2() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/payments?date_range='); + + $response->assertStatus(200); + } + + public function testPaymentGetBetweenQuery3() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/payments?date_range=1,1,1,1,1'); + + $response->assertStatus(200); + } + + public function testPaymentGetBetweenQuery4() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/payments?date_range=date,34343,34343434343'); + + $response->assertStatus(200); + } + + public function testPaymentGetBetweenQuery5() + { + Payment::factory()->count(10)->create([ + 'user_id' => $this->user->id, + 'company_id' => $this->company->id, + 'client_id' => $this->client->id, + 'date' => '2023-01-02', + ]); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/payments?date_range=date,2023-01-01,2023-01-03'); + + $response->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(10, $arr['data']); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/payments?date_range=date,2053-10-01,2053-10-03'); + + $response->assertStatus(200); + + $arr = $response->json(); + + $this->assertCount(0, $arr['data']); + + } + + public function testPaymentGetClientStatus() { $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), From 50b6e1478270a616950df2b13ce5a5aca387f4d2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 09:10:59 +1000 Subject: [PATCH 10/11] Fixes for check data --- app/Console/Commands/CheckData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 3dac3bb6163f..7c5a3f21bb42 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -862,7 +862,7 @@ class CheckData extends Command } $records = DB::table($table) ->join($tableName, "{$tableName}.id", '=', "{$table}.{$field}_id") - ->where("{$table}.{$company_id}", '!=', "{$tableName}.company_id") + ->whereRaw("{$table}.{$company_id} != {$tableName}.company_id") ->get(["{$table}.id"]); if ($records->count()) { From 2aca2251e4daa1325d5877f9133e50e70e373eeb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 6 Sep 2023 09:11:21 +1000 Subject: [PATCH 11/11] v5.7.9 --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 3113d499b22c..ef0ff164084a 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.7.8 \ No newline at end of file +5.7.9 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index a530a2dd26d4..cac415703b6c 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.8'), - 'app_tag' => env('APP_TAG','5.7.8'), + 'app_version' => env('APP_VERSION','5.7.9'), + 'app_tag' => env('APP_TAG','5.7.9'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),