From ab71d838ce73c07d1f5ff5aaa2f84ac0116eb37c Mon Sep 17 00:00:00 2001 From: Philip Helger Date: Thu, 16 May 2024 18:35:54 +0200 Subject: [PATCH] Moved SG-Peppol 1.0.3 rules to `phive-rules-peppol-legacy` --- README.md | 1 + .../legacy/PeppolLegacyValidationSG.java | 34 +++++++++++++++++ .../xslt/CEN-EN16931-UBL-SG-Conformant.xslt | 0 .../PEPPOL-EN16931-UBL-SG-Conformant.xslt | 0 .../phive/peppol/legacy/mock/CTestFiles.java | 13 +++++++ .../CEN-EN16931-UBL-SG-Conformant.sch | 0 .../PEPPOL-EN16931-UBL-SG-Conformant.sch | 0 ...ingapore invoice error 1 - NG tax code.xml | 0 .../Singapore invoice error 1 calculation.xml | 0 ...ingapore invoice valid 1 - NG tax code.xml | 0 .../1.0.3/Singapore invoice valid 1.xml | 0 .../phive/peppol/PeppolValidationSG.java | 37 +------------------ .../helger/phive/peppol/mock/CTestFiles.java | 13 ------- 13 files changed, 49 insertions(+), 49 deletions(-) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/main/resources/external/schematron/peppol-sg/1.0.3/xslt/CEN-EN16931-UBL-SG-Conformant.xslt (100%) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/main/resources/external/schematron/peppol-sg/1.0.3/xslt/PEPPOL-EN16931-UBL-SG-Conformant.xslt (100%) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/CEN-EN16931-UBL-SG-Conformant.sch (100%) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/PEPPOL-EN16931-UBL-SG-Conformant.sch (100%) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 - NG tax code.xml (100%) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 calculation.xml (100%) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1 - NG tax code.xml (100%) rename {phive-rules-peppol => phive-rules-peppol-legacy}/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1.xml (100%) diff --git a/README.md b/README.md index d60303b8..adbc28f1 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,7 @@ I hope that with the introduction of PINT, the versioning problem will be solved * All OIOUBL 1.x validations are now correctly based on UBL 2.1 instead of UBL 2.0 * Extracted the rules for the legacy OIOUBL rules into a separate registerable entity (`OIOUBLLegacyValidation`). * Added support for SG-PEPPOL 2023.12 rules. + * Moved SG-Peppol 1.0.3 rules to `phive-rules-peppol-legacy` * v3.1.9 - 2024-03-22 * Deprecated Peppol Business Card formats v1 and v2 * Deprecated Peppol May 2023 release diff --git a/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolLegacyValidationSG.java b/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolLegacyValidationSG.java index 559e6609..78942a96 100644 --- a/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolLegacyValidationSG.java +++ b/phive-rules-peppol-legacy/src/main/java/com/helger/phive/peppol/legacy/PeppolLegacyValidationSG.java @@ -67,6 +67,14 @@ private static ClassLoader _getCL () "creditnote", "1.0.2"); + // 1.0.3 + public static final VESID VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103 = new VESID ("eu.peppol.bis3.sg.ubl", + "invoice", + "1.0.3"); + public static final VESID VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103 = new VESID ("eu.peppol.bis3.sg.ubl", + "creditnote", + "1.0.3"); + private PeppolLegacyValidationSG () {} @@ -143,5 +151,31 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry getAllTestFiles () PeppolLegacyValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_102, PeppolLegacyValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_102, + PeppolLegacyValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103, + PeppolLegacyValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103, + /* OpenPeppol */ PeppolValidation370.VID_OPENPEPPOL_T19_V2, PeppolValidation370.VID_OPENPEPPOL_T58_V2, @@ -570,6 +573,16 @@ public static ICommonsList getAllMatchingTestFiles if (aVESID.equals (PeppolLegacyValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_102)) return new CommonsArrayList <> (); + // SG 1.0.3 + if (aVESID.equals (PeppolLegacyValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103)) + { + final String sPrefix = sPrefix0 + "sg-peppol/1.0.3/"; + return new CommonsArrayList <> (new FileSystemResource (sPrefix + "Singapore invoice valid 1.xml"), + new FileSystemResource (sPrefix + "Singapore invoice valid 1 - NG tax code.xml")); + } + if (aVESID.equals (PeppolLegacyValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103)) + return new CommonsArrayList <> (); + // 3.7.0 { if (aVESID.equals (PeppolValidation370.VID_OPENPEPPOL_T19_V2)) diff --git a/phive-rules-peppol/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/CEN-EN16931-UBL-SG-Conformant.sch b/phive-rules-peppol-legacy/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/CEN-EN16931-UBL-SG-Conformant.sch similarity index 100% rename from phive-rules-peppol/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/CEN-EN16931-UBL-SG-Conformant.sch rename to phive-rules-peppol-legacy/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/CEN-EN16931-UBL-SG-Conformant.sch diff --git a/phive-rules-peppol/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/PEPPOL-EN16931-UBL-SG-Conformant.sch b/phive-rules-peppol-legacy/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/PEPPOL-EN16931-UBL-SG-Conformant.sch similarity index 100% rename from phive-rules-peppol/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/PEPPOL-EN16931-UBL-SG-Conformant.sch rename to phive-rules-peppol-legacy/src/test/resources/external/rule-source/sg-peppol/1.0.3/Schematron/PEPPOL-EN16931-UBL-SG-Conformant.sch diff --git a/phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 - NG tax code.xml b/phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 - NG tax code.xml similarity index 100% rename from phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 - NG tax code.xml rename to phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 - NG tax code.xml diff --git a/phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 calculation.xml b/phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 calculation.xml similarity index 100% rename from phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 calculation.xml rename to phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice error 1 calculation.xml diff --git a/phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1 - NG tax code.xml b/phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1 - NG tax code.xml similarity index 100% rename from phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1 - NG tax code.xml rename to phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1 - NG tax code.xml diff --git a/phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1.xml b/phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1.xml similarity index 100% rename from phive-rules-peppol/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1.xml rename to phive-rules-peppol-legacy/src/test/resources/external/test-files/sg-peppol/1.0.3/Singapore invoice valid 1.xml diff --git a/phive-rules-peppol/src/main/java/com/helger/phive/peppol/PeppolValidationSG.java b/phive-rules-peppol/src/main/java/com/helger/phive/peppol/PeppolValidationSG.java index c50ea34e..e75f384b 100644 --- a/phive-rules-peppol/src/main/java/com/helger/phive/peppol/PeppolValidationSG.java +++ b/phive-rules-peppol/src/main/java/com/helger/phive/peppol/PeppolValidationSG.java @@ -50,16 +50,6 @@ private static ClassLoader _getCL () private static final String BASE_PATH = "external/schematron/peppol-sg/"; - // 1.0.3 - @Deprecated - public static final VESID VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103 = new VESID ("eu.peppol.bis3.sg.ubl", - "invoice", - "1.0.3"); - @Deprecated - public static final VESID VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103 = new VESID ("eu.peppol.bis3.sg.ubl", - "creditnote", - "1.0.3"); - // 2023.7 public static final VESID VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_2023_7 = new VESID ("eu.peppol.bis3.sg.ubl", "invoice", @@ -97,35 +87,10 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry getAllTestFiles () PeppolValidationAUNZ.VID_OPENPEPPOL_BIS3_AUNZ_UBL_CREDIT_NOTE_SELF_BILLING_1_0_10, /* Singapore */ - PeppolValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103, - PeppolValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103, - PeppolValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_2023_7, PeppolValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_2023_7, @@ -208,16 +205,6 @@ public static ICommonsList getAllMatchingTestFiles return new CommonsArrayList <> (new FileSystemResource (sPrefix + "NZ Self Billed Credit note.xml")); } - // SG 1.0.3 - if (aVESID.equals (PeppolValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103)) - { - final String sPrefix = sPrefix0 + "sg-peppol/1.0.3/"; - return new CommonsArrayList <> (new FileSystemResource (sPrefix + "Singapore invoice valid 1.xml"), - new FileSystemResource (sPrefix + "Singapore invoice valid 1 - NG tax code.xml")); - } - if (aVESID.equals (PeppolValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103)) - return new CommonsArrayList <> (); - // SG 2023.07 if (aVESID.equals (PeppolValidationSG.VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_2023_7)) {