Skip to content

Commit

Permalink
Moved Peppol 3.15.0 rules to phive-rules-peppol-legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Nov 29, 2023
1 parent 6392d0b commit 91b8716
Show file tree
Hide file tree
Showing 69 changed files with 101 additions and 98 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ I hope that with the introduction of PINT, the versioning problem will be solved

* v3.1.6 - 2023-11-29
* Added Peppol 2023 November release (Billing 3.0.16 and Upgrade 3.0.12)
* Moved Peppol 3.15.0 rules from `phive-rules-peppol` to `phive-rules-peppol-legacy`
* v3.1.5 - 2023-11-10
* Added support for Peppol Reporting EUSR v1.1.4 and deprecated v1.1.3
* Added support for Czech ISDOC v6.0.2 and deprecated v6.0.1 [original Schematron had errors]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry <IValidat
PeppolValidation3_12_0.init (aRegistry);
PeppolValidation3_13_0.init (aRegistry);
PeppolValidation3_14_0.init (aRegistry);
PeppolValidation3_15_0.init (aRegistry);
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.helger.phive.peppol;
package com.helger.phive.peppol.legacy;

import java.time.LocalDate;
import java.time.Month;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import com.helger.phive.peppol.legacy.PeppolValidation3_12_0;
import com.helger.phive.peppol.legacy.PeppolValidation3_13_0;
import com.helger.phive.peppol.legacy.PeppolValidation3_14_0;
import com.helger.phive.peppol.legacy.PeppolValidation3_15_0;
import com.helger.phive.xml.source.IValidationSourceXML;

@Immutable
Expand Down Expand Up @@ -242,7 +243,22 @@ public static ICommonsList <TestFile> getAllTestFiles ()
PeppolValidation3_14_0.VID_OPENPEPPOL_ORDER_RESPONSE_V3,
PeppolValidation3_14_0.VID_OPENPEPPOL_PUNCH_OUT_V3,
PeppolValidation3_14_0.VID_OPENPEPPOL_ORDER_AGREEMENT_V3,
PeppolValidation3_14_0.VID_OPENPEPPOL_INVOICE_MESSAGE_RESPONSE_V3, })
PeppolValidation3_14_0.VID_OPENPEPPOL_INVOICE_MESSAGE_RESPONSE_V3,

PeppolValidation3_15_0.VID_OPENPEPPOL_INVOICE_UBL_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_CREDIT_NOTE_UBL_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_INVOICE_CII_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_ORDER_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_DESPATCH_ADVICE_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_CATALOGUE_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_CATALOGUE_RESPONSE_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_MLR_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_ORDER_RESPONSE_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_PUNCH_OUT_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_ORDER_AGREEMENT_V3,
PeppolValidation3_15_0.VID_OPENPEPPOL_INVOICE_MESSAGE_RESPONSE_V3,

})
for (final IReadableResource aRes : getAllMatchingTestFiles (aESID))
{
assertTrue ("Not existing test file: " + aRes.getPath (), aRes.exists ());
Expand Down Expand Up @@ -1052,6 +1068,86 @@ public static ICommonsList <? extends IReadableResource> getAllMatchingTestFiles
"T111-uc008-Invoice is accepted by third party.xml"));
}

// 3.15.0
{
final String sPrefix = sPrefix0 + "openpeppol/3.15.0/";
// https://github.com/OpenPEPPOL/peppol-bis-invoice-3/tree/master/rules/examples
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_INVOICE_UBL_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "billing/Allowance-example.xml"),
new FileSystemResource (sPrefix + "billing/base-example.xml"),
new FileSystemResource (sPrefix + "billing/base-negative-inv-correction.xml"),
new FileSystemResource (sPrefix + "billing/vat-category-E.xml"),
new FileSystemResource (sPrefix + "billing/vat-category-O.xml"),
new FileSystemResource (sPrefix + "billing/Vat-category-S.xml"),
new FileSystemResource (sPrefix + "billing/vat-category-Z.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_CREDIT_NOTE_UBL_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "billing/base-creditnote-correction.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_INVOICE_CII_V3))
return new CommonsArrayList <> ();
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_ORDER_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "Order_Example.xml"),
new FileSystemResource (sPrefix + "Order use cases/UC1_Order.xml"),
new FileSystemResource (sPrefix + "Order use cases/UC2_Order.xml"),
new FileSystemResource (sPrefix + "Order use cases/UC3_Order.xml"),
new FileSystemResource (sPrefix + "Order use cases/UC4_Order.xml"),
new FileSystemResource (sPrefix + "Order use cases/UC5_Order.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_DESPATCH_ADVICE_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "DespatchAdvice_Example.xml"),
new FileSystemResource (sPrefix +
"Despatch Advice use cases/DespatchAdvice-BIS3_UseCase1.xml"),
new FileSystemResource (sPrefix +
"Despatch Advice use cases/DespatchAdvice-BIS3_UseCase2.xml"),
new FileSystemResource (sPrefix +
"Despatch Advice use cases/DespatchAdvice-BIS3_UseCase3.xml"),
new FileSystemResource (sPrefix +
"Despatch Advice use cases/DespatchAdvice-BIS3_UseCase4.xml"),
new FileSystemResource (sPrefix +
"Despatch Advice use cases/DespatchAdvice-BIS3_UseCase5.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_CATALOGUE_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "Catalogue_Example.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_CATALOGUE_RESPONSE_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "CatalogueResponse_Example.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_MLR_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "MessageLevelResponse_Example.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_ORDER_RESPONSE_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "OrderResponse_Example.xml"),
new FileSystemResource (sPrefix +
"Order-response use cases/UC1_Order_response.xml"),
new FileSystemResource (sPrefix +
"Order-response use cases/UC2_Order_response.xml"),
new FileSystemResource (sPrefix +
"Order-response use cases/UC3_Order_response.xml"),
new FileSystemResource (sPrefix +
"Order-response use cases/UC4_Order_response.xml"),
new FileSystemResource (sPrefix +
"Order-response use cases/UC5_Order_response.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_PUNCH_OUT_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "PunchOut_Example.xml"));
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_ORDER_AGREEMENT_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "OrderAgreement_Example.xml"));

final String sBase2 = sPrefix + "Invoice reponse use cases/";
if (aVESID.equals (PeppolValidation3_15_0.VID_OPENPEPPOL_INVOICE_MESSAGE_RESPONSE_V3))
return new CommonsArrayList <> (new FileSystemResource (sPrefix + "InvoiceResponse_Example.xml"),
new FileSystemResource (sBase2 + "T111-uc001-Invoice in process.xml"),
new FileSystemResource (sBase2 + "T111-uc002a-Additional reference data.xml"),
new FileSystemResource (sBase2 + "T111-uc002b-In process but postponed.xml"),
new FileSystemResource (sBase2 + "T111-uc003-Invoice is accepted.xml"),
new FileSystemResource (sBase2 + "T111-uc004a-Invoice is rejected.xml"),
new FileSystemResource (sBase2 + "T111-uc004b-Rejected requesting reissue.xml"),
new FileSystemResource (sBase2 +
"T111-uc004c-Rejected requesting replacement.xml"),
new FileSystemResource (sBase2 +
"T111-uc005-Invoice is conditionally accepted.xml"),
new FileSystemResource (sBase2 +
"T111-uc006a-Under query missing information.xml"),
new FileSystemResource (sBase2 + "T111-uc006b-Missing PO.xml"),
new FileSystemResource (sBase2 + "T111-uc006c-Wrong detail partial credit.xml"),
new FileSystemResource (sBase2 + "T111-uc007-Payment has been initiated.xml"),
new FileSystemResource (sBase2 +
"T111-uc008-Invoice is accepted by third party.xml"));
}

throw new IllegalArgumentException ("Invalid VESID: " + aVESID);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,12 @@ private PeppolValidation ()
* @param aRegistry
* The registry to add the artefacts. May not be <code>null</code>.
*/
@SuppressWarnings ("deprecation")
// @SuppressWarnings ("deprecation")
public static void initStandard (@Nonnull final IValidationExecutorSetRegistry <IValidationSourceXML> aRegistry)
{
// For better error messages
SchematronNamespaceBeautifier.addMappings (UBL21NamespaceContext.getInstance ());

PeppolValidation3_15_0.init (aRegistry);
PeppolValidation2023_05.init (aRegistry);
PeppolValidation2023_11.init (aRegistry);
PeppolValidationAUNZ.init (aRegistry);
Expand Down
Loading

0 comments on commit 91b8716

Please sign in to comment.