also work with ubl credit notes again
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
- 481
|
||||||
|
- 494
|
||||||
|
|
||||||
|
|
||||||
2.14.0
|
2.14.0
|
||||||
=======
|
=======
|
||||||
2024-09-22
|
2024-09-22
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.mustangproject;
|
package org.mustangproject;
|
||||||
|
|
||||||
public enum EStandard {
|
public enum EStandard {
|
||||||
facturx, orderx, despatchadvice, ubldespatchadvice, zugferd, cii, ubl
|
facturx, orderx, despatchadvice, ubldespatchadvice, zugferd, cii, ubl, ubl_creditnote
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class ZUGFeRDVisualizer {
|
|||||||
/***
|
/***
|
||||||
* returns which standard is used, CII or UBL
|
* returns which standard is used, CII or UBL
|
||||||
* @param fis inputstream (will be consumed)
|
* @param fis inputstream (will be consumed)
|
||||||
* @return (facturx=cii)
|
* @return (facturx = cii)
|
||||||
*/
|
*/
|
||||||
public EStandard findOutStandardFromRootNode(InputStream fis) {
|
public EStandard findOutStandardFromRootNode(InputStream fis) {
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ public class ZUGFeRDVisualizer {
|
|||||||
} else if (root.getLocalName().equals(ublSignature)) {
|
} else if (root.getLocalName().equals(ublSignature)) {
|
||||||
return EStandard.ubl;
|
return EStandard.ubl;
|
||||||
} else if (root.getLocalName().equals(ublCreditNoteSignature)) {
|
} else if (root.getLocalName().equals(ublCreditNoteSignature)) {
|
||||||
return EStandard.ubl;
|
return EStandard.ubl_creditnote;
|
||||||
} else if (root.getLocalName().equals(cioSignature)) {
|
} else if (root.getLocalName().equals(cioSignature)) {
|
||||||
return EStandard.orderx;
|
return EStandard.orderx;
|
||||||
}
|
}
|
||||||
@@ -185,7 +185,7 @@ public class ZUGFeRDVisualizer {
|
|||||||
|
|
||||||
|
|
||||||
fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning
|
fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning
|
||||||
EStandard thestandard=findOutStandardFromRootNode(fis);
|
EStandard thestandard = findOutStandardFromRootNode(fis);
|
||||||
fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning
|
fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning
|
||||||
|
|
||||||
if (thestandard == EStandard.zugferd) {
|
if (thestandard == EStandard.zugferd) {
|
||||||
@@ -198,6 +198,10 @@ public class ZUGFeRDVisualizer {
|
|||||||
//zf2 or fx
|
//zf2 or fx
|
||||||
applyUBL2XSLT(fis, iaos);
|
applyUBL2XSLT(fis, iaos);
|
||||||
doPostProcessing = true;
|
doPostProcessing = true;
|
||||||
|
} else if (thestandard == EStandard.ubl_creditnote) {
|
||||||
|
//zf2 or fx
|
||||||
|
applyUBLCreditNote2XSLT(fis, iaos);
|
||||||
|
doPostProcessing = true;
|
||||||
} else if (thestandard == EStandard.orderx) {
|
} else if (thestandard == EStandard.orderx) {
|
||||||
//zf2 or fx
|
//zf2 or fx
|
||||||
applyCIO2XSLT(fis, iaos);
|
applyCIO2XSLT(fis, iaos);
|
||||||
@@ -242,7 +246,7 @@ public class ZUGFeRDVisualizer {
|
|||||||
throws FileNotFoundException, TransformerException {
|
throws FileNotFoundException, TransformerException {
|
||||||
|
|
||||||
FileInputStream fis = new FileInputStream(xmlFilename);
|
FileInputStream fis = new FileInputStream(xmlFilename);
|
||||||
EStandard theStandard= findOutStandardFromRootNode(fis);
|
EStandard theStandard = findOutStandardFromRootNode(fis);
|
||||||
fis = new FileInputStream(xmlFilename);//rewind :-(
|
fis = new FileInputStream(xmlFilename);//rewind :-(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -258,10 +262,12 @@ public class ZUGFeRDVisualizer {
|
|||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
|
|
||||||
//zf2 or fx
|
//zf2 or fx
|
||||||
if (theStandard==EStandard.facturx) {
|
if (theStandard == EStandard.facturx) {
|
||||||
applyZF2XSLT(fis, iaos);
|
applyZF2XSLT(fis, iaos);
|
||||||
} else if (theStandard==EStandard.ubl) {
|
} else if (theStandard == EStandard.ubl) {
|
||||||
applyUBL2XSLT(fis, iaos);
|
applyUBL2XSLT(fis, iaos);
|
||||||
|
} else if (theStandard == EStandard.ubl_creditnote) {
|
||||||
|
applyUBLCreditNote2XSLT(fis, iaos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -365,7 +371,7 @@ public class ZUGFeRDVisualizer {
|
|||||||
|
|
||||||
protected void applyZF2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
protected void applyZF2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||||
throws TransformerException {
|
throws TransformerException {
|
||||||
if (mXsltXRTemplate==null) {
|
if (mXsltXRTemplate == null) {
|
||||||
mXsltXRTemplate = mFactory.newTemplates(
|
mXsltXRTemplate = mFactory.newTemplates(
|
||||||
new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/cii-xr.xsl")));
|
new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/cii-xr.xsl")));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user