diff --git a/VERSION.txt b/VERSION.txt index 802fbebe9d..030bca2b2f 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.0.31 \ No newline at end of file +5.0.32 \ No newline at end of file diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index 5c05c6e358..8cbd3b39a3 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -146,7 +146,8 @@ class CreateEntityPdf implements ShouldQueue ->build(); //todo - move this to the client creation stage so we don't keep hitting this unnecessarily - // Storage::makeDirectory($path, 0775); + //info("make dir => {$path}"); + //Storage::makeDirectory($path, 0775); $pdf = null; diff --git a/app/Jobs/Util/UploadAvatar.php b/app/Jobs/Util/UploadAvatar.php index b9da6dd71f..ff8700c016 100644 --- a/app/Jobs/Util/UploadAvatar.php +++ b/app/Jobs/Util/UploadAvatar.php @@ -37,7 +37,9 @@ class UploadAvatar implements ShouldQueue { //make dir - Storage::makeDirectory($this->directory, 0775); + // info("avatar dir creation => ". $this->directory); + + // Storage::makeDirectory($this->directory, 0775); $tmp_file = sha1(time()).'.png'; diff --git a/app/Services/Invoice/GenerateDeliveryNote.php b/app/Services/Invoice/GenerateDeliveryNote.php index 74170974a5..3661d1a56b 100644 --- a/app/Services/Invoice/GenerateDeliveryNote.php +++ b/app/Services/Invoice/GenerateDeliveryNote.php @@ -84,7 +84,7 @@ class GenerateDeliveryNote ->design($template) ->build(); - Storage::makeDirectory($this->invoice->client->invoice_filepath(), 0775); + // Storage::makeDirectory($this->invoice->client->invoice_filepath(), 0775); $pdf = $this->makePdf(null, null, $maker->getCompiledHTML()); diff --git a/app/Services/Invoice/HandleRestore.php b/app/Services/Invoice/HandleRestore.php index d647767355..4d20d9b51d 100644 --- a/app/Services/Invoice/HandleRestore.php +++ b/app/Services/Invoice/HandleRestore.php @@ -37,17 +37,23 @@ class HandleRestore extends AbstractService foreach($this->invoice->payments as $payment) { - + //restore the payment record $payment->restore(); + //determine the paymentable amount before paymentable restoration + $pre_restore_amount = $payment->paymentables() + ->where('paymentable_type', '=', 'invoices') + ->sum(\DB::raw('amount')); + + //restore the paymentables $payment->paymentables() ->where('paymentable_type', '=', 'invoices') ->where('paymentable_id', $this->invoice->id) ->restore(); + //determine the post restore paymentable amount (we need to increment the payment amount by the difference between pre and post) $payment_amount = $payment->paymentables() ->where('paymentable_type', '=', 'invoices') - ->where('paymentable_id', $this->invoice->id) ->sum(\DB::raw('amount')); info($payment->amount . " == " . $payment_amount); @@ -57,22 +63,20 @@ class HandleRestore extends AbstractService $payment->is_deleted = false; $payment->save(); + $this->payment_total += $payment_amount; } else { $payment->is_deleted = false; - $payment->amount += $this->payment_total; - $payment->applied += $this->payment_total; + $payment->amount += ($payment_amount - $pre_restore_amount); + $payment->applied += ($payment_amount - $pre_restore_amount); $payment->save(); + + $this->payment_total += ($payment_amount - $pre_restore_amount); } - $this->payment_total += $payment_amount; - } - - - //adjust ledger balance $this->invoice->ledger()->updateInvoiceBalance($this->invoice->balance, 'Restored invoice {$this->invoice->number}')->save(); diff --git a/app/Utils/PhantomJS/Phantom.php b/app/Utils/PhantomJS/Phantom.php index e6bbfca1fc..209ff83427 100644 --- a/app/Utils/PhantomJS/Phantom.php +++ b/app/Utils/PhantomJS/Phantom.php @@ -77,7 +77,7 @@ class Phantom $phantom_url = "https://phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$url}%22,renderType:%22pdf%22%7D"; $pdf = CurlUtils::get($phantom_url); - Storage::makeDirectory($path, 0775); + // Storage::makeDirectory($path, 0775); $instance = Storage::disk(config('filesystems.default'))->put($file_path, $pdf); diff --git a/composer.json b/composer.json index 16a018ea4d..08c1082e88 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ ], "type": "project", "require": { - "php": ">=7.3", + "php": "^7.3|^7.4", "ext-json": "*", "asgrim/ofxparser": "^1.2", "authorizenet/authorizenet": "^2.0", @@ -66,7 +66,6 @@ "require-dev": { "anahkiasen/former": "^4.2", "barryvdh/laravel-debugbar": "^3.4", - "brianium/paratest": "^5.0", "darkaonline/l5-swagger": "^8.0", "facade/ignition": "^2.3.6", "filp/whoops": "^2.7", diff --git a/composer.lock b/composer.lock index f946e5f518..f676a073ef 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d52dc9a6166a9ecfb0e5e92041c112e2", + "content-hash": "ef60a891b86ee73c6f31b73f0e778e09", "packages": [ { "name": "asgrim/ofxparser", @@ -116,16 +116,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.164.0", + "version": "3.166.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "39ecf57d828eb50ab23fd70255a68b8996392ac9" + "reference": "fe0ec9235d07b0f51ec4396dce0dd639020ae1a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/39ecf57d828eb50ab23fd70255a68b8996392ac9", - "reference": "39ecf57d828eb50ab23fd70255a68b8996392ac9", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/fe0ec9235d07b0f51ec4396dce0dd639020ae1a7", + "reference": "fe0ec9235d07b0f51ec4396dce0dd639020ae1a7", "shasum": "" }, "require": { @@ -200,9 +200,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.164.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.166.2" }, - "time": "2020-11-24T19:18:22+00:00" + "time": "2020-12-04T19:12:30+00:00" }, { "name": "brick/math", @@ -521,16 +521,16 @@ }, { "name": "composer/composer", - "version": "2.0.7", + "version": "2.0.8", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "cbee637510037f293e641857b2a6223d0ea8008d" + "reference": "62139b2806178adb979d76bd3437534a1a9fd490" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/cbee637510037f293e641857b2a6223d0ea8008d", - "reference": "cbee637510037f293e641857b2a6223d0ea8008d", + "url": "https://api.github.com/repos/composer/composer/zipball/62139b2806178adb979d76bd3437534a1a9fd490", + "reference": "62139b2806178adb979d76bd3437534a1a9fd490", "shasum": "" }, "require": { @@ -598,7 +598,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.0.7" + "source": "https://github.com/composer/composer/tree/2.0.8" }, "funding": [ { @@ -614,7 +614,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T16:31:06+00:00" + "time": "2020-12-03T16:20:39+00:00" }, { "name": "composer/package-versions-deprecated", @@ -772,16 +772,16 @@ }, { "name": "composer/spdx-licenses", - "version": "1.5.4", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223" + "reference": "de30328a7af8680efdc03e396aad24befd513200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", + "reference": "de30328a7af8680efdc03e396aad24befd513200", "shasum": "" }, "require": { @@ -793,7 +793,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -831,7 +831,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.4" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.5" }, "funding": [ { @@ -847,7 +847,7 @@ "type": "tidelift" } ], - "time": "2020-07-15T15:35:07+00:00" + "time": "2020-12-03T16:04:16+00:00" }, { "name": "composer/xdebug-handler", @@ -1902,16 +1902,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.154", + "version": "v0.156", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "7f44a314836c444b7894d648c1c49f83fb9d37ca" + "reference": "2f5e54fdef034f856208328126bddd8376dae4b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/7f44a314836c444b7894d648c1c49f83fb9d37ca", - "reference": "7f44a314836c444b7894d648c1c49f83fb9d37ca", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/2f5e54fdef034f856208328126bddd8376dae4b3", + "reference": "2f5e54fdef034f856208328126bddd8376dae4b3", "shasum": "" }, "require": { @@ -1937,9 +1937,9 @@ ], "support": { "issues": "https://github.com/googleapis/google-api-php-client-services/issues", - "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.154" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.156" }, - "time": "2020-11-19T19:01:11+00:00" + "time": "2020-11-30T20:03:55+00:00" }, { "name": "google/auth", @@ -2671,16 +2671,16 @@ }, { "name": "laravel/framework", - "version": "v8.16.1", + "version": "v8.17.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "f7dfc22e6c42e9ed4dda14c05814349af6943206" + "reference": "b89363b540bd8ad6e727ee165b510a19fe170a28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/f7dfc22e6c42e9ed4dda14c05814349af6943206", - "reference": "f7dfc22e6c42e9ed4dda14c05814349af6943206", + "url": "https://api.github.com/repos/laravel/framework/zipball/b89363b540bd8ad6e727ee165b510a19fe170a28", + "reference": "b89363b540bd8ad6e727ee165b510a19fe170a28", "shasum": "" }, "require": { @@ -2834,7 +2834,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2020-11-25T15:01:02+00:00" + "time": "2020-12-03T13:47:59+00:00" }, { "name": "laravel/slack-notification-channel", @@ -2899,16 +2899,16 @@ }, { "name": "laravel/socialite", - "version": "v5.1.1", + "version": "v5.1.2", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "dc786c41eb3615ca430da3b9aa5c9c0282f7e390" + "reference": "19fc65ac28e0b4684a8735b14c1dc6f6ef5d62c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/dc786c41eb3615ca430da3b9aa5c9c0282f7e390", - "reference": "dc786c41eb3615ca430da3b9aa5c9c0282f7e390", + "url": "https://api.github.com/repos/laravel/socialite/zipball/19fc65ac28e0b4684a8735b14c1dc6f6ef5d62c7", + "reference": "19fc65ac28e0b4684a8735b14c1dc6f6ef5d62c7", "shasum": "" }, "require": { @@ -2964,7 +2964,7 @@ "issues": "https://github.com/laravel/socialite/issues", "source": "https://github.com/laravel/socialite" }, - "time": "2020-11-24T17:34:35+00:00" + "time": "2020-12-04T15:30:50+00:00" }, { "name": "laravel/tinker", @@ -4146,16 +4146,16 @@ }, { "name": "nesbot/carbon", - "version": "2.41.5", + "version": "2.42.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "c4a9caf97cfc53adfc219043bcecf42bc663acee" + "reference": "d0463779663437392fe42ff339ebc0213bd55498" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/c4a9caf97cfc53adfc219043bcecf42bc663acee", - "reference": "c4a9caf97cfc53adfc219043bcecf42bc663acee", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d0463779663437392fe42ff339ebc0213bd55498", + "reference": "d0463779663437392fe42ff339ebc0213bd55498", "shasum": "" }, "require": { @@ -4170,7 +4170,7 @@ "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.9", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.35", + "phpstan/phpstan": "^0.12.54", "phpunit/phpunit": "^7.5 || ^8.0", "squizlabs/php_codesniffer": "^3.4" }, @@ -4235,20 +4235,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T06:02:30+00:00" + "time": "2020-11-28T14:25:28+00:00" }, { "name": "nikic/php-parser", - "version": "v4.10.2", + "version": "v4.10.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de" + "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/658f1be311a230e0907f5dfe0213742aff0596de", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", + "reference": "dbe56d23de8fcb157bbc0cfb3ad7c7de0cfb0984", "shasum": "" }, "require": { @@ -4289,9 +4289,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.3" }, - "time": "2020-09-26T10:30:38+00:00" + "time": "2020-12-03T17:45:45+00:00" }, { "name": "nwidart/laravel-modules", @@ -5708,16 +5708,16 @@ }, { "name": "psy/psysh", - "version": "v0.10.4", + "version": "v0.10.5", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560" + "reference": "7c710551d4a2653afa259c544508dc18a9098956" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/a8aec1b2981ab66882a01cce36a49b6317dc3560", - "reference": "a8aec1b2981ab66882a01cce36a49b6317dc3560", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/7c710551d4a2653afa259c544508dc18a9098956", + "reference": "7c710551d4a2653afa259c544508dc18a9098956", "shasum": "" }, "require": { @@ -5778,9 +5778,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/master" + "source": "https://github.com/bobthecow/psysh/tree/v0.10.5" }, - "time": "2020-05-03T19:32:03+00:00" + "time": "2020-12-04T02:51:30+00:00" }, { "name": "ralouphie/getallheaders", @@ -6279,21 +6279,21 @@ }, { "name": "sentry/sdk", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php-sdk.git", - "reference": "908ea3fd0e7a19ccf4b53d1c247c44231595d008" + "reference": "f03133b067fdf03fed09ff03daf3f1d68f5f3673" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/908ea3fd0e7a19ccf4b53d1c247c44231595d008", - "reference": "908ea3fd0e7a19ccf4b53d1c247c44231595d008", + "url": "https://api.github.com/repos/getsentry/sentry-php-sdk/zipball/f03133b067fdf03fed09ff03daf3f1d68f5f3673", + "reference": "f03133b067fdf03fed09ff03daf3f1d68f5f3673", "shasum": "" }, "require": { "http-interop/http-factory-guzzle": "^1.0", - "sentry/sentry": "^3.0", + "sentry/sentry": "^3.1", "symfony/http-client": "^4.3|^5.0" }, "type": "metapackage", @@ -6319,7 +6319,7 @@ "sentry" ], "support": { - "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.0.0" + "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.1.0" }, "funding": [ { @@ -6331,27 +6331,27 @@ "type": "custom" } ], - "time": "2020-09-28T07:49:07+00:00" + "time": "2020-12-01T10:31:45+00:00" }, { "name": "sentry/sentry", - "version": "3.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "745b3faafdc865ea8de75e0dc61ddfdd36a31d9c" + "reference": "55f5714e6eff6bc9e3dc4b47ac4a0e6d72088e1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/745b3faafdc865ea8de75e0dc61ddfdd36a31d9c", - "reference": "745b3faafdc865ea8de75e0dc61ddfdd36a31d9c", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/55f5714e6eff6bc9e3dc4b47ac4a0e6d72088e1e", + "reference": "55f5714e6eff6bc9e3dc4b47ac4a0e6d72088e1e", "shasum": "" }, "require": { "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/promises": "^1.3", - "guzzlehttp/psr7": "^1.6", + "guzzlehttp/psr7": "^1.7", "jean85/pretty-package-versions": "^1.5", "ocramius/package-versions": "^1.8", "php": "^7.2", @@ -6380,7 +6380,7 @@ "phpstan/phpstan": "^0.12", "phpstan/phpstan-phpunit": "^0.12", "phpunit/phpunit": "^7.5.18", - "symfony/phpunit-bridge": "^4.3|^5.0", + "symfony/phpunit-bridge": "^5.1", "vimeo/psalm": "^3.4" }, "suggest": { @@ -6389,7 +6389,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -6423,7 +6423,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.0.4" + "source": "https://github.com/getsentry/sentry-php/tree/3.1.0" }, "funding": [ { @@ -6435,26 +6435,27 @@ "type": "custom" } ], - "time": "2020-11-06T11:58:00+00:00" + "time": "2020-12-01T09:59:47+00:00" }, { "name": "sentry/sentry-laravel", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "f4c663b6510e793a180dee6b3a7c95c339f7fd8a" + "reference": "fd987481113fbfbfafb8adc0717cab9babe50ce4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/f4c663b6510e793a180dee6b3a7c95c339f7fd8a", - "reference": "f4c663b6510e793a180dee6b3a7c95c339f7fd8a", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/fd987481113fbfbfafb8adc0717cab9babe50ce4", + "reference": "fd987481113fbfbfafb8adc0717cab9babe50ce4", "shasum": "" }, "require": { "illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0", "php": "^7.2", - "sentry/sdk": "^3.0" + "sentry/sdk": "^3.1", + "sentry/sentry": "3.1.*" }, "require-dev": { "friendsofphp/php-cs-fixer": "2.16.*", @@ -6508,7 +6509,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/2.2.0" + "source": "https://github.com/getsentry/sentry-laravel/tree/2.3.0" }, "funding": [ { @@ -6520,7 +6521,7 @@ "type": "custom" } ], - "time": "2020-11-04T14:56:24+00:00" + "time": "2020-12-01T13:57:22+00:00" }, { "name": "spatie/browsershot", @@ -6590,16 +6591,16 @@ }, { "name": "spatie/image", - "version": "1.10.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/spatie/image.git", - "reference": "65d615c1f604e479764f25525291d696041dfcea" + "reference": "6eaf45d61832c2396dd4b10cc81d9fce93a59e2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image/zipball/65d615c1f604e479764f25525291d696041dfcea", - "reference": "65d615c1f604e479764f25525291d696041dfcea", + "url": "https://api.github.com/repos/spatie/image/zipball/6eaf45d61832c2396dd4b10cc81d9fce93a59e2d", + "reference": "6eaf45d61832c2396dd4b10cc81d9fce93a59e2d", "shasum": "" }, "require": { @@ -6641,7 +6642,7 @@ ], "support": { "issues": "https://github.com/spatie/image/issues", - "source": "https://github.com/spatie/image/tree/1.10.0" + "source": "https://github.com/spatie/image/tree/1.10.1" }, "funding": [ { @@ -6653,20 +6654,20 @@ "type": "github" } ], - "time": "2020-11-27T14:44:09+00:00" + "time": "2020-12-01T20:42:11+00:00" }, { "name": "spatie/image-optimizer", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/spatie/image-optimizer.git", - "reference": "b622d0cf29f57d7735d49f2b62471e6b788cb291" + "reference": "6aa170eb292758553d332efee5e0c3977341080c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/b622d0cf29f57d7735d49f2b62471e6b788cb291", - "reference": "b622d0cf29f57d7735d49f2b62471e6b788cb291", + "url": "https://api.github.com/repos/spatie/image-optimizer/zipball/6aa170eb292758553d332efee5e0c3977341080c", + "reference": "6aa170eb292758553d332efee5e0c3977341080c", "shasum": "" }, "require": { @@ -6705,9 +6706,9 @@ ], "support": { "issues": "https://github.com/spatie/image-optimizer/issues", - "source": "https://github.com/spatie/image-optimizer/tree/1.3.1" + "source": "https://github.com/spatie/image-optimizer/tree/1.3.2" }, - "time": "2020-11-20T11:36:11+00:00" + "time": "2020-11-28T12:37:58+00:00" }, { "name": "spatie/temporary-directory", @@ -6762,16 +6763,16 @@ }, { "name": "stripe/stripe-php", - "version": "v7.66.0", + "version": "v7.66.1", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "0dc50f42b06be83fe7029410616bda6e89c6d2be" + "reference": "a2ebaa272a8797b21e81afaf8d5ba0953ff15e13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/0dc50f42b06be83fe7029410616bda6e89c6d2be", - "reference": "0dc50f42b06be83fe7029410616bda6e89c6d2be", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/a2ebaa272a8797b21e81afaf8d5ba0953ff15e13", + "reference": "a2ebaa272a8797b21e81afaf8d5ba0953ff15e13", "shasum": "" }, "require": { @@ -6817,9 +6818,9 @@ ], "support": { "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v7.66.0" + "source": "https://github.com/stripe/stripe-php/tree/v7.66.1" }, - "time": "2020-11-24T16:33:56+00:00" + "time": "2020-12-01T18:44:12+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -6889,16 +6890,16 @@ }, { "name": "symfony/console", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e" + "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", - "reference": "e0b2c29c0fa6a69089209bbe8fcff4df2a313d0e", + "url": "https://api.github.com/repos/symfony/console/zipball/3e0564fb08d44a98bd5f1960204c958e57bd586b", + "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b", "shasum": "" }, "require": { @@ -6959,8 +6960,14 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "support": { - "source": "https://github.com/symfony/console/tree/v5.1.8" + "source": "https://github.com/symfony/console/tree/v5.2.0" }, "funding": [ { @@ -6976,20 +6983,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-28T11:24:18+00:00" }, { "name": "symfony/css-selector", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0" + "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", - "reference": "6cbebda22ffc0d4bb8fea0c1311c2ca54c4c8fa0", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", + "reference": "b8d8eb06b0942e84a69e7acebc3e9c1e6e6e7256", "shasum": "" }, "require": { @@ -7025,7 +7032,7 @@ "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.1.8" + "source": "https://github.com/symfony/css-selector/tree/v5.2.0" }, "funding": [ { @@ -7041,7 +7048,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-28T21:31:18+00:00" }, { "name": "symfony/deprecation-contracts", @@ -7112,16 +7119,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "a154f2b12fd1ec708559ba73ed58bd1304e55718" + "reference": "289008c5be039e39908d33ae0a8ac99be1210bba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/a154f2b12fd1ec708559ba73ed58bd1304e55718", - "reference": "a154f2b12fd1ec708559ba73ed58bd1304e55718", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/289008c5be039e39908d33ae0a8ac99be1210bba", + "reference": "289008c5be039e39908d33ae0a8ac99be1210bba", "shasum": "" }, "require": { @@ -7161,7 +7168,7 @@ "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.1.8" + "source": "https://github.com/symfony/error-handler/tree/v5.2.0" }, "funding": [ { @@ -7177,20 +7184,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-28T21:46:03+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a" + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/26f4edae48c913fc183a3da0553fe63bdfbd361a", - "reference": "26f4edae48c913fc183a3da0553fe63bdfbd361a", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", + "reference": "aa13a09811e6d2ad43f8fb336bebdb7691d85d3c", "shasum": "" }, "require": { @@ -7246,7 +7253,7 @@ "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.1.8" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.2.0" }, "funding": [ { @@ -7262,7 +7269,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-01T16:14:45+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -7345,16 +7352,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "df08650ea7aee2d925380069c131a66124d79177" + "reference": "bb92ba7f38b037e531908590a858a04d85c0e238" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/df08650ea7aee2d925380069c131a66124d79177", - "reference": "df08650ea7aee2d925380069c131a66124d79177", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb92ba7f38b037e531908590a858a04d85c0e238", + "reference": "bb92ba7f38b037e531908590a858a04d85c0e238", "shasum": "" }, "require": { @@ -7387,7 +7394,7 @@ "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.1.8" + "source": "https://github.com/symfony/filesystem/tree/v5.2.0" }, "funding": [ { @@ -7403,20 +7410,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-12T09:58:18+00:00" }, { "name": "symfony/finder", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0" + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", - "reference": "e70eb5a69c2ff61ea135a13d2266e8914a67b3a0", + "url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d", + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d", "shasum": "" }, "require": { @@ -7448,7 +7455,7 @@ "description": "Symfony Finder Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.1.8" + "source": "https://github.com/symfony/finder/tree/v5.2.0" }, "funding": [ { @@ -7464,20 +7471,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-18T09:42:36+00:00" }, { "name": "symfony/http-client", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "97a6a1f9f5bb3a6094833107b58a72bc9a9165cc" + "reference": "5b9fc5d85a6cec73832ff170ccd468d97dd082d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/97a6a1f9f5bb3a6094833107b58a72bc9a9165cc", - "reference": "97a6a1f9f5bb3a6094833107b58a72bc9a9165cc", + "url": "https://api.github.com/repos/symfony/http-client/zipball/5b9fc5d85a6cec73832ff170ccd468d97dd082d9", + "reference": "5b9fc5d85a6cec73832ff170ccd468d97dd082d9", "shasum": "" }, "require": { @@ -7495,6 +7502,7 @@ "symfony/http-client-implementation": "1.1" }, "require-dev": { + "amphp/amp": "^2.5", "amphp/http-client": "^4.2.1", "amphp/http-tunnel": "^1.0", "amphp/socket": "^1.1", @@ -7504,7 +7512,8 @@ "psr/http-client": "^1.0", "symfony/dependency-injection": "^4.4|^5.0", "symfony/http-kernel": "^4.4.13|^5.1.5", - "symfony/process": "^4.4|^5.0" + "symfony/process": "^4.4|^5.0", + "symfony/stopwatch": "^4.4|^5.0" }, "type": "library", "autoload": { @@ -7532,7 +7541,7 @@ "description": "Symfony HttpClient component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-client/tree/v5.1.8" + "source": "https://github.com/symfony/http-client/tree/v5.2.0" }, "funding": [ { @@ -7548,7 +7557,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-28T13:45:20+00:00" }, { "name": "symfony/http-client-contracts", @@ -7631,16 +7640,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f" + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a2860ec970404b0233ab1e59e0568d3277d32b6f", - "reference": "a2860ec970404b0233ab1e59e0568d3277d32b6f", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/e4576271ee99123aa59a40564c7b5405f0ebd1e6", + "reference": "e4576271ee99123aa59a40564c7b5405f0ebd1e6", "shasum": "" }, "require": { @@ -7684,7 +7693,7 @@ "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.1.8" + "source": "https://github.com/symfony/http-foundation/tree/v5.2.0" }, "funding": [ { @@ -7700,20 +7709,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-27T06:13:25+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "a13b3c4d994a4fd051f4c6800c5e33c9508091dd" + "reference": "38907e5ccb2d9d371191a946734afc83c7a03160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a13b3c4d994a4fd051f4c6800c5e33c9508091dd", - "reference": "a13b3c4d994a4fd051f4c6800c5e33c9508091dd", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/38907e5ccb2d9d371191a946734afc83c7a03160", + "reference": "38907e5ccb2d9d371191a946734afc83c7a03160", "shasum": "" }, "require": { @@ -7733,7 +7742,7 @@ "symfony/cache": "<5.0", "symfony/config": "<5.0", "symfony/console": "<4.4", - "symfony/dependency-injection": "<4.4", + "symfony/dependency-injection": "<5.1.8", "symfony/doctrine-bridge": "<5.0", "symfony/form": "<5.0", "symfony/http-client": "<5.0", @@ -7753,7 +7762,7 @@ "symfony/config": "^5.0", "symfony/console": "^4.4|^5.0", "symfony/css-selector": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", + "symfony/dependency-injection": "^5.1.8", "symfony/dom-crawler": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/finder": "^4.4|^5.0", @@ -7796,7 +7805,7 @@ "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.1.8" + "source": "https://github.com/symfony/http-kernel/tree/v5.2.0" }, "funding": [ { @@ -7812,24 +7821,25 @@ "type": "tidelift" } ], - "time": "2020-10-28T05:55:23+00:00" + "time": "2020-11-30T05:54:18+00:00" }, { "name": "symfony/mime", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b" + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/f5485a92c24d4bcfc2f3fc648744fb398482ff1b", - "reference": "f5485a92c24d4bcfc2f3fc648744fb398482ff1b", + "url": "https://api.github.com/repos/symfony/mime/zipball/05f667e8fa029568964fd3bec6bc17765b853cc5", + "reference": "05f667e8fa029568964fd3bec6bc17765b853cc5", "shasum": "" }, "require": { "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/polyfill-intl-idn": "^1.10", "symfony/polyfill-mbstring": "^1.0", "symfony/polyfill-php80": "^1.15" @@ -7839,7 +7849,11 @@ }, "require-dev": { "egulias/email-validator": "^2.1.10", - "symfony/dependency-injection": "^4.4|^5.0" + "phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/property-access": "^4.4|^5.1", + "symfony/property-info": "^4.4|^5.1", + "symfony/serializer": "^5.2" }, "type": "library", "autoload": { @@ -7871,7 +7885,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.1.8" + "source": "https://github.com/symfony/mime/tree/v5.2.0" }, "funding": [ { @@ -7887,25 +7901,26 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-30T14:55:39+00:00" }, { "name": "symfony/options-resolver", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02" + "reference": "87a2a4a766244e796dd9cb9d6f58c123358cd986" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", - "reference": "c6a02905e4ffc7a1498e8ee019db2b477cd1cc02", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/87a2a4a766244e796dd9cb9d6f58c123358cd986", + "reference": "87a2a4a766244e796dd9cb9d6f58c123358cd986", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php73": "~1.0", "symfony/polyfill-php80": "^1.15" }, "type": "library", @@ -7939,7 +7954,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.1.8" + "source": "https://github.com/symfony/options-resolver/tree/v5.2.0" }, "funding": [ { @@ -7955,7 +7970,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-24T12:08:07+00:00" }, { "name": "symfony/polyfill-ctype", @@ -8767,16 +8782,16 @@ }, { "name": "symfony/process", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f00872c3f6804150d6a0f73b4151daab96248101" + "reference": "240e74140d4d956265048f3025c0aecbbc302d54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f00872c3f6804150d6a0f73b4151daab96248101", - "reference": "f00872c3f6804150d6a0f73b4151daab96248101", + "url": "https://api.github.com/repos/symfony/process/zipball/240e74140d4d956265048f3025c0aecbbc302d54", + "reference": "240e74140d4d956265048f3025c0aecbbc302d54", "shasum": "" }, "require": { @@ -8809,7 +8824,7 @@ "description": "Symfony Process Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.1.8" + "source": "https://github.com/symfony/process/tree/v5.2.0" }, "funding": [ { @@ -8825,20 +8840,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-02T15:47:15+00:00" }, { "name": "symfony/routing", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "d6ceee2a37b61b41079005207bf37746d1bfe71f" + "reference": "130ac5175ad2fd417978baebd8062e2e6b2bc28b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/d6ceee2a37b61b41079005207bf37746d1bfe71f", - "reference": "d6ceee2a37b61b41079005207bf37746d1bfe71f", + "url": "https://api.github.com/repos/symfony/routing/zipball/130ac5175ad2fd417978baebd8062e2e6b2bc28b", + "reference": "130ac5175ad2fd417978baebd8062e2e6b2bc28b", "shasum": "" }, "require": { @@ -8852,7 +8867,7 @@ "symfony/yaml": "<4.4" }, "require-dev": { - "doctrine/annotations": "~1.2", + "doctrine/annotations": "^1.7", "psr/log": "~1.0", "symfony/config": "^5.0", "symfony/dependency-injection": "^4.4|^5.0", @@ -8899,7 +8914,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.1.8" + "source": "https://github.com/symfony/routing/tree/v5.2.0" }, "funding": [ { @@ -8915,7 +8930,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-27T00:39:34+00:00" }, { "name": "symfony/service-contracts", @@ -8998,16 +9013,16 @@ }, { "name": "symfony/string", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea" + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/a97573e960303db71be0dd8fda9be3bca5e0feea", - "reference": "a97573e960303db71be0dd8fda9be3bca5e0feea", + "url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242", + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242", "shasum": "" }, "require": { @@ -9061,7 +9076,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.1.8" + "source": "https://github.com/symfony/string/tree/v5.2.0" }, "funding": [ { @@ -9077,27 +9092,27 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-10-24T12:08:07+00:00" }, { "name": "symfony/translation", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6" + "reference": "52f486a707510884450df461b5a6429dd7a67379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/27980838fd261e04379fa91e94e81e662fe5a1b6", - "reference": "27980838fd261e04379fa91e94e81e662fe5a1b6", + "url": "https://api.github.com/repos/symfony/translation/zipball/52f486a707510884450df461b5a6429dd7a67379", + "reference": "52f486a707510884450df461b5a6429dd7a67379", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.15", - "symfony/translation-contracts": "^2" + "symfony/translation-contracts": "^2.3" }, "conflict": { "symfony/config": "<4.4", @@ -9127,6 +9142,9 @@ }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { "Symfony\\Component\\Translation\\": "" }, @@ -9151,7 +9169,7 @@ "description": "Symfony Translation Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.1.8" + "source": "https://github.com/symfony/translation/tree/v5.2.0" }, "funding": [ { @@ -9167,7 +9185,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-28T11:24:18+00:00" }, { "name": "symfony/translation-contracts", @@ -9249,16 +9267,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a" + "reference": "173a79c462b1c81e1fa26129f71e41333d846b26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", - "reference": "4e13f3fcefb1fcaaa5efb5403581406f4e840b9a", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/173a79c462b1c81e1fa26129f71e41333d846b26", + "reference": "173a79c462b1c81e1fa26129f71e41333d846b26", "shasum": "" }, "require": { @@ -9317,7 +9335,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.1.8" + "source": "https://github.com/symfony/var-dumper/tree/v5.2.0" }, "funding": [ { @@ -9333,7 +9351,7 @@ "type": "tidelift" } ], - "time": "2020-10-27T10:11:13+00:00" + "time": "2020-11-27T00:39:34+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -9958,31 +9976,32 @@ }, { "name": "anahkiasen/former", - "version": "4.5.0", + "version": "4.6.0", "source": { "type": "git", "url": "https://github.com/formers/former.git", - "reference": "625e1dbcf3a7c9a60b21ce96a7736a17b0f2ebf8" + "reference": "c5bcd07f4d17c8da6bea413865177a4e39876379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/formers/former/zipball/625e1dbcf3a7c9a60b21ce96a7736a17b0f2ebf8", - "reference": "625e1dbcf3a7c9a60b21ce96a7736a17b0f2ebf8", + "url": "https://api.github.com/repos/formers/former/zipball/c5bcd07f4d17c8da6bea413865177a4e39876379", + "reference": "c5bcd07f4d17c8da6bea413865177a4e39876379", "shasum": "" }, "require": { "anahkiasen/html-object": "~1.4", - "illuminate/config": "~5.0|^6.0|^7.0|^8.0", - "illuminate/container": "~5.0|^6.0|^7.0|^8.0", - "illuminate/http": "~5.0|^6.0|^7.0|^8.0", - "illuminate/routing": "~5.0|^6.0|^7.0|^8.0", - "illuminate/session": "~5.0|^6.0|^7.0|^8.0", - "illuminate/support": "~5.0|^6.0|^7.0|^8.0", - "illuminate/translation": "~5.0|^6.0|^7.0|^8.0", - "php": ">=7.2.0" + "illuminate/config": "^5.1.3|^6.0|^7.0|^8.0", + "illuminate/container": "^5.1.3|^6.0|^7.0|^8.0", + "illuminate/contracts": "^5.1.3|^6.0|^7.0|^8.0", + "illuminate/http": "^5.1.3|^6.0|^7.0|^8.0", + "illuminate/routing": "^5.1.3|^6.0|^7.0|^8.0", + "illuminate/session": "^5.1.3|^6.0|^7.0|^8.0", + "illuminate/support": "^5.1.3|^6.0|^7.0|^8.0", + "illuminate/translation": "^5.1.3|^6.0|^7.0|^8.0", + "php": "^7.2|^8.0" }, "require-dev": { - "illuminate/database": "~5.0|^6.0|^7.0|^8.0", + "illuminate/database": "^5.1.3|^6.0|^7.0|^8.0", "mockery/mockery": "^1.3", "phpunit/phpunit": "^8.5" }, @@ -10029,9 +10048,9 @@ ], "support": { "issues": "https://github.com/formers/former/issues", - "source": "https://github.com/formers/former/tree/4.5.0" + "source": "https://github.com/formers/former/tree/4.6.0" }, - "time": "2020-09-23T18:18:13+00:00" + "time": "2020-11-30T20:20:21+00:00" }, { "name": "anahkiasen/html-object", @@ -10159,85 +10178,6 @@ ], "time": "2020-09-07T19:32:39+00:00" }, - { - "name": "brianium/paratest", - "version": "5.0.4", - "source": { - "type": "git", - "url": "https://github.com/paratestphp/paratest.git", - "reference": "e54bea90b784b289a7ee17f2319210338c2d7d6d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/e54bea90b784b289a7ee17f2319210338c2d7d6d", - "reference": "e54bea90b784b289a7ee17f2319210338c2d7d6d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-pcre": "*", - "ext-pdo": "*", - "ext-reflection": "*", - "ext-simplexml": "*", - "php": "^7.3", - "phpunit/php-code-coverage": "^9.1.2", - "phpunit/php-file-iterator": "^3.0", - "phpunit/php-timer": "^5.0", - "phpunit/phpunit": "^9.3.5", - "sebastian/environment": "^5.1", - "symfony/console": "^4.4 || ^5.1", - "symfony/process": "^4.4 || ^5.1" - }, - "require-dev": { - "doctrine/coding-standard": "^8.1.0", - "ekino/phpstan-banned-code": "^0.3.1", - "ergebnis/phpstan-rules": "^0.15.1", - "phpstan/phpstan": "^0.12.37", - "phpstan/phpstan-deprecation-rules": "^0.12.5", - "phpstan/phpstan-phpunit": "^0.12.16", - "phpstan/phpstan-strict-rules": "^0.12.4", - "squizlabs/php_codesniffer": "^3.5.6", - "symfony/filesystem": "^5.1.3", - "thecodingmachine/phpstan-strict-rules": "^0.12.0", - "vimeo/psalm": "^3.12.2" - }, - "bin": [ - "bin/paratest" - ], - "type": "library", - "autoload": { - "psr-4": { - "ParaTest\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Scaturro", - "email": "scaturrob@gmail.com", - "homepage": "http://brianscaturro.com", - "role": "Lead" - } - ], - "description": "Parallel testing for PHP", - "homepage": "https://github.com/paratestphp/paratest", - "keywords": [ - "concurrent", - "parallel", - "phpunit", - "testing" - ], - "support": { - "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/5.0.4" - }, - "time": "2020-08-26T13:44:25+00:00" - }, { "name": "darkaonline/l5-swagger", "version": "8.0.2", @@ -11419,16 +11359,16 @@ }, { "name": "phar-io/version", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" + "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0", - "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", + "url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae", + "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae", "shasum": "" }, "require": { @@ -11464,9 +11404,9 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/master" + "source": "https://github.com/phar-io/version/tree/3.0.3" }, - "time": "2020-06-27T14:39:04+00:00" + "time": "2020-11-30T09:21:21+00:00" }, { "name": "php-cs-fixer/diff", @@ -11750,16 +11690,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.4", + "version": "9.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "0a7f0acf9269c190fd982b5c04423feae986b6e0" + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0a7f0acf9269c190fd982b5c04423feae986b6e0", - "reference": "0a7f0acf9269c190fd982b5c04423feae986b6e0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1", + "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1", "shasum": "" }, "require": { @@ -11773,7 +11713,7 @@ "sebastian/code-unit-reverse-lookup": "^2.0.2", "sebastian/complexity": "^2.0", "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0", + "sebastian/lines-of-code": "^1.0.3", "sebastian/version": "^3.0.1", "theseer/tokenizer": "^1.2.0" }, @@ -11815,7 +11755,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.4" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5" }, "funding": [ { @@ -11823,7 +11763,7 @@ "type": "github" } ], - "time": "2020-11-27T06:15:15+00:00" + "time": "2020-11-28T06:44:49+00:00" }, { "name": "phpunit/php-file-iterator", @@ -12068,16 +12008,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.4.3", + "version": "9.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab" + "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", - "reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", + "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", "shasum": "" }, "require": { @@ -12093,7 +12033,7 @@ "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2", + "phpunit/php-code-coverage": "^9.2.3", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -12124,7 +12064,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.4-dev" + "dev-master": "9.5-dev" } }, "autoload": { @@ -12155,7 +12095,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0" }, "funding": [ { @@ -12167,7 +12107,7 @@ "type": "github" } ], - "time": "2020-11-10T12:53:30+00:00" + "time": "2020-12-04T05:05:53+00:00" }, { "name": "sebastian/cli-parser", @@ -12739,16 +12679,16 @@ }, { "name": "sebastian/lines-of-code", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "acf76492a65401babcf5283296fa510782783a7a" + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/acf76492a65401babcf5283296fa510782783a7a", - "reference": "acf76492a65401babcf5283296fa510782783a7a", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", "shasum": "" }, "require": { @@ -12784,7 +12724,7 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.2" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" }, "funding": [ { @@ -12792,7 +12732,7 @@ "type": "github" } ], - "time": "2020-10-26T17:03:56+00:00" + "time": "2020-11-28T06:42:11+00:00" }, { "name": "sebastian/object-enumerator", @@ -13196,16 +13136,16 @@ }, { "name": "symfony/debug", - "version": "v4.4.16", + "version": "v4.4.17", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "c87adf3fc1cd0bf4758316a3a150d50a8f957ef4" + "reference": "65fe7b49868378319b82da3035fb30801b931c47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/c87adf3fc1cd0bf4758316a3a150d50a8f957ef4", - "reference": "c87adf3fc1cd0bf4758316a3a150d50a8f957ef4", + "url": "https://api.github.com/repos/symfony/debug/zipball/65fe7b49868378319b82da3035fb30801b931c47", + "reference": "65fe7b49868378319b82da3035fb30801b931c47", "shasum": "" }, "require": { @@ -13245,7 +13185,7 @@ "description": "Symfony Debug Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.16" + "source": "https://github.com/symfony/debug/tree/v4.4.17" }, "funding": [ { @@ -13261,7 +13201,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T11:50:19+00:00" + "time": "2020-10-28T20:42:29+00:00" }, { "name": "symfony/polyfill-php70", @@ -13333,16 +13273,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5" + "reference": "2b105c0354f39a63038a1d8bf776ee92852813af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/3d9f57c89011f0266e6b1d469e5c0110513859d5", - "reference": "3d9f57c89011f0266e6b1d469e5c0110513859d5", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/2b105c0354f39a63038a1d8bf776ee92852813af", + "reference": "2b105c0354f39a63038a1d8bf776ee92852813af", "shasum": "" }, "require": { @@ -13375,7 +13315,7 @@ "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.1.8" + "source": "https://github.com/symfony/stopwatch/tree/v5.2.0" }, "funding": [ { @@ -13391,20 +13331,20 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:01:57+00:00" + "time": "2020-11-01T16:14:45+00:00" }, { "name": "symfony/yaml", - "version": "v5.1.8", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f284e032c3cefefb9943792132251b79a6127ca6" + "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f284e032c3cefefb9943792132251b79a6127ca6", - "reference": "f284e032c3cefefb9943792132251b79a6127ca6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/bb73619b2ae5121bbbcd9f191dfd53ded17ae598", + "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598", "shasum": "" }, "require": { @@ -13450,7 +13390,7 @@ "description": "Symfony Yaml Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.1.8" + "source": "https://github.com/symfony/yaml/tree/v5.2.0" }, "funding": [ { @@ -13466,7 +13406,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T12:03:25+00:00" + "time": "2020-11-28T10:57:20+00:00" }, { "name": "theseer/tokenizer", @@ -13520,16 +13460,16 @@ }, { "name": "vimeo/psalm", - "version": "4.2.1", + "version": "4.3.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "ea9cb72143b77e7520c52fa37290bd8d8bc88fd9" + "reference": "2feba22a005a18bf31d4c7b9bdb9252c73897476" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/ea9cb72143b77e7520c52fa37290bd8d8bc88fd9", - "reference": "ea9cb72143b77e7520c52fa37290bd8d8bc88fd9", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/2feba22a005a18bf31d4c7b9bdb9252c73897476", + "reference": "2feba22a005a18bf31d4c7b9bdb9252c73897476", "shasum": "" }, "require": { @@ -13619,9 +13559,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.2.1" + "source": "https://github.com/vimeo/psalm/tree/4.3.1" }, - "time": "2020-11-20T14:56:53+00:00" + "time": "2020-12-03T16:44:10+00:00" }, { "name": "webmozart/path-util", @@ -13791,7 +13731,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=7.3", + "php": "^7.3|^7.4", "ext-json": "*" }, "platform-dev": [], diff --git a/config/filesystems.php b/config/filesystems.php index 01a12dad13..26b1850eea 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -60,7 +60,8 @@ return [ 'public' => [ 'driver' => 'local', - 'root' => 'storage/', + 'root' => public_path('storage'), + //'root' => 'storage/', // 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', diff --git a/config/ninja.php b/config/ninja.php index 236b2b05b5..7321356e7c 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -12,7 +12,7 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/').'/', 'app_domain' => env('APP_DOMAIN', ''), - 'app_version' => '5.0.31', + 'app_version' => '5.0.32', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), diff --git a/tests/Feature/DeleteInvoiceTest.php b/tests/Feature/DeleteInvoiceTest.php new file mode 100644 index 0000000000..2170c4f7bd --- /dev/null +++ b/tests/Feature/DeleteInvoiceTest.php @@ -0,0 +1,328 @@ +makeTestData(); + + $this->withoutMiddleware( + ThrottleRequests::class + ); + } + + /** + * @covers App\Services\Invoice\MarkInvoiceDeleted + */ + public function testInvoiceDeletion() + { + + $data = [ + 'name' => 'A Nice Client', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients', $data); + + $response->assertStatus(200); + + $arr = $response->json(); + + $client_hash_id = $arr['data']['id']; + $client = Client::find($this->decodePrimaryKey($client_hash_id)); + + $this->assertEquals($client->balance, 0); + $this->assertEquals($client->paid_to_date, 0); + //create new invoice. + + $line_items = []; + + $item = InvoiceItemFactory::create(); + $item->quantity = 1; + $item->cost = 10; + + $line_items[] = (array)$item; + + $item = InvoiceItemFactory::create(); + $item->quantity = 1; + $item->cost = 10; + + $line_items[] = (array)$item; + + $invoice = [ + 'status_id' => 1, + 'number' => '', + 'discount' => 0, + 'is_amount_discount' => 1, + 'po_number' => '3434343', + 'public_notes' => 'notes', + 'is_deleted' => 0, + 'custom_value1' => 0, + 'custom_value2' => 0, + 'custom_value3' => 0, + 'custom_value4' => 0, + 'client_id' => $client_hash_id, + 'line_items' => (array)$line_items, + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/', $invoice) + ->assertStatus(200); + + $arr = $response->json(); + + $invoice_one_hashed_id = $arr['data']['id']; + + $invoice = Invoice::find($this->decodePrimaryKey($invoice_one_hashed_id)); + + $invoice = $invoice->service()->markSent()->save(); + + $this->assertEquals(20, $invoice->balance); + $this->assertEquals(20, $invoice->client->balance); + + //delete invoice + $data = [ + 'ids' => [$invoice_one_hashed_id], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/bulk?action=delete', $data)->assertStatus(200); + + + $invoice = $invoice->fresh(); + + $this->assertEquals(20, $invoice->balance); + $this->assertEquals(0, $invoice->client->balance); + $this->assertTrue((bool)$invoice->is_deleted); + $this->assertNotNull($invoice->deleted_at); + + //delete invoice + $data = [ + 'ids' => [$invoice_one_hashed_id], + ]; + + //restore invoice + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/bulk?action=restore', $data)->assertStatus(200); + + $invoice = $invoice->fresh(); + + $this->assertEquals(20, $invoice->balance); + $this->assertFalse((bool)$invoice->is_deleted); + $this->assertNull($invoice->deleted_at); + $this->assertEquals(20, $invoice->client->fresh()->balance); + + } + + /** + * @covers App\Services\Invoice\HandleRestore + */ + public function testInvoiceDeletionAndRestoration() + { + //create new client + + $data = [ + 'name' => 'A Nice Client', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients', $data); + + $response->assertStatus(200); + + $arr = $response->json(); + + $client_hash_id = $arr['data']['id']; + $client = Client::find($this->decodePrimaryKey($client_hash_id)); + + $this->assertEquals($client->balance, 0); + $this->assertEquals($client->paid_to_date, 0); + //create new invoice. + + $line_items = []; + + $item = InvoiceItemFactory::create(); + $item->quantity = 1; + $item->cost = 10; + + $line_items[] = (array)$item; + + $item = InvoiceItemFactory::create(); + $item->quantity = 1; + $item->cost = 10; + + $line_items[] = (array)$item; + + $invoice = [ + 'status_id' => 1, + 'number' => '', + 'discount' => 0, + 'is_amount_discount' => 1, + 'po_number' => '3434343', + 'public_notes' => 'notes', + 'is_deleted' => 0, + 'custom_value1' => 0, + 'custom_value2' => 0, + 'custom_value3' => 0, + 'custom_value4' => 0, + 'client_id' => $client_hash_id, + 'line_items' => (array)$line_items, + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/', $invoice) + ->assertStatus(200); + + $arr = $response->json(); + + $invoice_one_hashed_id = $arr['data']['id']; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/', $invoice) + ->assertStatus(200); + + $arr = $response->json(); + + $invoice_two_hashed_id = $arr['data']['id']; + + //mark as paid + + $data = [ + 'amount' => 40.0, + 'client_id' => $client_hash_id, + 'invoices' => [ + [ + 'invoice_id' => $invoice_one_hashed_id, + 'amount' => 20.0, + ], + [ + 'invoice_id' => $invoice_two_hashed_id, + 'amount' => 20.0, + ], + ], + 'date' => '2020/12/01', + ]; + + $response = false; + + try { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments?include=invoices', $data); + } catch (ValidationException $e) { + $message = json_decode($e->validator->getMessageBag(), 1); + } + + $arr = $response->json(); + $response->assertStatus(200); + + $payment_hashed_id = $arr['data']['id']; + + $invoice_one = Invoice::find($this->decodePrimaryKey($invoice_one_hashed_id)); + $invoice_two = Invoice::find($this->decodePrimaryKey($invoice_two_hashed_id)); + $payment = Payment::find($this->decodePrimaryKey($payment_hashed_id)); + + $this->assertEquals(20, $invoice_one->company_ledger->sortByDesc('id')->first()->balance); + + //test balance + $this->assertEquals($invoice_one->amount, 20); + $this->assertEquals($invoice_one->balance, 0); + $this->assertEquals($invoice_two->amount, 20); + $this->assertEquals($invoice_two->balance, 0); + + $this->assertEquals($client->fresh()->paid_to_date, 40); + $this->assertEquals($client->balance, 0); + + //hydrate associated payment + $this->assertEquals($payment->amount, 40); + $this->assertEquals($payment->applied, 40); + + //delete invoice + $data = [ + 'ids' => [$invoice_one_hashed_id], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/bulk?action=delete', $data); + + $arr = $response->json(); + + $this->assertTrue($arr['data'][0]['is_deleted']); + + $this->assertEquals(20, $client->fresh()->paid_to_date); + $this->assertEquals(0, $client->fresh()->balance); + $this->assertEquals(20, $payment->fresh()->applied); + $this->assertEquals(20, $payment->fresh()->amount); + + $invoice_one = $invoice_one->fresh(); + + $this->assertTrue((bool)$invoice_one->is_deleted); + $this->assertNotNull($invoice_one->deleted_at); + + //restore invoice + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/bulk?action=restore', $data); + + $arr = $response->json(); + + $this->assertFalse($arr['data'][0]['is_deleted']); + + $invoice_one = $invoice_one->fresh(); + $this->assertFalse((bool)$invoice_one->is_deleted); + $this->assertNull($invoice_one->deleted_at); + + $payment = $payment->fresh(); + + $this->assertEquals(40, $payment->fresh()->applied); + $this->assertEquals(40, $payment->fresh()->amount); + $this->assertEquals(40, $client->fresh()->paid_to_date); + } +} diff --git a/tests/MockAccountData.php b/tests/MockAccountData.php index 6e973b4eb9..312c167e4d 100644 --- a/tests/MockAccountData.php +++ b/tests/MockAccountData.php @@ -47,6 +47,7 @@ use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Schema; +use Illuminate\Support\Facades\Storage; /** * Class MockAccountData. @@ -157,6 +158,9 @@ trait MockAccountData 'account_id' => $this->account->id, ]); + Storage::makeDirectory($this->company->company_key.'/documents', 0755, true); + Storage::makeDirectory($this->company->company_key.'/images', 0755, true); + $settings = CompanySettings::defaults(); $settings->company_logo = 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'; @@ -219,6 +223,10 @@ trait MockAccountData 'company_id' => $this->company->id, ]); + Storage::makeDirectory($this->company->company_key.'/'.$this->client->client_hash.'/invoices', 0755, true); + Storage::makeDirectory($this->company->company_key.'/'.$this->client->client_hash.'/credits', 0755, true); + Storage::makeDirectory($this->company->company_key.'/'.$this->client->client_hash.'/quotes', 0755, true); + $contact = ClientContact::factory()->create([ 'user_id' => $this->user->id, 'client_id' => $this->client->id,