From c8eb2bc8c364f08ef0d4e99966896e3b154da398 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Apr 2025 11:36:14 +1000 Subject: [PATCH] Adjustments for forte import customers --- app/Export/CSV/InvoiceExport.php | 2 + .../Factory/ForteCustomerFactory.php | 4 +- composer.lock | 72 ++++++++++--------- 3 files changed, 42 insertions(+), 36 deletions(-) diff --git a/app/Export/CSV/InvoiceExport.php b/app/Export/CSV/InvoiceExport.php index 3909827f03..3d0ddabe04 100644 --- a/app/Export/CSV/InvoiceExport.php +++ b/app/Export/CSV/InvoiceExport.php @@ -125,11 +125,13 @@ class InvoiceExport extends BaseExport if ($tax_amount_position = array_search('invoice.total_taxes', $this->input['report_keys'])) { $first_part = array_slice($this->input['report_keys'], 0, $tax_amount_position + 1); $second_part = array_slice($this->input['report_keys'], $tax_amount_position + 1); + $labels = []; $this->tax_names = $query->get() ->flatMap(function ($invoice) { $taxes = []; + /** @var \App\Models\Invoice $invoice */ // Invoice level taxes if (!empty($invoice->tax_name1) && !empty($invoice->tax_rate1)) { $taxes[] = trim($invoice->tax_name1) . ' ' . \App\Utils\Number::formatValueNoTrailingZeroes(floatval($invoice->tax_rate1), $invoice->client) . '%'; diff --git a/app/PaymentDrivers/Factory/ForteCustomerFactory.php b/app/PaymentDrivers/Factory/ForteCustomerFactory.php index 439158cafe..e5b8ce7b18 100644 --- a/app/PaymentDrivers/Factory/ForteCustomerFactory.php +++ b/app/PaymentDrivers/Factory/ForteCustomerFactory.php @@ -93,7 +93,7 @@ class ForteCustomerFactory private function getBillingAddress(array $customer): array { - nlog($customer); + if (isset($customer['default_billing_address_token']) && isset($customer['addresses'])) { foreach ($customer['addresses'] as $address) { @@ -141,7 +141,7 @@ class ForteCustomerFactory private function getShippingAddress(array $customer): array { - if (isset($customer['default_shipping_address_token'])) { + if (isset($customer['default_shipping_address_token']) && isset($customer['addresses'])) { foreach ($customer['addresses'] as $address) { diff --git a/composer.lock b/composer.lock index 3f7b01ab09..8a901231a6 100644 --- a/composer.lock +++ b/composer.lock @@ -252,16 +252,16 @@ }, { "name": "apimatic/unirest-php", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/apimatic/unirest-php.git", - "reference": "e16754010c16be5473289470f129d87a0f41b55e" + "reference": "df38c93ffa71e8a1b7a075c2322c28cdfe8fe1f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/e16754010c16be5473289470f129d87a0f41b55e", - "reference": "e16754010c16be5473289470f129d87a0f41b55e", + "url": "https://api.github.com/repos/apimatic/unirest-php/zipball/df38c93ffa71e8a1b7a075c2322c28cdfe8fe1f5", + "reference": "df38c93ffa71e8a1b7a075c2322c28cdfe8fe1f5", "shasum": "" }, "require": { @@ -311,9 +311,9 @@ "support": { "email": "opensource@apimatic.io", "issues": "https://github.com/apimatic/unirest-php/issues", - "source": "https://github.com/apimatic/unirest-php/tree/4.0.5" + "source": "https://github.com/apimatic/unirest-php/tree/4.0.6" }, - "time": "2023-04-25T14:19:45+00:00" + "time": "2025-04-22T09:12:12+00:00" }, { "name": "asm/php-ansible", @@ -1192,16 +1192,16 @@ }, { "name": "checkout/checkout-sdk-php", - "version": "3.2.7", + "version": "3.2.8", "source": { "type": "git", "url": "https://github.com/checkout/checkout-sdk-php.git", - "reference": "4b9438214a4777b343ff145eadefb5b5aa5c25a7" + "reference": "61a9d9e8b7d64f39ee58cc625c48eebd5d22c058" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/checkout/checkout-sdk-php/zipball/4b9438214a4777b343ff145eadefb5b5aa5c25a7", - "reference": "4b9438214a4777b343ff145eadefb5b5aa5c25a7", + "url": "https://api.github.com/repos/checkout/checkout-sdk-php/zipball/61a9d9e8b7d64f39ee58cc625c48eebd5d22c058", + "reference": "61a9d9e8b7d64f39ee58cc625c48eebd5d22c058", "shasum": "" }, "require": { @@ -1254,9 +1254,9 @@ ], "support": { "issues": "https://github.com/checkout/checkout-sdk-php/issues", - "source": "https://github.com/checkout/checkout-sdk-php/tree/3.2.7" + "source": "https://github.com/checkout/checkout-sdk-php/tree/3.2.8" }, - "time": "2024-11-20T09:31:05+00:00" + "time": "2025-04-22T08:03:18+00:00" }, { "name": "clue/stream-filter", @@ -5740,16 +5740,16 @@ }, { "name": "laravel/socialite", - "version": "v5.19.0", + "version": "v5.20.0", "source": { "type": "git", "url": "https://github.com/laravel/socialite.git", - "reference": "c40f843c5643fb6b089e46ce9794b8408bf08319" + "reference": "30972c12a41f71abeb418bc9ff157da8d9231519" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/socialite/zipball/c40f843c5643fb6b089e46ce9794b8408bf08319", - "reference": "c40f843c5643fb6b089e46ce9794b8408bf08319", + "url": "https://api.github.com/repos/laravel/socialite/zipball/30972c12a41f71abeb418bc9ff157da8d9231519", + "reference": "30972c12a41f71abeb418bc9ff157da8d9231519", "shasum": "" }, "require": { @@ -5808,7 +5808,7 @@ "issues": "https://github.com/laravel/socialite/issues", "source": "https://github.com/laravel/socialite" }, - "time": "2025-03-27T17:26:42+00:00" + "time": "2025-04-21T14:21:34+00:00" }, { "name": "laravel/tinker", @@ -18140,16 +18140,16 @@ }, { "name": "larastan/larastan", - "version": "v2.10.0", + "version": "v2.11.0", "source": { "type": "git", "url": "https://github.com/larastan/larastan.git", - "reference": "05519d721277604487a3ca71bdee87739d8d8716" + "reference": "484dabe3d75c7573b08c6a946d40b26211374396" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/larastan/larastan/zipball/05519d721277604487a3ca71bdee87739d8d8716", - "reference": "05519d721277604487a3ca71bdee87739d8d8716", + "url": "https://api.github.com/repos/larastan/larastan/zipball/484dabe3d75c7573b08c6a946d40b26211374396", + "reference": "484dabe3d75c7573b08c6a946d40b26211374396", "shasum": "" }, "require": { @@ -18166,7 +18166,7 @@ "phpstan/phpstan": "^1.12.17" }, "require-dev": { - "doctrine/coding-standard": "^12.0", + "doctrine/coding-standard": "^13", "laravel/framework": "^9.52.20 || ^10.48.28 || ^11.41.3", "mockery/mockery": "^1.5.1", "nikic/php-parser": "^4.19.1", @@ -18202,10 +18202,6 @@ { "name": "Can Vural", "email": "can9119@gmail.com" - }, - { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" } ], "description": "Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel", @@ -18221,7 +18217,7 @@ ], "support": { "issues": "https://github.com/larastan/larastan/issues", - "source": "https://github.com/larastan/larastan/tree/v2.10.0" + "source": "https://github.com/larastan/larastan/tree/v2.11.0" }, "funding": [ { @@ -18229,7 +18225,7 @@ "type": "github" } ], - "time": "2025-03-14T21:52:58+00:00" + "time": "2025-04-21T20:12:00+00:00" }, { "name": "mockery/mockery", @@ -18984,16 +18980,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.17", + "version": "11.5.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c" + "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fd2e863a2995cdfd864fb514b5e0b28b09895b5c", - "reference": "fd2e863a2995cdfd864fb514b5e0b28b09895b5c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc3e887c7f3f9917e1bf61e523413d753db00a17", + "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17", "shasum": "" }, "require": { @@ -19065,7 +19061,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.17" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.18" }, "funding": [ { @@ -19076,12 +19072,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2025-04-08T07:59:11+00:00" + "time": "2025-04-22T06:09:49+00:00" }, { "name": "react/cache",