Skip to content

Commit

Permalink
Merge pull request #74 from OpenPEPPOL/hotfix/2020-fall-greekRules
Browse files Browse the repository at this point in the history
Hotfix/2020 fall greek rules
  • Loading branch information
jerouris authored Nov 12, 2020
2 parents c65092d + 32544cb commit 9eb2ade
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 20 deletions.
2 changes: 2 additions & 0 deletions guide/release-notes/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ IMPORTANT: Changes in code lists are also reflected by changes in the validation

:leveloffset: +1

include::v3.0.9-hotfix.adoc[]

include::v3.0.8.adoc[]

include::v3.0.7-hotfix.adoc[]
Expand Down
14 changes: 14 additions & 0 deletions guide/release-notes/v3.0.9-hotfix.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
= Version 3.0.9 - Hotfix
[horizontal]
Release date:: 2020-11-12

== Changes to BIS document
* Added VAT tax category code B to code list 5305. This code is allowed in the EN16931 for Italy only, based on the A-deviation.

== Changes to support documents


== Changes to code lists and validation artefacts
* Correction to release notes 3.0.8, noting that version containted the latest version of the EN16931 valdiation artefacts with the changes noted in their release notes https://github.com/ConnectingEurope/eInvoicing-EN16931/releases/tag/validation-1.3.3

* Applied workarounds to some Peppol national rules for broader compatilibity with transformation tools.
14 changes: 5 additions & 9 deletions rules/national-examples/GR/GR-base-example-TaxRepresentative.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<cbc:BuyerReference>0150abc</cbc:BuyerReference>
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="9933">801399030</cbc:EndpointID>
<cbc:EndpointID schemeID="0088">1238764941386</cbc:EndpointID>
<cac:PartyIdentification>
<cbc:ID>155988103000</cbc:ID>
</cac:PartyIdentification>
Expand All @@ -27,14 +27,9 @@
<cbc:CityName>Athens</cbc:CityName>
<cbc:PostalZone>163 44</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>GR</cbc:IdentificationCode>
<cbc:IdentificationCode>SE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyLegalEntity>
<cbc:RegistrationName>SupplierOfficialName Ltd</cbc:RegistrationName>
<cbc:CompanyID>EL801399030</cbc:CompanyID>
</cac:PartyLegalEntity>

</cac:PostalAddress>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
Expand All @@ -53,7 +48,7 @@
<cbc:CityName>Stockholm</cbc:CityName>
<cbc:PostalZone>456 34</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>GR</cbc:IdentificationCode>
<cbc:IdentificationCode>SE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>

Expand Down Expand Up @@ -93,6 +88,7 @@
</cac:Attachment>
</cac:AdditionalDocumentReference>
<cac:TaxRepresentativeParty>

<cac:PartyName>
<cbc:Name>TaxRepresentative Name</cbc:Name>
</cac:PartyName>
Expand Down
29 changes: 19 additions & 10 deletions rules/sch/PEPPOL-EN16931-UBL.sch
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,25 @@ This schematron uses business terms defined the CEN/EN16931-1 and is reproduced
<let name="isGreekSender" value="($supplierCountry ='GR') or ($supplierCountry ='EL')"/>
<let name="isGreekReceiver" value="($customerCountry ='GR') or ($customerCountry ='EL')"/>
<let name="isGreekSenderandReceiver" value="$isGreekSender and $isGreekReceiver"/>
<!-- Test only accounting Supplier Country -->
<let name="accountingSupplierCountry" value="
if (/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)) then
upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2)))
else
if (/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode) then
upper-case(normalize-space(/*/cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode))
else
'XX'"/>

<!-- Sender Rules -->
<!-- Sender Rules -->
<pattern>
<let name="dateRegExp" value="'^(0?[1-9]|[12][0-9]|3[01])[-\\/ ]?(0?[1-9]|1[0-2])[-/ ]?(?:19|20)[0-9]{2}'"/>
<let name="dateRegExp" value="'^(0?[1-9]|[12][0-9]|3[01])[-\\/ ]?(0?[1-9]|1[0-2])[-\\/ ]?(19|20)[0-9]{2}'"/>
<let name="greekDocumentType" value="tokenize('1.1 1.2 1.3 1.4 1.5 1.6 2.1 2.2 2.3 2.4 3.1 3.2 4 5.1 5.2 6.1 6.2 7.1 8.1 8.2 11.1 11.2 11.3 11.4 11.5','\s')"/>
<let name="tokenizedUblIssueDate" value="tokenize(/*/cbc:IssueDate,'-')"/>


<!-- Invoice ID -->
<rule context="(/ubl-invoice:Invoice | /ubl-creditnote:CreditNote)/cbc:ID[$isGreekSender]">
<rule context="/ubl-invoice:Invoice/cbc:ID[$isGreekSender] | /ubl-creditnote:CreditNote/cbc:ID[$isGreekSender]">
<let name="IdSegments" value="tokenize(.,'\|')"/>
<assert id="GR-R-001-1" test="count($IdSegments) = 6" flag="fatal"> When the Supplier is Greek, the Invoice Id should consist of 6 segments</assert>
<assert id="GR-R-001-2" test="string-length(normalize-space($IdSegments[1])) = 9
Expand Down Expand Up @@ -403,7 +412,7 @@ This schematron uses business terms defined the CEN/EN16931-1 and is reproduced

<!-- Tax Representative Rules -->
<rule context="cac:TaxRepresentativeParty[$isGreekSender]">
<assert id="GR-R-007-2" test="string-length(normalize-space(cac:PartyName/cbc:Name))>0">If the Greek Suppliers do not have Greek VAT they must provide the full name of their tax representative in Greece</assert>
<assert id="GR-R-007-2" test="string-length(normalize-space(cac:PartyName/cbc:Name))>0" flag="fatal">If the Greek Suppliers do not have Greek VAT they must provide the full name of their tax representative in Greece</assert>
<assert id="GR-R-007-3" test="count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and
substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and
u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))" flag="fatal">If the Greek Suppliers do not have Greek VAT, they must provide the VAT number of their tax representative</assert>
Expand All @@ -412,15 +421,15 @@ This schematron uses business terms defined the CEN/EN16931-1 and is reproduced

<!-- VAT Number Rules -->
<rule context="cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID">
<assert id="GR-R-003" test="substring(.,1,2) = 'EL' and u:TinVerification(substring(.,3))" flag="fatal">Bad VAT Number for Greek Supplier</assert>
<assert id="GR-R-003" test="substring(.,1,2) = 'EL' and u:TinVerification(substring(.,3))" flag="fatal">For the Greek Suppliers, the VAT must start with 'EL' and must be a valid TIN number</assert>
</rule>

<!-- Document Reference Rules (existence of MARK and Invoice Verification URL) -->
<rule context="/ubl-invoice:Invoice[$isGreekSender] | /ubl-creditnote:CreditNote[$isGreekSender]">
<!-- ΜARK Rules -->
<assert id="GR-R-004-1" test="count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##M.AR.K##'])=1" flag="fatal"> When Supplier is Greek, there must be one MARK Number</assert>
<assert id="GR-S-008-1" flag="warning" test="count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE-URL##'])=1"> When Supplier is Greek, there should be one invoice url</assert>
<assert id="GR-R-008-2" test="(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE-URL##']) = 0 ) or (count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE-URL##']) = 1 ) "> When Supplier is Greek, there should be no more than one invoice url</assert>
<assert id="GR-R-008-2" test="(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE-URL##']) = 0 ) or (count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE-URL##']) = 1 )" flag="fatal"> When Supplier is Greek, there should be no more than one invoice url</assert>
</rule>

<!-- MARK Rules -->
Expand All @@ -439,24 +448,24 @@ This schematron uses business terms defined the CEN/EN16931-1 and is reproduced
</rule>

<!-- Endpoint Rules -->
<rule context="cac:AccountingSupplierParty[$isGreekSender]/cac:Party/cbc:EndpointID">
<assert id="GR-R-009" test="./@schemeID='9933'and u:TinVerification(.)" flag="fatal">Greek suppliers that send an invoice through the PEPPOL network must use their TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (schemeID 9933).</assert>
<rule context="cac:AccountingSupplierParty/cac:Party[$accountingSupplierCountry='GR' or $accountingSupplierCountry='EL']/cbc:EndpointID">
<assert id="GR-R-009" test="./@schemeID='9933' and u:TinVerification(.)" flag="fatal">Greek suppliers that send an invoice through the PEPPOL network must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (schemeID 9933).</assert>
</rule>

</pattern>

<!-- Greek Sender and Greek Receiver rules -->
<pattern>
<!-- VAT Number Rules -->
<rule context="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party">
<rule context="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party">
<assert id="GR-R-006" test="count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and
substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and
u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))" flag="fatal">Greek Suppliers must provide the VAT number of the buyer, if the buyer is Greek </assert>
</rule>

<!-- Endpoint Rules -->
<rule context="cac:AccountingCustomerParty[$isGreekSenderandReceiver]/cac:Party/cbc:EndpointID">
<assert id="GR-R-010" test="./@schemeID='9933'and u:TinVerification(.)" flag="fatal">Greek Suppliers that send an invoice through the PEPPOL network to a greek buyer must use the buyer's TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (SchemeID 9933)</assert>
<assert id="GR-R-010" test="./@schemeID='9933' and u:TinVerification(.)" flag="fatal">Greek Suppliers that send an invoice through the PEPPOL network to a greek buyer must use a correct TIN number as an electronic address according to PEPPOL Electronic Address Identifier scheme (SchemeID 9933)</assert>
</rule>
</pattern>

Expand Down
2 changes: 1 addition & 1 deletion rules/unit-UBL-GR/GR_Validation_GRR007.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<cac:Party>
<cac:PostalAddress>
<cac:Country>
<cbc:IdentificationCode>GR</cbc:IdentificationCode>
<cbc:IdentificationCode>SE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>

Expand Down
36 changes: 36 additions & 0 deletions rules/unit-UBL-GR/GR_Validation_GRR009.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,41 @@
</cac:AccountingSupplierParty>
</Invoice>
</test>

<test>
<assert>
<success>GR-R-009</success>
</assert>
<Invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 "
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:ID>061828591|01/10/2010|0|1.1|0|1</cbc:ID>
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="0088">1238764941386</cbc:EndpointID>
<cac:PostalAddress>
<cac:Country>
<cbc:IdentificationCode>SE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:TaxRepresentativeParty>
<cac:PostalAddress>
<cac:Country>
<cbc:IdentificationCode>GR</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>EL061828591</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
</cac:TaxRepresentativeParty>
</Invoice>
</test>

</testSet>
6 changes: 6 additions & 0 deletions structure/codelist/UNCL5305.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,10 @@
the transfer of immovable property located in the cities
of Ceuta and Melilla.</Description>
</Code>

<Code>
<Id>B</Id>
<Name>Transferred (VAT), In Italy</Name>
<Description>VAT not to be paid to the issuer of the invoice but directly to relevant tax authority. This code is allowed in the EN 16931 for Italy only based on the Italian A-deviation.</Description>
</Code>
</CodeList>

0 comments on commit 9eb2ade

Please sign in to comment.