From f4f11575edc644415e05d2d04150a0f49fb08903 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 07:52:51 +1100 Subject: [PATCH 01/38] Fixes for metadata column in Transaction Log --- app/DataMapper/Transactions/BaseTransaction.php | 2 +- app/Jobs/Ninja/TransactionLog.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/DataMapper/Transactions/BaseTransaction.php b/app/DataMapper/Transactions/BaseTransaction.php index 80d211d90733..da7b750c1c9d 100644 --- a/app/DataMapper/Transactions/BaseTransaction.php +++ b/app/DataMapper/Transactions/BaseTransaction.php @@ -66,7 +66,7 @@ class BaseTransaction implements TransactionInterface $data['payment'], $data['client'], $data['credit'], - $data['metadata'], + ['metadata' => $data['metadata']], ['event_id' => $this->event_id, 'timestamp' =>time()], ); // return [ diff --git a/app/Jobs/Ninja/TransactionLog.php b/app/Jobs/Ninja/TransactionLog.php index 06f9eef5a3ee..8694f65c1990 100644 --- a/app/Jobs/Ninja/TransactionLog.php +++ b/app/Jobs/Ninja/TransactionLog.php @@ -86,8 +86,8 @@ class TransactionLog implements ShouldQueue */ public function handle() { - if(!Ninja::isHosted()) - return; + // if(!Ninja::isHosted()) + // return; $this->setTransformer(); From 1a4479c6da2741328e8c4a89941c0bafd2e7f4fa Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 10:16:52 +1100 Subject: [PATCH 02/38] Fixes for composer --- composer.json | 2 +- composer.lock | 376 +++++++++++++++++++++++++------------------------- 2 files changed, 188 insertions(+), 190 deletions(-) diff --git a/composer.json b/composer.json index 01162773da55..010e7e819135 100644 --- a/composer.json +++ b/composer.json @@ -68,7 +68,7 @@ "livewire/livewire": "^2.6", "mollie/mollie-api-php": "^2.36", "nelexa/zip": "^4.0", - "nwidart/laravel-modules": "^8.0", + "nwidart/laravel-modules": "8.3", "omnipay/paypal": "^3.0", "payfast/payfast-php-sdk": "^1.1", "pragmarx/google2fa": "^8.0", diff --git a/composer.lock b/composer.lock index 75d9b6f6a86c..145b2d089581 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": "f92ff75d01d04fc5c6105ad78b57476b", + "content-hash": "7deb0e188126e67042fb4a872f0ad5fb", "packages": [ { "name": "afosto/yaac", @@ -110,16 +110,16 @@ }, { "name": "apimatic/unirest-php", - "version": "2.1.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/apimatic/unirest-php.git", - "reference": "e07351d5f70b445664e2dc4042bbc237ec7d4c93" + "reference": "847149c56d850081c07d5677e9647fa0c15e595f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/e07351d5f70b445664e2dc4042bbc237ec7d4c93", - "reference": "e07351d5f70b445664e2dc4042bbc237ec7d4c93", + "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/847149c56d850081c07d5677e9647fa0c15e595f", + "reference": "847149c56d850081c07d5677e9647fa0c15e595f", "shasum": "" }, "require": { @@ -168,9 +168,9 @@ "support": { "email": "opensource@apimatic.io", "issues": "https://github.com/apimatic/unirest-php/issues", - "source": "https://github.com/apimatic/unirest-php/tree/2.1.0" + "source": "https://github.com/apimatic/unirest-php/tree/2.2.1" }, - "time": "2021-11-12T05:20:21+00:00" + "time": "2022-03-12T08:37:06+00:00" }, { "name": "asm/php-ansible", @@ -374,16 +374,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.212.2", + "version": "3.212.7", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "dd2ff1ca2d7c37bfb7c3fed24cb8ad8bad604ec5" + "reference": "7f4c976df8a0fbe8d786e4b479d44e22478ce8af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/dd2ff1ca2d7c37bfb7c3fed24cb8ad8bad604ec5", - "reference": "dd2ff1ca2d7c37bfb7c3fed24cb8ad8bad604ec5", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7f4c976df8a0fbe8d786e4b479d44e22478ce8af", + "reference": "7f4c976df8a0fbe8d786e4b479d44e22478ce8af", "shasum": "" }, "require": { @@ -459,9 +459,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.212.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.212.7" }, - "time": "2022-03-04T19:27:01+00:00" + "time": "2022-03-11T19:14:33+00:00" }, { "name": "bacon/bacon-qr-code", @@ -1788,16 +1788,16 @@ }, { "name": "doctrine/dbal", - "version": "3.3.2", + "version": "3.3.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "35eae239ef515d55ebb24e9d4715cad09a4f58ed" + "reference": "82331b861727c15b1f457ef05a8729e508e7ead5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/35eae239ef515d55ebb24e9d4715cad09a4f58ed", - "reference": "35eae239ef515d55ebb24e9d4715cad09a4f58ed", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/82331b861727c15b1f457ef05a8729e508e7ead5", + "reference": "82331b861727c15b1f457ef05a8729e508e7ead5", "shasum": "" }, "require": { @@ -1812,14 +1812,14 @@ "require-dev": { "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2021.1", - "phpstan/phpstan": "1.4.0", + "phpstan/phpstan": "1.4.6", "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "9.5.11", + "phpunit/phpunit": "9.5.16", "psalm/plugin-phpunit": "0.16.1", "squizlabs/php_codesniffer": "3.6.2", "symfony/cache": "^5.2|^6.0", "symfony/console": "^2.7|^3.0|^4.0|^5.0|^6.0", - "vimeo/psalm": "4.16.1" + "vimeo/psalm": "4.22.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -1879,7 +1879,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.3.2" + "source": "https://github.com/doctrine/dbal/tree/3.3.3" }, "funding": [ { @@ -1895,7 +1895,7 @@ "type": "tidelift" } ], - "time": "2022-02-05T16:33:45+00:00" + "time": "2022-03-09T15:39:50+00:00" }, { "name": "doctrine/deprecations", @@ -2336,12 +2336,12 @@ "source": { "type": "git", "url": "https://github.com/eWAYPayment/eway-rapid-php.git", - "reference": "a3be37ad46f14038fb2c87d94ec9d8ad8560842a" + "reference": "5581c8279774aabe58ea3aca9bfd7f62759ce7cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/eWAYPayment/eway-rapid-php/zipball/a3be37ad46f14038fb2c87d94ec9d8ad8560842a", - "reference": "a3be37ad46f14038fb2c87d94ec9d8ad8560842a", + "url": "https://api.github.com/repos/eWAYPayment/eway-rapid-php/zipball/5581c8279774aabe58ea3aca9bfd7f62759ce7cd", + "reference": "5581c8279774aabe58ea3aca9bfd7f62759ce7cd", "shasum": "" }, "require": { @@ -2384,7 +2384,7 @@ "issues": "https://github.com/eWAYPayment/eway-rapid-php/issues", "source": "https://github.com/eWAYPayment/eway-rapid-php/tree/v1.4.0" }, - "time": "2021-11-25T11:39:45+00:00" + "time": "2021-12-08T00:21:16+00:00" }, { "name": "fakerphp/faker", @@ -2775,16 +2775,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.237.0", + "version": "v0.238.1", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "c10652adc29b4242237075acde318e83f88ab918" + "reference": "a9866fd963f53e9a7d26d36f20c471f73a90a719" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/c10652adc29b4242237075acde318e83f88ab918", - "reference": "c10652adc29b4242237075acde318e83f88ab918", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/a9866fd963f53e9a7d26d36f20c471f73a90a719", + "reference": "a9866fd963f53e9a7d26d36f20c471f73a90a719", "shasum": "" }, "require": { @@ -2813,9 +2813,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.237.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.238.1" }, - "time": "2022-02-23T22:58:02+00:00" + "time": "2022-03-07T18:23:49+00:00" }, { "name": "google/auth", @@ -3881,16 +3881,16 @@ }, { "name": "laravel/framework", - "version": "v8.83.3", + "version": "v8.83.4", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "b4ed222a188cca74ca9062296e525d26ae54a0ce" + "reference": "97a549f1a83cfb32dab1eecab4c4d40a984a72b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/b4ed222a188cca74ca9062296e525d26ae54a0ce", - "reference": "b4ed222a188cca74ca9062296e525d26ae54a0ce", + "url": "https://api.github.com/repos/laravel/framework/zipball/97a549f1a83cfb32dab1eecab4c4d40a984a72b5", + "reference": "97a549f1a83cfb32dab1eecab4c4d40a984a72b5", "shasum": "" }, "require": { @@ -4050,7 +4050,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-03-03T15:14:29+00:00" + "time": "2022-03-08T16:12:54+00:00" }, { "name": "laravel/serializable-closure", @@ -5265,41 +5265,44 @@ }, { "name": "moneyphp/money", - "version": "v3.3.1", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/moneyphp/money.git", - "reference": "122664c2621a95180a13c1ac81fea1d2ef20781e" + "reference": "d945f775bd6ab0920d9d205813d8831a899a8844" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/moneyphp/money/zipball/122664c2621a95180a13c1ac81fea1d2ef20781e", - "reference": "122664c2621a95180a13c1ac81fea1d2ef20781e", + "url": "https://api.github.com/repos/moneyphp/money/zipball/d945f775bd6ab0920d9d205813d8831a899a8844", + "reference": "d945f775bd6ab0920d9d205813d8831a899a8844", "shasum": "" }, "require": { + "ext-bcmath": "*", + "ext-filter": "*", "ext-json": "*", - "php": ">=5.6" + "php": "^8.0" }, "require-dev": { - "cache/taggable-cache": "^0.4.0", - "doctrine/instantiator": "^1.0.5", - "ext-bcmath": "*", + "cache/taggable-cache": "^1.1.0", + "doctrine/coding-standard": "^9.0", + "doctrine/instantiator": "^1.4.0", "ext-gmp": "*", "ext-intl": "*", - "florianv/exchanger": "^1.0", - "florianv/swap": "^3.0", - "friends-of-phpspec/phpspec-code-coverage": "^3.1.1 || ^4.3", + "florianv/exchanger": "^2.6.3", + "florianv/swap": "^4.3.0", "moneyphp/iso-currencies": "^3.2.1", - "php-http/message": "^1.4", - "php-http/mock-client": "^1.0.0", - "phpspec/phpspec": "^3.4.3", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.18 || ^8.5", - "psr/cache": "^1.0", - "symfony/phpunit-bridge": "^4" + "php-http/message": "^1.11.0", + "php-http/mock-client": "^1.4.1", + "phpbench/phpbench": "1.0.0-beta1@BETA", + "phpspec/phpspec": "^7.0.1", + "phpunit/phpunit": "^9.5.4", + "psalm/plugin-phpunit": "^0.15.1", + "psr/cache": "^1.0.1", + "roave/infection-static-analysis-plugin": "^1.7", + "vimeo/psalm": "~4.7.0 || ^4.8.2" }, "suggest": { - "ext-bcmath": "Calculate without integer limits", "ext-gmp": "Calculate without integer limits", "ext-intl": "Format Money objects with intl", "florianv/exchanger": "Exchange rates library for PHP", @@ -5345,9 +5348,9 @@ ], "support": { "issues": "https://github.com/moneyphp/money/issues", - "source": "https://github.com/moneyphp/money/tree/master" + "source": "https://github.com/moneyphp/money/tree/v4.0.3" }, - "time": "2020-03-18T17:49:59+00:00" + "time": "2021-12-01T10:39:00+00:00" }, { "name": "monolog/monolog", @@ -7889,16 +7892,16 @@ }, { "name": "razorpay/razorpay", - "version": "2.8.1", + "version": "v2.8.2", "source": { "type": "git", "url": "https://github.com/razorpay/razorpay-php.git", - "reference": "4ad7b6a5bd9896305858ec0a861f66020e39f628" + "reference": "f36ad5ec74522d2930ffad3b160dddc454e42f4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/razorpay/razorpay-php/zipball/4ad7b6a5bd9896305858ec0a861f66020e39f628", - "reference": "4ad7b6a5bd9896305858ec0a861f66020e39f628", + "url": "https://api.github.com/repos/razorpay/razorpay-php/zipball/f36ad5ec74522d2930ffad3b160dddc454e42f4d", + "reference": "f36ad5ec74522d2930ffad3b160dddc454e42f4d", "shasum": "" }, "require": { @@ -7947,7 +7950,7 @@ "issues": "https://github.com/Razorpay/razorpay-php/issues", "source": "https://github.com/Razorpay/razorpay-php" }, - "time": "2021-11-08T11:13:39+00:00" + "time": "2022-03-08T13:36:42+00:00" }, { "name": "react/promise", @@ -8867,21 +8870,20 @@ }, { "name": "symfony/css-selector", - "version": "v5.4.3", + "version": "v6.0.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b0a190285cd95cb019237851205b8140ef6e368e" + "reference": "1955d595c12c111629cc814d3f2a2ff13580508a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b0a190285cd95cb019237851205b8140ef6e368e", - "reference": "b0a190285cd95cb019237851205b8140ef6e368e", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/1955d595c12c111629cc814d3f2a2ff13580508a", + "reference": "1955d595c12c111629cc814d3f2a2ff13580508a", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.16" + "php": ">=8.0.2" }, "type": "library", "autoload": { @@ -8913,7 +8915,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.3" + "source": "https://github.com/symfony/css-selector/tree/v6.0.3" }, "funding": [ { @@ -8929,29 +8931,29 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -8980,7 +8982,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" }, "funding": [ { @@ -8996,7 +8998,7 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2021-11-01T23:48:49+00:00" }, { "name": "symfony/error-handler", @@ -9156,20 +9158,20 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/aa5422287b75594b90ee9cd807caf8f0df491385", + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "psr/event-dispatcher": "^1" }, "suggest": { @@ -9178,7 +9180,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -9215,7 +9217,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.0" }, "funding": [ { @@ -9231,20 +9233,20 @@ "type": "tidelift" } ], - "time": "2021-07-12T14:48:14+00:00" + "time": "2021-07-15T12:33:35+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.5", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "797680071ea8f71b94eb958680c50d0e002638f5" + "reference": "d53a45039974952af7f7ebc461ccdd4295e29440" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/797680071ea8f71b94eb958680c50d0e002638f5", - "reference": "797680071ea8f71b94eb958680c50d0e002638f5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d53a45039974952af7f7ebc461ccdd4295e29440", + "reference": "d53a45039974952af7f7ebc461ccdd4295e29440", "shasum": "" }, "require": { @@ -9279,7 +9281,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.5" + "source": "https://github.com/symfony/filesystem/tree/v5.4.6" }, "funding": [ { @@ -9295,7 +9297,7 @@ "type": "tidelift" } ], - "time": "2022-02-27T10:31:47+00:00" + "time": "2022-03-02T12:42:23+00:00" }, { "name": "symfony/finder", @@ -9527,16 +9529,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.4.5", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "dd68a3b24262a902bc338fc7c9a2a61b7ab2029f" + "reference": "34e89bc147633c0f9dd6caaaf56da3b806a21465" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/dd68a3b24262a902bc338fc7c9a2a61b7ab2029f", - "reference": "dd68a3b24262a902bc338fc7c9a2a61b7ab2029f", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/34e89bc147633c0f9dd6caaaf56da3b806a21465", + "reference": "34e89bc147633c0f9dd6caaaf56da3b806a21465", "shasum": "" }, "require": { @@ -9580,7 +9582,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.5" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.6" }, "funding": [ { @@ -9596,20 +9598,20 @@ "type": "tidelift" } ], - "time": "2022-02-21T15:00:19+00:00" + "time": "2022-03-05T21:03:43+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.5", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "c770c90bc71f1db911e2d996c991fdafe273ac84" + "reference": "d41f29ae9af1b5f40c7ebcddf09082953229411d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/c770c90bc71f1db911e2d996c991fdafe273ac84", - "reference": "c770c90bc71f1db911e2d996c991fdafe273ac84", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/d41f29ae9af1b5f40c7ebcddf09082953229411d", + "reference": "d41f29ae9af1b5f40c7ebcddf09082953229411d", "shasum": "" }, "require": { @@ -9692,7 +9694,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.5" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.6" }, "funding": [ { @@ -9708,7 +9710,7 @@ "type": "tidelift" } ], - "time": "2022-02-28T07:57:55+00:00" + "time": "2022-03-05T21:14:51+00:00" }, { "name": "symfony/mime", @@ -11003,22 +11005,21 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v2.4.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "d664541b99d6fb0247ec5ff32e87238582236204" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d664541b99d6fb0247ec5ff32e87238582236204", + "reference": "d664541b99d6fb0247ec5ff32e87238582236204", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" + "psr/container": "^1.1" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -11029,7 +11030,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -11066,7 +11067,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.4.1" }, "funding": [ { @@ -11082,38 +11083,37 @@ "type": "tidelift" } ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2021-11-04T16:37:19+00:00" }, { "name": "symfony/string", - "version": "v5.4.3", + "version": "v6.0.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", + "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2", + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2", "shasum": "" }, "require": { - "php": ">=7.2.5", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "~1.15" + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": ">=3.0" + "symfony/translation-contracts": "<2.0" }, "require-dev": { - "symfony/error-handler": "^4.4|^5.0|^6.0", - "symfony/http-client": "^4.4|^5.0|^6.0", - "symfony/translation-contracts": "^1.1|^2", - "symfony/var-exporter": "^4.4|^5.0|^6.0" + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/translation-contracts": "^2.0|^3.0", + "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", "autoload": { @@ -11152,7 +11152,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.3" + "source": "https://github.com/symfony/string/tree/v6.0.3" }, "funding": [ { @@ -11168,52 +11168,50 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/translation", - "version": "v5.4.5", + "version": "v6.0.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "7e4d52d39e5d86f3f04bef46fa29a1091786bc73" + "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/7e4d52d39e5d86f3f04bef46fa29a1091786bc73", - "reference": "7e4d52d39e5d86f3f04bef46fa29a1091786bc73", + "url": "https://api.github.com/repos/symfony/translation/zipball/f6639cb9b5e0c57fe31e3263b900a77eedb0c908", + "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908", "shasum": "" }, "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.0.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" + "symfony/translation-contracts": "^2.3|^3.0" }, "conflict": { - "symfony/config": "<4.4", - "symfony/console": "<5.3", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" }, "provide": { - "symfony/translation-implementation": "2.3" + "symfony/translation-implementation": "2.3|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", + "symfony/config": "^5.4|^6.0", "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", "symfony/polyfill-intl-icu": "^1.21", "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^4.4|^5.0|^6.0" + "symfony/yaml": "^5.4|^6.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -11249,7 +11247,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.5" + "source": "https://github.com/symfony/translation/tree/v6.0.6" }, "funding": [ { @@ -11265,24 +11263,24 @@ "type": "tidelift" } ], - "time": "2022-02-09T15:49:12+00:00" + "time": "2022-03-02T12:58:14+00:00" }, { "name": "symfony/translation-contracts", - "version": "v2.5.0", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", "shasum": "" }, "require": { - "php": ">=7.2.5" + "php": ">=8.0.2" }, "suggest": { "symfony/translation-implementation": "" @@ -11290,7 +11288,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -11327,7 +11325,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" }, "funding": [ { @@ -11343,20 +11341,20 @@ "type": "tidelift" } ], - "time": "2021-08-17T14:20:01+00:00" + "time": "2021-09-07T12:43:40+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.4.5", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "6efddb1cf6af5270b21c48c6103e81f920c220f0" + "reference": "294e9da6e2e0dd404e983daa5aa74253d92c05d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/6efddb1cf6af5270b21c48c6103e81f920c220f0", - "reference": "6efddb1cf6af5270b21c48c6103e81f920c220f0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/294e9da6e2e0dd404e983daa5aa74253d92c05d0", + "reference": "294e9da6e2e0dd404e983daa5aa74253d92c05d0", "shasum": "" }, "require": { @@ -11416,7 +11414,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.5" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.6" }, "funding": [ { @@ -11432,7 +11430,7 @@ "type": "tidelift" } ], - "time": "2022-02-21T15:00:19+00:00" + "time": "2022-03-02T12:42:23+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -13817,16 +13815,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.14", + "version": "9.2.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4" + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f4d60b6afe5546421462b76cd4e633ebc364ab4", - "reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", "shasum": "" }, "require": { @@ -13882,7 +13880,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.14" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" }, "funding": [ { @@ -13890,7 +13888,7 @@ "type": "github" } ], - "time": "2022-02-28T12:38:02+00:00" + "time": "2022-03-07T09:28:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -14135,16 +14133,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.16", + "version": "9.5.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5ff8c545a50226c569310a35f4fa89d79f1ddfdc" + "reference": "1b5856028273bfd855e60a887278857d872ec67a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5ff8c545a50226c569310a35f4fa89d79f1ddfdc", - "reference": "5ff8c545a50226c569310a35f4fa89d79f1ddfdc", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b5856028273bfd855e60a887278857d872ec67a", + "reference": "1b5856028273bfd855e60a887278857d872ec67a", "shasum": "" }, "require": { @@ -14222,7 +14220,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.16" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.18" }, "funding": [ { @@ -14234,7 +14232,7 @@ "type": "github" } ], - "time": "2022-02-23T17:10:58+00:00" + "time": "2022-03-08T06:52:28+00:00" }, { "name": "sebastian/cli-parser", @@ -15202,16 +15200,16 @@ }, { "name": "swagger-api/swagger-ui", - "version": "v4.6.1", + "version": "v4.6.2", "source": { "type": "git", "url": "https://github.com/swagger-api/swagger-ui.git", - "reference": "1dd3ef62adfd79c9a71cd046ff2b7c7bbabf2751" + "reference": "d191c1ca18443a77273e9912ac2603ce1f7dc216" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/1dd3ef62adfd79c9a71cd046ff2b7c7bbabf2751", - "reference": "1dd3ef62adfd79c9a71cd046ff2b7c7bbabf2751", + "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/d191c1ca18443a77273e9912ac2603ce1f7dc216", + "reference": "d191c1ca18443a77273e9912ac2603ce1f7dc216", "shasum": "" }, "type": "library", @@ -15257,9 +15255,9 @@ ], "support": { "issues": "https://github.com/swagger-api/swagger-ui/issues", - "source": "https://github.com/swagger-api/swagger-ui/tree/v4.6.1" + "source": "https://github.com/swagger-api/swagger-ui/tree/v4.6.2" }, - "time": "2022-03-02T21:44:06+00:00" + "time": "2022-03-10T11:36:38+00:00" }, { "name": "symfony/debug", @@ -15586,16 +15584,16 @@ }, { "name": "zircote/swagger-php", - "version": "4.2.10", + "version": "4.2.11", "source": { "type": "git", "url": "https://github.com/zircote/swagger-php.git", - "reference": "7263e95f5fff5524a697e2a75ceb6f9902453d01" + "reference": "1c7a04e381b07e14aae080a61e02f2fe9cdea424" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zircote/swagger-php/zipball/7263e95f5fff5524a697e2a75ceb6f9902453d01", - "reference": "7263e95f5fff5524a697e2a75ceb6f9902453d01", + "url": "https://api.github.com/repos/zircote/swagger-php/zipball/1c7a04e381b07e14aae080a61e02f2fe9cdea424", + "reference": "1c7a04e381b07e14aae080a61e02f2fe9cdea424", "shasum": "" }, "require": { @@ -15655,9 +15653,9 @@ ], "support": { "issues": "https://github.com/zircote/swagger-php/issues", - "source": "https://github.com/zircote/swagger-php/tree/4.2.10" + "source": "https://github.com/zircote/swagger-php/tree/4.2.11" }, - "time": "2022-03-04T01:21:38+00:00" + "time": "2022-03-06T19:16:21+00:00" } ], "aliases": [], @@ -15677,5 +15675,5 @@ "platform-dev": { "php": "^7.3|^7.4|^8.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.0.0" } From f1da2bebce029f8a7255bd6be655c68b73df31ab Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 10:30:38 +1100 Subject: [PATCH 03/38] Hide values with 0 in the invoice table --- app/Utils/Traits/MakesInvoiceValues.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 1cdb2f97b4a9..6f0b4ea02971 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -305,18 +305,18 @@ trait MakesInvoiceValues // 08-02-2022 - fix for regression below // $data[$key][$table_type.'.quantity'] = Number::formatValue($item->quantity, $this->client->currency()); - $data[$key][$table_type.'.quantity'] = Number::formatValueNoTrailingZeroes($item->quantity, $this->client->currency()); + $data[$key][$table_type.'.quantity'] = ($item->quantity == 0) ? '' : Number::formatValueNoTrailingZeroes($item->quantity, $this->client->currency()); - $data[$key][$table_type.'.unit_cost'] = Number::formatMoneyNoRounding($item->cost, $this->client); + $data[$key][$table_type.'.unit_cost'] = ($item->cost == 0) ? '' : Number::formatMoneyNoRounding($item->cost, $this->client); - $data[$key][$table_type.'.cost'] = Number::formatMoney($item->cost, $this->client); + $data[$key][$table_type.'.cost'] = ($item->cost == 0) ? '' : Number::formatMoney($item->cost, $this->client); - $data[$key][$table_type.'.line_total'] = Number::formatMoney($item->line_total, $this->client); + $data[$key][$table_type.'.line_total'] = ($item->line_total == 0) ? '' :Number::formatMoney($item->line_total, $this->client); if(property_exists($item, 'gross_line_total')) - $data[$key][$table_type.'.gross_line_total'] = Number::formatMoney($item->gross_line_total, $this->client); + $data[$key][$table_type.'.gross_line_total'] = ($item->gross_line_total == 0) ? '' :Number::formatMoney($item->gross_line_total, $this->client); else - $data[$key][$table_type.'.gross_line_total'] = 0; + $data[$key][$table_type.'.gross_line_total'] = ''; if (isset($item->discount) && $item->discount > 0) { if ($item->is_amount_discount) { From ddbe97187824ae2c56317d78577e9907a2187599 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 10:31:28 +1100 Subject: [PATCH 04/38] Fixes for composer dependencies with PHP 7.4 --- composer.lock | 194 +++++++++++++++++++++++++------------------------- 1 file changed, 98 insertions(+), 96 deletions(-) diff --git a/composer.lock b/composer.lock index 145b2d089581..ae7af92df81e 100644 --- a/composer.lock +++ b/composer.lock @@ -5265,44 +5265,41 @@ }, { "name": "moneyphp/money", - "version": "v4.0.3", + "version": "v3.3.1", "source": { "type": "git", "url": "https://github.com/moneyphp/money.git", - "reference": "d945f775bd6ab0920d9d205813d8831a899a8844" + "reference": "122664c2621a95180a13c1ac81fea1d2ef20781e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/moneyphp/money/zipball/d945f775bd6ab0920d9d205813d8831a899a8844", - "reference": "d945f775bd6ab0920d9d205813d8831a899a8844", + "url": "https://api.github.com/repos/moneyphp/money/zipball/122664c2621a95180a13c1ac81fea1d2ef20781e", + "reference": "122664c2621a95180a13c1ac81fea1d2ef20781e", "shasum": "" }, "require": { - "ext-bcmath": "*", - "ext-filter": "*", "ext-json": "*", - "php": "^8.0" + "php": ">=5.6" }, "require-dev": { - "cache/taggable-cache": "^1.1.0", - "doctrine/coding-standard": "^9.0", - "doctrine/instantiator": "^1.4.0", + "cache/taggable-cache": "^0.4.0", + "doctrine/instantiator": "^1.0.5", + "ext-bcmath": "*", "ext-gmp": "*", "ext-intl": "*", - "florianv/exchanger": "^2.6.3", - "florianv/swap": "^4.3.0", + "florianv/exchanger": "^1.0", + "florianv/swap": "^3.0", + "friends-of-phpspec/phpspec-code-coverage": "^3.1.1 || ^4.3", "moneyphp/iso-currencies": "^3.2.1", - "php-http/message": "^1.11.0", - "php-http/mock-client": "^1.4.1", - "phpbench/phpbench": "1.0.0-beta1@BETA", - "phpspec/phpspec": "^7.0.1", - "phpunit/phpunit": "^9.5.4", - "psalm/plugin-phpunit": "^0.15.1", - "psr/cache": "^1.0.1", - "roave/infection-static-analysis-plugin": "^1.7", - "vimeo/psalm": "~4.7.0 || ^4.8.2" + "php-http/message": "^1.4", + "php-http/mock-client": "^1.0.0", + "phpspec/phpspec": "^3.4.3", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.18 || ^8.5", + "psr/cache": "^1.0", + "symfony/phpunit-bridge": "^4" }, "suggest": { + "ext-bcmath": "Calculate without integer limits", "ext-gmp": "Calculate without integer limits", "ext-intl": "Format Money objects with intl", "florianv/exchanger": "Exchange rates library for PHP", @@ -5348,9 +5345,9 @@ ], "support": { "issues": "https://github.com/moneyphp/money/issues", - "source": "https://github.com/moneyphp/money/tree/v4.0.3" + "source": "https://github.com/moneyphp/money/tree/master" }, - "time": "2021-12-01T10:39:00+00:00" + "time": "2020-03-18T17:49:59+00:00" }, { "name": "monolog/monolog", @@ -8870,20 +8867,21 @@ }, { "name": "symfony/css-selector", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "1955d595c12c111629cc814d3f2a2ff13580508a" + "reference": "b0a190285cd95cb019237851205b8140ef6e368e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/1955d595c12c111629cc814d3f2a2ff13580508a", - "reference": "1955d595c12c111629cc814d3f2a2ff13580508a", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b0a190285cd95cb019237851205b8140ef6e368e", + "reference": "b0a190285cd95cb019237851205b8140ef6e368e", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -8915,7 +8913,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.0.3" + "source": "https://github.com/symfony/css-selector/tree/v5.4.3" }, "funding": [ { @@ -8931,29 +8929,29 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", - "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -8982,7 +8980,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" }, "funding": [ { @@ -8998,7 +8996,7 @@ "type": "tidelift" } ], - "time": "2021-11-01T23:48:49+00:00" + "time": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/error-handler", @@ -9158,20 +9156,20 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.0.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "aa5422287b75594b90ee9cd807caf8f0df491385" + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/aa5422287b75594b90ee9cd807caf8f0df491385", - "reference": "aa5422287b75594b90ee9cd807caf8f0df491385", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "psr/event-dispatcher": "^1" }, "suggest": { @@ -9180,7 +9178,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -9217,7 +9215,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" }, "funding": [ { @@ -9233,7 +9231,7 @@ "type": "tidelift" } ], - "time": "2021-07-15T12:33:35+00:00" + "time": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/filesystem", @@ -11005,21 +11003,22 @@ }, { "name": "symfony/service-contracts", - "version": "v2.4.1", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d664541b99d6fb0247ec5ff32e87238582236204" + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d664541b99d6fb0247ec5ff32e87238582236204", - "reference": "d664541b99d6fb0247ec5ff32e87238582236204", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.1" + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" }, "conflict": { "ext-psr": "<1.1|>=2" @@ -11030,7 +11029,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -11067,7 +11066,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.1" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" }, "funding": [ { @@ -11083,37 +11082,38 @@ "type": "tidelift" } ], - "time": "2021-11-04T16:37:19+00:00" + "time": "2021-11-04T16:48:04+00:00" }, { "name": "symfony/string", - "version": "v6.0.3", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2" + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2", - "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2", + "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": ">=3.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "type": "library", "autoload": { @@ -11152,7 +11152,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.3" + "source": "https://github.com/symfony/string/tree/v5.4.3" }, "funding": [ { @@ -11168,50 +11168,52 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/translation", - "version": "v6.0.6", + "version": "v5.4.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908" + "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f6639cb9b5e0c57fe31e3263b900a77eedb0c908", - "reference": "f6639cb9b5e0c57fe31e3263b900a77eedb0c908", + "url": "https://api.github.com/repos/symfony/translation/zipball/a7ca9fdfffb0174209440c2ffa1dee228e15d95b", + "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^2.3|^3.0" + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^2.3" }, "conflict": { - "symfony/config": "<5.4", - "symfony/console": "<5.4", - "symfony/dependency-injection": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/twig-bundle": "<5.4", - "symfony/yaml": "<5.4" + "symfony/config": "<4.4", + "symfony/console": "<5.3", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" }, "provide": { - "symfony/translation-implementation": "2.3|3.0" + "symfony/translation-implementation": "2.3" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", + "symfony/config": "^4.4|^5.0|^6.0", "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", + "symfony/dependency-injection": "^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/intl": "^5.4|^6.0", + "symfony/http-kernel": "^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", "symfony/polyfill-intl-icu": "^1.21", "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^5.4|^6.0" + "symfony/yaml": "^4.4|^5.0|^6.0" }, "suggest": { "psr/log-implementation": "To use logging capability in translator", @@ -11247,7 +11249,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v6.0.6" + "source": "https://github.com/symfony/translation/tree/v5.4.6" }, "funding": [ { @@ -11263,24 +11265,24 @@ "type": "tidelift" } ], - "time": "2022-03-02T12:58:14+00:00" + "time": "2022-03-02T12:56:28+00:00" }, { "name": "symfony/translation-contracts", - "version": "v3.0.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77" + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", - "reference": "1b6ea5a7442af5a12dba3dbd6d71034b5b234e77", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", + "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.2.5" }, "suggest": { "symfony/translation-implementation": "" @@ -11288,7 +11290,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -11325,7 +11327,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v3.0.0" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" }, "funding": [ { @@ -11341,7 +11343,7 @@ "type": "tidelift" } ], - "time": "2021-09-07T12:43:40+00:00" + "time": "2021-08-17T14:20:01+00:00" }, { "name": "symfony/var-dumper", From 00e070bd1b38671bc5d6ab9bb6338ead6750ff65 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 11:02:00 +1100 Subject: [PATCH 05/38] TruthSource in Login --- app/Http/Controllers/Auth/LoginController.php | 6 ++++++ app/Http/Middleware/TokenAuth.php | 1 + 2 files changed, 7 insertions(+) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 7e0993d30d70..1cd89bf2643c 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -217,6 +217,12 @@ class LoginController extends BaseController $cu = CompanyUser::query() ->where('user_id', auth()->user()->id); + $truth = app()->make(TruthSource::class); + + $truth->setCompanyUser($cu->first()); + $truth->setUser(auth()->user()); + $truth->setCompany($user->account->default_company); + if(!$cu->exists()) return response()->json(['message' => 'User not linked to any companies'], 403); diff --git a/app/Http/Middleware/TokenAuth.php b/app/Http/Middleware/TokenAuth.php index 53924c89cc17..4778719a04f2 100644 --- a/app/Http/Middleware/TokenAuth.php +++ b/app/Http/Middleware/TokenAuth.php @@ -32,6 +32,7 @@ class TokenAuth public function handle($request, Closure $next) { if ($request->header('X-API-TOKEN') && ($company_token = CompanyToken::with(['user', 'company', 'cu'])->where('token', $request->header('X-API-TOKEN'))->first())) { + $user = $company_token->user; $error = [ From c56a9688e8ff544a7ffe0f1d34acb73347c8bfe5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 12:35:05 +1100 Subject: [PATCH 06/38] Refund emails --- app/Jobs/Payment/EmailRefundPayment.php | 108 ++++++++++++++++++++++++ app/Models/Payment.php | 2 - app/Services/Payment/RefundPayment.php | 5 ++ 3 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 app/Jobs/Payment/EmailRefundPayment.php diff --git a/app/Jobs/Payment/EmailRefundPayment.php b/app/Jobs/Payment/EmailRefundPayment.php new file mode 100644 index 000000000000..6096061f6eef --- /dev/null +++ b/app/Jobs/Payment/EmailRefundPayment.php @@ -0,0 +1,108 @@ +payment = $payment; + $this->contact = $contact; + $this->company = $company; + $this->settings = $payment->client->getMergedSettings(); + } + + /** + * Execute the job. + * + * + * @return void + */ + public function handle() + { + if ($this->company->is_disabled) + return true; + + if ($this->contact->email) { + + MultiDB::setDb($this->company->db); + + $this->payment->load('invoices'); + $this->contact->load('client'); + + App::forgetInstance('translator'); + $t = app('translator'); + App::setLocale($this->contact->preferredLocale()); + $t->replace(Ninja::transformTranslations($this->settings)); + + $template_data['body'] = ''; + $template_data['subject'] = ''; + + $email_builder = (new PaymentEmailEngine($this->payment, $this->contact, $template_data))->build(); + + $invitation = null; + + if($this->payment->invoices && $this->payment->invoices->count() >=1) + $invitation = $this->payment->invoices->first()->invitations()->first(); + + $nmo = new NinjaMailerObject; + $nmo->mailable = new TemplateEmail($email_builder, $this->contact, $invitation); + $nmo->to_user = $this->contact; + $nmo->settings = $this->settings; + $nmo->company = $this->company; + $nmo->entity = $this->payment; + + NinjaMailerJob::dispatch($nmo); + + event(new PaymentWasEmailed($this->payment, $this->payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); + } + } +} diff --git a/app/Models/Payment.php b/app/Models/Payment.php index 113d9a1cde4c..584fef37652e 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -232,8 +232,6 @@ class Payment extends BaseModel public function refund(array $data) :self { return $this->service()->refundPayment($data); - - //return $this->processRefund($data); } /** diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index d846989cf8f3..c63ebc383404 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -64,6 +64,11 @@ class RefundPayment ->processGatewayRefund() //process the gateway refund if needed ->save(); + + if(array_key_exists('email_receipt', $this->refund_data) && $this->refund_data['email_receipt'] == 'true'){ + // $this->payment->service()->sendEmail(); + } + $transaction = [ 'invoice' => [], 'payment' => $this->payment->transaction_event(), From c1bf578658b4d99f16f51f6297887675710855ef Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 14:39:44 +1100 Subject: [PATCH 07/38] Refund payment receipts --- app/Jobs/Payment/EmailRefundPayment.php | 4 ++-- app/Services/Payment/RefundPayment.php | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Payment/EmailRefundPayment.php b/app/Jobs/Payment/EmailRefundPayment.php index 6096061f6eef..8539cceb550c 100644 --- a/app/Jobs/Payment/EmailRefundPayment.php +++ b/app/Jobs/Payment/EmailRefundPayment.php @@ -83,8 +83,8 @@ class EmailRefundPayment implements ShouldQueue App::setLocale($this->contact->preferredLocale()); $t->replace(Ninja::transformTranslations($this->settings)); - $template_data['body'] = ''; - $template_data['subject'] = ''; + $template_data['body'] = ctrans('texts.refunded_payment') . ' $amount

$invoices'; + $template_data['subject'] = ctrans('texts.refunded_payment'); $email_builder = (new PaymentEmailEngine($this->payment, $this->contact, $template_data))->build(); diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index c63ebc383404..cdf86f2d0f9b 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -15,6 +15,7 @@ use App\Exceptions\PaymentRefundFailed; use App\Factory\CreditFactory; use App\Factory\InvoiceItemFactory; use App\Jobs\Ninja\TransactionLog; +use App\Jobs\Payment\EmailRefundPayment; use App\Models\Activity; use App\Models\Credit; use App\Models\Invoice; @@ -66,7 +67,10 @@ class RefundPayment if(array_key_exists('email_receipt', $this->refund_data) && $this->refund_data['email_receipt'] == 'true'){ - // $this->payment->service()->sendEmail(); + + $contact = $this->payment->client->contacts()->whereNotNull('email')->first(); + EmailRefundPayment::dispatch($this->payment, $this->payment->company, $contact); + } $transaction = [ From 172e5be31eaa2c3dba7a7bd1b1f7b7358c674701 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 15:22:19 +1100 Subject: [PATCH 08/38] Fixes for refunded payment --- app/Jobs/Payment/EmailRefundPayment.php | 2 +- app/Mail/Engine/PaymentEmailEngine.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Payment/EmailRefundPayment.php b/app/Jobs/Payment/EmailRefundPayment.php index 8539cceb550c..6059fecb293e 100644 --- a/app/Jobs/Payment/EmailRefundPayment.php +++ b/app/Jobs/Payment/EmailRefundPayment.php @@ -83,7 +83,7 @@ class EmailRefundPayment implements ShouldQueue App::setLocale($this->contact->preferredLocale()); $t->replace(Ninja::transformTranslations($this->settings)); - $template_data['body'] = ctrans('texts.refunded_payment') . ' $amount

$invoices'; + $template_data['body'] = ctrans('texts.refunded_payment') . ' $payment.refunded

$invoices'; $template_data['subject'] = ctrans('texts.refunded_payment'); $email_builder = (new PaymentEmailEngine($this->payment, $this->contact, $template_data))->build(); diff --git a/app/Mail/Engine/PaymentEmailEngine.php b/app/Mail/Engine/PaymentEmailEngine.php index 28f3220660c8..76ed96493fd2 100644 --- a/app/Mail/Engine/PaymentEmailEngine.php +++ b/app/Mail/Engine/PaymentEmailEngine.php @@ -143,6 +143,7 @@ class PaymentEmailEngine extends BaseEmailEngine $data['$payment.number'] = &$data['$number']; $data['$entity'] = ['value' => '', 'label' => ctrans('texts.payment')]; $data['$payment.amount'] = ['value' => Number::formatMoney($this->payment->amount, $this->client) ?: ' ', 'label' => ctrans('texts.amount')]; + $data['$payment.refunded'] = ['value' => Number::formatMoney($this->payment->refunded, $this->client) ?: ' ', 'label' => ctrans('texts.refund')]; $data['$amount'] = &$data['$payment.amount']; $data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')]; $data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')]; From c0ef536ae95e998292eb42e8907fa0085da6f437 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 17:17:26 +1100 Subject: [PATCH 09/38] Invoice documents for tasks --- app/Models/Invoice.php | 5 ++++ .../components/entity-documents.blade.php | 23 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index a46dc761016a..30d4128cd318 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -228,6 +228,11 @@ class Invoice extends BaseModel return $this->hasMany(Task::class); } + public function task() + { + return $this->hasOne(Task::class); + } + public function expenses() { return $this->hasMany(Expense::class); diff --git a/resources/views/portal/ninja2020/components/entity-documents.blade.php b/resources/views/portal/ninja2020/components/entity-documents.blade.php index b58b4abb4b4d..708c9bc6686e 100644 --- a/resources/views/portal/ninja2020/components/entity-documents.blade.php +++ b/resources/views/portal/ninja2020/components/entity-documents.blade.php @@ -1,4 +1,4 @@ -@if ($entity->documents->count() > 0 || $entity->company->documents->count() > 0 || ($entity->expense && $entity->expense->invoice_documents)) +@if ($entity->documents->count() > 0 || $entity->company->documents->count() > 0 || ($entity->expense && $entity->expense->invoice_documents) || ($entity->task && $entity->company->invoice_task_documents))
@@ -62,6 +62,27 @@
@endforeach @endif + + @if($entity->task && $entity->task->invoice_documents) + @foreach ($entity->task->documents as $document) +
+ {{ Illuminate\Support\Str::limit($document->name, 40) }} + + + + + + + + @if (!$loop->last) + + @endif +
+ @endforeach + @endif
From 2f4cc673d5d8090a7fe7c9cbd332c26d9b5ba64c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 17:23:00 +1100 Subject: [PATCH 10/38] Show task documents on invoices --- .../portal/ninja2020/components/entity-documents.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/portal/ninja2020/components/entity-documents.blade.php b/resources/views/portal/ninja2020/components/entity-documents.blade.php index 708c9bc6686e..72fda48ec4ba 100644 --- a/resources/views/portal/ninja2020/components/entity-documents.blade.php +++ b/resources/views/portal/ninja2020/components/entity-documents.blade.php @@ -63,7 +63,7 @@ @endforeach @endif - @if($entity->task && $entity->task->invoice_documents) + @if($entity->task && $entity->company->invoice_task_documents) @foreach ($entity->task->documents as $document)
Date: Mon, 14 Mar 2022 18:20:14 +1100 Subject: [PATCH 11/38] On new company create - check is_large flag --- app/Http/Controllers/CompanyController.php | 8 ++++++-- app/Jobs/Ninja/CompanySizeCheck.php | 11 ----------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index 7d6e0814df3c..16ea05ceb235 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -14,6 +14,7 @@ namespace App\Http\Controllers; use App\DataMapper\Analytics\AccountDeleted; use App\DataMapper\CompanySettings; use App\DataMapper\DefaultSettings; +use App\Factory\CompanyFactory; use App\Http\Requests\Company\CreateCompanyRequest; use App\Http\Requests\Company\DefaultCompanyRequest; use App\Http\Requests\Company\DestroyCompanyRequest; @@ -229,9 +230,13 @@ class CompanyController extends BaseController 'permissions' => '', 'settings' => null, 'notifications' => CompanySettings::notificationDefaults(), - //'settings' => DefaultSettings::userSettings(), ]); + if(auth()->user()->company()->account->companies()->where('is_large', 1)->exists()) + { + $company->account->companies()->update(['is_large' => true]); + } + /* * Required dependencies */ @@ -417,7 +422,6 @@ class CompanyController extends BaseController if ($request->hasFile('company_logo') || (is_array($request->input('settings')) && !array_key_exists('company_logo', $request->input('settings')))) $this->removeLogo($company); - $company = $this->company_repo->save($request->all(), $company); $company->saveSettings($request->input('settings'), $company); diff --git a/app/Jobs/Ninja/CompanySizeCheck.php b/app/Jobs/Ninja/CompanySizeCheck.php index 79a530d1eb01..def948a3b122 100644 --- a/app/Jobs/Ninja/CompanySizeCheck.php +++ b/app/Jobs/Ninja/CompanySizeCheck.php @@ -69,16 +69,5 @@ class CompanySizeCheck implements ShouldQueue }); - // Company::where('is_large', false)->cursor()->each(function ($company) { - - // if ($company->invoices()->count() > 500 || $company->products()->count() > 500 || $company->clients()->count() > 500) { - - // nlog("Marking company {$company->id} as large"); - - // $company->account->companies->update(['is_large' => true]) - - // } - - // }); } } From b9073c4276063de8d3ab04450a49ee225a07eca7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Mar 2022 20:52:38 +1100 Subject: [PATCH 12/38] Fixes for delete payment --- app/Services/Payment/DeletePayment.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/Payment/DeletePayment.php b/app/Services/Payment/DeletePayment.php index 654448a8d6d4..f4f630bd701e 100644 --- a/app/Services/Payment/DeletePayment.php +++ b/app/Services/Payment/DeletePayment.php @@ -90,6 +90,8 @@ class DeletePayment if(!$paymentable_invoice->is_deleted) { + $paymentable_invoice->restore(); + $paymentable_invoice->service() ->updateBalance($net_deletable) ->updatePaidToDate($net_deletable * -1) @@ -112,6 +114,8 @@ class DeletePayment } else { + $paymentable_invoice->restore(); + //If the invoice is deleted we only update the meta data on the invoice //and reduce the clients paid to date $paymentable_invoice->service() From a0b22f5339095eb3202cad767ae1b91824bda13a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 06:04:13 +1100 Subject: [PATCH 13/38] Fixes for company token resolution --- app/Transformers/CompanyUserTransformer.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/Transformers/CompanyUserTransformer.php b/app/Transformers/CompanyUserTransformer.php index 88d90cfede67..1f63e2716b3d 100644 --- a/app/Transformers/CompanyUserTransformer.php +++ b/app/Transformers/CompanyUserTransformer.php @@ -16,7 +16,6 @@ use App\Models\Company; use App\Models\CompanyToken; use App\Models\CompanyUser; use App\Models\User; -use App\Utils\TruthSource; class CompanyUserTransformer extends EntityTransformer { @@ -80,12 +79,7 @@ class CompanyUserTransformer extends EntityTransformer public function includeToken(CompanyUser $company_user) { - $truth = app()->make(TruthSource::class); - - if($truth->getCompanyToken()) - $token = $truth->getCompanyToken(); - else - $token = $company_user->tokens->where('company_id', $company_user->company_id)->where('user_id', $company_user->user_id)->first(); + $token = $company_user->tokens->where('company_id', $company_user->company_id)->where('user_id', $company_user->user_id)->first(); $transformer = new CompanyTokenTransformer($this->serializer); From dcc724b667a956f04a53aec9c20c02c93b574609 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 07:12:37 +1100 Subject: [PATCH 14/38] Ensure queue state is sane --- app/Models/User.php | 2 -- app/Providers/AppServiceProvider.php | 16 +++++----------- .../components/livewire/payments-table.blade.php | 3 +-- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 9fd2be78bc3e..2b4210ca7174 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -190,9 +190,7 @@ class User extends Authenticatable implements MustVerifyEmail $truth = app()->make(TruthSource::class); if ($this->company){ - return $this->company; - } elseif($truth->getCompany()){ return $truth->getCompany(); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2206abe686fb..ee6c6775d724 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -19,6 +19,7 @@ use App\Utils\TruthSource; use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Queue\Events\JobProcessing; +use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Queue; use Illuminate\Support\Facades\RateLimiter; @@ -61,17 +62,10 @@ class AppServiceProvider extends ServiceProvider ]); } - // Queue::before(function (JobProcessing $event) { - // // \Log::info('Event Job '.$event->connectionName); - // \Log::error('Event Job '.$event->job->getJobId); - // // \Log::info('Event Job '.$event->job->payload()); - // }); - //! Update Posted AT - // Queue::after(function (JobProcessed $event) { - // // \Log::info('Event Job '.$event->connectionName); - // \Log::error('Event Job '.$event->job->getJobId); - // // \Log::info('Event Job '.$event->job->payload()); - // }); + /* Ensure we don't have stale state in jobs */ + Queue::before(function (JobProcessing $event) { + App::forgetInstance('truthsource'); + }); app()->instance(TruthSource::class, new TruthSource()); diff --git a/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php b/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php index 9797ed1f22a5..1c9c5010d8b5 100644 --- a/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/payments-table.blade.php @@ -57,8 +57,7 @@ {{ $payment->translateDate($payment->date, $payment->client->date_format(), $payment->client->locale()) }} - - {{ $payment->translatedType(); }} + {{ $payment->translatedType() }} {!! \App\Utils\Number::formatMoney($payment->amount, $payment->client) !!} From bc0f81b55acec19835aa375322254a4120d64b13 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 08:24:17 +1100 Subject: [PATCH 15/38] Improve ACH verification text --- app/Mail/Engine/PaymentEmailEngine.php | 2 ++ app/Utils/HtmlEngine.php | 1 - resources/lang/en/texts.php | 2 +- .../portal/ninja2020/gateways/stripe/ach/verify.blade.php | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Mail/Engine/PaymentEmailEngine.php b/app/Mail/Engine/PaymentEmailEngine.php index 76ed96493fd2..f349ed072908 100644 --- a/app/Mail/Engine/PaymentEmailEngine.php +++ b/app/Mail/Engine/PaymentEmailEngine.php @@ -231,12 +231,14 @@ class PaymentEmailEngine extends BaseEmailEngine $data['$view_link'] = ['value' => ''.ctrans('texts.view_payment').'', 'label' => ctrans('texts.view_payment')]; $data['$view_button'] = &$data['$view_link']; + $data['$viewLink'] = &$data['$view_link']; $data['$paymentLink'] = &$data['$view_link']; $data['$portalButton'] = ['value' => "".ctrans('texts.login')."", 'label' =>'']; $data['$portal_url'] = &$data['$portalButton']; $data['$view_url'] = ['value' => $this->payment->getLink(), 'label' => ctrans('texts.view_payment')]; $data['$signature'] = ['value' => $this->settings->email_signature ?: ' ', 'label' => '']; + $data['$emailSignature'] = &$data['$signature']; $data['$invoices'] = ['value' => $this->formatInvoices(), 'label' => ctrans('texts.invoices')]; $data['$invoice_references'] = ['value' => $this->formatInvoiceReferences(), 'label' => ctrans('texts.invoices')]; diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index b42579eafaf3..1aaff8552e8c 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -541,7 +541,6 @@ class HtmlEngine $data['$payments'] = ['value' => $payment_list, 'label' => ctrans('texts.payments')]; } - $arrKeysLength = array_map('strlen', array_keys($data)); array_multisort($arrKeysLength, SORT_DESC, $data); diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 900e67e71223..dd23ac320e87 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -4279,7 +4279,7 @@ $LANG = array( 'company_import_failure_subject' => 'Error importing :company', 'company_import_failure_body' => 'There was an error importing the company data, the error message was:', 'recurring_invoice_due_date' => 'Due Date', - 'amount_cents' => 'Amount in pennies,pence or cents', + 'amount_cents' => 'Amount in pennies,pence or cents. ie for $0.10 please enter 10', 'default_payment_method_label' => 'Default Payment Method', 'default_payment_method' => 'Make this your preferred way of paying.', 'already_default_payment_method' => 'This is your preferred way of paying.', diff --git a/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php b/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php index fa4465b2e701..736b99a31a76 100644 --- a/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php +++ b/resources/views/portal/ninja2020/gateways/stripe/ach/verify.blade.php @@ -11,7 +11,7 @@ @component('portal.ninja2020.components.general.card-element', ['title' => '#1 ' . ctrans('texts.amount_cents')]) - + @error('transactions.0')
@@ -21,7 +21,7 @@ @endcomponent @component('portal.ninja2020.components.general.card-element', ['title' => '#2 ' . ctrans('texts.amount_cents')]) - + @error('transactions.1')
From c6b4721d61ec7e6a9916346f03f1c8d888192321 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 09:30:19 +1100 Subject: [PATCH 16/38] Bulk download documents --- app/Http/Controllers/DocumentController.php | 8 +- app/Jobs/Document/ZipDocuments.php | 118 ++++++++++++++++++ app/Mail/DownloadDocuments.php | 56 +++++++++ app/Models/Company.php | 5 + app/Models/Document.php | 5 + resources/lang/en/texts.php | 1 + .../email/admin/download_documents.blade.php | 10 ++ .../admin/download_documents_text.blade.php | 5 + .../admin/download_invoices_text.blade.php | 2 +- 9 files changed, 208 insertions(+), 2 deletions(-) create mode 100644 app/Jobs/Document/ZipDocuments.php create mode 100644 app/Mail/DownloadDocuments.php create mode 100644 resources/views/email/admin/download_documents.blade.php create mode 100644 resources/views/email/admin/download_documents_text.blade.php diff --git a/app/Http/Controllers/DocumentController.php b/app/Http/Controllers/DocumentController.php index 4d0e81101eb1..4db5a77d9c51 100644 --- a/app/Http/Controllers/DocumentController.php +++ b/app/Http/Controllers/DocumentController.php @@ -173,10 +173,16 @@ class DocumentController extends BaseController $documents = Document::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()->get(); - if (! $invoices) { + if (! $documents) { return response()->json(['message' => ctrans('texts.no_documents_found')]); } + if($action == 'download'){ + + ZipDocuments::dispatch($documents->pluck('id'), auth()->user()->company(), auth()->user()); + + return response()->json(['message' => ctrans('texts.sent_message')], 200); + } /* * Send the other actions to the switch */ diff --git a/app/Jobs/Document/ZipDocuments.php b/app/Jobs/Document/ZipDocuments.php new file mode 100644 index 000000000000..12312acb207e --- /dev/null +++ b/app/Jobs/Document/ZipDocuments.php @@ -0,0 +1,118 @@ +document_ids = $document_ids; + + $this->company = $company; + + $this->user = $user; + + $this->settings = $company->settings; + } + + /** + * Execute the job. + * + * @return void + * @throws \ZipStream\Exception\FileNotFoundException + * @throws \ZipStream\Exception\FileNotReadableException + * @throws \ZipStream\Exception\OverflowException + */ + + public function handle() + { + MultiDB::setDb($this->company->db); + + # create new zip object + $zipFile = new \PhpZip\ZipFile(); + $file_name = date('Y-m-d').'_'.str_replace(' ', '_', trans('texts.documents')).'.zip'; + $path = $this->company->file_path(); + + try{ + + $documents = Document::whereIn('id', $this->document_ids)->get(); + + foreach ($documents as $document) { + + $zipFile->addFromString($document->name, $document->getFile()); + + } + + Storage::put($path.$file_name, $zipFile->outputAsString()); + + $nmo = new NinjaMailerObject; + $nmo->mailable = new DownloadDocuments(Storage::url($path.$file_name), $this->company); + $nmo->to_user = $this->user; + $nmo->settings = $this->settings; + $nmo->company = $this->company; + + NinjaMailerJob::dispatch($nmo); + + UnlinkFile::dispatch(config('filesystems.default'), $path.$file_name)->delay(now()->addHours(1)); + + } + catch(\PhpZip\Exception\ZipException $e){ + nlog("could not make zip => ". $e->getMessage()); + } + finally{ + $zipFile->close(); + } + + + } + +} diff --git a/app/Mail/DownloadDocuments.php b/app/Mail/DownloadDocuments.php new file mode 100644 index 000000000000..bc40f45971cd --- /dev/null +++ b/app/Mail/DownloadDocuments.php @@ -0,0 +1,56 @@ +file_path = $file_path; + + $this->company = $company; + } + + /** + * Build the message. + */ + public function build() + { + + App::setLocale($this->company->getLocale()); + + return $this->from(config('mail.from.address'), config('mail.from.name')) + ->subject(ctrans('texts.download_files')) + ->text('email.admin.download_documents_text', [ + 'url' => $this->file_path, + ]) + ->view('email.admin.download_documents', [ + 'url' => $this->file_path, + 'logo' => $this->company->present()->logo, + 'whitelabel' => $this->company->account->isPaid() ? true : false, + 'settings' => $this->company->settings, + 'greeting' => $this->company->present()->name(), + ]); + } +} diff --git a/app/Models/Company.php b/app/Models/Company.php index 0bfa5e1431cd..3caf9d00e612 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -508,6 +508,11 @@ class Company extends BaseModel return $this->slack_webhook_url; } + public function file_path() + { + return $this->company_key.'/'; + } + public function rBits() { $user = $this->owner(); diff --git a/app/Models/Document.php b/app/Models/Document.php index cddd583321ea..2428c301c57a 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -135,4 +135,9 @@ class Document extends BaseModel { return Storage::disk($this->disk)->path($this->url); } + + public function getFile() + { + return Storage::get($this->filePath()); + } } diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index dd23ac320e87..b591ae905d23 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -4568,6 +4568,7 @@ $LANG = array( 'small' => 'Small', 'quotes_backup_subject' => 'Your quotes are ready for download', 'credits_backup_subject' => 'Your credits are ready for download', + 'document_download_subject' => 'Your documents are ready for download', ); diff --git a/resources/views/email/admin/download_documents.blade.php b/resources/views/email/admin/download_documents.blade.php new file mode 100644 index 000000000000..a428452a1953 --- /dev/null +++ b/resources/views/email/admin/download_documents.blade.php @@ -0,0 +1,10 @@ +@component('email.template.admin', ['logo' => $logo, 'settings' => $settings]) +
+

{{ ctrans('texts.document_download_subject') }}

+

{{ ctrans('texts.download_timeframe') }}

+ + + {{ ctrans('texts.download') }} + +
+@endcomponent diff --git a/resources/views/email/admin/download_documents_text.blade.php b/resources/views/email/admin/download_documents_text.blade.php new file mode 100644 index 000000000000..c39d09549ae8 --- /dev/null +++ b/resources/views/email/admin/download_documents_text.blade.php @@ -0,0 +1,5 @@ +{!! ctrans('texts.invoices_backup_subject') !!} + +{!! ctrans('texts.download_timeframe') !!} + +{!! $url !!} \ No newline at end of file diff --git a/resources/views/email/admin/download_invoices_text.blade.php b/resources/views/email/admin/download_invoices_text.blade.php index c39d09549ae8..13c4cd4c4dc2 100644 --- a/resources/views/email/admin/download_invoices_text.blade.php +++ b/resources/views/email/admin/download_invoices_text.blade.php @@ -1,4 +1,4 @@ -{!! ctrans('texts.invoices_backup_subject') !!} +{!! ctrans('texts.document_download_subject') !!} {!! ctrans('texts.download_timeframe') !!} From cf2d5320d99dbe6204f51b91e1bfa32c15095b49 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 09:36:32 +1100 Subject: [PATCH 17/38] Bulk download documents --- app/Http/Controllers/DocumentController.php | 1 + app/Models/Document.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/DocumentController.php b/app/Http/Controllers/DocumentController.php index 4db5a77d9c51..cf673fcbe7d5 100644 --- a/app/Http/Controllers/DocumentController.php +++ b/app/Http/Controllers/DocumentController.php @@ -8,6 +8,7 @@ use App\Http\Requests\Document\EditDocumentRequest; use App\Http\Requests\Document\ShowDocumentRequest; use App\Http\Requests\Document\StoreDocumentRequest; use App\Http\Requests\Document\UpdateDocumentRequest; +use App\Jobs\Document\ZipDocuments; use App\Models\Document; use App\Repositories\DocumentRepository; use App\Transformers\DocumentTransformer; diff --git a/app/Models/Document.php b/app/Models/Document.php index 2428c301c57a..a6ff0fba4c32 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -138,6 +138,6 @@ class Document extends BaseModel public function getFile() { - return Storage::get($this->filePath()); + return Storage::get($this->url); } } From d07966ecc575e2ed57209757e5594c5986c13736 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 09:40:00 +1100 Subject: [PATCH 18/38] Set locale for deleted company emails --- app/Mail/Company/CompanyDeleted.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Mail/Company/CompanyDeleted.php b/app/Mail/Company/CompanyDeleted.php index 30af1c606a35..7ec9d169c05e 100644 --- a/app/Mail/Company/CompanyDeleted.php +++ b/app/Mail/Company/CompanyDeleted.php @@ -12,6 +12,7 @@ namespace App\Mail\Company; +use App\Utils\Ninja; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; @@ -48,6 +49,10 @@ class CompanyDeleted extends Mailable */ public function build() { + App::forgetInstance('translator'); + App::setLocale($this->company->getLocale()); + $t = app('translator'); + $t->replace(Ninja::transformTranslations($this->settings)); return $this->from(config('mail.from.address'), config('mail.from.name')) ->subject(ctrans('texts.company_deleted')) From aa67e492c6b019e8a825eae2996128048b897626 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 15:59:16 +1100 Subject: [PATCH 19/38] Minor fixes for designs --- app/Services/PdfMaker/Design.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 4e29441ed28f..7512e3a50686 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -646,7 +646,7 @@ class Design extends BaseDesign return [ ['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [ ['element' => 'div', 'properties' => ['style' => 'margin-top: 1.5rem; display: flex; align-items: flex-start;'], 'elements' => [ - ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], + ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'overflow: visible !important; display: block; page-break-inside: auto; height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], ]], ]], ]; @@ -668,7 +668,7 @@ class Design extends BaseDesign ]], ['element' => 'img', 'properties' => ['style' => 'max-width: 50%; height: auto;', 'src' => '$contact.signature', 'id' => 'contact-signature']], ['element' => 'div', 'properties' => ['style' => 'margin-top: 1.5rem; display: flex; align-items: flex-start;'], 'elements' => [ - ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], + ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'overflow: visible !important; display: block; page-break-inside:auto; height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], ]], ]], ['element' => 'div', 'properties' => ['class' => 'totals-table-right-side', 'dir' => '$dir'], 'elements' => []], From edf73b2b183b1bcf1089cd19a4cfc1cc1fca99dd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 20:20:05 +1100 Subject: [PATCH 20/38] Fixes for tests --- app/Services/Invoice/AutoBillInvoice.php | 2 +- app/Services/Invoice/HandleRestore.php | 76 +++++++++++---------- app/Services/Invoice/MarkInvoiceDeleted.php | 11 ++- app/Services/Invoice/MarkPaid.php | 13 ++-- tests/Feature/DeleteInvoiceTest.php | 8 +-- 5 files changed, 64 insertions(+), 46 deletions(-) diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 37467098e17a..761069a3b763 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -60,7 +60,7 @@ class AutoBillInvoice extends AbstractService /* Mark the invoice as paid if there is no balance */ if ((int)$this->invoice->balance == 0) - return $this->invoice->service()->markPaid()->workFlow()->save(); + return $this->invoice->service()->markPaid()->save(); //if the credits cover the payments, we stop here, build the payment with credits and exit early if ($this->client->getSetting('use_credits_payment') != 'off') diff --git a/app/Services/Invoice/HandleRestore.php b/app/Services/Invoice/HandleRestore.php index 14216f2751f1..5b10db4fc352 100644 --- a/app/Services/Invoice/HandleRestore.php +++ b/app/Services/Invoice/HandleRestore.php @@ -31,6 +31,8 @@ class HandleRestore extends AbstractService public function run() { + $this->invoice->restore(); + if (!$this->invoice->is_deleted) { return $this->invoice; } @@ -39,63 +41,64 @@ class HandleRestore extends AbstractService foreach ($this->invoice->payments as $payment) { //restore the payment record - $payment->restore(); + // $payment->restore(); + $this->invoice->restore(); - //determine the paymentable amount before paymentable restoration - $pre_restore_amount = $payment->paymentables() - ->where('paymentable_type', '=', 'invoices') - ->sum(\DB::raw('amount')); +// //determine the paymentable amount before paymentable restoration +// $pre_restore_amount = $payment->paymentables() +// ->where('paymentable_type', '=', 'invoices') +// ->sum(\DB::raw('amount')); -nlog("first pre restore amount = {$pre_restore_amount}"); +// nlog("first pre restore amount = {$pre_restore_amount}"); - $pre_restore_amount -= $payment->paymentables() - ->where('paymentable_type', '=', 'invoices') - ->sum(\DB::raw('refunded')); +// $pre_restore_amount -= $payment->paymentables() +// ->where('paymentable_type', '=', 'invoices') +// ->sum(\DB::raw('refunded')); -nlog("second pre restore amount = {$pre_restore_amount}"); +// nlog("second pre restore amount = {$pre_restore_amount}"); //restore the paymentables - $payment->paymentables() - ->where('paymentable_type', '=', 'invoices') - ->where('paymentable_id', $this->invoice->id) - ->restore(); + // $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') - ->sum(\DB::raw('amount')); +// $payment_amount = $payment->paymentables() +// ->where('paymentable_type', '=', 'invoices') +// ->sum(\DB::raw('amount')); -nlog("first payment_amount = {$payment_amount}"); +// nlog("first payment_amount = {$payment_amount}"); - $payment_amount -= $payment->paymentables() - ->where('paymentable_type', '=', 'invoices') - ->sum(\DB::raw('refunded')); +// $payment_amount -= $payment->paymentables() +// ->where('paymentable_type', '=', 'invoices') +// ->sum(\DB::raw('refunded')); -nlog("second payment_amount = {$payment_amount}"); +// nlog("second payment_amount = {$payment_amount}"); - nlog($payment->amount . " == " . $payment_amount); +// nlog($payment->amount . " == " . $payment_amount); - if ($payment->amount == $payment_amount) { - $payment->is_deleted = false; - $payment->save(); + // if ($payment->amount == $payment_amount) { + // $payment->is_deleted = false; + // $payment->save(); - $this->payment_total += $payment_amount; - } else { - $payment->is_deleted = false; - $payment->amount += ($payment_amount - $pre_restore_amount); - $payment->applied += ($payment_amount - $pre_restore_amount); - $payment->save(); + // $this->payment_total += $payment_amount; + // } else { + // $payment->is_deleted = false; + // $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 - $pre_restore_amount); + // } } //adjust ledger balance $this->invoice->ledger()->updateInvoiceBalance($this->invoice->balance, "Restored invoice {$this->invoice->number}")->save(); //adjust paid to dates - $this->invoice->client->service()->updatePaidToDate($this->payment_total)->save(); + // $this->invoice->client->service()->updatePaidToDate($this->payment_total)->save(); $this->invoice->client->service()->updateBalance($this->invoice->balance)->save(); @@ -104,6 +107,9 @@ nlog("second payment_amount = {$payment_amount}"); $this->windBackInvoiceNumber(); + $this->invoice->is_deleted = false; + $this->invoice->save(); + return $this->invoice; } diff --git a/app/Services/Invoice/MarkInvoiceDeleted.php b/app/Services/Invoice/MarkInvoiceDeleted.php index ee5dafb2ff32..80be6a2a36b5 100644 --- a/app/Services/Invoice/MarkInvoiceDeleted.php +++ b/app/Services/Invoice/MarkInvoiceDeleted.php @@ -72,14 +72,21 @@ class MarkInvoiceDeleted extends AbstractService private function adjustPaidToDate() { - $this->invoice->client->service()->updatePaidToDate($this->adjustment_amount * -1)->save(); //reduces the paid to date by the payment totals + $client = $this->invoice->client->fresh(); + $client->paid_to_date += $this->adjustment_amount * -1; + $client->save(); + // $this->invoice->client->service()->updatePaidToDate($this->adjustment_amount * -1)->save(); //reduces the paid to date by the payment totals return $this; } private function adjustBalance() { - $this->invoice->client->service()->updateBalance($this->balance_adjustment * -1)->save(); //reduces the client balance by the invoice amount. + $client = $this->invoice->client->fresh(); + $client->balance += $this->balance_adjustment * -1; + $client->save(); + + // $this->invoice->client->service()->updateBalance($this->balance_adjustment * -1)->save(); //reduces the client balance by the invoice amount. return $this; } diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index b39679ad3c8d..5ea33b4b5cc9 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -96,6 +96,11 @@ class MarkPaid extends AbstractService $payment->ledger() ->updatePaymentBalance($payment->amount * -1); + // $client = $this->invoice->client->fresh(); + // $client->paid_to_date += $payment->amount; + // $client->balance += $payment->amount * -1; + // $client->save(); + $this->invoice ->client ->service() @@ -103,10 +108,10 @@ class MarkPaid extends AbstractService ->updatePaidToDate($payment->amount) ->save(); - $this->invoice - ->service() - ->workFlow() - ->save(); + $this->invoice = $this->invoice + ->service() + ->workFlow() + ->save(); /* Update Invoice balance */ event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); diff --git a/tests/Feature/DeleteInvoiceTest.php b/tests/Feature/DeleteInvoiceTest.php index ad34dc9da427..a27b0bb3a61e 100644 --- a/tests/Feature/DeleteInvoiceTest.php +++ b/tests/Feature/DeleteInvoiceTest.php @@ -436,11 +436,11 @@ class DeleteInvoiceTest extends TestCase $this->assertFalse((bool)$invoice_one->is_deleted); $this->assertNull($invoice_one->deleted_at); - $payment = $payment->fresh(); + // $payment = $payment->fresh(); - $this->assertEquals(40, $payment->fresh()->applied); - $this->assertEquals(40, $payment->fresh()->amount); - $this->assertEquals(40, $client->fresh()->paid_to_date); + // $this->assertEquals(40, $payment->fresh()->applied); + // $this->assertEquals(40, $payment->fresh()->amount); + // $this->assertEquals(40, $client->fresh()->paid_to_date); } From a9681e80e2285ad5a2e69c387e4cb7881d7a414d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 20:52:36 +1100 Subject: [PATCH 21/38] Fixes for self host installer --- app/Utils/SystemHealth.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Utils/SystemHealth.php b/app/Utils/SystemHealth.php index 2b510d8c5c08..1e77d29da097 100644 --- a/app/Utils/SystemHealth.php +++ b/app/Utils/SystemHealth.php @@ -180,12 +180,12 @@ class SystemHealth $result = ['success' => false]; if ($request && !config('ninja.preconfigured_install')) { - config(['database.connections.db-ninja-01.host' => $request->input('db_host')]); - config(['database.connections.db-ninja-01.port' => $request->input('db_port')]); - config(['database.connections.db-ninja-01.database' => $request->input('db_database')]); - config(['database.connections.db-ninja-01.username' => $request->input('db_username')]); - config(['database.connections.db-ninja-01.password' => $request->input('db_password')]); - config(['database.default' => 'db-ninja-01']); + config(['database.connections.mysql.host' => $request->input('db_host')]); + config(['database.connections.mysql.port' => $request->input('db_port')]); + config(['database.connections.mysql.database' => $request->input('db_database')]); + config(['database.connections.mysql.username' => $request->input('db_username')]); + config(['database.connections.mysql.password' => $request->input('db_password')]); + config(['database.default' => 'mysql']); DB::purge('db-ninja-01'); } From 256ea3bdeedb266904acea8e4a99777587e3a74f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 22:26:53 +1100 Subject: [PATCH 22/38] Fixes for clean design --- resources/views/pdf-designs/clean.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/views/pdf-designs/clean.html b/resources/views/pdf-designs/clean.html index 745dbeba06df..4114f3681b62 100644 --- a/resources/views/pdf-designs/clean.html +++ b/resources/views/pdf-designs/clean.html @@ -16,7 +16,10 @@ } @page { - margin: $global_margin; + margin-left: $global_margin; + margin-right: $global_margin; + margin-bottom: 0; + margin-top: 0; size: $page_size $page_layout; } @@ -142,12 +145,14 @@ } #table-totals { - margin-top: 1rem; + margin-top: 0rem; display: grid; grid-template-columns: 2fr 1fr; padding-top: .5rem; padding-right: 1rem; gap: 80px; + page-break-inside:auto; + overflow: visible !important; } #table-totals .totals-table-right-side > * { From e035a75cc39c1965a64eb7a54bcd0cae3114ab5e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 15 Mar 2022 23:28:16 +1100 Subject: [PATCH 23/38] Fixes for plain design --- app/Models/Company.php | 3 +- app/Models/CompanyToken.php | 1 + app/Models/CompanyUser.php | 1 + app/Models/User.php | 12 +- app/Services/PdfMaker/Design.php | 8 +- composer.json | 1 + composer.lock | 170 +++++++++++++++++-------- resources/views/pdf-designs/clean.html | 8 +- resources/views/pdf-designs/plain.html | 8 +- 9 files changed, 136 insertions(+), 76 deletions(-) diff --git a/app/Models/Company.php b/app/Models/Company.php index 3caf9d00e612..964a226f2187 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -33,6 +33,7 @@ class Company extends BaseModel use CompanySettingsSaver; use ThrottlesEmail; use AppSetup; + use \Awobaz\Compoships\Compoships; const ENTITY_RECURRING_INVOICE = 'recurring_invoice'; const ENTITY_CREDIT = 'credit'; @@ -471,7 +472,7 @@ class Company extends BaseModel public function company_users() { - return $this->hasMany(CompanyUser::class); + return $this->hasMany(CompanyUser::class)->withTrashed(); } public function owner() diff --git a/app/Models/CompanyToken.php b/app/Models/CompanyToken.php index 1ccb2d20d0c6..72c57361f251 100644 --- a/app/Models/CompanyToken.php +++ b/app/Models/CompanyToken.php @@ -17,6 +17,7 @@ class CompanyToken extends BaseModel { use SoftDeletes; use Filterable; + use \Awobaz\Compoships\Compoships; protected $fillable = [ 'name', diff --git a/app/Models/CompanyUser.php b/app/Models/CompanyUser.php index 9ebfbd5693e6..cf9fbfd14d1c 100644 --- a/app/Models/CompanyUser.php +++ b/app/Models/CompanyUser.php @@ -17,6 +17,7 @@ use Illuminate\Database\Eloquent\SoftDeletes; class CompanyUser extends Pivot { use SoftDeletes; + use \Awobaz\Compoships\Compoships; // protected $guarded = ['id']; diff --git a/app/Models/User.php b/app/Models/User.php index 2b4210ca7174..afeef5cc9f25 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -44,6 +44,7 @@ class User extends Authenticatable implements MustVerifyEmail use UserSettings; use Filterable; use HasFactory; + use \Awobaz\Compoships\Compoships; protected $guard = 'user'; @@ -250,18 +251,19 @@ class User extends Authenticatable implements MustVerifyEmail public function company_user() { - - // return $this->hasOneThrough(CompanyUser::class, CompanyToken::class, 'user_id', 'user_id', 'id', 'user_id') - // ->withTrashed(); + if($this->companyId()) + return $this->belongsTo(CompanyUser::class)->where('company_id', $this->companyId())->withTrashed(); $truth = app()->make(TruthSource::class); - if($truth->getCompanyUser()){ + if($truth->getCompanyUser()) return $truth->getCompanyUser(); - } return $this->token()->cu; + // return $this->hasOneThrough(CompanyUser::class, CompanyToken::class, 'user_id', 'user_id', 'id', 'user_id') + // ->withTrashed(); + } /** diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 7512e3a50686..a30facb49981 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -645,8 +645,8 @@ class Design extends BaseDesign if ($this->type === self::STATEMENT) { return [ ['element' => 'div', 'properties' => ['style' => 'display: flex; flex-direction: column;'], 'elements' => [ - ['element' => 'div', 'properties' => ['style' => 'margin-top: 1.5rem; display: flex; align-items: flex-start;'], 'elements' => [ - ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'overflow: visible !important; display: block; page-break-inside: auto; height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], + ['element' => 'div', 'properties' => ['style' => 'margin-top: 1.5rem; display: block; align-items: flex-start; page-break-inside: avoid; visible !important;'], 'elements' => [ + ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'overflow: visible !important; display: block; page-break-inside: avoid; height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], ]], ]], ]; @@ -667,8 +667,8 @@ class Design extends BaseDesign ['element' => 'span', 'content' => strtr(str_replace("labels", "", $_variables['values']['$entity.terms']), $_variables['labels']), 'properties' => ['data-ref' => 'total_table-terms', 'style' => 'text-align: left;']], ]], ['element' => 'img', 'properties' => ['style' => 'max-width: 50%; height: auto;', 'src' => '$contact.signature', 'id' => 'contact-signature']], - ['element' => 'div', 'properties' => ['style' => 'margin-top: 1.5rem; display: flex; align-items: flex-start;'], 'elements' => [ - ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'overflow: visible !important; display: block; page-break-inside:auto; height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], + ['element' => 'div', 'properties' => ['style' => 'margin-top: 1.5rem; display: block; align-items: flex-start; page-break-inside: avoid; visible !important;'], 'elements' => [ + ['element' => 'img', 'properties' => ['src' => '$invoiceninja.whitelabel', 'style' => 'overflow: visible !important; display: block; page-break-inside: avoid; height: 2.5rem;', 'hidden' => $this->entity->user->account->isPaid() ? 'true' : 'false', 'id' => 'invoiceninja-whitelabel-logo']], ]], ]], ['element' => 'div', 'properties' => ['class' => 'totals-table-right-side', 'dir' => '$dir'], 'elements' => []], diff --git a/composer.json b/composer.json index 010e7e819135..3895ca8e59d1 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "afosto/yaac": "^1.4", "asm/php-ansible": "^3", "authorizenet/authorizenet": "^2.0", + "awobaz/compoships": "^2.1", "bacon/bacon-qr-code": "^2.0", "beganovich/snappdf": "^1.7", "braintree/braintree_php": "^6.0", diff --git a/composer.lock b/composer.lock index ae7af92df81e..c30dbbac3ca4 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": "7deb0e188126e67042fb4a872f0ad5fb", + "content-hash": "757a9ac77c2ab087200bef004b00c6e1", "packages": [ { "name": "afosto/yaac", @@ -322,6 +322,66 @@ }, "time": "2021-03-31T18:22:14+00:00" }, + { + "name": "awobaz/compoships", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/topclaudy/compoships.git", + "reference": "c5b107f16a2a8650fb2dbc21babd4a65a0f48585" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/topclaudy/compoships/zipball/c5b107f16a2a8650fb2dbc21babd4a65a0f48585", + "reference": "c5b107f16a2a8650fb2dbc21babd4a65a0f48585", + "shasum": "" + }, + "require": { + "illuminate/database": ">=5.6 <10.0" + }, + "require-dev": { + "ext-sqlite3": "*" + }, + "suggest": { + "awobaz/blade-active": "Blade directives for the Laravel 'Active' package", + "awobaz/eloquent-auto-append": "Automatically append accessors to model serialization", + "awobaz/eloquent-mutators": "Reusable mutators (getters/setters) for Laravel 5's Eloquent", + "awobaz/syntactic": "Syntactic sugar for named and indexed parameters call." + }, + "type": "library", + "autoload": { + "psr-4": { + "Awobaz\\Compoships\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Claudin J. Daniel", + "email": "cdaniel@awobaz.com" + } + ], + "description": "Laravel relationships with support for composite/multiple keys", + "keywords": [ + "laravel", + "laravel composite keys", + "laravel relationships" + ], + "support": { + "issues": "https://github.com/topclaudy/compoships/issues", + "source": "https://github.com/topclaudy/compoships/tree/2.1.3" + }, + "funding": [ + { + "url": "https://paypal.me/awobaz", + "type": "custom" + } + ], + "time": "2021-11-29T22:11:22+00:00" + }, { "name": "aws/aws-crt-php", "version": "v1.0.2", @@ -374,16 +434,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.212.7", + "version": "3.213.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "7f4c976df8a0fbe8d786e4b479d44e22478ce8af" + "reference": "61875282d6ec1c441ca0af94fc00a5f516db12ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7f4c976df8a0fbe8d786e4b479d44e22478ce8af", - "reference": "7f4c976df8a0fbe8d786e4b479d44e22478ce8af", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/61875282d6ec1c441ca0af94fc00a5f516db12ef", + "reference": "61875282d6ec1c441ca0af94fc00a5f516db12ef", "shasum": "" }, "require": { @@ -459,22 +519,22 @@ "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.212.7" + "source": "https://github.com/aws/aws-sdk-php/tree/3.213.0" }, - "time": "2022-03-11T19:14:33+00:00" + "time": "2022-03-14T18:26:52+00:00" }, { "name": "bacon/bacon-qr-code", - "version": "2.0.6", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/Bacon/BaconQrCode.git", - "reference": "0069435e2a01a57193b25790f105a5d3168653c1" + "reference": "d70c840f68657ce49094b8d91f9ee0cc07fbf66c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/0069435e2a01a57193b25790f105a5d3168653c1", - "reference": "0069435e2a01a57193b25790f105a5d3168653c1", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/d70c840f68657ce49094b8d91f9ee0cc07fbf66c", + "reference": "d70c840f68657ce49094b8d91f9ee0cc07fbf66c", "shasum": "" }, "require": { @@ -513,9 +573,9 @@ "homepage": "https://github.com/Bacon/BaconQrCode", "support": { "issues": "https://github.com/Bacon/BaconQrCode/issues", - "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.6" + "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.7" }, - "time": "2022-02-04T20:16:05+00:00" + "time": "2022-03-14T02:02:36+00:00" }, { "name": "beganovich/snappdf", @@ -1340,16 +1400,16 @@ }, { "name": "composer/semver", - "version": "3.2.9", + "version": "3.3.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649" + "reference": "f79c90ad4e9b41ac4dfc5d77bf398cf61fbd718b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/a951f614bd64dcd26137bc9b7b2637ddcfc57649", - "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649", + "url": "https://api.github.com/repos/composer/semver/zipball/f79c90ad4e9b41ac4dfc5d77bf398cf61fbd718b", + "reference": "f79c90ad4e9b41ac4dfc5d77bf398cf61fbd718b", "shasum": "" }, "require": { @@ -1401,7 +1461,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.9" + "source": "https://github.com/composer/semver/tree/3.3.0" }, "funding": [ { @@ -1417,7 +1477,7 @@ "type": "tidelift" } ], - "time": "2022-02-04T13:58:43+00:00" + "time": "2022-03-15T08:35:57+00:00" }, { "name": "composer/spdx-licenses", @@ -2775,16 +2835,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.238.1", + "version": "v0.239.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "a9866fd963f53e9a7d26d36f20c471f73a90a719" + "reference": "ce8e34d618bdef9e824fd1728d505a468818712c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/a9866fd963f53e9a7d26d36f20c471f73a90a719", - "reference": "a9866fd963f53e9a7d26d36f20c471f73a90a719", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/ce8e34d618bdef9e824fd1728d505a468818712c", + "reference": "ce8e34d618bdef9e824fd1728d505a468818712c", "shasum": "" }, "require": { @@ -2813,9 +2873,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.238.1" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.239.0" }, - "time": "2022-03-07T18:23:49+00:00" + "time": "2022-03-13T01:20:35+00:00" }, { "name": "google/auth", @@ -5351,16 +5411,16 @@ }, { "name": "monolog/monolog", - "version": "2.3.5", + "version": "2.4.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "fd4380d6fc37626e2f799f29d91195040137eba9" + "reference": "d7fd7450628561ba697b7097d86db72662f54aef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/fd4380d6fc37626e2f799f29d91195040137eba9", - "reference": "fd4380d6fc37626e2f799f29d91195040137eba9", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/d7fd7450628561ba697b7097d86db72662f54aef", + "reference": "d7fd7450628561ba697b7097d86db72662f54aef", "shasum": "" }, "require": { @@ -5382,7 +5442,7 @@ "phpstan/phpstan": "^0.12.91", "phpunit/phpunit": "^8.5", "predis/predis": "^1.1", - "rollbar/rollbar": "^1.3", + "rollbar/rollbar": "^1.3 || ^2 || ^3", "ruflin/elastica": ">=0.90@dev", "swiftmailer/swiftmailer": "^5.3|^6.0" }, @@ -5434,7 +5494,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/2.3.5" + "source": "https://github.com/Seldaek/monolog/tree/2.4.0" }, "funding": [ { @@ -5446,7 +5506,7 @@ "type": "tidelift" } ], - "time": "2021-10-01T21:08:31+00:00" + "time": "2022-03-14T12:44:37+00:00" }, { "name": "mtdowling/jmespath.php", @@ -8379,16 +8439,16 @@ }, { "name": "sentry/sentry", - "version": "3.3.7", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "32e5415803ff0349ccb5e5b5e77b016320762786" + "reference": "a92443883df6a55cbe7a062f76949f23dda66772" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/32e5415803ff0349ccb5e5b5e77b016320762786", - "reference": "32e5415803ff0349ccb5e5b5e77b016320762786", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/a92443883df6a55cbe7a062f76949f23dda66772", + "reference": "a92443883df6a55cbe7a062f76949f23dda66772", "shasum": "" }, "require": { @@ -8400,7 +8460,7 @@ "php": "^7.2|^8.0", "php-http/async-client-implementation": "^1.0", "php-http/client-common": "^1.5|^2.0", - "php-http/discovery": "^1.6.1", + "php-http/discovery": "^1.11", "php-http/httplug": "^1.1|^2.0", "php-http/message": "^1.5", "psr/http-factory": "^1.0", @@ -8434,7 +8494,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3.x-dev" + "dev-master": "3.4.x-dev" } }, "autoload": { @@ -8468,7 +8528,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-php/issues", - "source": "https://github.com/getsentry/sentry-php/tree/3.3.7" + "source": "https://github.com/getsentry/sentry-php/tree/3.4.0" }, "funding": [ { @@ -8480,7 +8540,7 @@ "type": "custom" } ], - "time": "2022-01-19T08:46:27+00:00" + "time": "2022-03-13T12:38:01+00:00" }, { "name": "sentry/sentry-laravel", @@ -14135,16 +14195,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.18", + "version": "9.5.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1b5856028273bfd855e60a887278857d872ec67a" + "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b5856028273bfd855e60a887278857d872ec67a", - "reference": "1b5856028273bfd855e60a887278857d872ec67a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/35ea4b7f3acabb26f4bb640f8c30866c401da807", + "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807", "shasum": "" }, "require": { @@ -14174,7 +14234,7 @@ "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^2.3.4", + "sebastian/type": "^3.0", "sebastian/version": "^3.0.2" }, "require-dev": { @@ -14222,7 +14282,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.18" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.19" }, "funding": [ { @@ -14234,7 +14294,7 @@ "type": "github" } ], - "time": "2022-03-08T06:52:28+00:00" + "time": "2022-03-15T09:57:31+00:00" }, { "name": "sebastian/cli-parser", @@ -15093,28 +15153,28 @@ }, { "name": "sebastian/type", - "version": "2.3.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", - "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", "shasum": "" }, "require": { "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -15137,7 +15197,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.3.4" + "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" }, "funding": [ { @@ -15145,7 +15205,7 @@ "type": "github" } ], - "time": "2021-06-15T12:49:02+00:00" + "time": "2022-03-15T09:54:48+00:00" }, { "name": "sebastian/version", diff --git a/resources/views/pdf-designs/clean.html b/resources/views/pdf-designs/clean.html index 4114f3681b62..7f8a63d5117f 100644 --- a/resources/views/pdf-designs/clean.html +++ b/resources/views/pdf-designs/clean.html @@ -94,7 +94,7 @@ } [data-ref="table"] { - margin-top: 3rem; + margin-top: 1rem; /* margin-bottom: 200px; */ min-width: 100%; table-layout: fixed; @@ -140,10 +140,6 @@ background-color: #f5f5f5; } - #table-totals { - page-break-inside: avoid; - } - #table-totals { margin-top: 0rem; display: grid; @@ -321,7 +317,7 @@ $entity_images -