diff --git a/src/ZugferdDocumentBuilder.php b/src/ZugferdDocumentBuilder.php index 0a2fc518..52898c57 100644 --- a/src/ZugferdDocumentBuilder.php +++ b/src/ZugferdDocumentBuilder.php @@ -2745,7 +2745,7 @@ public function addDocumentAllowanceCharge(float $actualAmount, bool $isCharge, * Amount of the service fee * @param array|null $taxTypeCodes * Coded description of a sales tax category. Note: Fixed value = "VAT" - * @param array|null $taxCategpryCodes + * @param array|null $taxCategoryCodes * Coded description of a sales tax category * * The following entries from UNTDID 5305 are used (details in brackets): @@ -2776,9 +2776,9 @@ public function addDocumentAllowanceCharge(float $actualAmount, bool $isCharge, * value 20 is given for 20% (and not 0.2) * @return ZugferdDocumentBuilder */ - public function addDocumentLogisticsServiceCharge(string $description, float $appliedAmount, ?array $taxTypeCodes = null, ?array $taxCategpryCodes = null, ?array $rateApplicablePercents = null): ZugferdDocumentBuilder + public function addDocumentLogisticsServiceCharge(string $description, float $appliedAmount, ?array $taxTypeCodes = null, ?array $taxCategoryCodes = null, ?array $rateApplicablePercents = null): ZugferdDocumentBuilder { - $logcharge = $this->getObjectHelper()->getLogisticsServiceChargeType($description, $appliedAmount, $taxTypeCodes, $taxCategpryCodes, $rateApplicablePercents); + $logcharge = $this->getObjectHelper()->getLogisticsServiceChargeType($description, $appliedAmount, $taxTypeCodes, $taxCategoryCodes, $rateApplicablePercents); $this->getObjectHelper()->tryCall($this->headerTradeSettlement, "addToSpecifiedLogisticsServiceCharge", $logcharge); return $this; } diff --git a/src/ZugferdDocumentReader.php b/src/ZugferdDocumentReader.php index 8bd5927a..b881b465 100644 --- a/src/ZugferdDocumentReader.php +++ b/src/ZugferdDocumentReader.php @@ -3141,7 +3141,7 @@ public function nextDocumentLogisticsServiceCharge(): bool * Amount of the service fee * @param array|null $taxTypeCodes * Coded description of a sales tax category. Note: Fixed value = "VAT" - * @param array|null $taxCategpryCodes + * @param array|null $taxCategoryCodes * Coded description of a sales tax category * * The following entries from UNTDID 5305 are used (details in brackets): @@ -3172,7 +3172,7 @@ public function nextDocumentLogisticsServiceCharge(): bool * value 20 is given for 20% (and not 0.2) * @return ZugferdDocumentReader */ - public function getDocumentLogisticsServiceCharge(?string &$description, ?float &$appliedAmount, ?array &$taxTypeCodes = null, ?array &$taxCategpryCodes = null, ?array &$rateApplicablePercents = null): ZugferdDocumentReader + public function getDocumentLogisticsServiceCharge(?string &$description, ?float &$appliedAmount, ?array &$taxTypeCodes = null, ?array &$taxCategoryCodes = null, ?array &$rateApplicablePercents = null): ZugferdDocumentReader { $serviceCharge = $this->getInvoiceValueByPath("getSupplyChainTradeTransaction.getApplicableHeaderTradeSettlement.getSpecifiedLogisticsServiceCharge", []); $serviceCharge = $serviceCharge[$this->documentLogisticServiceChargePointer]; @@ -3186,7 +3186,7 @@ public function getDocumentLogisticsServiceCharge(?string &$description, ?float "typecode" => ["getTypeCode.value", ""], ] ); - $taxCategpryCodes = $this->convertToArray( + $taxCategoryCodes = $this->convertToArray( $appliedTradeTax, [ "categorycode" => ["getCategoryCode.value", ""], diff --git a/src/ZugferdObjectHelper.php b/src/ZugferdObjectHelper.php index c844efd2..0d6965ae 100644 --- a/src/ZugferdObjectHelper.php +++ b/src/ZugferdObjectHelper.php @@ -1049,11 +1049,11 @@ public function getTradeAllowanceChargeType(?float $actualAmount = null, ?bool $ * @param string|null $description * @param float|null $appliedAmount * @param array|null $taxTypeCodes - * @param array|null $taxCategpryCodes + * @param array|null $taxCategoryCodes * @param array|null $rateApplicablePercents * @return object|null */ - public function getLogisticsServiceChargeType(?string $description = null, ?float $appliedAmount = null, ?array $taxTypeCodes = null, ?array $taxCategpryCodes = null, ?array $rateApplicablePercents = null): ?object + public function getLogisticsServiceChargeType(?string $description = null, ?float $appliedAmount = null, ?array $taxTypeCodes = null, ?array $taxCategoryCodes = null, ?array $rateApplicablePercents = null): ?object { if (self::isAllNullOrEmpty(func_get_args())) { return null; @@ -1064,9 +1064,9 @@ public function getLogisticsServiceChargeType(?string $description = null, ?floa $this->tryCall($logCharge, "setDescription", $this->getTextType($description)); $this->tryCall($logCharge, "setAppliedAmount", $this->getAmountType($appliedAmount)); - if (!is_null($taxCategpryCodes) && !is_null($taxTypeCodes) && !is_null($rateApplicablePercents)) { + if (!is_null($taxCategoryCodes) && !is_null($taxTypeCodes) && !is_null($rateApplicablePercents)) { foreach ($rateApplicablePercents as $index => $rateApplicablePercent) { - $taxBreakdown = $this->getTradeTaxType($taxCategpryCodes[$index], $taxTypeCodes[$index], null, null, $rateApplicablePercent); + $taxBreakdown = $this->getTradeTaxType($taxCategoryCodes[$index], $taxTypeCodes[$index], null, null, $rateApplicablePercent); $this->tryCall($logCharge, "addToAppliedTradeTax", $taxBreakdown); } } diff --git a/tests/testcases/PdfReaderExtendedTest.php b/tests/testcases/PdfReaderExtendedTest.php index a2730004..5d81ca81 100644 --- a/tests/testcases/PdfReaderExtendedTest.php +++ b/tests/testcases/PdfReaderExtendedTest.php @@ -1218,17 +1218,17 @@ public function testtDocumentLogisticsServiceChargeLoop(): void public function testGetDocumentLogisticsServiceCharge(): void { $this->assertTrue(self::$document->firstDocumentLogisticsServiceCharge()); - self::$document->getDocumentLogisticsServiceCharge($description, $appliedAmount, $taxTypeCodes, $taxCategpryCodes, $rateApplicablePercents); + self::$document->getDocumentLogisticsServiceCharge($description, $appliedAmount, $taxTypeCodes, $taxCategoryCodes, $rateApplicablePercents); $this->assertEquals("Transportkosten: Frachbetrag", $description); $this->assertEquals(15.00, $appliedAmount); $this->assertIsArray($taxTypeCodes); $this->assertEquals(1, count($taxTypeCodes)); $this->assertArrayHasKey(0, $taxTypeCodes); $this->assertEquals("VAT", $taxTypeCodes[0]); - $this->assertIsArray($taxCategpryCodes); - $this->assertEquals(1, count($taxCategpryCodes)); - $this->assertArrayHasKey(0, $taxCategpryCodes); - $this->assertEquals("S", $taxCategpryCodes[0]); + $this->assertIsArray($taxCategoryCodes); + $this->assertEquals(1, count($taxCategoryCodes)); + $this->assertArrayHasKey(0, $taxCategoryCodes); + $this->assertEquals("S", $taxCategoryCodes[0]); $this->assertIsArray($rateApplicablePercents); $this->assertEquals(1, count($rateApplicablePercents)); $this->assertArrayHasKey(0, $rateApplicablePercents); diff --git a/tests/testcases/ReaderExtendedTest.php b/tests/testcases/ReaderExtendedTest.php index a81fb2ba..b26a91db 100644 --- a/tests/testcases/ReaderExtendedTest.php +++ b/tests/testcases/ReaderExtendedTest.php @@ -1263,17 +1263,17 @@ public function testtDocumentLogisticsServiceChargeLoop(): void public function testGetDocumentLogisticsServiceCharge(): void { $this->assertTrue(self::$document->firstDocumentLogisticsServiceCharge()); - self::$document->getDocumentLogisticsServiceCharge($description, $appliedAmount, $taxTypeCodes, $taxCategpryCodes, $rateApplicablePercents); + self::$document->getDocumentLogisticsServiceCharge($description, $appliedAmount, $taxTypeCodes, $taxCategoryCodes, $rateApplicablePercents); $this->assertEquals("Transportkosten: Frachbetrag", $description); $this->assertEquals(15.00, $appliedAmount); $this->assertIsArray($taxTypeCodes); $this->assertEquals(1, count($taxTypeCodes)); $this->assertArrayHasKey(0, $taxTypeCodes); $this->assertEquals("VAT", $taxTypeCodes[0]); - $this->assertIsArray($taxCategpryCodes); - $this->assertEquals(1, count($taxCategpryCodes)); - $this->assertArrayHasKey(0, $taxCategpryCodes); - $this->assertEquals("S", $taxCategpryCodes[0]); + $this->assertIsArray($taxCategoryCodes); + $this->assertEquals(1, count($taxCategoryCodes)); + $this->assertArrayHasKey(0, $taxCategoryCodes); + $this->assertEquals("S", $taxCategoryCodes[0]); $this->assertIsArray($rateApplicablePercents); $this->assertEquals(1, count($rateApplicablePercents)); $this->assertArrayHasKey(0, $rateApplicablePercents);