Fixes for importing invoices with item discounts

This commit is contained in:
David Bomba 2025-10-21 07:49:25 +11:00
parent e999f9b8bb
commit 6daba8822b
2 changed files with 83 additions and 78 deletions

View File

@ -87,6 +87,11 @@ class InvoiceTransformer extends BaseTransformer
'tax_rate2' => $this->getFloat($invoice_data, 'invoice.tax_rate2'),
'tax_name3' => $this->getString($invoice_data, 'invoice.tax_name3'),
'tax_rate3' => $this->getFloat($invoice_data, 'invoice.tax_rate3'),
'is_amount_discount' => filter_var(
$this->getString($invoice_data, 'invoice.is_amount_discount'),
FILTER_VALIDATE_BOOLEAN,
FILTER_NULL_ON_FAILURE
),
'custom_value1' => $this->getString(
$invoice_data,
'invoice.custom_value1'

156
composer.lock generated
View File

@ -380,16 +380,16 @@
},
{
"name": "awobaz/compoships",
"version": "2.5.0",
"version": "2.5.1",
"source": {
"type": "git",
"url": "https://github.com/topclaudy/compoships.git",
"reference": "251a0e07ee7bf3cfc9d0201f3e51a5c782891ca1"
"reference": "d8de30b57949d6021bb0312105f6d9d0920266b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/topclaudy/compoships/zipball/251a0e07ee7bf3cfc9d0201f3e51a5c782891ca1",
"reference": "251a0e07ee7bf3cfc9d0201f3e51a5c782891ca1",
"url": "https://api.github.com/repos/topclaudy/compoships/zipball/d8de30b57949d6021bb0312105f6d9d0920266b6",
"reference": "d8de30b57949d6021bb0312105f6d9d0920266b6",
"shasum": ""
},
"require": {
@ -430,7 +430,7 @@
],
"support": {
"issues": "https://github.com/topclaudy/compoships/issues",
"source": "https://github.com/topclaudy/compoships/tree/2.5.0"
"source": "https://github.com/topclaudy/compoships/tree/2.5.1"
},
"funding": [
{
@ -438,7 +438,7 @@
"type": "custom"
}
],
"time": "2025-10-03T17:30:21+00:00"
"time": "2025-10-10T14:07:12+00:00"
},
{
"name": "aws/aws-crt-php",
@ -496,16 +496,16 @@
},
{
"name": "aws/aws-sdk-php",
"version": "3.356.36",
"version": "3.356.40",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
"reference": "20facd00fe1a8f733c3275918bf533d2330af53d"
"reference": "3c1d71932ed962810316930b327b3b71a7517cff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/20facd00fe1a8f733c3275918bf533d2330af53d",
"reference": "20facd00fe1a8f733c3275918bf533d2330af53d",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/3c1d71932ed962810316930b327b3b71a7517cff",
"reference": "3c1d71932ed962810316930b327b3b71a7517cff",
"shasum": ""
},
"require": {
@ -587,9 +587,9 @@
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.356.36"
"source": "https://github.com/aws/aws-sdk-php/tree/3.356.40"
},
"time": "2025-10-09T18:07:17+00:00"
"time": "2025-10-15T18:13:33+00:00"
},
{
"name": "babenkoivan/elastic-adapter",
@ -1069,16 +1069,16 @@
},
{
"name": "braintree/braintree_php",
"version": "6.28.0",
"version": "6.29.0",
"source": {
"type": "git",
"url": "https://github.com/braintree/braintree_php.git",
"reference": "f8693ee85b232c6fe4599100cdaba2c07ca34b79"
"reference": "210629e087fced3b6fa66bd33627e782e14ae512"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/braintree/braintree_php/zipball/f8693ee85b232c6fe4599100cdaba2c07ca34b79",
"reference": "f8693ee85b232c6fe4599100cdaba2c07ca34b79",
"url": "https://api.github.com/repos/braintree/braintree_php/zipball/210629e087fced3b6fa66bd33627e782e14ae512",
"reference": "210629e087fced3b6fa66bd33627e782e14ae512",
"shasum": ""
},
"require": {
@ -1112,9 +1112,9 @@
"description": "Braintree PHP Client Library",
"support": {
"issues": "https://github.com/braintree/braintree_php/issues",
"source": "https://github.com/braintree/braintree_php/tree/6.28.0"
"source": "https://github.com/braintree/braintree_php/tree/6.29.0"
},
"time": "2025-08-05T18:53:15+00:00"
"time": "2025-10-15T20:11:56+00:00"
},
{
"name": "brick/math",
@ -2059,16 +2059,16 @@
},
{
"name": "dompdf/dompdf",
"version": "v3.1.2",
"version": "v3.1.3",
"source": {
"type": "git",
"url": "https://github.com/dompdf/dompdf.git",
"reference": "b3493e35d31a5e76ec24c3b64a29b0034b2f32a6"
"reference": "baed300e4fb8226359c04395518059a136e2a2e2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/b3493e35d31a5e76ec24c3b64a29b0034b2f32a6",
"reference": "b3493e35d31a5e76ec24c3b64a29b0034b2f32a6",
"url": "https://api.github.com/repos/dompdf/dompdf/zipball/baed300e4fb8226359c04395518059a136e2a2e2",
"reference": "baed300e4fb8226359c04395518059a136e2a2e2",
"shasum": ""
},
"require": {
@ -2117,9 +2117,9 @@
"homepage": "https://github.com/dompdf/dompdf",
"support": {
"issues": "https://github.com/dompdf/dompdf/issues",
"source": "https://github.com/dompdf/dompdf/tree/v3.1.2"
"source": "https://github.com/dompdf/dompdf/tree/v3.1.3"
},
"time": "2025-09-23T03:06:41+00:00"
"time": "2025-10-14T13:10:17+00:00"
},
{
"name": "dompdf/php-font-lib",
@ -3036,16 +3036,16 @@
},
{
"name": "google/apiclient-services",
"version": "v0.415.0",
"version": "v0.416.0",
"source": {
"type": "git",
"url": "https://github.com/googleapis/google-api-php-client-services.git",
"reference": "080bdeb1d5243429164dc589b69426bae98dad1d"
"reference": "a7b96415b22d85cee12ab730089f1d1b66bc191f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/080bdeb1d5243429164dc589b69426bae98dad1d",
"reference": "080bdeb1d5243429164dc589b69426bae98dad1d",
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/a7b96415b22d85cee12ab730089f1d1b66bc191f",
"reference": "a7b96415b22d85cee12ab730089f1d1b66bc191f",
"shasum": ""
},
"require": {
@ -3074,9 +3074,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.415.0"
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.416.0"
},
"time": "2025-10-05T01:02:15+00:00"
"time": "2025-10-13T01:08:26+00:00"
},
{
"name": "google/auth",
@ -4033,16 +4033,16 @@
},
{
"name": "horstoeko/zugferd",
"version": "v1.0.115",
"version": "v1.0.116",
"source": {
"type": "git",
"url": "https://github.com/horstoeko/zugferd.git",
"reference": "9bbf0c06942645001d10e88d6e26ff6d8983da2c"
"reference": "23fe5478a394ed96e15aaaff7451742f33d36f02"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/horstoeko/zugferd/zipball/9bbf0c06942645001d10e88d6e26ff6d8983da2c",
"reference": "9bbf0c06942645001d10e88d6e26ff6d8983da2c",
"url": "https://api.github.com/repos/horstoeko/zugferd/zipball/23fe5478a394ed96e15aaaff7451742f33d36f02",
"reference": "23fe5478a394ed96e15aaaff7451742f33d36f02",
"shasum": ""
},
"require": {
@ -4101,9 +4101,9 @@
],
"support": {
"issues": "https://github.com/horstoeko/zugferd/issues",
"source": "https://github.com/horstoeko/zugferd/tree/v1.0.115"
"source": "https://github.com/horstoeko/zugferd/tree/v1.0.116"
},
"time": "2025-06-06T08:14:02+00:00"
"time": "2025-10-14T12:07:57+00:00"
},
{
"name": "horstoeko/zugferdvisualizer",
@ -4941,20 +4941,20 @@
},
{
"name": "laminas/laminas-diactoros",
"version": "3.6.0",
"version": "3.8.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-diactoros.git",
"reference": "b068eac123f21c0e592de41deeb7403b88e0a89f"
"reference": "60c182916b2749480895601649563970f3f12ec4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/b068eac123f21c0e592de41deeb7403b88e0a89f",
"reference": "b068eac123f21c0e592de41deeb7403b88e0a89f",
"url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/60c182916b2749480895601649563970f3f12ec4",
"reference": "60c182916b2749480895601649563970f3f12ec4",
"shasum": ""
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"psr/http-factory": "^1.1",
"psr/http-message": "^1.1 || ^2.0"
},
@ -4971,11 +4971,11 @@
"ext-gd": "*",
"ext-libxml": "*",
"http-interop/http-factory-tests": "^2.2.0",
"laminas/laminas-coding-standard": "~3.0.0",
"laminas/laminas-coding-standard": "~3.1.0",
"php-http/psr7-integration-tests": "^1.4.0",
"phpunit/phpunit": "^10.5.36",
"psalm/plugin-phpunit": "^0.19.0",
"vimeo/psalm": "^5.26.1"
"psalm/plugin-phpunit": "^0.19.5",
"vimeo/psalm": "^6.13"
},
"type": "library",
"extra": {
@ -5025,7 +5025,7 @@
"type": "community_bridge"
}
],
"time": "2025-05-05T16:03:34+00:00"
"time": "2025-10-12T15:31:36+00:00"
},
{
"name": "laracasts/presenter",
@ -5294,16 +5294,16 @@
},
{
"name": "laravel/octane",
"version": "v2.12.3",
"version": "v2.13.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/octane.git",
"reference": "172e61d0b4dd9db263a59ff66213fa2d68f23dbf"
"reference": "21fd6220560c609bf703fa4ce6008081a4ce746c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/octane/zipball/172e61d0b4dd9db263a59ff66213fa2d68f23dbf",
"reference": "172e61d0b4dd9db263a59ff66213fa2d68f23dbf",
"url": "https://api.github.com/repos/laravel/octane/zipball/21fd6220560c609bf703fa4ce6008081a4ce746c",
"reference": "21fd6220560c609bf703fa4ce6008081a4ce746c",
"shasum": ""
},
"require": {
@ -5380,7 +5380,7 @@
"issues": "https://github.com/laravel/octane/issues",
"source": "https://github.com/laravel/octane"
},
"time": "2025-09-23T13:39:52+00:00"
"time": "2025-10-13T16:28:21+00:00"
},
{
"name": "laravel/prompts",
@ -5443,16 +5443,16 @@
},
{
"name": "laravel/scout",
"version": "v10.19.1",
"version": "v10.20.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/scout.git",
"reference": "bc8dbffc06472e28147ee739aec95fdf653f9d91"
"reference": "a04d7a8eb27b66c8b7edb7e0c6a078e9e78c4f5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/scout/zipball/bc8dbffc06472e28147ee739aec95fdf653f9d91",
"reference": "bc8dbffc06472e28147ee739aec95fdf653f9d91",
"url": "https://api.github.com/repos/laravel/scout/zipball/a04d7a8eb27b66c8b7edb7e0c6a078e9e78c4f5b",
"reference": "a04d7a8eb27b66c8b7edb7e0c6a078e9e78c4f5b",
"shasum": ""
},
"require": {
@ -5520,20 +5520,20 @@
"issues": "https://github.com/laravel/scout/issues",
"source": "https://github.com/laravel/scout"
},
"time": "2025-10-07T14:48:20+00:00"
"time": "2025-10-14T14:09:26+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v2.0.5",
"version": "v2.0.6",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "3832547db6e0e2f8bb03d4093857b378c66eceed"
"reference": "038ce42edee619599a1debb7e81d7b3759492819"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3832547db6e0e2f8bb03d4093857b378c66eceed",
"reference": "3832547db6e0e2f8bb03d4093857b378c66eceed",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/038ce42edee619599a1debb7e81d7b3759492819",
"reference": "038ce42edee619599a1debb7e81d7b3759492819",
"shasum": ""
},
"require": {
@ -5581,7 +5581,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
"time": "2025-09-22T17:29:40+00:00"
"time": "2025-10-09T13:42:30+00:00"
},
{
"name": "laravel/slack-notification-channel",
@ -11314,16 +11314,16 @@
},
{
"name": "sentry/sentry-laravel",
"version": "4.16.0",
"version": "4.17.0",
"source": {
"type": "git",
"url": "https://github.com/getsentry/sentry-laravel.git",
"reference": "b33b2e487b02db02d92988228f142d7fa2be2bfa"
"reference": "f321c450f1ff31fc97cf42c249de4a47d593d216"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/b33b2e487b02db02d92988228f142d7fa2be2bfa",
"reference": "b33b2e487b02db02d92988228f142d7fa2be2bfa",
"url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/f321c450f1ff31fc97cf42c249de4a47d593d216",
"reference": "f321c450f1ff31fc97cf42c249de4a47d593d216",
"shasum": ""
},
"require": {
@ -11387,7 +11387,7 @@
],
"support": {
"issues": "https://github.com/getsentry/sentry-laravel/issues",
"source": "https://github.com/getsentry/sentry-laravel/tree/4.16.0"
"source": "https://github.com/getsentry/sentry-laravel/tree/4.17.0"
},
"funding": [
{
@ -11399,7 +11399,7 @@
"type": "custom"
}
],
"time": "2025-09-10T16:38:18+00:00"
"time": "2025-10-15T09:58:47+00:00"
},
{
"name": "setasign/fpdf",
@ -18331,7 +18331,7 @@
},
{
"name": "illuminate/json-schema",
"version": "v12.33.0",
"version": "v12.34.0",
"source": {
"type": "git",
"url": "https://github.com/illuminate/json-schema.git",
@ -18525,16 +18525,16 @@
},
{
"name": "laravel/boost",
"version": "v1.3.0",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/boost.git",
"reference": "ef8800843efc581965c38393adb63ba336dc3979"
"reference": "8d2dedf7779c2e175a02a176dec38e6f9b35352b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/boost/zipball/ef8800843efc581965c38393adb63ba336dc3979",
"reference": "ef8800843efc581965c38393adb63ba336dc3979",
"url": "https://api.github.com/repos/laravel/boost/zipball/8d2dedf7779c2e175a02a176dec38e6f9b35352b",
"reference": "8d2dedf7779c2e175a02a176dec38e6f9b35352b",
"shasum": ""
},
"require": {
@ -18543,7 +18543,7 @@
"illuminate/contracts": "^10.49.0|^11.45.3|^12.28.1",
"illuminate/routing": "^10.49.0|^11.45.3|^12.28.1",
"illuminate/support": "^10.49.0|^11.45.3|^12.28.1",
"laravel/mcp": "^0.2.0",
"laravel/mcp": "^0.2.0|^0.3.0",
"laravel/prompts": "0.1.25|^0.3.6",
"laravel/roster": "^0.2.8",
"php": "^8.1"
@ -18587,20 +18587,20 @@
"issues": "https://github.com/laravel/boost/issues",
"source": "https://github.com/laravel/boost"
},
"time": "2025-09-30T09:34:43+00:00"
"time": "2025-10-14T01:13:19+00:00"
},
{
"name": "laravel/mcp",
"version": "v0.2.1",
"version": "v0.3.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/mcp.git",
"reference": "0ecf0c04b20e5946ae080e8d67984d5c555174b0"
"reference": "4e1389eedb4741a624e26cc3660b31bae04c4342"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/mcp/zipball/0ecf0c04b20e5946ae080e8d67984d5c555174b0",
"reference": "0ecf0c04b20e5946ae080e8d67984d5c555174b0",
"url": "https://api.github.com/repos/laravel/mcp/zipball/4e1389eedb4741a624e26cc3660b31bae04c4342",
"reference": "4e1389eedb4741a624e26cc3660b31bae04c4342",
"shasum": ""
},
"require": {
@ -18660,7 +18660,7 @@
"issues": "https://github.com/laravel/mcp/issues",
"source": "https://github.com/laravel/mcp"
},
"time": "2025-09-24T15:48:16+00:00"
"time": "2025-10-07T14:28:56+00:00"
},
{
"name": "laravel/roster",