Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024 q2 dev #93

Merged
merged 8 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions guides/release-notes/v3.0.13.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ Release date:: May 2024

* Update of PEPPOL-COMMON-R049 which validates identifiers using ICD/EAS 0007. The change is adding validation of the check number of a Swedish Organization number.

* Added rule to check that an OrderResponse with ResponseTypeCode CA (accepted with amendment on line level) actually has order response lines. The rule is introduced with severity warning and will be changed to severity fatal in next release. The rule is added to both T76 (Order Responseand) and T116 (Order Response Advanced).

== Other
2 changes: 2 additions & 0 deletions rules/sch/PEPPOLBIS-T01.sch
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>

<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T110.sch
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>

<!-- Rules -->

Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T111.sch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
17 changes: 9 additions & 8 deletions rules/sch/PEPPOLBIS-T114.sch
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
<xi:include href="parts/function/gln.xml"/>
<xi:include href="parts/function/slack.xml"/>
<xi:include href="parts/function/mod11.xml"/>
<xi:include href="parts/function/checkCodiceIPA.xml"/>
<xi:include href="parts/function/addPIVA.xml"/>
<xi:include href="parts/function/checkCF.xml"/>
<xi:include href="parts/function/checkCF16.xml"/>
<xi:include href="parts/function/checkPIVA.xml"/>
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkCodiceIPA.xml"/>
<xi:include href="parts/function/addPIVA.xml"/>
<xi:include href="parts/function/checkCF.xml"/>
<xi:include href="parts/function/checkCF16.xml"/>
<xi:include href="parts/function/checkPIVA.xml"/>
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
17 changes: 9 additions & 8 deletions rules/sch/PEPPOLBIS-T115.sch
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@

<xi:include href="parts/function/slack.xml"/>
<xi:include href="parts/function/mod11.xml"/>
<xi:include href="parts/function/checkCodiceIPA.xml"/>
<xi:include href="parts/function/addPIVA.xml"/>
<xi:include href="parts/function/checkCF.xml"/>
<xi:include href="parts/function/checkCF16.xml"/>
<xi:include href="parts/function/checkPIVA.xml"/>
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkCodiceIPA.xml"/>
<xi:include href="parts/function/addPIVA.xml"/>
<xi:include href="parts/function/checkCF.xml"/>
<xi:include href="parts/function/checkCF16.xml"/>
<xi:include href="parts/function/checkPIVA.xml"/>
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>

<!-- Rules -->

Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T116.sch
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T16.sch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T19.sch
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T58.sch
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T71.sch
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T76.sch
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
1 change: 1 addition & 0 deletions rules/sch/PEPPOLBIS-T77.sch
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<xi:include href="parts/function/checkPIVAseIT.xml"/>
<xi:include href="parts/function/mod97-0208.xml"/>
<xi:include href="parts/function/abn.xml"/>
<xi:include href="parts/function/checkSEOrgnr.xml"/>
<!-- Rules -->

<include href="parts/common/empty-elements.sch"/>
Expand Down
7 changes: 7 additions & 0 deletions rules/sch/parts/PEPPOL-M-T116.sch
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
flag="fatal">Promised Delivery Period MUST only be stated on document or on line level. </assert> -->
</rule>

<rule context="cbc:OrderResponseCode">
<assert id="PEPPOL-T116-R007"
test="(normalize-space(.) = 'CA' and count(../cac:OrderLine) > 0) or normalize-space(.) != 'CA'"
flag="warning">An order response with code CA (Conditionally accepted) must provide order lines.</assert>
</rule>


<!-- Line level -->
<rule context="cac:OrderLine/cac:LineItem">
<assert id="PEPPOL-T116-R003"
Expand Down
5 changes: 5 additions & 0 deletions rules/sch/parts/PEPPOL-M-T76.sch
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,10 @@
flag="fatal">Each order response line SHALL have a document line identifier that is unique within the order.</assert>
</rule>

<rule context="cbc:OrderResponseCode">
<assert id="PEPPOL-T76-R007"
test="(normalize-space(.) = 'CA' and count(../cac:OrderLine) > 0) or normalize-space(.) != 'CA'"
flag="warning">An order response with code CA (Conditionally accepted) must provide order lines.</assert>
</rule>

</pattern>
2 changes: 1 addition & 1 deletion rules/sch/parts/common.sch
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<include href="function/mod97-0208.xml"/>
<include href="function/checkCodiceIPA.xml"/>
<include href="function/abn.xml"/>
<include href="function/checkSEOrgnr.xml"/>
<include href="function/checkSEOrgnr.xml"/>

<include href="common/empty-elements.sch"/>
<include href="common/rules.sch"/>
Expand Down
9 changes: 4 additions & 5 deletions rules/sch/parts/function/checkSEOrgnr.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Function for Swedish organisation numbers (0007) -->
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkSEOrgnr" as="xs:boolean">
<param name="number" as="xs:string"/>
<function xmlns="http://www.w3.org/1999/XSL/Transform" name="u:checkSEOrgnr" as="xs:boolean">
<!-- Function for Swedish organisation numbers (0007) -->
<param name="number" as="xs:string"/>
<choose>
<!-- Check if input is numeric -->
<when test="not(matches($number, '^\d+$'))">
Expand All @@ -24,4 +23,4 @@
<sequence select="$calculatedCheckDigit = number($checkDigit)"/>
</otherwise>
</choose>
</function>
</function>
82 changes: 82 additions & 0 deletions rules/unit-order-response-advanced/PEPPOL-T116-R007.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<testSet xmlns="http://difi.no/xsd/vefa/validator/1.0"
configuration="peppolbis-t116-base-3.0">
<assert>
<description>An order response with code CA (Conditionally accepted) must provide order lines.</description>
<scope>PEPPOL-T116-R007</scope>
</assert>

<test>

<assert>
<success>PEPPOL-T116-R007</success>
</assert>

<OrderResponse xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2">

<cbc:OrderResponseCode>RE</cbc:OrderResponseCode>

<!-- <cac:OrderLine>
<cac:LineItem>
<cac:Price>
<cbc:PriceAmount currencyID="EUR"/>
</cac:Price>
</cac:LineItem>
</cac:OrderLine>-->

</OrderResponse>
</test>


<test>

<assert>
<success>PEPPOL-T116-R007</success>
</assert>

<OrderResponse xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2">

<cbc:OrderResponseCode>CA</cbc:OrderResponseCode>

<cac:OrderLine>
<cac:LineItem>
<cac:Price>
<cbc:PriceAmount currencyID="EUR"/>
</cac:Price>
</cac:LineItem>
</cac:OrderLine>

</OrderResponse>
</test>


<test>
<assert>
<warning>PEPPOL-T116-R007</warning>
</assert>
<OrderResponse xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2">

<cbc:OrderResponseCode>CA</cbc:OrderResponseCode>

<!-- <cac:OrderLine>
<cac:LineItem>
<cac:Price>
<cbc:PriceAmount currencyID="EUR"/>
</cac:Price>
</cac:LineItem>
</cac:OrderLine>
-->
</OrderResponse>
</test>





</testSet>
82 changes: 82 additions & 0 deletions rules/unit-order-response/PEPPOL-T76-R007.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<testSet xmlns="http://difi.no/xsd/vefa/validator/1.0"
configuration="peppolbis-t76-base-3.0">
<assert>
<description>An order response with code CA (Conditionally accepted) must provide order lines.</description>
<scope>PEPPOL-T76-R007</scope>
</assert>

<test>

<assert>
<success>PEPPOL-T76-R007</success>
</assert>

<OrderResponse xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2">

<cbc:OrderResponseCode>RE</cbc:OrderResponseCode>

<!-- <cac:OrderLine>
<cac:LineItem>
<cac:Price>
<cbc:PriceAmount currencyID="EUR"/>
</cac:Price>
</cac:LineItem>
</cac:OrderLine>-->

</OrderResponse>
</test>


<test>

<assert>
<success>PEPPOL-T76-R007</success>
</assert>

<OrderResponse xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2">

<cbc:OrderResponseCode>CA</cbc:OrderResponseCode>

<cac:OrderLine>
<cac:LineItem>
<cac:Price>
<cbc:PriceAmount currencyID="EUR"/>
</cac:Price>
</cac:LineItem>
</cac:OrderLine>

</OrderResponse>
</test>


<test>
<assert>
<warning>PEPPOL-T76-R007</warning>
</assert>
<OrderResponse xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2">

<cbc:OrderResponseCode>CA</cbc:OrderResponseCode>

<!-- <cac:OrderLine>
<cac:LineItem>
<cac:Price>
<cbc:PriceAmount currencyID="EUR"/>
</cac:Price>
</cac:LineItem>
</cac:OrderLine>
-->
</OrderResponse>
</test>





</testSet>
3 changes: 2 additions & 1 deletion structure/syntax/ubl-order-response-advanced.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@
<Term>cbc:OrderResponseCode</Term>
<Name>Response code</Name>
<Description>A code that indicates whether the referenced order has been received and not yet processed,
or is Accepted or Rejected as whole, alternatively, Accepted with change or already delivered.If response code is Accept or
or is Accepted or Rejected as whole, alternatively, Accepted with change or already delivered. If response code is Accept or
Reject there may not be any response lines.</Description>
<DataType>Code</DataType>
<Reference type="BUSINESS_TERM">tir116-200</Reference>
<Reference type="CODE_LIST">UNCL4343-T76</Reference>
<Reference type="RULE">PEPPOL-T116-R007</Reference>
<Value type="EXAMPLE">AP</Value>
</Element>
<Element cardinality="0..1">
Expand Down
4 changes: 2 additions & 2 deletions structure/syntax/ubl-order-response.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
<Term>cbc:OrderResponseCode</Term>
<Name>Response code</Name>
<Description>A code that indicates whether the referenced order has been received and not yet processed,
or is Accepted or Rejected as whole, alternatively, Accepted with change or already delivered.If response code is Accept or
or is Accepted or Rejected as whole, alternatively, Accepted with change or already delivered. If response code is Accept or
Reject there may not be any response lines.</Description>
<DataType>Code</DataType>
<Reference type="BUSINESS_TERM">tir76-200</Reference>
<Reference type="CODE_LIST">UNCL4343-T76</Reference>

<Reference type="RULE">PEPPOL-T76-R007</Reference>
<Value type="EXAMPLE">AP</Value>
</Element>
<Element cardinality="0..1">
Expand Down
Loading