Skip to content

Commit

Permalink
Merge pull request #63 from Schrank/fix-typo
Browse files Browse the repository at this point in the history
Fix typo taxCategpryCodes -> taxCategoryCodes
  • Loading branch information
horstoeko authored May 28, 2024
2 parents 0ae838a + 3efed44 commit d21a4c5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/ZugferdDocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions src/ZugferdDocumentReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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];
Expand All @@ -3186,7 +3186,7 @@ public function getDocumentLogisticsServiceCharge(?string &$description, ?float
"typecode" => ["getTypeCode.value", ""],
]
);
$taxCategpryCodes = $this->convertToArray(
$taxCategoryCodes = $this->convertToArray(
$appliedTradeTax,
[
"categorycode" => ["getCategoryCode.value", ""],
Expand Down
8 changes: 4 additions & 4 deletions src/ZugferdObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down
10 changes: 5 additions & 5 deletions tests/testcases/PdfReaderExtendedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions tests/testcases/ReaderExtendedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d21a4c5

Please sign in to comment.