Skip to content

Commit

Permalink
Bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Jan 8, 2025
1 parent 5ae2e60 commit 767a7c9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ I hope that with the introduction of PINT, the versioning problem will be solved
# News and noteworthy

* v3.2.4 - 2025-01-08
* Added specific support for XRechnung Extension (for versions 2.1.1, 2.2.0, 2.3.1, 3.0.0, 3.0.1 and 3.0.2)
* Added specific support for XRechnung Extension (for versions 2.0.1, 2.1.1, 2.2.0, 2.3.1, 3.0.0, 3.0.1 and 3.0.2)
* v3.2.3 - 2025-01-03
* Fixed Factur-X VES display name to include the profile name as well
* Added Peppol A-NZ-PEPPOL 1.0.12 rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ public final class XRechnungValidation
public static final DVRCoordinate VID_XRECHNUNG_UBL_INVOICE_201 = PhiveRulesHelper.createCoordinate (GROUP_ID,
"ubl-invoice",
"2.0.1");
@Deprecated
public static final DVRCoordinate VID_XRECHNUNG_EXTENSION_UBL_INVOICE_201 = PhiveRulesHelper.createCoordinate (GROUP_ID_EXT,
"ubl-invoice",
"2.0.1");

// Valid from 01.02.2022 - 31.07.2022
@Deprecated
Expand Down Expand Up @@ -488,6 +492,26 @@ public static void initXRechnung (@Nonnull final IValidationExecutorSetRegistry
PhiveRulesHelper.createSimpleStatus (bDeprecated),
aNewList));
}
{
final ICommonsMap <String, CustomErrorDetails> aCustomErrorLevels = new CommonsHashMap <> ();
aCustomErrorLevels.put ("BR-CL-01", CustomErrorDetails.of (EErrorLevel.INFO));
aCustomErrorLevels.put ("BR-CL-23", CustomErrorDetails.of (EErrorLevel.WARN));
aCustomErrorLevels.put ("BR-CL-21", CustomErrorDetails.of (EErrorLevel.WARN));
// added PH
aCustomErrorLevels.put ("BR-CL-24", CustomErrorDetails.of (EErrorLevel.INFO));

final ICommonsList <IValidationExecutor <IValidationSourceXML>> aNewList = _getListWithCustomErrorDetails (aVESUBLInvoice133,
aCustomErrorLevels);
aNewList.add (PhiveRulesUBLHelper.createXSLT_UBL21 (new ClassPathResource (sPrefix +
"2.0.1/XRechnung-UBL-validation-Invoice.xslt",
_getCL ())));
aRegistry.registerValidationExecutorSet (ValidationExecutorSet.create (VID_XRECHNUNG_EXTENSION_UBL_INVOICE_201,
"XRechnung UBL Invoice " +
VID_XRECHNUNG_EXTENSION_UBL_INVOICE_201.getVersionString () +
" Extension",
PhiveRulesHelper.createSimpleStatus (bDeprecated),
aNewList));
}
}

// v2.1.1 (based on rule release 1.6.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ public static ICommonsList <PhiveTestFile> getAllTestFiles ()
XRechnungValidation.VID_XRECHNUNG_CII_201,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_201,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_201,
XRechnungValidation.VID_XRECHNUNG_EXTENSION_UBL_INVOICE_201,

XRechnungValidation.VID_XRECHNUNG_CII_211,
XRechnungValidation.VID_XRECHNUNG_UBL_CREDITNOTE_211,
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_211, })
XRechnungValidation.VID_XRECHNUNG_UBL_INVOICE_211,
XRechnungValidation.VID_XRECHNUNG_EXTENSION_UBL_INVOICE_211, })
for (final IReadableResource aRes : getAllMatchingTestFiles (aESID))
{
assertTrue ("Not existing test file: " + aRes.getPath (), aRes.exists ());
Expand Down Expand Up @@ -375,14 +377,6 @@ public static ICommonsList <? extends IReadableResource> getAllMatchingTestFiles
"ubl-inv-br-de-20-paymentmeans-code59-test-56-remove.xml",
"ubl-inv-br-de-21-check-unique-file-name-test-100-identity.xml",
"ubl-inv-br-de-21-check-unique-file-name-test-99-identity.xml",
"ubl-inv-br-de-21-extension_mime_code_test-87-identity.xml",
"ubl-inv-br-de-21-extension_mime_code_test-90-remove.xml",
"ubl-inv-br-de-21-extension_mime_code_test-91-code-application_xml.xml",
"ubl-inv-br-de-21-extension_mime_code_test-92-code-application_pdf.xml",
"ubl-inv-br-de-21-extension_mime_code_test-93-code-image_png.xml",
"ubl-inv-br-de-21-extension_mime_code_test-94-code-image_jpeg.xml",
"ubl-inv-br-de-21-extension_mime_code_test-95-code-text_csv.xml",
"ubl-inv-br-de-21-extension_mime_code_test-96-code-application_vnd.openxmlformats-officedocument.spreadsheetml.sheet.xml",
"ubl-inv-br-dex-02-some-invoicelines-with-sub-174-identity.xml",
"ubl-inv-paymentmeans-test-115-identity.xml",
"ubl-inv-paymentmeans-test-116-code-326.xml",
Expand All @@ -401,6 +395,20 @@ public static ICommonsList <? extends IReadableResource> getAllMatchingTestFiles
"ubl-inv-paymentmeans-test-130-code-sdsfsadgfa.xml" })
ret.add (new ClassPathResource (sPrefix + s));
}
else
if (aVESID.equals (XRechnungValidation.VID_XRECHNUNG_EXTENSION_UBL_INVOICE_201))
{
final String sPrefix = sPrefix0 + "2.0.1/ubl-inv/";
for (final String s : new String [] { "ubl-inv-br-de-21-extension_mime_code_test-87-identity.xml",
"ubl-inv-br-de-21-extension_mime_code_test-90-remove.xml",
"ubl-inv-br-de-21-extension_mime_code_test-91-code-application_xml.xml",
"ubl-inv-br-de-21-extension_mime_code_test-92-code-application_pdf.xml",
"ubl-inv-br-de-21-extension_mime_code_test-93-code-image_png.xml",
"ubl-inv-br-de-21-extension_mime_code_test-94-code-image_jpeg.xml",
"ubl-inv-br-de-21-extension_mime_code_test-95-code-text_csv.xml",
"ubl-inv-br-de-21-extension_mime_code_test-96-code-application_vnd.openxmlformats-officedocument.spreadsheetml.sheet.xml" })
ret.add (new ClassPathResource (sPrefix + s));
}

// 2.1.1
if (aVESID.equals (XRechnungValidation.VID_XRECHNUNG_CII_211))
Expand Down Expand Up @@ -519,15 +527,6 @@ public static ICommonsList <? extends IReadableResource> getAllMatchingTestFiles
"ubl-inv-br-de-2-test-207-identity.xml",
"ubl-inv-br-de-21-check-unique-file-name-test-118-identity.xml",
"ubl-inv-br-de-21-check-unique-file-name-test-119-identity.xml",
"ubl-inv-br-de-21-extension_mime_code_test-104-identity.xml",
"ubl-inv-br-de-21-extension_mime_code_test-105-code-invalid_customizationid.xml",
"ubl-inv-br-de-21-extension_mime_code_test-107-remove.xml",
"ubl-inv-br-de-21-extension_mime_code_test-108-code-application_xml.xml",
"ubl-inv-br-de-21-extension_mime_code_test-109-code-application_pdf.xml",
"ubl-inv-br-de-21-extension_mime_code_test-110-code-image_png.xml",
"ubl-inv-br-de-21-extension_mime_code_test-111-code-image_jpeg.xml",
"ubl-inv-br-de-21-extension_mime_code_test-112-code-text_csv.xml",
"ubl-inv-br-de-21-extension_mime_code_test-113-code-application_vnd.openxmlformats-officedocument.spreadsheetml.sheet.xml",
"ubl-inv-br-de-23-test-bg-17-100-code-58.xml",
"ubl-inv-br-de-23-test-bg-17-101-identity.xml",
"ubl-inv-br-de-23-test-bg-17-99-code-30.xml",
Expand All @@ -548,6 +547,21 @@ public static ICommonsList <? extends IReadableResource> getAllMatchingTestFiles
"ubl-inv-br-dex-02-some-invoicelines-with-sub-195-identity.xml" })
ret.add (new ClassPathResource (sPrefix + s));
}
else
if (aVESID.equals (XRechnungValidation.VID_XRECHNUNG_EXTENSION_UBL_INVOICE_211))
{
final String sPrefix = sPrefix0 + "2.1.1/ubl-inv/";
for (final String s : new String [] { "ubl-inv-br-de-21-extension_mime_code_test-104-identity.xml",
"ubl-inv-br-de-21-extension_mime_code_test-105-code-invalid_customizationid.xml",
"ubl-inv-br-de-21-extension_mime_code_test-107-remove.xml",
"ubl-inv-br-de-21-extension_mime_code_test-108-code-application_xml.xml",
"ubl-inv-br-de-21-extension_mime_code_test-109-code-application_pdf.xml",
"ubl-inv-br-de-21-extension_mime_code_test-110-code-image_png.xml",
"ubl-inv-br-de-21-extension_mime_code_test-111-code-image_jpeg.xml",
"ubl-inv-br-de-21-extension_mime_code_test-112-code-text_csv.xml",
"ubl-inv-br-de-21-extension_mime_code_test-113-code-application_vnd.openxmlformats-officedocument.spreadsheetml.sheet.xml" })
ret.add (new ClassPathResource (sPrefix + s));
}

// 2.2.0
if (aVESID.equals (XRechnungValidation.VID_XRECHNUNG_CII_220))
Expand Down

0 comments on commit 767a7c9

Please sign in to comment.