From 7d871edd4ead85d3c37d97a0e46613c8181d234a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Mar 2023 11:37:53 +1100 Subject: [PATCH 1/4] Updates for number rounding with negative numbers --- app/Utils/Number.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Utils/Number.php b/app/Utils/Number.php index a61ee2c01599..5dc8fd1975b5 100644 --- a/app/Utils/Number.php +++ b/app/Utils/Number.php @@ -238,7 +238,9 @@ class Number $precision = 2; } elseif ($v < 1) { $precision = strlen($v) - strrpos($v, '.') - 1; - } elseif(is_array($parts) && $parts[0] != 0) { + } + + if(is_array($parts) && $parts[0] != 0) { $precision = 2; } From 2f3b0e51f0147a9dd5115c3206fb0e110826dff2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Mar 2023 13:15:11 +1100 Subject: [PATCH 2/4] Minor fixes --- app/Http/Controllers/SubdomainController.php | 3 ++- app/Utils/Ninja.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/SubdomainController.php b/app/Http/Controllers/SubdomainController.php index 829de80c6d98..287e5cc819b6 100644 --- a/app/Http/Controllers/SubdomainController.php +++ b/app/Http/Controllers/SubdomainController.php @@ -36,7 +36,8 @@ class SubdomainController extends BaseController 'lb', 'shopify', 'beta', - 'prometh' + 'prometh', + 'license', ]; public function __construct() diff --git a/app/Utils/Ninja.php b/app/Utils/Ninja.php index 3274983d540e..7d264753a91b 100644 --- a/app/Utils/Ninja.php +++ b/app/Utils/Ninja.php @@ -64,7 +64,7 @@ class Ninja 'license' => config('ninja.license'), ]; - $data = trim(CurlUtils::post('https://license.invoiceninja.com/api/check', $data)); + $data = trim(CurlUtils::post('https://license.invoicing.co/api/check', $data)); $data = json_decode($data); if ($data && property_exists($data, 'message') && $data->message == sha1(config('ninja.license'))) { From fb8db155322fa3ab0fc205a65ae5ac7c3e7809d9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Mar 2023 17:28:22 +1100 Subject: [PATCH 3/4] Update composer lock file --- composer.lock | 155 +++++++++++++++++++++++++------------------------- 1 file changed, 78 insertions(+), 77 deletions(-) diff --git a/composer.lock b/composer.lock index c734e1518484..e18d3cd13a7c 100644 --- a/composer.lock +++ b/composer.lock @@ -380,16 +380,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.261.2", + "version": "3.261.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "4f9cd0d3fc439372cd9f57d4f1bea9744216d2f0" + "reference": "31bc1e2a528c0f0881e4366d8ee0fa729cd42b00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/4f9cd0d3fc439372cd9f57d4f1bea9744216d2f0", - "reference": "4f9cd0d3fc439372cd9f57d4f1bea9744216d2f0", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/31bc1e2a528c0f0881e4366d8ee0fa729cd42b00", + "reference": "31bc1e2a528c0f0881e4366d8ee0fa729cd42b00", "shasum": "" }, "require": { @@ -468,9 +468,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.261.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.261.4" }, - "time": "2023-03-01T19:22:23+00:00" + "time": "2023-03-03T19:22:53+00:00" }, { "name": "bacon/bacon-qr-code", @@ -1171,16 +1171,16 @@ }, { "name": "doctrine/dbal", - "version": "3.6.0", + "version": "3.6.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "85b98cb23c8af471a67abfe14485da696bcabc2e" + "reference": "57815c7bbcda3cd18871d253c1dd8cbe56f8526e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/85b98cb23c8af471a67abfe14485da696bcabc2e", - "reference": "85b98cb23c8af471a67abfe14485da696bcabc2e", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/57815c7bbcda3cd18871d253c1dd8cbe56f8526e", + "reference": "57815c7bbcda3cd18871d253c1dd8cbe56f8526e", "shasum": "" }, "require": { @@ -1196,11 +1196,11 @@ "doctrine/coding-standard": "11.1.0", "fig/log-test": "^1", "jetbrains/phpstorm-stubs": "2022.3", - "phpstan/phpstan": "1.9.14", - "phpstan/phpstan-strict-rules": "^1.4", - "phpunit/phpunit": "9.6.3", + "phpstan/phpstan": "1.10.3", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "9.6.4", "psalm/plugin-phpunit": "0.18.4", - "squizlabs/php_codesniffer": "3.7.1", + "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^5.4|^6.0", "symfony/console": "^4.4|^5.4|^6.0", "vimeo/psalm": "4.30.0" @@ -1263,7 +1263,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.6.0" + "source": "https://github.com/doctrine/dbal/tree/3.6.1" }, "funding": [ { @@ -1279,7 +1279,7 @@ "type": "tidelift" } ], - "time": "2023-02-07T22:52:03+00:00" + "time": "2023-03-02T19:26:24+00:00" }, { "name": "doctrine/deprecations", @@ -2172,16 +2172,16 @@ }, { "name": "google/apiclient-services", - "version": "v0.289.0", + "version": "v0.289.1", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client-services.git", - "reference": "937f83a927db2d09db7eebb69ce2ac4114559bd7" + "reference": "df7e6cbab08f60509b3f360d8286c194ad2930e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/937f83a927db2d09db7eebb69ce2ac4114559bd7", - "reference": "937f83a927db2d09db7eebb69ce2ac4114559bd7", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/df7e6cbab08f60509b3f360d8286c194ad2930e2", + "reference": "df7e6cbab08f60509b3f360d8286c194ad2930e2", "shasum": "" }, "require": { @@ -2210,9 +2210,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.289.0" + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.289.1" }, - "time": "2023-02-26T01:10:11+00:00" + "time": "2023-03-01T17:20:18+00:00" }, { "name": "google/auth", @@ -4932,16 +4932,16 @@ }, { "name": "livewire/livewire", - "version": "v2.12.2", + "version": "v2.12.3", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "ea2a3099f0b5d0017316cb5197bc5b97c7164785" + "reference": "019b1e69d8cd8c7e749eba7a38e4fa69ecbc8f74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/ea2a3099f0b5d0017316cb5197bc5b97c7164785", - "reference": "ea2a3099f0b5d0017316cb5197bc5b97c7164785", + "url": "https://api.github.com/repos/livewire/livewire/zipball/019b1e69d8cd8c7e749eba7a38e4fa69ecbc8f74", + "reference": "019b1e69d8cd8c7e749eba7a38e4fa69ecbc8f74", "shasum": "" }, "require": { @@ -4993,7 +4993,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v2.12.2" + "source": "https://github.com/livewire/livewire/tree/v2.12.3" }, "funding": [ { @@ -5001,7 +5001,7 @@ "type": "github" } ], - "time": "2023-02-28T15:56:02+00:00" + "time": "2023-03-03T20:12:38+00:00" }, { "name": "microsoft/microsoft-graph", @@ -5787,16 +5787,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.3", + "version": "v4.15.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039" + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/570e980a201d8ed0236b0a62ddf2c9cbb2034039", - "reference": "570e980a201d8ed0236b0a62ddf2c9cbb2034039", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", "shasum": "" }, "require": { @@ -5837,9 +5837,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.3" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" }, - "time": "2023-01-16T22:05:37+00:00" + "time": "2023-03-05T19:49:14+00:00" }, { "name": "nunomaduro/termwind", @@ -6937,16 +6937,16 @@ }, { "name": "phpseclib/phpseclib", - "version": "3.0.18", + "version": "3.0.19", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "f28693d38ba21bb0d9f0c411ee5dae2b178201da" + "reference": "cc181005cf548bfd8a4896383bb825d859259f95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/f28693d38ba21bb0d9f0c411ee5dae2b178201da", - "reference": "f28693d38ba21bb0d9f0c411ee5dae2b178201da", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95", + "reference": "cc181005cf548bfd8a4896383bb825d859259f95", "shasum": "" }, "require": { @@ -7027,7 +7027,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/3.0.18" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.19" }, "funding": [ { @@ -7043,7 +7043,7 @@ "type": "tidelift" } ], - "time": "2022-12-17T18:26:50+00:00" + "time": "2023-03-05T17:13:09+00:00" }, { "name": "pragmarx/google2fa", @@ -8650,16 +8650,16 @@ }, { "name": "socialiteproviders/microsoft", - "version": "4.2.1", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/SocialiteProviders/Microsoft.git", - "reference": "2289ce5b037e5d48fff9f38c2354a8401f37609e" + "reference": "19bc79810d7319c466f38552546b2c233b634059" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/SocialiteProviders/Microsoft/zipball/2289ce5b037e5d48fff9f38c2354a8401f37609e", - "reference": "2289ce5b037e5d48fff9f38c2354a8401f37609e", + "url": "https://api.github.com/repos/SocialiteProviders/Microsoft/zipball/19bc79810d7319c466f38552546b2c233b634059", + "reference": "19bc79810d7319c466f38552546b2c233b634059", "shasum": "" }, "require": { @@ -8696,7 +8696,7 @@ "issues": "https://github.com/socialiteproviders/providers/issues", "source": "https://github.com/socialiteproviders/providers" }, - "time": "2023-01-13T01:15:41+00:00" + "time": "2023-03-02T09:58:36+00:00" }, { "name": "sprain/swiss-qr-bill", @@ -12167,16 +12167,16 @@ }, { "name": "turbo124/beacon", - "version": "v1.4.1", + "version": "v1.4.3", "source": { "type": "git", "url": "https://github.com/turbo124/beacon.git", - "reference": "635b1bfb48e84a96f48ebb75442bc03ebacf2c78" + "reference": "4df55a8f7373fc9dfeed9abf8753e739398b8efc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/turbo124/beacon/zipball/635b1bfb48e84a96f48ebb75442bc03ebacf2c78", - "reference": "635b1bfb48e84a96f48ebb75442bc03ebacf2c78", + "url": "https://api.github.com/repos/turbo124/beacon/zipball/4df55a8f7373fc9dfeed9abf8753e739398b8efc", + "reference": "4df55a8f7373fc9dfeed9abf8753e739398b8efc", "shasum": "" }, "require": { @@ -12223,9 +12223,9 @@ "turbo124" ], "support": { - "source": "https://github.com/turbo124/beacon/tree/v1.4.1" + "source": "https://github.com/turbo124/beacon/tree/v1.4.3" }, - "time": "2023-03-02T08:16:48+00:00" + "time": "2023-03-06T06:00:33+00:00" }, { "name": "turbo124/predis", @@ -13136,16 +13136,16 @@ }, { "name": "brianium/paratest", - "version": "v6.9.0", + "version": "v6.9.1", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "6f90dcaf14077a64c966936584b301dd4d01a440" + "reference": "51691208db882922c55d6c465be3e7d95028c449" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/6f90dcaf14077a64c966936584b301dd4d01a440", - "reference": "6f90dcaf14077a64c966936584b301dd4d01a440", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/51691208db882922c55d6c465be3e7d95028c449", + "reference": "51691208db882922c55d6c465be3e7d95028c449", "shasum": "" }, "require": { @@ -13156,22 +13156,22 @@ "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "jean85/pretty-package-versions": "^2.0.5", "php": "^7.3 || ^8.0", - "phpunit/php-code-coverage": "^9.2.24", + "phpunit/php-code-coverage": "^9.2.25", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-timer": "^5.0.3", - "phpunit/phpunit": "^9.6.3", - "sebastian/environment": "^5.1.4", - "symfony/console": "^5.4.16 || ^6.2.5", - "symfony/process": "^5.4.11 || ^6.2.5" + "phpunit/phpunit": "^9.6.4", + "sebastian/environment": "^5.1.5", + "symfony/console": "^5.4.21 || ^6.2.7", + "symfony/process": "^5.4.21 || ^6.2.7" }, "require-dev": { "doctrine/coding-standard": "^10.0.0", "ext-pcov": "*", "ext-posix": "*", "infection/infection": "^0.26.19", - "squizlabs/php_codesniffer": "^3.7.1", - "symfony/filesystem": "^5.4.13 || ^6.2.5", - "vimeo/psalm": "^5.6" + "squizlabs/php_codesniffer": "^3.7.2", + "symfony/filesystem": "^5.4.21 || ^6.2.7", + "vimeo/psalm": "^5.7.7" }, "bin": [ "bin/paratest", @@ -13212,7 +13212,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v6.9.0" + "source": "https://github.com/paratestphp/paratest/tree/v6.9.1" }, "funding": [ { @@ -13224,7 +13224,7 @@ "type": "paypal" } ], - "time": "2023-02-07T10:03:32+00:00" + "time": "2023-03-03T09:35:17+00:00" }, { "name": "composer/class-map-generator", @@ -14016,16 +14016,16 @@ }, { "name": "filp/whoops", - "version": "2.14.6", + "version": "2.15.0", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "f7948baaa0330277c729714910336383286305da" + "reference": "3e8aebbca9f0ae6f618962c4ad514077fd365ab3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/f7948baaa0330277c729714910336383286305da", - "reference": "f7948baaa0330277c729714910336383286305da", + "url": "https://api.github.com/repos/filp/whoops/zipball/3e8aebbca9f0ae6f618962c4ad514077fd365ab3", + "reference": "3e8aebbca9f0ae6f618962c4ad514077fd365ab3", "shasum": "" }, "require": { @@ -14075,7 +14075,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.14.6" + "source": "https://github.com/filp/whoops/tree/2.15.0" }, "funding": [ { @@ -14083,7 +14083,7 @@ "type": "github" } ], - "time": "2022-11-02T16:23:29+00:00" + "time": "2023-03-03T12:00:00+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -16534,16 +16534,16 @@ }, { "name": "spatie/backtrace", - "version": "1.2.2", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/spatie/backtrace.git", - "reference": "7b34fee6c1ad45f8ee0498d17cd8ea9a076402c1" + "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/7b34fee6c1ad45f8ee0498d17cd8ea9a076402c1", - "reference": "7b34fee6c1ad45f8ee0498d17cd8ea9a076402c1", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/ec4dd16476b802dbdc6b4467f84032837e316b8c", + "reference": "ec4dd16476b802dbdc6b4467f84032837e316b8c", "shasum": "" }, "require": { @@ -16552,6 +16552,7 @@ "require-dev": { "ext-json": "*", "phpunit/phpunit": "^9.3", + "spatie/phpunit-snapshot-assertions": "^4.2", "symfony/var-dumper": "^5.1" }, "type": "library", @@ -16579,7 +16580,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/backtrace/tree/1.2.2" + "source": "https://github.com/spatie/backtrace/tree/1.4.0" }, "funding": [ { @@ -16591,7 +16592,7 @@ "type": "other" } ], - "time": "2023-02-21T08:29:12+00:00" + "time": "2023-03-04T08:57:24+00:00" }, { "name": "spatie/flare-client-php", From ff8be6ab31f23710188abbd8ff69e86cb9c77ebc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Mar 2023 20:15:14 +1100 Subject: [PATCH 4/4] Fixes for client settings cast --- app/DataMapper/ClientSettings.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/DataMapper/ClientSettings.php b/app/DataMapper/ClientSettings.php index b079f3af6f33..33ccfbea026a 100644 --- a/app/DataMapper/ClientSettings.php +++ b/app/DataMapper/ClientSettings.php @@ -88,6 +88,9 @@ class ClientSettings extends BaseSettings return $company_settings; } + if(is_array($client_settings)) + $client_settings = (object)$client_settings; + foreach ($company_settings as $key => $value) { /* pseudo code if the property exists and is a string BUT has no length, treat it as TRUE