From a4ddcc90fa40d778c0813f41e99a1457fcc6e027 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 2 Oct 2020 07:29:11 +1000 Subject: [PATCH 01/19] Fixes for Email preview with blank entity --- app/Utils/TemplateEngine.php | 56 ++++++++++++++++++++++++++++++++++++ composer.lock | 43 +++++++++++++-------------- 2 files changed, 78 insertions(+), 21 deletions(-) diff --git a/app/Utils/TemplateEngine.php b/app/Utils/TemplateEngine.php index 4563d472d9..1bf85b519c 100644 --- a/app/Utils/TemplateEngine.php +++ b/app/Utils/TemplateEngine.php @@ -12,6 +12,10 @@ namespace App\Utils; use App\DataMapper\EmailTemplateDefaults; +use App\Models\Client; +use App\Models\ClientContact; +use App\Models\Invoice; +use App\Models\InvoiceInvitation; use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesInvoiceHtml; use App\Utils\Traits\MakesTemplateData; @@ -71,6 +75,8 @@ class TemplateEngine $class = 'App\Models\\'.ucfirst($this->entity); $this->entity_obj = $class::whereId($this->decodePrimaryKey($this->entity_id))->company()->first(); } + else + $this->mockEntity(); return $this; } @@ -195,6 +201,56 @@ class TemplateEngine 'wrapper' => $wrapper, ]; + + $this->tearDown(); + return $data; } + + private function mockEntity() + { + \DB::beginTransaction(); + + $client = Client::factory()->create([ + 'user_id' => auth()->user()->id, + 'company_id' => auth()->user()->company()->id, + ]); + + $contact = ClientContact::factory()->create([ + 'user_id' => auth()->user()->id, + 'company_id' => auth()->user()->company()->id, + 'client_id' => $client->id, + 'is_primary' => 1, + 'send_email' => true, + ]); + + $this->entity_obj = Invoice::factory()->create([ + 'user_id' => auth()->user()->id, + 'company_id' => auth()->user()->company()->id, + 'client_id' => $client->id, + ]); + + $invitation = InvoiceInvitation::factory()->create([ + 'user_id' => auth()->user()->id, + 'company_id' => auth()->user()->company()->id, + 'invoice_id' => $this->entity_obj->id, + 'client_contact_id' => $contact->id, + ]); + + $this->entity_obj->setRelation('invitations', $invitation); + $this->entity_obj->setRelation('client', $client); + $this->entity_obj->setRelation('company', auth()->user()->company()); + $this->entity_obj->load('client'); + $client->setRelation('company', auth()->user()->company()); + $client->load('company'); + + } + + private function tearDown() + { + + \DB::rollBack(); + + } + } diff --git a/composer.lock b/composer.lock index c344f50e9f..72cd6ffd35 100644 --- a/composer.lock +++ b/composer.lock @@ -108,16 +108,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.157.0", + "version": "3.158.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "ad2c0183d7ebc695acb1ba39d528f2328f2c0de3" + "reference": "59345aa45161a8f83c3a0027a7df9567ae72cc85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/ad2c0183d7ebc695acb1ba39d528f2328f2c0de3", - "reference": "ad2c0183d7ebc695acb1ba39d528f2328f2c0de3", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/59345aa45161a8f83c3a0027a7df9567ae72cc85", + "reference": "59345aa45161a8f83c3a0027a7df9567ae72cc85", "shasum": "" }, "require": { @@ -189,7 +189,7 @@ "s3", "sdk" ], - "time": "2020-09-30T18:58:20+00:00" + "time": "2020-10-01T18:41:53+00:00" }, { "name": "brick/math", @@ -5928,16 +5928,16 @@ }, { "name": "sentry/sentry", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "b77ff3783060ce3213011ddae369e550ec985dc8" + "reference": "b39248013660036d222681a359990284904a5db3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/b77ff3783060ce3213011ddae369e550ec985dc8", - "reference": "b77ff3783060ce3213011ddae369e550ec985dc8", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/b39248013660036d222681a359990284904a5db3", + "reference": "b39248013660036d222681a359990284904a5db3", "shasum": "" }, "require": { @@ -6024,20 +6024,20 @@ "type": "custom" } ], - "time": "2020-09-28T07:11:32+00:00" + "time": "2020-10-01T12:10:56+00:00" }, { "name": "sentry/sentry-laravel", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "ed8f28507f18474223df7de4c86e210c09dda630" + "reference": "3c6b1da08087f428ab1a188af35483eb76ef6b1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/ed8f28507f18474223df7de4c86e210c09dda630", - "reference": "ed8f28507f18474223df7de4c86e210c09dda630", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/3c6b1da08087f428ab1a188af35483eb76ef6b1e", + "reference": "3c6b1da08087f428ab1a188af35483eb76ef6b1e", "shasum": "" }, "require": { @@ -6048,6 +6048,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "2.16.*", "laravel/framework": "^7.0", + "mockery/mockery": "1.3.*", "orchestra/testbench": "^5.0", "phpunit/phpunit": "^8.0" }, @@ -6104,7 +6105,7 @@ "type": "custom" } ], - "time": "2020-09-28T08:31:49+00:00" + "time": "2020-10-01T12:14:37+00:00" }, { "name": "spatie/browsershot", @@ -12029,16 +12030,16 @@ }, { "name": "swagger-api/swagger-ui", - "version": "v3.34.0", + "version": "v3.35.0", "source": { "type": "git", - "url": "git@github.com:swagger-api/swagger-ui.git", - "reference": "c20a8c479eaa7897a2ddabcaf5f75e6d41f4525c" + "url": "https://github.com/swagger-api/swagger-ui.git", + "reference": "db2cca8e8691f48c1e27a543e1cee97e760c0742" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/c20a8c479eaa7897a2ddabcaf5f75e6d41f4525c", - "reference": "c20a8c479eaa7897a2ddabcaf5f75e6d41f4525c", + "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/db2cca8e8691f48c1e27a543e1cee97e760c0742", + "reference": "db2cca8e8691f48c1e27a543e1cee97e760c0742", "shasum": "" }, "type": "library", @@ -12082,7 +12083,7 @@ "swagger", "ui" ], - "time": "2020-09-18T18:46:18+00:00" + "time": "2020-10-01T18:14:37+00:00" }, { "name": "symfony/debug", From 2c4cfa409a75015260edbb2582a6d1793473ce0b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 2 Oct 2020 08:19:42 +1000 Subject: [PATCH 02/19] Recurring invoice migrations --- app/Console/Commands/ImportMigrations.php | 2 +- app/Jobs/Util/Import.php | 53 +++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/ImportMigrations.php b/app/Console/Commands/ImportMigrations.php index c9c891146c..54d1adfa9f 100644 --- a/app/Console/Commands/ImportMigrations.php +++ b/app/Console/Commands/ImportMigrations.php @@ -112,7 +112,7 @@ class ImportMigrations extends Command public function getCompany(Account $account): Company { - $company = factory(Company::class)->create([ + $company = Company::factory()->create([ 'account_id' => $account->id, ]); diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index f4b667d213..aa1b5ba99a 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -22,6 +22,7 @@ use App\Factory\InvoiceFactory; use App\Factory\PaymentFactory; use App\Factory\ProductFactory; use App\Factory\QuoteFactory; +use App\Factory\RecurringInvoiceFactory; use App\Factory\TaxRateFactory; use App\Factory\UserFactory; use App\Http\Requests\Company\UpdateCompanyRequest; @@ -99,6 +100,7 @@ class Import implements ShouldQueue 'clients', 'products', 'invoices', + 'recurring_invoices', 'quotes', 'payments', 'credits', @@ -478,6 +480,57 @@ class Import implements ShouldQueue $product_repository = null; } + private function processRecurringInvoices(array $data) :void + { + RecurringInvoice::unguard(); + + $rules = [ + '*.client_id' => ['required'], + ]; + + $validator = Validator::make($data, $rules); + + if ($validator->fails()) { + throw new MigrationValidatorFailed(json_encode($validator->errors())); + } + + $invoice_repository = new InvoiceMigrationRepository(); + + foreach ($data as $key => $resource) { + $modified = $resource; + + if (array_key_exists('client_id', $resource) && ! array_key_exists('clients', $this->ids)) { + throw new ResourceDependencyMissing('Processing invoices failed, because of missing dependency - clients.'); + } + + $modified['client_id'] = $this->transformId('clients', $resource['client_id']); + $modified['user_id'] = $this->processUserId($resource); + $modified['company_id'] = $this->company->id; + $modified['line_items'] = $this->cleanItems($modified['line_items']); + + unset($modified['id']); + + $invoice = $invoice_repository->save( + $modified, + RecurringInvoiceFactory::create($this->company->id, $modified['user_id']) + ); + + $key = "recurring_invoices_{$resource['id']}"; + + $this->ids['recurring_invoices'][$key] = [ + 'old' => $resource['id'], + 'new' => $invoice->id, + ]; + } + + RecurringInvoice::reguard(); + + /*Improve memory handling by setting everything to null when we have finished*/ + $data = null; + $invoice_repository = null; + + } + private function processInvoices(array $data): void { Invoice::unguard(); From 62ec47b5ccc9c484aed4a8d057f89651db263f8c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 2 Oct 2020 08:28:29 +1000 Subject: [PATCH 03/19] Fixes for migration email --- app/Mail/MigrationCompleted.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Mail/MigrationCompleted.php b/app/Mail/MigrationCompleted.php index ca230f4b28..861e2bfda2 100644 --- a/app/Mail/MigrationCompleted.php +++ b/app/Mail/MigrationCompleted.php @@ -28,6 +28,8 @@ class MigrationCompleted extends Mailable */ public function build() { - return $this->view('email.migration.completed'); + $data['settings'] = auth()->user()->company()->settings; + + return $this->view('email.migration.completed', $data); } } From 1390e739e3737364cf0b37a22998db4bd3af2392 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 2 Oct 2020 16:33:55 +1000 Subject: [PATCH 04/19] recurring --- app/Jobs/Util/Import.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index aa1b5ba99a..5c7ca4f4ff 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -47,6 +47,7 @@ use App\Models\Payment; use App\Models\PaymentTerm; use App\Models\Product; use App\Models\Quote; +use App\Models\RecurringInvoice; use App\Models\TaxRate; use App\Models\User; use App\Repositories\ClientContactRepository; @@ -98,15 +99,16 @@ class Import implements ShouldQueue 'payment_terms', 'tax_rates', 'clients', - 'products', - 'invoices', + // 'products', + // 'invoices', 'recurring_invoices', - 'quotes', - 'payments', - 'credits', - 'company_gateways', - //'documents', - 'client_gateway_tokens', + // 'quotes', + // 'payments', + // 'credits', + // 'company_gateways', + // 'client_gateway_tokens', + + // //'documents', ]; /** From ee8ae093142fb4df4c37e8aa4b028d17afe28c4e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 3 Oct 2020 18:09:48 +1000 Subject: [PATCH 05/19] Fixes for no invitation --- app/Utils/Traits/MakesInvoiceValues.php | 12 ++- composer.lock | 110 +++++++++++++----------- 2 files changed, 69 insertions(+), 53 deletions(-) diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index bc1f50d469..6c518a9817 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -213,7 +213,9 @@ trait MakesInvoiceValues $data['$number'] = ['value' => $this->number ?: ' ', 'label' => ctrans('texts.invoice_number')]; $data['$entity.terms'] = ['value' => $this->terms ?: ' ', 'label' => ctrans('texts.invoice_terms')]; $data['$terms'] = &$data['$entity.terms']; - $data['$view_link'] = ['value' => ''.ctrans('texts.view_invoice').'', 'label' => ctrans('texts.view_invoice')]; + + if($invitation) + $data['$view_link'] = ['value' => ''.ctrans('texts.view_invoice').'', 'label' => ctrans('texts.view_invoice')]; // $data['$view_link'] = ['value' => $invitation->getLink(), 'label' => ctrans('texts.view_invoice')]; } @@ -222,7 +224,9 @@ trait MakesInvoiceValues $data['$number'] = ['value' => $this->number ?: ' ', 'label' => ctrans('texts.quote_number')]; $data['$entity.terms'] = ['value' => $this->terms ?: ' ', 'label' => ctrans('texts.quote_terms')]; $data['$terms'] = &$data['$entity.terms']; - $data['$view_link'] = ['value' => ''.ctrans('texts.view_quote').'', 'label' => ctrans('texts.view_quote')]; + + if($invitation) + $data['$view_link'] = ['value' => ''.ctrans('texts.view_quote').'', 'label' => ctrans('texts.view_quote')]; // $data['$view_link'] = ['value' => $invitation->getLink(), 'label' => ctrans('texts.view_quote')]; } @@ -231,7 +235,9 @@ trait MakesInvoiceValues $data['$number'] = ['value' => $this->number ?: ' ', 'label' => ctrans('texts.credit_number')]; $data['$entity.terms'] = ['value' => $this->terms ?: ' ', 'label' => ctrans('texts.credit_terms')]; $data['$terms'] = &$data['$entity.terms']; - $data['$view_link'] = ['value' => ''.ctrans('texts.view_credit').'', 'label' => ctrans('texts.view_credit')]; + + if($invitation) + $data['$view_link'] = ['value' => ''.ctrans('texts.view_credit').'', 'label' => ctrans('texts.view_credit')]; // $data['$view_link'] = ['value' => $invitation->getLink(), 'label' => ctrans('texts.view_credit')]; } diff --git a/composer.lock b/composer.lock index 72cd6ffd35..18b946ada0 100644 --- a/composer.lock +++ b/composer.lock @@ -108,16 +108,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.158.0", + "version": "3.158.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "59345aa45161a8f83c3a0027a7df9567ae72cc85" + "reference": "55ae8bdf2eb2f9774193fa79c6fc436835c42db4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/59345aa45161a8f83c3a0027a7df9567ae72cc85", - "reference": "59345aa45161a8f83c3a0027a7df9567ae72cc85", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/55ae8bdf2eb2f9774193fa79c6fc436835c42db4", + "reference": "55ae8bdf2eb2f9774193fa79c6fc436835c42db4", "shasum": "" }, "require": { @@ -189,7 +189,7 @@ "s3", "sdk" ], - "time": "2020-10-01T18:41:53+00:00" + "time": "2020-10-02T18:16:40+00:00" }, { "name": "brick/math", @@ -355,23 +355,23 @@ }, { "name": "clue/stream-filter", - "version": "v1.4.1", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/clue/php-stream-filter.git", - "reference": "5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71" + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71", - "reference": "5a58cc30a8bd6a4eb8f856adf61dd3e013f53f71", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/aeb7d8ea49c7963d3b581378955dbf5bc49aa320", + "reference": "aeb7d8ea49c7963d3b581378955dbf5bc49aa320", "shasum": "" }, "require": { "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8" + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -389,7 +389,7 @@ "authors": [ { "name": "Christian Lück", - "email": "christian@lueck.tv" + "email": "christian@clue.engineering" } ], "description": "A simple and modern approach to stream filtering in PHP", @@ -403,7 +403,17 @@ "stream_filter_append", "stream_filter_register" ], - "time": "2019-04-09T12:31:48+00:00" + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2020-10-02T12:38:20+00:00" }, { "name": "composer/ca-bundle", @@ -1804,16 +1814,16 @@ }, { "name": "google/auth", - "version": "v1.13.0", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "173191f5defd1d9ae8bdfc28da31b63eb73dd34e" + "reference": "95c23ebd89a0a4d1b511aed81426f57388ab7268" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/173191f5defd1d9ae8bdfc28da31b63eb73dd34e", - "reference": "173191f5defd1d9ae8bdfc28da31b63eb73dd34e", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/95c23ebd89a0a4d1b511aed81426f57388ab7268", + "reference": "95c23ebd89a0a4d1b511aed81426f57388ab7268", "shasum": "" }, "require": { @@ -1852,7 +1862,7 @@ "google", "oauth2" ], - "time": "2020-09-18T20:03:05+00:00" + "time": "2020-10-02T22:20:36+00:00" }, { "name": "graham-campbell/result-type", @@ -2487,16 +2497,16 @@ }, { "name": "laravel/framework", - "version": "v8.7.1", + "version": "v8.8.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "3fb29e904a152b3e1fe49581f66ba5e02fe991f2" + "reference": "0bdd5c6f12cb7cb6644e484169656245af417735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/3fb29e904a152b3e1fe49581f66ba5e02fe991f2", - "reference": "3fb29e904a152b3e1fe49581f66ba5e02fe991f2", + "url": "https://api.github.com/repos/laravel/framework/zipball/0bdd5c6f12cb7cb6644e484169656245af417735", + "reference": "0bdd5c6f12cb7cb6644e484169656245af417735", "shasum": "" }, "require": { @@ -2646,7 +2656,7 @@ "framework", "laravel" ], - "time": "2020-09-29T15:39:07+00:00" + "time": "2020-10-02T14:33:08+00:00" }, { "name": "laravel/slack-notification-channel", @@ -5928,16 +5938,16 @@ }, { "name": "sentry/sentry", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "b39248013660036d222681a359990284904a5db3" + "reference": "a35c6c71693a72f2fedb9b6f9644ced52268771d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/b39248013660036d222681a359990284904a5db3", - "reference": "b39248013660036d222681a359990284904a5db3", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/a35c6c71693a72f2fedb9b6f9644ced52268771d", + "reference": "a35c6c71693a72f2fedb9b6f9644ced52268771d", "shasum": "" }, "require": { @@ -6024,7 +6034,7 @@ "type": "custom" } ], - "time": "2020-10-01T12:10:56+00:00" + "time": "2020-10-02T14:16:36+00:00" }, { "name": "sentry/sentry-laravel", @@ -9850,16 +9860,16 @@ }, { "name": "facade/ignition", - "version": "2.3.7", + "version": "2.3.8", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "b364db8860a63c1fb58b72b9718863c21df08762" + "reference": "e8fed9c382cd1d02b5606688576a35619afdf82c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/b364db8860a63c1fb58b72b9718863c21df08762", - "reference": "b364db8860a63c1fb58b72b9718863c21df08762", + "url": "https://api.github.com/repos/facade/ignition/zipball/e8fed9c382cd1d02b5606688576a35619afdf82c", + "reference": "e8fed9c382cd1d02b5606688576a35619afdf82c", "shasum": "" }, "require": { @@ -9918,7 +9928,7 @@ "laravel", "page" ], - "time": "2020-09-06T19:26:27+00:00" + "time": "2020-10-01T23:01:14+00:00" }, { "name": "facade/ignition-contracts", @@ -10658,16 +10668,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.1.11", + "version": "9.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c9394cb9d07ecfa9351b96f2e296bad473195f4d" + "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c9394cb9d07ecfa9351b96f2e296bad473195f4d", - "reference": "c9394cb9d07ecfa9351b96f2e296bad473195f4d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/53a4b737e83be724efd2bc4e7b929b9a30c48972", + "reference": "53a4b737e83be724efd2bc4e7b929b9a30c48972", "shasum": "" }, "require": { @@ -10695,7 +10705,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.1-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -10727,7 +10737,7 @@ "type": "github" } ], - "time": "2020-09-19T05:29:17+00:00" + "time": "2020-10-02T03:37:32+00:00" }, { "name": "phpunit/php-file-iterator", @@ -10956,16 +10966,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.3.11", + "version": "9.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f7316ea106df7c9507f4fdaa88c47bc10a3b27a1" + "reference": "ef533467a7974c4b6c354f3eff42a115910bd4e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f7316ea106df7c9507f4fdaa88c47bc10a3b27a1", - "reference": "f7316ea106df7c9507f4fdaa88c47bc10a3b27a1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ef533467a7974c4b6c354f3eff42a115910bd4e5", + "reference": "ef533467a7974c4b6c354f3eff42a115910bd4e5", "shasum": "" }, "require": { @@ -10981,7 +10991,7 @@ "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.11.1", - "phpunit/php-code-coverage": "^9.1.11", + "phpunit/php-code-coverage": "^9.2", "phpunit/php-file-iterator": "^3.0.4", "phpunit/php-invoker": "^3.1", "phpunit/php-text-template": "^2.0.2", @@ -11012,7 +11022,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.3-dev" + "dev-master": "9.4-dev" } }, "autoload": { @@ -11051,7 +11061,7 @@ "type": "github" } ], - "time": "2020-09-24T08:08:49+00:00" + "time": "2020-10-02T03:54:37+00:00" }, { "name": "scrivo/highlight.php", @@ -11182,16 +11192,16 @@ }, { "name": "sebastian/code-unit", - "version": "1.0.6", + "version": "1.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "d3a241b6028ff9d8e97d2b6ebd4090d01f92fad8" + "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/d3a241b6028ff9d8e97d2b6ebd4090d01f92fad8", - "reference": "d3a241b6028ff9d8e97d2b6ebd4090d01f92fad8", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/59236be62b1bb9919e6d7f60b0b832dc05cef9ab", + "reference": "59236be62b1bb9919e6d7f60b0b832dc05cef9ab", "shasum": "" }, "require": { @@ -11230,7 +11240,7 @@ "type": "github" } ], - "time": "2020-09-28T05:28:46+00:00" + "time": "2020-10-02T14:47:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", From f6ac4a820169e9cbc0fa98bf54bc8f85037a7e60 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 4 Oct 2020 19:52:58 +1100 Subject: [PATCH 06/19] Add mysqlnd requirement to systemhealth check --- app/Console/Commands/DemoMode.php | 2 +- app/Models/Gateway.php | 2 +- app/Utils/SystemHealth.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index f58b9d5bfd..b26f72670d 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -198,7 +198,7 @@ class DemoMode extends Command if (! $u2) { $u2 = User::factory()->create([ 'email' => 'demo@invoiceninja.com', - 'password' => Hash::make('demo'), + 'password' => Hash::make('Password0'), 'account_id' => $account->id, 'confirmation_code' => $this->createDbHash(config('database.default')), ]); diff --git a/app/Models/Gateway.php b/app/Models/Gateway.php index f658e84fa1..5ab72a3b81 100644 --- a/app/Models/Gateway.php +++ b/app/Models/Gateway.php @@ -21,7 +21,7 @@ class Gateway extends StaticModel 'is_secure' => 'boolean', 'recommended' => 'boolean', //'visible' => 'boolean', - //'sort_order' => 'int', + 'sort_order' => 'int', 'updated_at' => 'timestamp', 'created_at' => 'timestamp', 'default_gateway_type_id' => 'string', diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index 4c7814bbaa..05a3395b59 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -26,6 +26,7 @@ class SystemHealth { private static $extensions = [ 'mysqli', + 'mysqlnd', 'gd', 'curl', 'zip', From fccc98caa785a39480fb65590e0431e996813be5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 4 Oct 2020 20:34:08 +1100 Subject: [PATCH 07/19] Fixes for model factories -> invoice designs --- .env.example | 2 +- app/Http/Controllers/PreviewController.php | 4 ++++ app/Http/Requests/Vendor/StoreVendorRequest.php | 8 -------- resources/views/index/index.blade.php | 8 ++++---- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.env.example b/.env.example index 2a6eb900de..b92cf8fae0 100644 --- a/.env.example +++ b/.env.example @@ -52,7 +52,7 @@ TRUSTED_PROXIES= NINJA_ENVIRONMENT=selfhost -PHANTOMJS_CLOUD_KEY='a-demo-key-with-low-quota-per-ip-address' +PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address' PHANTOMJS_SECRET= SELF_UPDATER_REPO_VENDOR = invoiceninja diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index c0a2d85a9b..3d5e4e87aa 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -16,6 +16,10 @@ use App\Designs\Designer; use App\Factory\InvoiceFactory; use App\Jobs\Invoice\CreateInvoicePdf; use App\Jobs\Util\PreviewPdf; +use App\Models\Client; +use App\Models\ClientContact; +use App\Models\Invoice; +use App\Models\InvoiceInvitation; use App\Services\PdfMaker\Design; use App\Services\PdfMaker\PdfMaker; use App\Utils\HtmlEngine; diff --git a/app/Http/Requests/Vendor/StoreVendorRequest.php b/app/Http/Requests/Vendor/StoreVendorRequest.php index 005fcea8a5..df27f39ea8 100644 --- a/app/Http/Requests/Vendor/StoreVendorRequest.php +++ b/app/Http/Requests/Vendor/StoreVendorRequest.php @@ -42,14 +42,6 @@ class StoreVendorRequest extends Request //$rules['settings'] = new ValidVendorGroupSettingsRule(); $rules['contacts.*.email'] = 'nullable|distinct'; - // $contacts = request('contacts'); - - // if (is_array($contacts)) { - // for ($i = 0; $i < count($contacts); $i++) { - - // //$rules['contacts.' . $i . '.email'] = 'nullable|email|distinct'; - // } - // } return $rules; } diff --git a/resources/views/index/index.blade.php b/resources/views/index/index.blade.php index ccfe1573d8..efdde9ef82 100644 --- a/resources/views/index/index.blade.php +++ b/resources/views/index/index.blade.php @@ -1,9 +1,8 @@ - + Invoice Ninja - @@ -11,11 +10,12 @@