@@ -4,7 +4,10 @@ import static java.math.BigDecimal.ZERO;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/***
|
||||
@@ -91,17 +94,14 @@ public class TransactionCalculator implements IAbsoluteValueProvider {
|
||||
}
|
||||
|
||||
private String getAllowanceChargeReasonForPercent(BigDecimal percent, IZUGFeRDAllowanceCharge[] charges) {
|
||||
String res = " ";
|
||||
if ((charges != null) && (charges.length > 0)) {
|
||||
for (IZUGFeRDAllowanceCharge currentCharge : charges) {
|
||||
if ((percent == null) || (currentCharge.getTaxPercent().compareTo(percent) == 0)
|
||||
&& currentCharge.getReason() != null) {
|
||||
res += currentCharge.getReason() + " ";
|
||||
if (charges == null) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
res = res.substring(0, res.length() - 1);
|
||||
return res;
|
||||
return Arrays.stream(charges)
|
||||
.filter(currentCharge -> (percent == null || currentCharge.getTaxPercent().compareTo(percent) == 0))
|
||||
.map(IZUGFeRDAllowanceCharge::getReason)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.joining(" "));
|
||||
}
|
||||
|
||||
/***
|
||||
|
||||
@@ -20,42 +20,9 @@
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PipedInputStream;
|
||||
import java.io.PipedOutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Result;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Templates;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.URIResolver;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.fop.apps.FOPException;
|
||||
import org.apache.fop.apps.FOUserAgent;
|
||||
import org.apache.fop.apps.Fop;
|
||||
import org.apache.fop.apps.FopFactory;
|
||||
import org.apache.fop.apps.FopFactoryBuilder;
|
||||
import com.helger.commons.io.stream.StreamHelper;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.fop.apps.*;
|
||||
import org.apache.fop.apps.io.ResourceResolverFactory;
|
||||
import org.apache.fop.configuration.Configuration;
|
||||
import org.apache.fop.configuration.ConfigurationException;
|
||||
@@ -65,12 +32,19 @@ import org.mustangproject.ClasspathResolverURIAdapter;
|
||||
import org.mustangproject.EStandard;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.helger.commons.io.stream.StreamHelper;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.*;
|
||||
import javax.xml.transform.sax.SAXResult;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Optional;
|
||||
|
||||
public class ZUGFeRDVisualizer {
|
||||
|
||||
@@ -113,7 +87,7 @@ public class ZUGFeRDVisualizer {
|
||||
* @param fis inputstream (will be consumed)
|
||||
* @return (facturx = cii)
|
||||
*/
|
||||
public EStandard findOutStandardFromRootNode(InputStream fis) {
|
||||
private EStandard findOutStandardFromRootNode(InputStream fis) {
|
||||
|
||||
String zf1Signature = "CrossIndustryDocument";
|
||||
String zf2Signature = "CrossIndustryInvoice";
|
||||
@@ -144,14 +118,85 @@ public class ZUGFeRDVisualizer {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String visualize(String xmlFilename, Language lang)
|
||||
throws FileNotFoundException, TransformerException, IOException, SAXException, ParserConfigurationException {
|
||||
|
||||
try {
|
||||
if (mXsltPDFTemplate == null) {
|
||||
mXsltPDFTemplate = mFactory.newTemplates(
|
||||
new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/xr-pdf.xsl")));
|
||||
public String visualize(String xmlFilename, Language lang) throws IOException, TransformerException {
|
||||
FileInputStream fis = new FileInputStream(xmlFilename);
|
||||
return visualize(fis, lang);
|
||||
}
|
||||
|
||||
public String visualize(InputStream inputXml, Language lang) throws IOException, TransformerException {
|
||||
initTemplates(lang);
|
||||
|
||||
String fileContent = new String(IOUtils.toByteArray(inputXml), StandardCharsets.UTF_8);
|
||||
EStandard thestandard = findOutStandardFromRootNode(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)));
|
||||
ByteArrayOutputStream htmlOutput = new ByteArrayOutputStream();
|
||||
|
||||
|
||||
ByteArrayInputStream xmlContentStream = new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
if (thestandard == EStandard.zugferd) {
|
||||
applyZF1XSLT(xmlContentStream, htmlOutput);
|
||||
return htmlOutput.toString(StandardCharsets.UTF_8);
|
||||
} else if (thestandard == EStandard.facturx) {
|
||||
//zf2 or fx
|
||||
applyZF2XSLT(xmlContentStream, htmlOutput);
|
||||
} else if (thestandard == EStandard.ubl) {
|
||||
//zf2 or fx
|
||||
applyUBL2XSLT(xmlContentStream, htmlOutput);
|
||||
} else if (thestandard == EStandard.ubl_creditnote) {
|
||||
//zf2 or fx
|
||||
applyUBLCreditNote2XSLT(xmlContentStream, htmlOutput);
|
||||
} else if (thestandard == EStandard.orderx) {
|
||||
//zf2 or fx
|
||||
applyCIO2XSLT(xmlContentStream, htmlOutput);
|
||||
} else {
|
||||
throw new IllegalArgumentException("File does not look like CII or UBL");
|
||||
}
|
||||
Optional<InputStream> in = copyStream(htmlOutput);
|
||||
ByteArrayOutputStream htmlOutStream = new ByteArrayOutputStream();
|
||||
if (in.isPresent()) {
|
||||
applyXSLTToHTML(in.get(), htmlOutStream);
|
||||
}
|
||||
|
||||
return htmlOutStream.toString(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: jstaerk: why not copy with that simple call: new ByteArrayInputStream(byteArrayOutputStream.toByteArray()) ?
|
||||
*/
|
||||
private Optional<InputStream> copyStream(ByteArrayOutputStream byteArrayOutputStream) {
|
||||
// take the copy of the stream and re-write it to an InputStream
|
||||
PipedInputStream in = new PipedInputStream();
|
||||
try {
|
||||
PipedOutputStream out = new PipedOutputStream(in);
|
||||
new Thread(() -> {
|
||||
try {
|
||||
// write the original OutputStream to the PipedOutputStream
|
||||
// note that in order for the below method to work, you need
|
||||
// to ensure that the data has finished writing to the
|
||||
// ByteArrayOutputStream
|
||||
byteArrayOutputStream.writeTo(out);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Failed to write to stream", e);
|
||||
} finally {
|
||||
// close the PipedOutputStream here because we're done writing data
|
||||
// once this thread has completed its run
|
||||
StreamHelper.close(out);
|
||||
}
|
||||
}).start();
|
||||
} catch (IOException e1) {
|
||||
LOGGER.error("Failed to create HTML", e1);
|
||||
return Optional.empty();
|
||||
}
|
||||
return Optional.of(in);
|
||||
}
|
||||
|
||||
|
||||
private void initTemplates(Language lang) throws TransformerConfigurationException {
|
||||
if (mXsltXRTemplate == null) {
|
||||
mXsltXRTemplate = mFactory.newTemplates(
|
||||
new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/cii-xr.xsl")));
|
||||
}
|
||||
|
||||
if (mXsltHTMLTemplate == null) {
|
||||
mXsltHTMLTemplate = mFactory.newTemplates(new StreamSource(
|
||||
CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/xrechnung-html." + lang.name().toLowerCase() + ".xsl")));
|
||||
@@ -160,90 +205,10 @@ public class ZUGFeRDVisualizer {
|
||||
mXsltZF1HTMLTemplate = mFactory.newTemplates(new StreamSource(
|
||||
CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/ZUGFeRD_1p0_c1p0_s1p0.xslt")));
|
||||
}
|
||||
} catch (TransformerConfigurationException ex) {
|
||||
LOGGER.error("Failed to init XSLT templates", ex);
|
||||
}
|
||||
|
||||
/**
|
||||
* *
|
||||
* http://www.unece.org/fileadmin/DAM/cefact/xml/XML-Naming-And-Design-Rules-V2_1.pdf
|
||||
* http://www.ferd-net.de/upload/Dokumente/FACTUR-X_ZUGFeRD_2p0_Teil1_Profil_EN16931_1p03.pdf
|
||||
* http://countwordsfree.com/xmlviewer
|
||||
*/
|
||||
FileInputStream fis = new FileInputStream(xmlFilename);
|
||||
String fileContent = "";
|
||||
try {
|
||||
fileContent = new String(Files.readAllBytes(Paths.get(xmlFilename)), StandardCharsets.UTF_8);
|
||||
} catch (IOException e2) {
|
||||
LOGGER.error("Failed to read file content", e2);
|
||||
}
|
||||
|
||||
ByteArrayOutputStream iaos = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
boolean doPostProcessing = false;
|
||||
|
||||
|
||||
fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning
|
||||
EStandard thestandard = findOutStandardFromRootNode(fis);
|
||||
fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning
|
||||
|
||||
if (thestandard == EStandard.zugferd) {
|
||||
applyZF1XSLT(fis, baos);
|
||||
} else if (thestandard == EStandard.facturx) {
|
||||
//zf2 or fx
|
||||
applyZF2XSLT(fis, iaos);
|
||||
doPostProcessing = true;
|
||||
} else if (thestandard == EStandard.ubl) {
|
||||
//zf2 or fx
|
||||
applyUBL2XSLT(fis, iaos);
|
||||
doPostProcessing = true;
|
||||
} else if (thestandard == EStandard.ubl_creditnote) {
|
||||
//zf2 or fx
|
||||
applyUBLCreditNote2XSLT(fis, iaos);
|
||||
doPostProcessing = true;
|
||||
} else if (thestandard == EStandard.orderx) {
|
||||
//zf2 or fx
|
||||
applyCIO2XSLT(fis, iaos);
|
||||
doPostProcessing = true;
|
||||
} else {
|
||||
throw new IllegalArgumentException("File does not look like CII or UBL");
|
||||
}
|
||||
if (doPostProcessing) {
|
||||
// take the copy of the stream and re-write it to an InputStream
|
||||
PipedInputStream in = new PipedInputStream();
|
||||
PipedOutputStream out;
|
||||
try {
|
||||
out = new PipedOutputStream(in);
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
// write the original OutputStream to the PipedOutputStream
|
||||
// note that in order for the below method to work, you need
|
||||
// to ensure that the data has finished writing to the
|
||||
// ByteArrayOutputStream
|
||||
iaos.writeTo(out);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Failed to write to stream", e);
|
||||
} finally {
|
||||
// close the PipedOutputStream here because we're done writing data
|
||||
// once this thread has completed its run
|
||||
StreamHelper.close(out);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
applyXSLTToHTML(in, baos);
|
||||
} catch (IOException e1) {
|
||||
LOGGER.error("Failed to create HTML", e1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return baos.toString(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
protected String toFOP(String xmlFilename)
|
||||
throws FileNotFoundException, TransformerException {
|
||||
throws IOException, TransformerException {
|
||||
|
||||
FileInputStream fis = new FileInputStream(xmlFilename);
|
||||
EStandard theStandard = findOutStandardFromRootNode(fis);
|
||||
@@ -253,7 +218,7 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
|
||||
protected String toFOP(InputStream is, EStandard theStandard)
|
||||
throws FileNotFoundException, TransformerException {
|
||||
throws TransformerException, IOException {
|
||||
|
||||
try {
|
||||
if (mXsltPDFTemplate == null) {
|
||||
@@ -265,7 +230,6 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
|
||||
ByteArrayOutputStream iaos = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
//zf2 or fx
|
||||
if (theStandard == EStandard.facturx) {
|
||||
@@ -277,33 +241,11 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
|
||||
|
||||
PipedInputStream in = new PipedInputStream();
|
||||
PipedOutputStream out;
|
||||
try {
|
||||
out = new PipedOutputStream(in);
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
// write the original OutputStream to the PipedOutputStream
|
||||
// note that in order for the below method to work, you need
|
||||
// to ensure that the data has finished writing to the
|
||||
// ByteArrayOutputStream
|
||||
iaos.writeTo(out);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Failed to write to stream", e);
|
||||
} finally {
|
||||
// close the PipedOutputStream here because we're done writing data
|
||||
// once this thread has completed its run
|
||||
StreamHelper.close(out);
|
||||
Optional<InputStream> in = copyStream(iaos);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
if (in.isPresent()) {
|
||||
applyXSLTToPDF(in.get(), baos);
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
applyXSLTToPDF(in, baos);
|
||||
} catch (IOException e1) {
|
||||
LOGGER.error("Failed to create PDF", e1);
|
||||
}
|
||||
|
||||
|
||||
return baos.toString(StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
@@ -319,7 +261,7 @@ public class ZUGFeRDVisualizer {
|
||||
*/
|
||||
try {
|
||||
result = this.toFOP(XMLinputFile.getAbsolutePath());
|
||||
} catch (FileNotFoundException | TransformerException e) {
|
||||
} catch (TransformerException | IOException e) {
|
||||
LOGGER.error("Failed to apply FOP", e);
|
||||
}
|
||||
DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder();
|
||||
@@ -373,7 +315,7 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
}
|
||||
|
||||
protected void applyZF2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
protected void applyZF2XSLT(final InputStream xmlFile, final OutputStream htmlOutStream)
|
||||
throws TransformerException {
|
||||
if (mXsltXRTemplate == null) {
|
||||
mXsltXRTemplate = mFactory.newTemplates(
|
||||
@@ -382,10 +324,10 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
Transformer transformer = mXsltXRTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream));
|
||||
}
|
||||
|
||||
protected void applyCIO2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
protected void applyCIO2XSLT(final InputStream xmlFile, final OutputStream htmlOutstream)
|
||||
throws TransformerException {
|
||||
if (mXsltCIOTemplate == null) {
|
||||
mXsltCIOTemplate = mFactory.newTemplates(
|
||||
@@ -393,10 +335,10 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
Transformer transformer = mXsltCIOTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutstream));
|
||||
}
|
||||
|
||||
protected void applyUBL2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
protected void applyUBL2XSLT(final InputStream xmlFile, final OutputStream htmlOutStream)
|
||||
throws TransformerException {
|
||||
if (mXsltUBLTemplate == null) {
|
||||
mXsltUBLTemplate = mFactory.newTemplates(
|
||||
@@ -404,10 +346,10 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
Transformer transformer = mXsltUBLTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream));
|
||||
}
|
||||
|
||||
protected void applyUBLCreditNote2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
protected void applyUBLCreditNote2XSLT(final InputStream xmlFile, final OutputStream htmlOutStream)
|
||||
throws TransformerException {
|
||||
if (mXsltUBLTemplate == null) {
|
||||
mXsltUBLTemplate = mFactory.newTemplates(
|
||||
@@ -415,28 +357,30 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
Transformer transformer = mXsltUBLTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream));
|
||||
}
|
||||
|
||||
protected void applyZF1XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
protected void applyZF1XSLT(final InputStream xmlFile, final OutputStream htmlOutStream)
|
||||
throws TransformerException {
|
||||
Transformer transformer = mXsltZF1HTMLTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream));
|
||||
}
|
||||
|
||||
protected void applyXSLTToHTML(final InputStream xmlFile, final OutputStream HTMLOutstream)
|
||||
throws TransformerException {
|
||||
protected void applyXSLTToHTML(final InputStream xmlFile, final OutputStream htmlOutStream)
|
||||
throws TransformerException, IOException {
|
||||
Transformer transformer = mXsltHTMLTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream));
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream));
|
||||
xmlFile.close();
|
||||
}
|
||||
|
||||
protected void applyXSLTToPDF(final InputStream xmlFile, final OutputStream PDFOutstream)
|
||||
throws TransformerException {
|
||||
throws TransformerException, IOException {
|
||||
Transformer transformer = mXsltPDFTemplate.newTransformer();
|
||||
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(PDFOutstream));
|
||||
xmlFile.close();
|
||||
}
|
||||
|
||||
private static class ClasspathResourceURIResolver implements URIResolver {
|
||||
@@ -445,7 +389,7 @@ public class ZUGFeRDVisualizer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Source resolve(String href, String base) throws TransformerException {
|
||||
public Source resolve(String href, String base) {
|
||||
return new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/" + href));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
select="./rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ram:ReceivingAdviceReferencedDocument/ram:IssuerAssignedID"/>
|
||||
<xsl:apply-templates mode="BT-16"
|
||||
select="./rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ram:DespatchAdviceReferencedDocument/ram:IssuerAssignedID"/>
|
||||
<xsl:apply-templates mode="BT-X-202"
|
||||
select="./rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ram:DeliveryNoteReferencedDocument/ram:IssuerAssignedID"/>
|
||||
<xsl:apply-templates mode="BT-17"
|
||||
select="./rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:AdditionalReferencedDocument/ram:IssuerAssignedID[following-sibling::ram:TypeCode='50']"/>
|
||||
<xsl:apply-templates mode="BT-18"
|
||||
@@ -295,6 +297,14 @@
|
||||
<xr:Receiving_advice_reference>
|
||||
<xsl:attribute name="xr:id" select="'BT-15'"/>
|
||||
<xsl:attribute name="xr:src" select="xr:src-path(.)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="../ram:FormattedIssueDateTime/qdt:DateTimeString[@format = '102']">
|
||||
<xsl:call-template name="dateAsAttribute">
|
||||
<xsl:with-param name="dateString" select="../ram:FormattedIssueDateTime/qdt:DateTimeString[@format = '102']"/>
|
||||
<xsl:with-param name="attributeName" select="'bt-x-201'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:call-template name="document_reference"/>
|
||||
</xr:Receiving_advice_reference>
|
||||
</xsl:template>
|
||||
@@ -303,9 +313,33 @@
|
||||
<xr:Despatch_advice_reference>
|
||||
<xsl:attribute name="xr:id" select="'BT-16'"/>
|
||||
<xsl:attribute name="xr:src" select="xr:src-path(.)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="../ram:FormattedIssueDateTime/qdt:DateTimeString[@format = '102']">
|
||||
<xsl:call-template name="dateAsAttribute">
|
||||
<xsl:with-param name="dateString" select="../ram:FormattedIssueDateTime/qdt:DateTimeString[@format = '102']"/>
|
||||
<xsl:with-param name="attributeName" select="'bt-x-200'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:call-template name="document_reference"/>
|
||||
</xr:Despatch_advice_reference>
|
||||
</xsl:template>
|
||||
<xsl:template mode="BT-X-202"
|
||||
match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeDelivery/ram:DeliveryNoteReferencedDocument/ram:IssuerAssignedID">
|
||||
<xr:Delivery_note_reference>
|
||||
<xsl:attribute name="xr:id" select="'BT-X-202'"/>
|
||||
<xsl:attribute name="xr:src" select="xr:src-path(.)"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="../ram:FormattedIssueDateTime/qdt:DateTimeString[@format = '102']">
|
||||
<xsl:call-template name="dateAsAttribute">
|
||||
<xsl:with-param name="dateString" select="../ram:FormattedIssueDateTime/qdt:DateTimeString[@format = '102']"/>
|
||||
<xsl:with-param name="attributeName" select="'bt-x-203'"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<xsl:call-template name="document_reference"/>
|
||||
</xr:Delivery_note_reference>
|
||||
</xsl:template>
|
||||
<xsl:template mode="BT-17"
|
||||
match="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:AdditionalReferencedDocument/ram:IssuerAssignedID[following-sibling::ram:TypeCode='50']">
|
||||
<xr:Tender_or_lot_reference>
|
||||
@@ -2437,6 +2471,7 @@
|
||||
<xsl:template name="text">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="date">
|
||||
<xsl:variable name="normalizeddate" select="normalize-space(replace(., '-', ''))"/>
|
||||
<xsl:choose>
|
||||
@@ -2453,6 +2488,24 @@
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:template name="dateAsAttribute">
|
||||
<xsl:param name="dateString"/>
|
||||
<xsl:param name="attributeName" select="'date'"/>
|
||||
<xsl:variable name="normalizeddate" select="normalize-space(replace($dateString, '-', ''))"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="matches($normalizeddate, '^[0-9]{8}$')">
|
||||
<xsl:attribute name="{$attributeName}"
|
||||
select="xs:date( concat(substring($normalizeddate,1,4), '-', substring($normalizeddate,5,2), '-', substring($normalizeddate,7,2) ) )"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>ILLEGAL DATE FORMAT: <para>Mit diesem Datentyp wird ein kalendarisches Datum
|
||||
abgebildet, wie es in der ISO 8601 Spezifikation <quote>Calendar date complete representation</quote>
|
||||
beschrieben ist (siehe ISO 8601:2004, Abschnitt 5.2.1.1). Das Datum beinhaltet keine Zeitangabe. Das
|
||||
konkret zu verwendende Format ist abhängig von der genutzten Syntax.</para>
|
||||
<para>Der Datentyp basiert auf dem Typ <quote>Date Time. Type</quote>, wie in ISO
|
||||
15000-5:2014 Anhang B definiert.</para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:template name="identifier-with-scheme-and-version">
|
||||
<xsl:param name="schemeID" as="element()?"/>
|
||||
<xsl:if test="@listID | @schemeID">
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<xsl:variable name="i18n.history" select="'Bearbeitungshistorie'"/>
|
||||
<xsl:variable name="i18n.disclaimer" select="'Wir übernehmen keine Haftung für die Richtigkeit der Daten.'"/>
|
||||
<xsl:variable name="i18n.recipientInfo" select="'Informationen zum Käufer'"/>
|
||||
<xsl:variable name="i18n.dateOf" select="' vom '"/>
|
||||
<xsl:variable name="i18n.bt50" select="'Straße / Haus-Nr.'"/>
|
||||
<xsl:variable name="i18n.bt51" select="'Postfach'"/>
|
||||
<xsl:variable name="i18n.bt163" select="'Adresszusatz'"/>
|
||||
@@ -197,6 +198,7 @@
|
||||
<xsl:variable name="i18n.bt17" select="'Vergabenummer'"/>
|
||||
<xsl:variable name="i18n.bt15" select="'Kennung der Empfangsbestätigung'"/>
|
||||
<xsl:variable name="i18n.bt16" select="'Kennung der Versandanzeige'"/>
|
||||
<xsl:variable name="i18n.btx202" select="'Kennung des Lieferscheins'"/>
|
||||
<xsl:variable name="i18n.bt23" select="'Prozesskennung'"/>
|
||||
<xsl:variable name="i18n.bt24" select="'Spezifikationskennung'"/>
|
||||
<xsl:variable name="i18n.bt18" select="'Objektkennung'"/>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<xsl:variable name="i18n.history" select="'History'"/>
|
||||
<xsl:variable name="i18n.disclaimer" select="'We accept no liability for the correctness of the data'"/>
|
||||
<xsl:variable name="i18n.recipientInfo" select="'Buyer Information'"/>
|
||||
<xsl:variable name="i18n.dateOf" select="' from '"/>
|
||||
<xsl:variable name="i18n.bt50" select="'Street / house number'"/>
|
||||
<xsl:variable name="i18n.bt51" select="'PO Box'"/>
|
||||
<xsl:variable name="i18n.bt163" select="'Address Addition'"/>
|
||||
@@ -197,6 +198,7 @@
|
||||
<xsl:variable name="i18n.bt17" select="'Assignment number'"/>
|
||||
<xsl:variable name="i18n.bt15" select="'Receipt confirmation ID'"/>
|
||||
<xsl:variable name="i18n.bt16" select="'Dispatch note ID'"/>
|
||||
<xsl:variable name="i18n.btx202" select="'Delivery note ID'"/>
|
||||
<xsl:variable name="i18n.bt23" select="'Process ID'"/>
|
||||
<xsl:variable name="i18n.bt24" select="'Specification ID'"/>
|
||||
<xsl:variable name="i18n.bt18" select="'Object ID'"/>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<xsl:variable name="i18n.history" select="'Historique de traitement'"/>
|
||||
<xsl:variable name="i18n.disclaimer" select="'Nous n''assumons aucune responsabilité quant à l''exactitude des données.'"/>
|
||||
<xsl:variable name="i18n.recipientInfo" select="'Informations sur l''acheteur'"/>
|
||||
<xsl:variable name="i18n.dateOf" select="' du '"/>
|
||||
<xsl:variable name="i18n.bt50" select="'Rue / Numéro de maison'"/>
|
||||
<xsl:variable name="i18n.bt51" select="'Boîte postale'"/>
|
||||
<xsl:variable name="i18n.bt163" select="'Supplément d''adresse'"/>
|
||||
@@ -197,6 +198,7 @@
|
||||
<xsl:variable name="i18n.bt17" select="'Numéro d''attribution'"/>
|
||||
<xsl:variable name="i18n.bt15" select="'Identifiant de l''accusé de réception'"/>
|
||||
<xsl:variable name="i18n.bt16" select="'Identifiant du bordereau d''expédition'"/>
|
||||
<xsl:variable name="i18n.btx202" select="'Identifiant du bon de livraison'"/>
|
||||
<xsl:variable name="i18n.bt23" select="'Identifiant processus'"/>
|
||||
<xsl:variable name="i18n.bt24" select="'Identifiant spécification'"/>
|
||||
<xsl:variable name="i18n.bt18" select="'Identifiant objet'"/>
|
||||
|
||||
@@ -1144,17 +1144,29 @@ function downloadData (element_id) {
|
||||
<xsl:apply-templates select="./xr:VAT_BREAKDOWN"/>
|
||||
</div>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="./xr:DOCUMENT_LEVEL_ALLOWANCES">
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig">
|
||||
<xsl:apply-templates select="./xr:DOCUMENT_LEVEL_ALLOWANCES"/>
|
||||
</div>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="./xr:DOCUMENT_LEVEL_CHARGES">
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig">
|
||||
<xsl:apply-templates select="./xr:DOCUMENT_LEVEL_CHARGES"/>
|
||||
</div>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="./xr:LOGISTICS_SERVICE_CHARGES">
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig">
|
||||
<xsl:apply-templates select="./xr:LOGISTICS_SERVICE_CHARGES"/>
|
||||
</div>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig first">
|
||||
<div class="boxzeile">
|
||||
@@ -2182,11 +2194,24 @@ function downloadData (element_id) {
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende"><xsl:value-of select="$i18n.bt15"/>:</div>
|
||||
<div id="BT-15" title="BT-15" class="boxdaten wert"><xsl:value-of select="xr:Receiving_advice_reference"/></div>
|
||||
<div id="BT-15" title="BT-15" class="boxdaten wert">
|
||||
<xsl:value-of select="xr:Receiving_advice_reference"/>
|
||||
<xsl:if test="xr:Receiving_advice_reference/@bt-x-201"><xsl:value-of select="concat($i18n.dateOf, format-date(xr:Receiving_advice_reference/@bt-x-201,'[D].[M].[Y]'))"/></xsl:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende"><xsl:value-of select="$i18n.bt16"/>:</div>
|
||||
<div id="BT-16" title="BT-16" class="boxdaten wert"><xsl:value-of select="xr:Despatch_advice_reference"/></div>
|
||||
<div id="BT-16" title="BT-16" class="boxdaten wert">
|
||||
<xsl:value-of select="xr:Despatch_advice_reference"/>
|
||||
<xsl:if test="xr:Despatch_advice_reference/@bt-x-200"><xsl:value-of select="concat($i18n.dateOf, format-date(xr:Despatch_advice_reference/@bt-x-200,'[D].[M].[Y]'))"/></xsl:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende"><xsl:value-of select="$i18n.btx202"/>:</div>
|
||||
<div id="BT-X-202" title="BT-X-202" class="boxdaten wert">
|
||||
<xsl:value-of select="xr:Delivery_note_reference"/>
|
||||
<xsl:if test="xr:Delivery_note_reference/@bt-x-203"><xsl:value-of select="concat($i18n.dateOf, format-date(xr:Delivery_note_reference/@bt-x-203,'[D].[M].[Y]'))"/></xsl:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende"><xsl:value-of select="$i18n.bt23"/>:</div>
|
||||
|
||||
@@ -22,10 +22,9 @@ package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDVisualizer.Language;
|
||||
import org.mustangproject.util.ByteArraySearcher;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -40,179 +39,34 @@ public class VisualizationTest extends ResourceCase {
|
||||
final String TARGET_PDF_UBL = "./target/testout-Visualization-cii.pdf";
|
||||
|
||||
public void testCIIVisualizationBasic() {
|
||||
|
||||
// the writing part
|
||||
String sourceFilename = "factur-x.xml";
|
||||
File CIIinputFile = getResourceAsFile(sourceFilename);
|
||||
|
||||
String expected = null;
|
||||
String result = null;
|
||||
try {
|
||||
ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer();
|
||||
/* remove file endings so that tests can also pass after checking
|
||||
out from git with arbitrary options (which may include CSRF changes)
|
||||
*/
|
||||
result = zvi.visualize(CIIinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.FR);
|
||||
Files.write(Paths.get("./target/testout-factur-x-vis.fr.html"), result.getBytes(StandardCharsets.UTF_8));
|
||||
result = result
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
|
||||
File expectedResult = getResourceAsFile("factur-x-vis.fr.html");
|
||||
expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8)
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
// remove linebreaks as well...
|
||||
|
||||
} catch (UnsupportedOperationException e) {
|
||||
fail("UnsupportedOperationException should not happen: " + e.getMessage());
|
||||
} catch (IllegalArgumentException e) {
|
||||
fail("IllegalArgumentException should not happen: " + e.getMessage());
|
||||
} catch (TransformerException e) {
|
||||
fail("TransformerException should not happen: " + e.getMessage());
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not happen: " + e.getMessage());
|
||||
} catch (ParserConfigurationException e) {
|
||||
fail("ParserConfigurationException should not happen: " + e.getMessage());
|
||||
} catch (SAXException e) {
|
||||
fail("SAXException should not happen: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
assertNotNull(result);
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(expected, result);
|
||||
this.runZUGFeRDVisualization("factur-x.xml", "factur-x-vis.fr.html", Language.FR);
|
||||
}
|
||||
|
||||
public void testCIIVisualizationExtended() {
|
||||
|
||||
// the writing part
|
||||
String sourceFilename = "factur-x-extended.xml";
|
||||
File CIIinputFile = getResourceAsFile(sourceFilename);
|
||||
|
||||
String expected = null;
|
||||
String result = null;
|
||||
try {
|
||||
ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer();
|
||||
/* remove file endings so that tests can also pass after checking
|
||||
out from git with arbitrary options (which may include CSRF changes)
|
||||
*/
|
||||
result = zvi.visualize(CIIinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.DE);
|
||||
Files.write(Paths.get("./target/testout-factur-x-vis-extended.de.html"), result.getBytes(StandardCharsets.UTF_8));
|
||||
result = result
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
|
||||
File expectedResult = getResourceAsFile("factur-x-vis-extended.de.html");
|
||||
expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8)
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
// remove linebreaks as well...
|
||||
|
||||
} catch (UnsupportedOperationException e) {
|
||||
fail("UnsupportedOperationException should not happen: " + e.getMessage());
|
||||
} catch (IllegalArgumentException e) {
|
||||
fail("IllegalArgumentException should not happen: " + e.getMessage());
|
||||
} catch (TransformerException e) {
|
||||
fail("TransformerException should not happen: " + e.getMessage());
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not happen: " + e.getMessage());
|
||||
} catch (ParserConfigurationException e) {
|
||||
fail("ParserConfigurationException should not happen: " + e.getMessage());
|
||||
} catch (SAXException e) {
|
||||
fail("SAXException should not happen: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
assertNotNull(result);
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(expected, result);
|
||||
this.runZUGFeRDVisualization("factur-x-extended.xml", "factur-x-vis-extended.de.html", Language.DE);
|
||||
}
|
||||
|
||||
public void testUBLCreditNoteVisualizationBasic() {
|
||||
|
||||
// the writing part
|
||||
File UBLinputFile = getResourceAsFile("ubl-creditnote.xml");
|
||||
|
||||
String expected = null;
|
||||
String result = null;
|
||||
try {
|
||||
ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer();
|
||||
/* remove file endings so that tests can also pass after checking
|
||||
out from git with arbitrary options (which may include CSRF changes)
|
||||
*/
|
||||
result = zvi.visualize(UBLinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.EN);
|
||||
Files.write(Paths.get("./target/testout-factur-x-vis-ubl-creditnote.en.html"), result.getBytes(StandardCharsets.UTF_8));
|
||||
result = result
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
|
||||
File expectedResult = getResourceAsFile("factur-x-vis-ubl-creditnote.en.html");
|
||||
expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8)
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
// remove linebreaks as well...
|
||||
|
||||
} catch (UnsupportedOperationException e) {
|
||||
fail("UnsupportedOperationException should not happen: " + e.getMessage());
|
||||
} catch (IllegalArgumentException e) {
|
||||
fail("IllegalArgumentException should not happen: " + e.getMessage());
|
||||
} catch (TransformerException e) {
|
||||
fail("TransformerException should not happen: " + e.getMessage());
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not happen: " + e.getMessage());
|
||||
} catch (ParserConfigurationException e) {
|
||||
fail("ParserConfigurationException should not happen: " + e.getMessage());
|
||||
} catch (SAXException e) {
|
||||
fail("SAXException should not happen: " + e.getMessage());
|
||||
this.runZUGFeRDVisualization("ubl-creditnote.xml", "factur-x-vis-ubl-creditnote.en.html", Language.EN);
|
||||
}
|
||||
|
||||
|
||||
assertNotNull(result);
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(expected, result);
|
||||
}
|
||||
|
||||
|
||||
public void testUBLVisualizationBasic() {
|
||||
this.runZUGFeRDVisualization("ubl/01.01a-INVOICE.ubl.xml", "factur-x-vis-ubl.en.html", Language.EN);
|
||||
}
|
||||
|
||||
// the writing part
|
||||
File UBLinputFile = getResourceAsFile("ubl/01.01a-INVOICE.ubl.xml");
|
||||
private void runZUGFeRDVisualization(String inputFilename, String resultFileName, Language lang) {
|
||||
File CIIinputFile = getResourceAsFile(inputFilename);
|
||||
|
||||
String expected = null;
|
||||
String result = null;
|
||||
try {
|
||||
ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer();
|
||||
/* remove file endings so that tests can also pass after checking
|
||||
out from git with arbitrary options (which may include CSRF changes)
|
||||
*/
|
||||
result = zvi.visualize(UBLinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.EN);
|
||||
Files.write(Paths.get("./target/testout-factur-x-vis-ubl.en.html"), result.getBytes(StandardCharsets.UTF_8));
|
||||
result = result
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
result = zvi.visualize(CIIinputFile.getAbsolutePath(), lang);
|
||||
Files.write(Paths.get("./target/testout-" + resultFileName), result.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
File expectedResult = getResourceAsFile("factur-x-vis-ubl.en.html");
|
||||
File expectedResult = getResourceAsFile(resultFileName);
|
||||
expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8)
|
||||
.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
// remove linebreaks as well...
|
||||
;
|
||||
|
||||
} catch (UnsupportedOperationException e) {
|
||||
fail("UnsupportedOperationException should not happen: " + e.getMessage());
|
||||
@@ -222,16 +76,20 @@ public class VisualizationTest extends ResourceCase {
|
||||
fail("TransformerException should not happen: " + e.getMessage());
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not happen: " + e.getMessage());
|
||||
} catch (ParserConfigurationException e) {
|
||||
fail("ParserConfigurationException should not happen: " + e.getMessage());
|
||||
} catch (SAXException e) {
|
||||
fail("SAXException should not happen: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
assertNotNull(result);
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(expected, result);
|
||||
/* remove file endings so that tests can also pass after checking
|
||||
out from git with arbitrary options (which may include CSRF changes)
|
||||
*/
|
||||
assertEquals(expected.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", ""), result.replace("\r", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace(" ", ""));
|
||||
}
|
||||
|
||||
public void testPDFVisualizationCII() {
|
||||
|
||||
@@ -359,6 +359,9 @@ GLN 4304171000002
|
||||
</ram:ActualDeliverySupplyChainEvent>
|
||||
<ram:DeliveryNoteReferencedDocument>
|
||||
<ram:IssuerAssignedID>L87654321012</ram:IssuerAssignedID>
|
||||
<ram:FormattedIssueDateTime>
|
||||
<qdt:DateTimeString format="102">20241031</qdt:DateTimeString>
|
||||
</ram:FormattedIssueDateTime>
|
||||
</ram:DeliveryNoteReferencedDocument>
|
||||
</ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
|
||||
@@ -1085,7 +1085,6 @@
|
||||
</div>
|
||||
<div class="boxabstand"></div>
|
||||
</div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig">
|
||||
<div class="boxzeile">
|
||||
<div id="uebersichtVersandkosten" class="box">
|
||||
@@ -2248,6 +2247,10 @@
|
||||
<div class="boxdaten legende">Kennung der Versandanzeige:</div>
|
||||
<div id="BT-16" title="BT-16" class="boxdaten wert"></div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Kennung des Lieferscheins:</div>
|
||||
<div id="BT-X-202" title="BT-X-202" class="boxdaten wert">L87654321012 vom 31.10.2024</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Prozesskennung:</div>
|
||||
<div id="BT-23" title="BT-23" class="boxdaten wert"></div>
|
||||
|
||||
@@ -1359,7 +1359,6 @@
|
||||
</div>
|
||||
<div class="boxabstand"></div>
|
||||
</div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig first">
|
||||
<div class="boxzeile">
|
||||
<div id="uebersichtZahlungsinformationen" class="box subBox">
|
||||
@@ -2355,6 +2354,10 @@
|
||||
<div class="boxdaten legende">Dispatch note ID:</div>
|
||||
<div id="BT-16" title="BT-16" class="boxdaten wert"></div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Delivery note ID:</div>
|
||||
<div id="BT-X-202" title="BT-X-202" class="boxdaten wert"></div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Process ID:</div>
|
||||
<div id="BT-23" title="BT-23" class="boxdaten wert"></div>
|
||||
|
||||
@@ -1219,9 +1219,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig first">
|
||||
<div class="boxzeile">
|
||||
<div id="uebersichtZahlungsinformationen" class="box subBox">
|
||||
@@ -1755,6 +1752,10 @@
|
||||
<div class="boxdaten legende">Dispatch note ID:</div>
|
||||
<div id="BT-16" title="BT-16" class="boxdaten wert"></div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Delivery note ID:</div>
|
||||
<div id="BT-X-202" title="BT-X-202" class="boxdaten wert"></div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Process ID:</div>
|
||||
<div id="BT-23" title="BT-23" class="boxdaten wert"></div>
|
||||
|
||||
@@ -1250,9 +1250,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig"></div>
|
||||
<div class="boxtabelle boxabstandtop boxtabelleZweispaltig first">
|
||||
<div class="boxzeile">
|
||||
<div id="uebersichtZahlungsinformationen" class="box subBox">
|
||||
@@ -1927,6 +1924,10 @@
|
||||
<div class="boxdaten legende">Identifiant du bordereau d'expédition:</div>
|
||||
<div id="BT-16" title="BT-16" class="boxdaten wert"></div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Identifiant du bon de livraison:</div>
|
||||
<div id="BT-X-202" title="BT-X-202" class="boxdaten wert"></div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Identifiant processus:</div>
|
||||
<div id="BT-23" title="BT-23" class="boxdaten wert"></div>
|
||||
|
||||
Reference in New Issue
Block a user