Skip to content

Commit

Permalink
Moved SG-Peppol 1.0.3 rules to phive-rules-peppol-legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed May 16, 2024
1 parent 3848575 commit ab71d83
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 49 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
{}

Expand Down Expand Up @@ -143,5 +151,31 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry <IValidat
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_PEPPOL_102,
aNSCtxCreditNote)));
}

// 1.0.3
{
final IReadableResource BIS3_BILLING_SG_CEN_103 = new ClassPathResource (BASE_PATH +
"1.0.3/xslt/CEN-EN16931-UBL-SG-Conformant.xslt",
_getCL ());
final IReadableResource BIS3_BILLING_SG_PEPPOL_103 = new ClassPathResource (BASE_PATH +
"1.0.3/xslt/PEPPOL-EN16931-UBL-SG-Conformant.xslt",
_getCL ());
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103,
"SG Peppol BIS3 Invoice (UBL) 1.0.3",
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_CEN_103,
aNSCtxInvoice),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_PEPPOL_103,
aNSCtxInvoice)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103,
"SG Peppol BIS3 Credit Note (UBL) 1.0.3",
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_CEN_103,
aNSCtxCreditNote),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_PEPPOL_103,
aNSCtxCreditNote)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ public static ICommonsList <TestFile> 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,
Expand Down Expand Up @@ -570,6 +573,16 @@ public static ICommonsList <? extends IReadableResource> 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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -97,35 +87,10 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry <IValidat
// For better error messages (merge both)
SchematronNamespaceBeautifier.addMappings (aNSCtxCreditNote);

@SuppressWarnings ("unused")
final boolean bDeprecated = true;
final boolean bNotDeprecated = false;

// 1.0.3
{
final IReadableResource BIS3_BILLING_SG_CEN_103 = new ClassPathResource (BASE_PATH +
"1.0.3/xslt/CEN-EN16931-UBL-SG-Conformant.xslt",
_getCL ());
final IReadableResource BIS3_BILLING_SG_PEPPOL_103 = new ClassPathResource (BASE_PATH +
"1.0.3/xslt/PEPPOL-EN16931-UBL-SG-Conformant.xslt",
_getCL ());
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_BIS3_SG_UBL_INVOICE_103,
"SG Peppol BIS3 Invoice (UBL) 1.0.3",
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_CEN_103,
aNSCtxInvoice),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_PEPPOL_103,
aNSCtxInvoice)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_BIS3_SG_UBL_CREDIT_NOTE_103,
"SG Peppol BIS3 Credit Note (UBL) 1.0.3",
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_CEN_103,
aNSCtxCreditNote),
ValidationExecutorSchematron.createXSLT (BIS3_BILLING_SG_PEPPOL_103,
aNSCtxCreditNote)));
}

// 2023.7
{
final IReadableResource BIS3_BILLING_SG_CEN_2023_07 = new ClassPathResource (BASE_PATH +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ public static ICommonsList <TestFile> 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,

Expand Down Expand Up @@ -208,16 +205,6 @@ public static ICommonsList <? extends IReadableResource> 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))
{
Expand Down

0 comments on commit ab71d83

Please sign in to comment.