Skip to content

Commit

Permalink
Added Peppol PINT Japan 1.0.2 rules
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Jul 24, 2024
1 parent ca1138e commit 0804f6b
Show file tree
Hide file tree
Showing 16 changed files with 3,696 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ I hope that with the introduction of PINT, the versioning problem will be solved
* v3.1.12 - work in progress
* Added Peppol PINT rules 1.0.2
* Added Peppol PINT A-NZ 1.0.1 rules
* Added Peppol PINT Japan 1.0.2 rules
* v3.1.11 - 2024-07-02
* Added Peppol May 2024 release (Billing 3.0.17 and Upgrade 3.0.13)
* Added Peppol A-NZ-PEPPOL 1.0.11 rules
Expand Down
4 changes: 2 additions & 2 deletions phive-rules-peppol/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@
<goal>convert</goal>
</goals>
<configuration>
<schematronDirectory>src/test/resources/external/rule-source/pint-jp/0.1.2</schematronDirectory>
<xsltDirectory>src/main/resources/external/schematron/pint-jp/0.1.2/xslt</xsltDirectory>
<schematronDirectory>src/test/resources/external/rule-source/pint-jp/1.0.2</schematronDirectory>
<xsltDirectory>src/main/resources/external/schematron/pint-jp/1.0.2/xslt</xsltDirectory>
</configuration>
</execution>
-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,24 @@
@Immutable
public final class PeppolValidationPintJP
{
public static final String GROUP_ID = "org.peppol.jp.pint";
private static final String BASE_PATH = "external/schematron/pint-jp/";

@Nonnull
private static ClassLoader _getCL ()
{
return PeppolValidationPintJP.class.getClassLoader ();
}

private static final String BASE_PATH = "external/schematron/pint-jp/";

// 0.1.2
public static final VESID VID_OPENPEPPOL_JP_PINT_INVOICE_012 = new VESID ("org.peppol.jp.pint", "invoice", "0.1.2");
public static final VESID VID_OPENPEPPOL_JP_PINT_CREDIT_NOTE_012 = new VESID ("org.peppol.jp.pint",
"credit-note",
"0.1.2");
@Deprecated
public static final VESID VID_OPENPEPPOL_JP_PINT_INVOICE_012 = new VESID (GROUP_ID, "invoice", "0.1.2");
@Deprecated
public static final VESID VID_OPENPEPPOL_JP_PINT_CREDIT_NOTE_012 = new VESID (GROUP_ID, "credit-note", "0.1.2");

// 1.0.2
public static final VESID VID_OPENPEPPOL_JP_PINT_INVOICE_1_0_2 = new VESID (GROUP_ID, "invoice", "1.0.2");
public static final VESID VID_OPENPEPPOL_JP_PINT_CREDIT_NOTE_1_0_2 = new VESID (GROUP_ID, "credit-note", "1.0.2");

private PeppolValidationPintJP ()
{}
Expand All @@ -76,6 +81,7 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry <IValidat
// For better error messages (merge both)
SchematronNamespaceBeautifier.addMappings (aNSCtxCreditNote);

final boolean bDeprecated = false;
final boolean bNotDeprecated = false;

// 0.1.2
Expand All @@ -88,20 +94,43 @@ public static void init (@Nonnull final IValidationExecutorSetRegistry <IValidat
_getCL ());
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_JP_PINT_INVOICE_012,
"Peppol PINT Japan Invoice (UBL) 0.1.2",
_createStatus (bNotDeprecated),
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (aCPR1,
aNSCtxInvoice),
ValidationExecutorSchematron.createXSLT (aCPR2,
aNSCtxInvoice)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_JP_PINT_CREDIT_NOTE_012,
"Peppol PINT Japan Credit Note (UBL) 0.1.2",
_createStatus (bNotDeprecated),
_createStatus (bDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (aCPR1,
aNSCtxCreditNote),
ValidationExecutorSchematron.createXSLT (aCPR2,
aNSCtxCreditNote)));
}

// 1.0.2
{
final ClassPathResource aCPR2 = new ClassPathResource (BASE_PATH +
"1.0.2/xslt/PINT-jurisdiction-aligned-rules.xslt",
_getCL ());
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_JP_PINT_INVOICE_1_0_2,
"Peppol PINT Japan Invoice (UBL) 1.0.2",
_createStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllInvoiceXSDs ()),
ValidationExecutorSchematron.createXSLT (PeppolValidationPint.RES_OPENPEPPOL_PINT_1_0_1,
aNSCtxCreditNote),
ValidationExecutorSchematron.createXSLT (aCPR2,
aNSCtxInvoice)));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_OPENPEPPOL_JP_PINT_CREDIT_NOTE_1_0_2,
"Peppol PINT Japan Credit Note (UBL) 1.0.2",
_createStatus (bNotDeprecated),
ValidationExecutorXSD.create (UBL21Marshaller.getAllCreditNoteXSDs ()),
ValidationExecutorSchematron.createXSLT (PeppolValidationPint.RES_OPENPEPPOL_PINT_1_0_1,
aNSCtxCreditNote),
ValidationExecutorSchematron.createXSLT (aCPR2,
aNSCtxCreditNote)));
}
}
}
Loading

0 comments on commit 0804f6b

Please sign in to comment.