Skip to content

Commit

Permalink
#119 Update to ZUGFeRD 2.3 (PHPCS, PHPStan)
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Sep 23, 2024
1 parent b5bfbf5 commit 42cbe91
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/ZugferdDocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,8 @@ public function addDocumentPaymentMeanToPaymentCard(string $cardType, string $ca
* @param float|null $lineTotalBasisAmount __BT-, From __ Tax rate goods amount
* @param float|null $allowanceChargeBasisAmount __BT-, From __ Total amount of surcharges and deductions of the tax rate at document level
* @param DateTime|null $taxPointDate __BT-, From __ Specification of a date, in accordance with the sales tax guideline, on which the sales tax for the seller and for the buyer becomes relevant for accounting, insofar as this date can be determined and differs from the invoice date
* Note: The tax collection date for VAT purposes is usually the date the goods were delivered or the service was completed (the base tax date). There are a few variations. For further information, please refer to Article 226 (7) of Council Directive 2006/112 / EC. This element is required if the date set for the sales tax return differs from the invoice date. Both the buyer and the seller should use the delivery date for VAT returns, if provided by the seller. This is not used in Germany. Instead, the delivery and service date must be specified.
* Note: The tax collection date for VAT purposes is usually the date the goods were delivered or the service was completed (the base tax date). There are a few variations. For further information, please refer to Article 226 (7) of Council Directive 2006/112 / EC. This element is required if the
* date set for the sales tax return differs from the invoice date. Both the buyer and the seller should use the delivery date for VAT returns, if provided by the seller. This is not used in Germany. Instead, the delivery and service date must be specified.
* @param string|null $dueDateTypeCode __BT-8, From BASIC WL__ The code for the date on which sales tax becomes relevant for the seller and the buyer.
* The code must distinguish between the following entries from UNTDID 2005:
* - date of issue of the invoice document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ class ZugferdAccountingAccountsClassificationTypes
* The code indicates a building site chart of accounts
*/
const BUILDING_SITE_ACCOUNT_CHART_OF_ACCOUNTS = '7';
}
}
11 changes: 9 additions & 2 deletions src/codelists/ZugferdVATExemptionReasonCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ class ZugferdVATExemptionReasonCode
/**
* VATEX-EU-143-1FA
* Exempt based on article 143, section 1 (fa) of Council Directive 2006/112/EC
* Context of exemption: The importation of goods by the European Community, the European Atomic Energy Community, the European Central Bank or the European Investment Bank, or by the bodies set up by the Communities to which the Protocol of 8 April 1965 on the privileges and immunities of the European Communities applies, within the limits and under the conditions of that Protocol and the agreements for its implementation or the headquarters agreements, in so far as it does not lead to distortion of competition;
* Context of exemption: The importation of goods by the European Community, the European Atomic Energy Community, the European Central
* Bank or the European Investment Bank, or by the bodies set up by the Communities to which the Protocol of 8 April 1965 on the
* privileges and immunities of the European Communities applies, within the limits and under the conditions of that Protocol and the
* agreements for its implementation or the headquarters agreements, in so far as it does not lead to distortion of competition;
*/
const VATEX_EU_143_1FA = "VATEX-EU-143-1FA";

Expand Down Expand Up @@ -326,7 +329,11 @@ class ZugferdVATExemptionReasonCode
/**
* VATEX-EU-151-1AA
* Exempt based on article 151, section 1 (aa) of Council Directive 2006/112/EC
* Context of exemption: The supply of goods or services to the European Community, the European Atomic Energy Community, the European Central Bank or the European Investment Bank, or to the bodies set up by the Communities to which the Protocol of 8 April 1965 on the privileges and immunities of the European Communities applies, within the limits and under the conditions of that Protocol and the agreements for its implementation or the headquarters agreements, in so far as it does not lead to distortion of competition.
* Context of exemption: The supply of goods or services to the European Community, the European Atomic Energy Community,
* the European Central Bank or the European Investment Bank, or to the bodies set up by the Communities to which the Protocol
* of 8 April 1965 on the privileges and immunities of the European Communities applies, within the limits and under the
* conditions of that Protocol and the agreements for its implementation or the headquarters agreements, in so far as it does
* not lead to distortion of competition.
*/
const VATEX_EU_151_1AA = "VATEX-EU-151-1AA";

Expand Down
2 changes: 1 addition & 1 deletion tests/testcases/issues/Issue104Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public function testInvalidException2()

$this->assertNull($document);
}
}
}
4 changes: 2 additions & 2 deletions tests/testcases/issues/Issue113Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function testSummationWithoutTotalVatAmount(): void
{
self::$document = ZugferdDocumentBuilder::createNew(ZugferdProfiles::PROFILE_EN16931);
self::$document->setDocumentSummation(100.0, 100.0);

$this->disableRenderXmlContent();
$this->assertXPathNotExistsWithIndex('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:LineTotalAmount', 0);
$this->assertXPathNotExistsWithIndex('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:ChargeTotalAmount', 0);
Expand All @@ -27,4 +27,4 @@ public function testSummationWithoutTotalVatAmount(): void
$this->assertXPathNotExistsWithIndex('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TotalPrepaidAmount', 0);
$this->assertXPathValueWithIndex('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:DuePayableAmount', 0, "100.00");
}
}
}

0 comments on commit 42cbe91

Please sign in to comment.