From 3aa5e2e4ebb8be8b55d9fce6e323cca0bfc9e13f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 6 Oct 2020 21:06:14 +1100 Subject: [PATCH] Minor release --- app/Factory/InvoiceItemFactory.php | 6 +- .../StoreRecurringInvoiceRequest.php | 13 ++-- .../RecurringInvoiceRepository.php | 2 + app/Utils/Traits/GeneratesCounter.php | 10 +-- composer.lock | 64 +++++++++---------- database/factories/ProjectFactory.php | 2 +- ...00_update_gateway_table_visible_column.php | 11 ++++ 7 files changed, 61 insertions(+), 47 deletions(-) diff --git a/app/Factory/InvoiceItemFactory.php b/app/Factory/InvoiceItemFactory.php index 6c489c2106f6..d370495a9001 100644 --- a/app/Factory/InvoiceItemFactory.php +++ b/app/Factory/InvoiceItemFactory.php @@ -38,7 +38,7 @@ class InvoiceItemFactory $item->custom_value2 = ''; $item->custom_value3 = ''; $item->custom_value4 = ''; - $item->type_id = 1; + $item->type_id = "1"; return $item; } @@ -69,7 +69,7 @@ class InvoiceItemFactory $item->custom_value4 = $faker->realText(10); $item->tax_name1 = 'GST'; $item->tax_rate1 = 10.00; - $item->type_id = 1; + $item->type_id = "1"; $data[] = $item; } @@ -103,7 +103,7 @@ class InvoiceItemFactory $item->custom_value4 = $faker->realText(10); $item->tax_name1 = 'GST'; $item->tax_rate1 = 10.00; - $item->type_id = 1; + $item->type_id = "1"; $data[] = $item; } diff --git a/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php b/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php index f92ef7dd3dd8..67fb0ef95051 100644 --- a/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php +++ b/app/Http/Requests/RecurringInvoice/StoreRecurringInvoiceRequest.php @@ -97,12 +97,13 @@ class StoreRecurringInvoiceRequest extends Request $input['line_items'] = isset($input['line_items']) ? $this->cleanItems($input['line_items']) : []; - if(isset($input['auto_bill'])) - $input['auto_bill_enabled'] = $this->setAutoBillFlag($input['auto_bill']); - else{ - $client = Client::find($input['client_id']); - $input['auto_bill'] = $client->getSetting('auto_bill'); - } + if(isset($input['auto_bill'])) + $input['auto_bill_enabled'] = $this->setAutoBillFlag($input['auto_bill']); + else{ + + if($client = Client::find($input['client_id'])) + $input['auto_bill'] = $client->getSetting('auto_bill'); + } $this->replace($input); } diff --git a/app/Repositories/RecurringInvoiceRepository.php b/app/Repositories/RecurringInvoiceRepository.php index 736390139992..525bbc9fc6a2 100644 --- a/app/Repositories/RecurringInvoiceRepository.php +++ b/app/Repositories/RecurringInvoiceRepository.php @@ -33,6 +33,8 @@ class RecurringInvoiceRepository extends BaseRepository $invoice_calc = new InvoiceSum($invoice, $invoice->settings); + $invoice->service()->applyNumber()->save(); + $invoice = $invoice_calc->build()->getInvoice(); return $invoice; diff --git a/app/Utils/Traits/GeneratesCounter.php b/app/Utils/Traits/GeneratesCounter.php index ad0ee68a299d..a94a231cfcc4 100644 --- a/app/Utils/Traits/GeneratesCounter.php +++ b/app/Utils/Traits/GeneratesCounter.php @@ -154,13 +154,13 @@ trait GeneratesCounter $is_client_counter = false; //todo handle if we have specific client patterns in the future - $pattern = $client->company->settings->invoice_number_pattern; + $pattern = $client->company->settings->recurring_invoice_number_pattern; //Determine if we are using client_counters if (strpos($pattern, 'client_counter') === false) { - $counter = $client->company->settings->invoice_number_counter; + $counter = $client->company->settings->recurring_invoice_number_counter; } else { - $counter = $client->settings->invoice_number_counter; + $counter = $client->settings->recurring_invoice_number_counter; $is_client_counter = true; } @@ -172,9 +172,9 @@ trait GeneratesCounter //increment the correct invoice_number Counter (company vs client) if ($is_client_counter) { - $this->incrementCounter($client, 'invoice_number_counter'); + $this->incrementCounter($client, 'recurring_invoice_number_counter'); } else { - $this->incrementCounter($client->company, 'invoice_number_counter'); + $this->incrementCounter($client->company, 'recurring_invoice_number_counter'); } return $invoice_number; diff --git a/composer.lock b/composer.lock index f152fe110bef..83432f82fc5b 100644 --- a/composer.lock +++ b/composer.lock @@ -108,16 +108,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.158.1", + "version": "3.158.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "55ae8bdf2eb2f9774193fa79c6fc436835c42db4" + "reference": "b80957465d94c127254e36061dd3d0c3ccc94cc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/55ae8bdf2eb2f9774193fa79c6fc436835c42db4", - "reference": "55ae8bdf2eb2f9774193fa79c6fc436835c42db4", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/b80957465d94c127254e36061dd3d0c3ccc94cc1", + "reference": "b80957465d94c127254e36061dd3d0c3ccc94cc1", "shasum": "" }, "require": { @@ -189,7 +189,7 @@ "s3", "sdk" ], - "time": "2020-10-02T18:16:40+00:00" + "time": "2020-10-05T18:13:27+00:00" }, { "name": "brick/math", @@ -1777,16 +1777,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.148", + "version": "v0.149", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "692a8d4c6a89458570e0d804624c50120cdd6388" + "reference": "6a44aa8dc22b181594ba93c2ffb5d731c318c810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/692a8d4c6a89458570e0d804624c50120cdd6388", - "reference": "692a8d4c6a89458570e0d804624c50120cdd6388", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/6a44aa8dc22b181594ba93c2ffb5d731c318c810", + "reference": "6a44aa8dc22b181594ba93c2ffb5d731c318c810", "shasum": "" }, "require": { @@ -1810,7 +1810,7 @@ "keywords": [ "google" ], - "time": "2020-09-26T00:26:16+00:00" + "time": "2020-10-05T00:26:25+00:00" }, { "name": "google/auth", @@ -3880,16 +3880,16 @@ }, { "name": "nesbot/carbon", - "version": "2.40.1", + "version": "2.41.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d9a76d8b7eb0f97cf3a82529393245212f40ba3b" + "reference": "8690b13ad4da6d54d692afea15aab30b36fee52e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d9a76d8b7eb0f97cf3a82529393245212f40ba3b", - "reference": "d9a76d8b7eb0f97cf3a82529393245212f40ba3b", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/8690b13ad4da6d54d692afea15aab30b36fee52e", + "reference": "8690b13ad4da6d54d692afea15aab30b36fee52e", "shasum": "" }, "require": { @@ -3965,7 +3965,7 @@ "type": "tidelift" } ], - "time": "2020-09-23T08:17:37+00:00" + "time": "2020-10-04T09:11:05+00:00" }, { "name": "nikic/php-parser", @@ -6039,16 +6039,16 @@ }, { "name": "sentry/sentry-laravel", - "version": "2.0.1", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "3c6b1da08087f428ab1a188af35483eb76ef6b1e" + "reference": "1815b6e7c037f9495768e906f978e1a15d7a2944" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/3c6b1da08087f428ab1a188af35483eb76ef6b1e", - "reference": "3c6b1da08087f428ab1a188af35483eb76ef6b1e", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/1815b6e7c037f9495768e906f978e1a15d7a2944", + "reference": "1815b6e7c037f9495768e906f978e1a15d7a2944", "shasum": "" }, "require": { @@ -6116,7 +6116,7 @@ "type": "custom" } ], - "time": "2020-10-01T12:14:37+00:00" + "time": "2020-10-06T08:40:32+00:00" }, { "name": "spatie/browsershot", @@ -8848,16 +8848,16 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.2.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "77ce1c3627c9f39643acd9af086631f842c50c4d" + "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/77ce1c3627c9f39643acd9af086631f842c50c4d", - "reference": "77ce1c3627c9f39643acd9af086631f842c50c4d", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e2eaa60b558f26a4b0354e1bbb25636efaaad105", + "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105", "shasum": "" }, "require": { @@ -8869,7 +8869,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -8919,7 +8919,7 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2020-09-28T13:05:58+00:00" }, { "name": "symfony/var-dumper", @@ -11940,16 +11940,16 @@ }, { "name": "sebastian/type", - "version": "2.2.2", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "e494dcaeb89d1458c9ccd8c819745245a1669aea" + "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/e494dcaeb89d1458c9ccd8c819745245a1669aea", - "reference": "e494dcaeb89d1458c9ccd8c819745245a1669aea", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fa592377f3923946cb90bf1f6a71ba2e5f229909", + "reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909", "shasum": "" }, "require": { @@ -11961,7 +11961,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -11988,7 +11988,7 @@ "type": "github" } ], - "time": "2020-09-28T06:01:38+00:00" + "time": "2020-10-06T08:41:03+00:00" }, { "name": "sebastian/version", diff --git a/database/factories/ProjectFactory.php b/database/factories/ProjectFactory.php index 06083f94302e..ec8ba7bda004 100644 --- a/database/factories/ProjectFactory.php +++ b/database/factories/ProjectFactory.php @@ -34,7 +34,7 @@ class ProjectFactory extends Factory { return [ 'name' => $this->faker->name(), - 'description' => $this->faker->text(50), + 'public_notes' => $this->faker->text(50), ]; } } diff --git a/database/migrations/2020_09_27_215800_update_gateway_table_visible_column.php b/database/migrations/2020_09_27_215800_update_gateway_table_visible_column.php index ca211a45b665..e13d117bc586 100644 --- a/database/migrations/2020_09_27_215800_update_gateway_table_visible_column.php +++ b/database/migrations/2020_09_27_215800_update_gateway_table_visible_column.php @@ -31,6 +31,17 @@ class UpdateGatewayTableVisibleColumn extends Migration }); + + Schema::table('expenses', function ($t){ + $t->renameColumn('invoice_category_id', 'category_id'); + }); + + Schema::table('projects', function ($t){ + $t->text('public_notes')->nullable(); + $t->dropColumn('description'); + $t->decimal('budgeted_hours', 12,2)->change(); + }); + }