From 0505c1554c868089fae5a6b1e969687621a4163e Mon Sep 17 00:00:00 2001 From: Zumbala Date: Thu, 22 Feb 2024 14:28:20 +0100 Subject: [PATCH] ResponseTypeCode check not having order lines --- guides/release-notes/v3.0.13.adoc | 5 ++ .../UC2_Order_response.xml | 2 +- .../OrderResponseAdvanced_Example.xml | 2 +- rules/examples/OrderResponse_Example.xml | 2 +- rules/sch/parts/PEPPOL-M-T116.sch | 9 +++ rules/sch/parts/PEPPOL-M-T76.sch | 13 ++++- .../PEPPOL-T116-R008.xml | 54 ++++++++++++++++++ .../PEPPOL-T116-R009.xml | 55 +++++++++++++++++++ .../PEPPOL-T116-R010.xml | 54 ++++++++++++++++++ rules/unit-order-response/PEPPOL-T76-R008.xml | 54 ++++++++++++++++++ rules/unit-order-response/PEPPOL-T76-R009.xml | 55 +++++++++++++++++++ rules/unit-order-response/PEPPOL-T76-R010.xml | 54 ++++++++++++++++++ 12 files changed, 354 insertions(+), 5 deletions(-) create mode 100644 rules/unit-order-response-advanced/PEPPOL-T116-R008.xml create mode 100644 rules/unit-order-response-advanced/PEPPOL-T116-R009.xml create mode 100644 rules/unit-order-response-advanced/PEPPOL-T116-R010.xml create mode 100644 rules/unit-order-response/PEPPOL-T76-R008.xml create mode 100644 rules/unit-order-response/PEPPOL-T76-R009.xml create mode 100644 rules/unit-order-response/PEPPOL-T76-R010.xml diff --git a/guides/release-notes/v3.0.13.adoc b/guides/release-notes/v3.0.13.adoc index 70da5671..2a21e516 100644 --- a/guides/release-notes/v3.0.13.adoc +++ b/guides/release-notes/v3.0.13.adoc @@ -12,6 +12,7 @@ Release date:: May 2024 * Order transaction (T01) * Order Response transaction (T76) +* Order Response transaction Advanced (T116) * Catalogue transaction (T19) ** Added possibility (by use of a code) to indicate if an item is non-returnable after purchase. The element cac:TransactionConditions/cbc:ActionCode on item-level is used and the code is added to the codelist "Transaction condition code (OpenPeppol)", together with the previous code to indicate if an item is contracted (CT). The element cbc:ActionCode was previously fixed to the value 'CT' since it was the only allowed code, but with this change, it can be used for both purposes. @@ -23,4 +24,8 @@ Release date:: May 2024 * 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). +* Added rule to check that an OrderResponse with ResponseTypeCode AP or RE should not have 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). + +* Added rule to check that an OrderResponse with ResponseTypeCode AB must not have order response lines. The rule is introduced with severity error. The rule is added to both T76 (Order Responseand) and T116 (Order Response Advanced). + == Other diff --git a/rules/examples/Order-response use cases/UC2_Order_response.xml b/rules/examples/Order-response use cases/UC2_Order_response.xml index 2bc55e37..d721127b 100644 --- a/rules/examples/Order-response use cases/UC2_Order_response.xml +++ b/rules/examples/Order-response use cases/UC2_Order_response.xml @@ -8,7 +8,7 @@ 101 2013-07-01 14:23:26 - AP + CA Response message with item identifiers EUR 92487ksdhfj diff --git a/rules/examples/OrderResponseAdvanced_Example.xml b/rules/examples/OrderResponseAdvanced_Example.xml index 9c25c704..9d69962f 100644 --- a/rules/examples/OrderResponseAdvanced_Example.xml +++ b/rules/examples/OrderResponseAdvanced_Example.xml @@ -8,7 +8,7 @@ 101-111 2022-04-01 06:10:10 - AP + CA Response message with amendments in the details EUR ABC-123 diff --git a/rules/examples/OrderResponse_Example.xml b/rules/examples/OrderResponse_Example.xml index 7bce3081..cc8da2b1 100644 --- a/rules/examples/OrderResponse_Example.xml +++ b/rules/examples/OrderResponse_Example.xml @@ -9,7 +9,7 @@ 101-111 2013-07-01 06:10:10 - AP + CA Response message with amendments in the details EUR ABC-123 diff --git a/rules/sch/parts/PEPPOL-M-T116.sch b/rules/sch/parts/PEPPOL-M-T116.sch index a4cf279d..0db434cb 100644 --- a/rules/sch/parts/PEPPOL-M-T116.sch +++ b/rules/sch/parts/PEPPOL-M-T116.sch @@ -49,6 +49,15 @@ An order response with code CA (Conditionally accepted) must provide order lines. + An order response with code AP (Accepted) should NOT provide order lines. + An order response with code RE (Rejected) should NOT provide order lines. + An order response with code AB (Acknowledged) must NOT provide order lines. diff --git a/rules/sch/parts/PEPPOL-M-T76.sch b/rules/sch/parts/PEPPOL-M-T76.sch index 0a37f498..47cce744 100644 --- a/rules/sch/parts/PEPPOL-M-T76.sch +++ b/rules/sch/parts/PEPPOL-M-T76.sch @@ -48,8 +48,17 @@ An order response with code CA (Conditionally accepted) must provide order lines. + 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. + An order response with code AP (Accepted) should NOT provide order lines. + An order response with code RE (Rejected) should NOT provide order lines. + An order response with code AB (Acknowledged) must NOT provide order lines. \ No newline at end of file diff --git a/rules/unit-order-response-advanced/PEPPOL-T116-R008.xml b/rules/unit-order-response-advanced/PEPPOL-T116-R008.xml new file mode 100644 index 00000000..1f27b45a --- /dev/null +++ b/rules/unit-order-response-advanced/PEPPOL-T116-R008.xml @@ -0,0 +1,54 @@ + + + + An order response with code AP (Accepted) should NOT provide order lines. + PEPPOL-T116-R008 + + + + + + PEPPOL-T116-R008 + + + + + AP + + + + + + + + + PEPPOL-T116-R008 + + + + + AP + + + + + + + + + + + + + diff --git a/rules/unit-order-response-advanced/PEPPOL-T116-R009.xml b/rules/unit-order-response-advanced/PEPPOL-T116-R009.xml new file mode 100644 index 00000000..ed37cb5c --- /dev/null +++ b/rules/unit-order-response-advanced/PEPPOL-T116-R009.xml @@ -0,0 +1,55 @@ + + + + An order response with code RE (Rejected) should NOT provide order lines. + PEPPOL-T116-R009 + + + + + + PEPPOL-T116-R009 + + + + + RE + + + + + + + + + PEPPOL-T116-R009 + + + + + RE + + + + + + + + + + + + + + diff --git a/rules/unit-order-response-advanced/PEPPOL-T116-R010.xml b/rules/unit-order-response-advanced/PEPPOL-T116-R010.xml new file mode 100644 index 00000000..82cf4499 --- /dev/null +++ b/rules/unit-order-response-advanced/PEPPOL-T116-R010.xml @@ -0,0 +1,54 @@ + + + + An order response with code AB (Acknowledged) must NOT provide order lines. + PEPPOL-T116-R010 + + + + + + PEPPOL-T116-R010 + + + + + AB + + + + + + + + + PEPPOL-T116-R010 + + + + + AB + + + + + + + + + + + + + diff --git a/rules/unit-order-response/PEPPOL-T76-R008.xml b/rules/unit-order-response/PEPPOL-T76-R008.xml new file mode 100644 index 00000000..935882b9 --- /dev/null +++ b/rules/unit-order-response/PEPPOL-T76-R008.xml @@ -0,0 +1,54 @@ + + + + An order response with code AP (Accepted) should NOT provide order lines. + PEPPOL-T76-R008 + + + + + + PEPPOL-T76-R008 + + + + + AP + + + + + + + + + PEPPOL-T76-R008 + + + + + AP + + + + + + + + + + + + + diff --git a/rules/unit-order-response/PEPPOL-T76-R009.xml b/rules/unit-order-response/PEPPOL-T76-R009.xml new file mode 100644 index 00000000..2a9b2fe0 --- /dev/null +++ b/rules/unit-order-response/PEPPOL-T76-R009.xml @@ -0,0 +1,55 @@ + + + + An order response with code RE (Rejected) should NOT provide order lines. + PEPPOL-T76-R009 + + + + + + PEPPOL-T76-R009 + + + + + RE + + + + + + + + + PEPPOL-T76-R009 + + + + + RE + + + + + + + + + + + + + + diff --git a/rules/unit-order-response/PEPPOL-T76-R010.xml b/rules/unit-order-response/PEPPOL-T76-R010.xml new file mode 100644 index 00000000..a49bd177 --- /dev/null +++ b/rules/unit-order-response/PEPPOL-T76-R010.xml @@ -0,0 +1,54 @@ + + + + An order response with code AB (Acknowledged) must NOT provide order lines. + PEPPOL-T76-R010 + + + + + + PEPPOL-T76-R010 + + + + + AB + + + + + + + + + PEPPOL-T76-R010 + + + + + AB + + + + + + + + + + + + +