Skip to content

Commit

Permalink
POACC-704
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinForsberg-Ecru committed Feb 12, 2024
1 parent 9819f49 commit 1489b8f
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 3 deletions.
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
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>
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-t76-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

0 comments on commit 1489b8f

Please sign in to comment.