Remove \n behind xml tags
This commit is contained in:
@@ -28,13 +28,13 @@ public interface IZUGFeRDTradeSettlementDebit extends IZUGFeRDTradeSettlement {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
String xml = " <ram:SpecifiedTradeSettlementPaymentMeans>\n"
|
String xml = "<ram:SpecifiedTradeSettlementPaymentMeans>"
|
||||||
+ " <ram:TypeCode>59</ram:TypeCode>\n"
|
+ "<ram:TypeCode>59</ram:TypeCode>"
|
||||||
+ " <ram:PayerPartyDebtorFinancialAccount>\n"
|
+ " <ram:PayerPartyDebtorFinancialAccount>"
|
||||||
+ " <ram:IBANID>"+XMLTools.encodeXML(getIBAN())+"</ram:IBANID>\n"
|
+ "<ram:IBANID>"+XMLTools.encodeXML(getIBAN())+"</ram:IBANID>"
|
||||||
+ " </ram:PayerPartyDebtorFinancialAccount>\n";
|
+ "</ram:PayerPartyDebtorFinancialAccount>";
|
||||||
|
|
||||||
xml = xml + " </ram:SpecifiedTradeSettlementPaymentMeans>\n";
|
xml = xml + "</ram:SpecifiedTradeSettlementPaymentMeans>";
|
||||||
return xml;
|
return xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
*********************************************************************** */
|
*********************************************************************** */
|
||||||
package org.mustangproject.ZUGFeRD;
|
package org.mustangproject.ZUGFeRD;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
|
|
||||||
import org.mustangproject.XMLTools;
|
import org.mustangproject.XMLTools;
|
||||||
|
|
||||||
public interface IZUGFeRDTradeSettlementPayment extends IZUGFeRDTradeSettlement {
|
public interface IZUGFeRDTradeSettlementPayment extends IZUGFeRDTradeSettlement {
|
||||||
@@ -60,26 +58,27 @@ public interface IZUGFeRDTradeSettlementPayment extends IZUGFeRDTradeSettlement
|
|||||||
default String getAccountName() { return null; }
|
default String getAccountName() { return null; }
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
default String getSettlementXML() {
|
default String getSettlementXML() {
|
||||||
String accountNameStr="";
|
String accountNameStr="";
|
||||||
if (getAccountName()!=null) {
|
if (getAccountName()!=null) {
|
||||||
accountNameStr="<ram:AccountName>" + XMLTools.encodeXML(getAccountName()) + "</ram:AccountName>\n";
|
accountNameStr="<ram:AccountName>" + XMLTools.encodeXML(getAccountName()) + "</ram:AccountName>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String xml = " <ram:SpecifiedTradeSettlementPaymentMeans>\n"
|
String xml = " <ram:SpecifiedTradeSettlementPaymentMeans>"
|
||||||
+ " <ram:TypeCode>58</ram:TypeCode>\n"
|
+ " <ram:TypeCode>58</ram:TypeCode>"
|
||||||
+ " <ram:Information>SEPA credit transfer</ram:Information>\n"
|
+ " <ram:Information>SEPA credit transfer</ram:Information>"
|
||||||
+ " <ram:PayeePartyCreditorFinancialAccount>\n"
|
+ " <ram:PayeePartyCreditorFinancialAccount>"
|
||||||
+ " <ram:IBANID>" + XMLTools.encodeXML(getOwnIBAN()) + "</ram:IBANID>\n";
|
+ " <ram:IBANID>" + XMLTools.encodeXML(getOwnIBAN()) + "</ram:IBANID>";
|
||||||
xml+= accountNameStr;
|
xml+= accountNameStr;
|
||||||
xml+= " </ram:PayeePartyCreditorFinancialAccount>\n"
|
xml+= " </ram:PayeePartyCreditorFinancialAccount>"
|
||||||
+ " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
|
+ " <ram:PayeeSpecifiedCreditorFinancialInstitution>"
|
||||||
+ " <ram:BICID>" + XMLTools.encodeXML(getOwnBIC()) + "</ram:BICID>\n"
|
+ " <ram:BICID>" + XMLTools.encodeXML(getOwnBIC()) + "</ram:BICID>"
|
||||||
// + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>\n"
|
// + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>"
|
||||||
//
|
//
|
||||||
+ " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
|
+ " </ram:PayeeSpecifiedCreditorFinancialInstitution>"
|
||||||
+ " </ram:SpecifiedTradeSettlementPaymentMeans>\n";
|
+ " </ram:SpecifiedTradeSettlementPaymentMeans>";
|
||||||
return xml;
|
return xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,17 +20,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.mustangproject.ZUGFeRD;
|
package org.mustangproject.ZUGFeRD;
|
||||||
|
|
||||||
import org.dom4j.Document;
|
import static org.mustangproject.ZUGFeRD.ZUGFeRDDateFormat.DATE;
|
||||||
import org.dom4j.DocumentException;
|
import static org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants.CORRECTEDINVOICE;
|
||||||
import org.dom4j.DocumentHelper;
|
import static org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants.CATEGORY_CODES_WITH_EXEMPTION_REASON;
|
||||||
import org.dom4j.io.OutputFormat;
|
|
||||||
import org.dom4j.io.XMLWriter;
|
|
||||||
import org.mustangproject.EStandard;
|
|
||||||
import org.mustangproject.FileAttachment;
|
|
||||||
import org.mustangproject.XMLTools;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.StringWriter;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -40,9 +33,9 @@ import java.util.Map;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import static org.mustangproject.ZUGFeRD.ZUGFeRDDateFormat.DATE;
|
import org.mustangproject.EStandard;
|
||||||
import static org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants.CORRECTEDINVOICE;
|
import org.mustangproject.FileAttachment;
|
||||||
import static org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants.CATEGORY_CODES_WITH_EXEMPTION_REASON;
|
import org.mustangproject.XMLTools;
|
||||||
|
|
||||||
public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider {
|
public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider {
|
||||||
|
|
||||||
@@ -60,7 +53,7 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
boolean hasDueDate = false;
|
boolean hasDueDate = false;
|
||||||
final SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
final SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||||
|
|
||||||
String exemptionReason = "";
|
final String exemptionReason = "";
|
||||||
|
|
||||||
if (trans.getPaymentTermDescription() != null) {
|
if (trans.getPaymentTermDescription() != null) {
|
||||||
paymentTermsDescription = trans.getPaymentTermDescription();
|
paymentTermsDescription = trans.getPaymentTermDescription();
|
||||||
@@ -73,73 +66,73 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
|
|
||||||
String senderReg = "";
|
String senderReg = "";
|
||||||
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
||||||
senderReg = "" + "<ram:IncludedNote>\n" + " <ram:Content>\n"
|
senderReg = "<ram:IncludedNote><ram:Content>"
|
||||||
+ XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + " </ram:Content>\n"
|
+ XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + "</ram:Content>"
|
||||||
+ "<ram:SubjectCode>REG</ram:SubjectCode>\n" + "</ram:IncludedNote>\n";
|
+ "<ram:SubjectCode>REG</ram:SubjectCode></ram:IncludedNote>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String rebateAgreement = "";
|
String rebateAgreement = "";
|
||||||
if (trans.rebateAgreementExists()) {
|
if (trans.rebateAgreementExists()) {
|
||||||
rebateAgreement = "<ram:IncludedNote>\n" + " <ram:Content>"
|
rebateAgreement = "<ram:IncludedNote><ram:Content>"
|
||||||
+ "Es bestehen Rabatt- und Bonusvereinbarungen.</ram:Content>\n"
|
+ "Es bestehen Rabatt- und Bonusvereinbarungen.</ram:Content>"
|
||||||
+ "<ram:SubjectCode>AAK</ram:SubjectCode>\n" + "</ram:IncludedNote>\n";
|
+ "<ram:SubjectCode>AAK</ram:SubjectCode></ram:IncludedNote>";
|
||||||
}
|
}
|
||||||
|
|
||||||
String subjectNote = "";
|
String subjectNote = "";
|
||||||
if (trans.getSubjectNote() != null) {
|
if (trans.getSubjectNote() != null) {
|
||||||
subjectNote = "<ram:IncludedNote>\n" + " <ram:Content>"
|
subjectNote = "<ram:IncludedNote><ram:Content>"
|
||||||
+ XMLTools.encodeXML(trans.getSubjectNote()) + "</ram:Content>\n"
|
+ XMLTools.encodeXML(trans.getSubjectNote()) + "</ram:Content>"
|
||||||
+ "</ram:IncludedNote>\n";
|
+ "</ram:IncludedNote>";
|
||||||
}
|
}
|
||||||
|
|
||||||
String typecode = "220";
|
final String typecode = "220";
|
||||||
/*if (trans.getDocumentCode() != null) {
|
/*if (trans.getDocumentCode() != null) {
|
||||||
typecode = trans.getDocumentCode();
|
typecode = trans.getDocumentCode();
|
||||||
}*/
|
}*/
|
||||||
String notes = "";
|
String notes = "";
|
||||||
if (trans.getNotes() != null) {
|
if (trans.getNotes() != null) {
|
||||||
for (final String currentNote : trans.getNotes()) {
|
for (final String currentNote : trans.getNotes()) {
|
||||||
notes = notes + "<ram:IncludedNote><ram:Content>" + XMLTools.encodeXML(currentNote) + "</ram:Content></ram:IncludedNote>";
|
notes += "<ram:IncludedNote><ram:Content>" + XMLTools.encodeXML(currentNote) + "</ram:Content></ram:IncludedNote>";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
|
|
||||||
+ "<rsm:SCRDMCCBDACIOMessageStructure\n" +
|
+ "<rsm:SCRDMCCBDACIOMessageStructure\n" +
|
||||||
"xmlns:rsm=\"urn:un:unece:uncefact:data:SCRDMCCBDACIOMessageStructure:100\"\n" +
|
"xmlns:rsm=\"urn:un:unece:uncefact:data:SCRDMCCBDACIOMessageStructure:100\"\n" +
|
||||||
"xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:128\"\n" +
|
"xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:128\"\n" +
|
||||||
"xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType:128\"\n" +
|
"xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType:128\"\n" +
|
||||||
"xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:128\"\n" +
|
"xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:128\"\n" +
|
||||||
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
|
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">"
|
||||||
// + "
|
// + "
|
||||||
// xsi:schemaLocation=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100
|
// xsi:schemaLocation=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100
|
||||||
// ../Schema/ZUGFeRD1p0.xsd\""
|
// ../Schema/ZUGFeRD1p0.xsd\""
|
||||||
+ " <rsm:ExchangedDocumentContext>\n"
|
+ "<rsm:ExchangedDocumentContext>"
|
||||||
// + "
|
// + "
|
||||||
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>\n"
|
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>\n"
|
||||||
//
|
//
|
||||||
+ "<ram:BusinessProcessSpecifiedDocumentContextParameter>\n"
|
+ "<ram:BusinessProcessSpecifiedDocumentContextParameter>"
|
||||||
+ "<ram:ID>A1</ram:ID>\n"
|
+ "<ram:ID>A1</ram:ID>"
|
||||||
+ "</ram:BusinessProcessSpecifiedDocumentContextParameter>\n"
|
+ "</ram:BusinessProcessSpecifiedDocumentContextParameter>"
|
||||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
+ "<ram:GuidelineSpecifiedDocumentContextParameter>"
|
||||||
+ " <ram:ID>" + getProfile().getID() + "</ram:ID>\n"
|
+ "<ram:ID>" + getProfile().getID() + "</ram:ID>"
|
||||||
+ " </ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
+ "</ram:GuidelineSpecifiedDocumentContextParameter>"
|
||||||
+ " </rsm:ExchangedDocumentContext>\n"
|
+ "</rsm:ExchangedDocumentContext>"
|
||||||
+ " <rsm:ExchangedDocument>\n"
|
+ "<rsm:ExchangedDocument>"
|
||||||
+ " <ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>\n"
|
+ "<ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>"
|
||||||
// + " <ram:Name>RECHNUNG</ram:Name>\n"
|
// + " <ram:Name>RECHNUNG</ram:Name>"
|
||||||
// + " <ram:TypeCode>380</ram:TypeCode>\n"
|
// + "<ram:TypeCode>380</ram:TypeCode>"
|
||||||
+ " <ram:TypeCode>" + typecode + "</ram:TypeCode>\n"
|
+ "<ram:TypeCode>" + typecode + "</ram:TypeCode>"
|
||||||
+ "<ram:IssueDateTime>"
|
+ "<ram:IssueDateTime>"
|
||||||
+ DATE.udtFormat(trans.getIssueDate()) + "</ram:IssueDateTime>\n" // date
|
+ DATE.udtFormat(trans.getIssueDate()) + "</ram:IssueDateTime>" // date
|
||||||
+ notes
|
+ notes
|
||||||
+ subjectNote
|
+ subjectNote
|
||||||
+ rebateAgreement
|
+ rebateAgreement
|
||||||
+ senderReg
|
+ senderReg
|
||||||
|
|
||||||
+ " </rsm:ExchangedDocument>\n"
|
+ "</rsm:ExchangedDocument>"
|
||||||
+ " <rsm:SupplyChainTradeTransaction>\n";
|
+ "<rsm:SupplyChainTradeTransaction>";
|
||||||
int lineID = 0;
|
int lineID = 0;
|
||||||
for (final IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
for (final IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||||
lineID++;
|
lineID++;
|
||||||
@@ -154,21 +147,21 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
final LineCalculator lc = new LineCalculator(currentItem);
|
final LineCalculator lc = new LineCalculator(currentItem);
|
||||||
xml = xml + " <ram:IncludedSupplyChainTradeLineItem>\n" +
|
xml = xml + "<ram:IncludedSupplyChainTradeLineItem>" +
|
||||||
" <ram:AssociatedDocumentLineDocument>\n"
|
"<ram:AssociatedDocumentLineDocument>"
|
||||||
+ " <ram:LineID>" + lineID + "</ram:LineID>\n"
|
+ "<ram:LineID>" + lineID + "</ram:LineID>"
|
||||||
+ notes
|
+ notes
|
||||||
+ " </ram:AssociatedDocumentLineDocument>\n"
|
+ "</ram:AssociatedDocumentLineDocument>"
|
||||||
|
|
||||||
+ " <ram:SpecifiedTradeProduct>\n";
|
+ "<ram:SpecifiedTradeProduct>";
|
||||||
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>"
|
||||||
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
||||||
xml = xml + "<ram:SellerAssignedID>"
|
xml = xml + "<ram:SellerAssignedID>"
|
||||||
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>\n";
|
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>";
|
||||||
}
|
}
|
||||||
if (currentItem.getProduct().getBuyerAssignedID() != null) {
|
if (currentItem.getProduct().getBuyerAssignedID() != null) {
|
||||||
xml = xml + "<ram:BuyerAssignedID>"
|
xml = xml + "<ram:BuyerAssignedID>"
|
||||||
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>\n";
|
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>";
|
||||||
}
|
}
|
||||||
String allowanceChargeStr = "";
|
String allowanceChargeStr = "";
|
||||||
if (currentItem.getItemAllowances() != null && currentItem.getItemAllowances().length > 0) {
|
if (currentItem.getItemAllowances() != null && currentItem.getItemAllowances().length > 0) {
|
||||||
@@ -184,12 +177,12 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>\n"
|
xml = xml + "<ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>"
|
||||||
+ "<ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription())
|
+ "<ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription())
|
||||||
+ "</ram:Description>\n"
|
+ "</ram:Description>"
|
||||||
+ " </ram:SpecifiedTradeProduct>\n"
|
+ "</ram:SpecifiedTradeProduct>"
|
||||||
|
|
||||||
+ " <ram:SpecifiedLineTradeAgreement>\n";
|
+ "<ram:SpecifiedLineTradeAgreement>";
|
||||||
/* if (currentItem.getReferencedDocuments() != null) {
|
/* if (currentItem.getReferencedDocuments() != null) {
|
||||||
for (IReferencedDocument currentReferencedDocument : currentItem.getReferencedDocuments()) {
|
for (IReferencedDocument currentReferencedDocument : currentItem.getReferencedDocuments()) {
|
||||||
xml = xml + "<ram:AdditionalReferencedDocument>\n" +
|
xml = xml + "<ram:AdditionalReferencedDocument>\n" +
|
||||||
@@ -204,15 +197,15 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
}*/
|
}*/
|
||||||
if (currentItem.getBuyerOrderReferencedDocumentLineID() != null) {
|
if (currentItem.getBuyerOrderReferencedDocumentLineID() != null) {
|
||||||
xml = xml + "<ram:BuyerOrderReferencedDocument> \n"
|
xml = xml + "<ram:BuyerOrderReferencedDocument> \n"
|
||||||
+ " <ram:LineID>" + XMLTools.encodeXML(currentItem.getBuyerOrderReferencedDocumentLineID()) + "</ram:LineID>\n"
|
+ "<ram:LineID>" + XMLTools.encodeXML(currentItem.getBuyerOrderReferencedDocumentLineID()) + "</ram:LineID>"
|
||||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
+ "</ram:BuyerOrderReferencedDocument>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " <ram:GrossPriceProductTradePrice>\n"
|
xml = xml + "<ram:GrossPriceProductTradePrice>"
|
||||||
+ "<ram:ChargeAmount>" + priceFormat(lc.getPriceGross())
|
+ "<ram:ChargeAmount>" + priceFormat(lc.getPriceGross())
|
||||||
+ "</ram:ChargeAmount>\n" //currencyID=\"EUR\"
|
+ "</ram:ChargeAmount>" //currencyID=\"EUR\"
|
||||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>"
|
||||||
+ allowanceChargeStr
|
+ allowanceChargeStr
|
||||||
// + " <AppliedTradeAllowanceCharge>\n"
|
// + " <AppliedTradeAllowanceCharge>\n"
|
||||||
// + " <ChargeIndicator>false</ChargeIndicator>\n"
|
// + " <ChargeIndicator>false</ChargeIndicator>\n"
|
||||||
@@ -222,25 +215,25 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
+ "</ram:GrossPriceProductTradePrice>\n"
|
+ "</ram:GrossPriceProductTradePrice>\n"
|
||||||
+ "<ram:NetPriceProductTradePrice>\n"
|
+ "<ram:NetPriceProductTradePrice>\n"
|
||||||
+ "<ram:ChargeAmount>" + priceFormat(lc.getPrice())
|
+ "<ram:ChargeAmount>" + priceFormat(lc.getPrice())
|
||||||
+ "</ram:ChargeAmount>\n" // currencyID=\"EUR\"
|
+ "</ram:ChargeAmount>" // currencyID=\"EUR\"
|
||||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>"
|
||||||
+ " </ram:NetPriceProductTradePrice>\n"
|
+ "</ram:NetPriceProductTradePrice>"
|
||||||
+ " </ram:SpecifiedLineTradeAgreement>\n"
|
+ "</ram:SpecifiedLineTradeAgreement>"
|
||||||
|
|
||||||
+ " <ram:SpecifiedLineTradeDelivery>\n"
|
+ "<ram:SpecifiedLineTradeDelivery>"
|
||||||
+ "<ram:RequestedQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">"
|
+ "<ram:RequestedQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">"
|
||||||
+ quantityFormat(currentItem.getQuantity()) + "</ram:RequestedQuantity>\n"
|
+ quantityFormat(currentItem.getQuantity()) + "</ram:RequestedQuantity>"
|
||||||
+ " </ram:SpecifiedLineTradeDelivery>\n"
|
+ "</ram:SpecifiedLineTradeDelivery>"
|
||||||
+ " <ram:SpecifiedLineTradeSettlement>\n"
|
+ "<ram:SpecifiedLineTradeSettlement>"
|
||||||
+ " <ram:ApplicableTradeTax>\n"
|
+ "<ram:ApplicableTradeTax>"
|
||||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
+ "<ram:TypeCode>VAT</ram:TypeCode>"
|
||||||
+ exemptionReason
|
+ exemptionReason
|
||||||
+ " <ram:CategoryCode>" + currentItem.getProduct().getTaxCategoryCode() + "</ram:CategoryCode>\n"
|
+ "<ram:CategoryCode>" + currentItem.getProduct().getTaxCategoryCode() + "</ram:CategoryCode>"
|
||||||
|
|
||||||
+ "<ram:RateApplicablePercent>"
|
+ "<ram:RateApplicablePercent>"
|
||||||
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n"
|
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>"
|
||||||
+ " </ram:ApplicableTradeTax>\n";
|
+ "</ram:ApplicableTradeTax>";
|
||||||
if ((currentItem.getDetailedDeliveryPeriodFrom() != null) || (currentItem.getDetailedDeliveryPeriodTo() != null)) {
|
if ((currentItem.getDetailedDeliveryPeriodFrom() != null) || (currentItem.getDetailedDeliveryPeriodTo() != null)) {
|
||||||
xml = xml + "<ram:BillingSpecifiedPeriod>";
|
xml = xml + "<ram:BillingSpecifiedPeriod>";
|
||||||
if (currentItem.getDetailedDeliveryPeriodFrom() != null) {
|
if (currentItem.getDetailedDeliveryPeriodFrom() != null) {
|
||||||
@@ -253,85 +246,85 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedTradeSettlementLineMonetarySummation>\n"
|
xml = xml + "<ram:SpecifiedTradeSettlementLineMonetarySummation>"
|
||||||
+ "<ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount())
|
+ "<ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount())
|
||||||
+ "</ram:LineTotalAmount>\n" // currencyID=\"EUR\"
|
+ "</ram:LineTotalAmount>" // currencyID=\"EUR\"
|
||||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n";
|
+ "</ram:SpecifiedTradeSettlementLineMonetarySummation>";
|
||||||
/* if (currentItem.getAdditionalReferencedDocumentID() != null) {
|
/* if (currentItem.getAdditionalReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:AdditionalReferencedDocument><ram:IssuerAssignedID>" + currentItem.getAdditionalReferencedDocumentID() + "</ram:IssuerAssignedID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>\n";
|
xml = xml + "<ram:AdditionalReferencedDocument><ram:IssuerAssignedID>" + currentItem.getAdditionalReferencedDocumentID() + "</ram:IssuerAssignedID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>";
|
||||||
|
|
||||||
}*/
|
}*/
|
||||||
xml = xml + " </ram:SpecifiedLineTradeSettlement>\n"
|
xml = xml + "</ram:SpecifiedLineTradeSettlement>"
|
||||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n";
|
+ "</ram:IncludedSupplyChainTradeLineItem>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + " <ram:ApplicableHeaderTradeAgreement>\n";
|
xml = xml + "<ram:ApplicableHeaderTradeAgreement>";
|
||||||
if (trans.getReferenceNumber() != null) {
|
if (trans.getReferenceNumber() != null) {
|
||||||
xml = xml + " <ram:BuyerReference>" + XMLTools.encodeXML(trans.getReferenceNumber()) + "</ram:BuyerReference>\n";
|
xml = xml + "<ram:BuyerReference>" + XMLTools.encodeXML(trans.getReferenceNumber()) + "</ram:BuyerReference>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " <ram:SellerTradeParty>\n"
|
xml = xml + "<ram:SellerTradeParty>"
|
||||||
+ getTradePartyAsXML(trans.getSender(), true, false)
|
+ getTradePartyAsXML(trans.getSender(), true, false)
|
||||||
+ " </ram:SellerTradeParty>\n"
|
+ "</ram:SellerTradeParty>"
|
||||||
+ " <ram:BuyerTradeParty>\n";
|
+ "<ram:BuyerTradeParty>";
|
||||||
// + " <ID>GE2020211</ID>\n"
|
// + " <ID>GE2020211</ID>"
|
||||||
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>"
|
||||||
|
|
||||||
xml += getTradePartyAsXML(trans.getRecipient(), false, false);
|
xml += getTradePartyAsXML(trans.getRecipient(), false, false);
|
||||||
xml += " </ram:BuyerTradeParty>\n";
|
xml += "</ram:BuyerTradeParty>";
|
||||||
|
|
||||||
if (trans.getSellerOrderReferencedDocumentID() != null) {
|
if (trans.getSellerOrderReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:SellerOrderReferencedDocument>\n"
|
xml = xml + "<ram:SellerOrderReferencedDocument>"
|
||||||
+ "<ram:IssuerAssignedID>"
|
+ "<ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getSellerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getSellerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:SellerOrderReferencedDocument>\n";
|
+ "</ram:SellerOrderReferencedDocument>";
|
||||||
}
|
}
|
||||||
if (trans.getBuyerOrderReferencedDocumentID() != null) {
|
if (trans.getBuyerOrderReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:BuyerOrderReferencedDocument>\n"
|
xml = xml + "<ram:BuyerOrderReferencedDocument>"
|
||||||
+ "<ram:IssuerAssignedID>"
|
+ "<ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
+ "</ram:BuyerOrderReferencedDocument>";
|
||||||
}
|
}
|
||||||
if (trans.getContractReferencedDocument() != null) {
|
if (trans.getContractReferencedDocument() != null) {
|
||||||
xml = xml + " <ram:ContractReferencedDocument>\n"
|
xml = xml + "<ram:ContractReferencedDocument>"
|
||||||
+ "<ram:IssuerAssignedID>"
|
+ "<ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getContractReferencedDocument()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getContractReferencedDocument()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:ContractReferencedDocument>\n";
|
+ "</ram:ContractReferencedDocument>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional Documents of XRechnung (Rechnungsbegruendende Unterlagen - BG-24 XRechnung)
|
// Additional Documents of XRechnung (Rechnungsbegruendende Unterlagen - BG-24 XRechnung)
|
||||||
if (trans.getAdditionalReferencedDocuments() != null) {
|
if (trans.getAdditionalReferencedDocuments() != null) {
|
||||||
for (final FileAttachment f : trans.getAdditionalReferencedDocuments()) {
|
for (final FileAttachment f : trans.getAdditionalReferencedDocuments()) {
|
||||||
final String documentContent = new String(Base64.getEncoder().encodeToString(f.getData()));
|
final String documentContent = new String(Base64.getEncoder().encodeToString(f.getData()));
|
||||||
xml = xml + " <ram:AdditionalReferencedDocument>\n"
|
xml = xml + "<ram:AdditionalReferencedDocument>"
|
||||||
+ " <ram:IssuerAssignedID>" + f.getFilename() + "</ram:IssuerAssignedID>\n"
|
+ "<ram:IssuerAssignedID>" + f.getFilename() + "</ram:IssuerAssignedID>"
|
||||||
+ " <ram:TypeCode>916</ram:TypeCode>\n"
|
+ "<ram:TypeCode>916</ram:TypeCode>"
|
||||||
+ " <ram:Name>" + f.getDescription() + "</ram:Name>\n"
|
+ "<ram:Name>" + f.getDescription() + "</ram:Name>"
|
||||||
+ "<ram:AttachmentBinaryObject mimeCode=\"" + f.getMimetype() + "\"\n"
|
+ "<ram:AttachmentBinaryObject mimeCode=\"" + f.getMimetype() + "\"\n"
|
||||||
+ " filename=\"" + f.getFilename() + "\">" + documentContent + "</ram:AttachmentBinaryObject>\n"
|
+ "filename=\"" + f.getFilename() + "\">" + documentContent + "</ram:AttachmentBinaryObject>"
|
||||||
+ " </ram:AdditionalReferencedDocument>\n";
|
+ "</ram:AdditionalReferencedDocument>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans.getSpecifiedProcuringProjectID() != null) {
|
if (trans.getSpecifiedProcuringProjectID() != null) {
|
||||||
xml = xml + " <ram:SpecifiedProcuringProject>\n"
|
xml = xml + "<ram:SpecifiedProcuringProject>"
|
||||||
+ "<ram:ID>"
|
+ "<ram:ID>"
|
||||||
+ XMLTools.encodeXML(trans.getSpecifiedProcuringProjectID()) + "</ram:ID>\n";
|
+ XMLTools.encodeXML(trans.getSpecifiedProcuringProjectID()) + "</ram:ID>";
|
||||||
if (trans.getSpecifiedProcuringProjectName() != null) {
|
if (trans.getSpecifiedProcuringProjectName() != null) {
|
||||||
xml += " <ram:Name >" + XMLTools.encodeXML(trans.getSpecifiedProcuringProjectName()) + "</ram:Name>\n";
|
xml += "<ram:Name >" + XMLTools.encodeXML(trans.getSpecifiedProcuringProjectName()) + "</ram:Name>";
|
||||||
}
|
}
|
||||||
xml += " </ram:SpecifiedProcuringProject>\n";
|
xml += "</ram:SpecifiedProcuringProject>";
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:ApplicableHeaderTradeAgreement>\n"
|
xml = xml + "</ram:ApplicableHeaderTradeAgreement>"
|
||||||
+ " <ram:ApplicableHeaderTradeDelivery>\n";
|
+ "<ram:ApplicableHeaderTradeDelivery>";
|
||||||
if (this.trans.getDeliveryAddress() != null) {
|
if (this.trans.getDeliveryAddress() != null) {
|
||||||
xml += "<ram:ShipToTradeParty>" +
|
xml += "<ram:ShipToTradeParty>" +
|
||||||
getTradePartyAsXML(this.trans.getDeliveryAddress(), false, true) +
|
getTradePartyAsXML(this.trans.getDeliveryAddress(), false, true) +
|
||||||
"</ram:ShipToTradeParty>";
|
"</ram:ShipToTradeParty>";
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
xml += " <ram:ActualDeliverySupplyChainEvent>\n"
|
xml += "<ram:ActualDeliverySupplyChainEvent>"
|
||||||
+ "<ram:OccurrenceDateTime>";
|
+ "<ram:OccurrenceDateTime>";
|
||||||
|
|
||||||
if (trans.getDeliveryDate() != null) {
|
if (trans.getDeliveryDate() != null) {
|
||||||
@@ -349,9 +342,9 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
* "<ID>2013-51112</ID>\n" +
|
* "<ID>2013-51112</ID>\n" +
|
||||||
* "</DeliveryNoteReferencedDocument>\n"
|
* "</DeliveryNoteReferencedDocument>\n"
|
||||||
*/
|
*/
|
||||||
xml+= " </ram:ApplicableHeaderTradeDelivery>\n" + " <ram:ApplicableHeaderTradeSettlement>\n"
|
xml+= "</ram:ApplicableHeaderTradeDelivery>\n<ram:ApplicableHeaderTradeSettlement>"
|
||||||
// + " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>\n"
|
// + "<ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>"
|
||||||
+ " <ram:OrderCurrencyCode>" + trans.getCurrency() + "</ram:OrderCurrencyCode>\n";
|
+ "<ram:OrderCurrencyCode>" + trans.getCurrency() + "</ram:OrderCurrencyCode>";
|
||||||
|
|
||||||
if (trans.getTradeSettlementPayment() != null) {
|
if (trans.getTradeSettlementPayment() != null) {
|
||||||
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
|
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
|
||||||
@@ -413,17 +406,17 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
if (calc.getChargesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
if (calc.getChargesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>" +
|
||||||
" <ram:ChargeIndicator>\n" +
|
"<ram:ChargeIndicator>" +
|
||||||
" <udt:Indicator>true</udt:Indicator>\n" +
|
"<udt:Indicator>true</udt:Indicator>" +
|
||||||
" </ram:ChargeIndicator>\n" +
|
"</ram:ChargeIndicator>" +
|
||||||
" <ram:ActualAmount>" + currencyFormat(calc.getChargesForPercent(currentTaxPercent)) + "</ram:ActualAmount>\n" +
|
"<ram:ActualAmount>" + currencyFormat(calc.getChargesForPercent(currentTaxPercent)) + "</ram:ActualAmount>" +
|
||||||
" <ram:Reason>" + XMLTools.encodeXML(calc.getChargeReasonForPercent(currentTaxPercent)) + "</ram:Reason>\n" +
|
"<ram:Reason>" + XMLTools.encodeXML(calc.getChargeReasonForPercent(currentTaxPercent)) + "</ram:Reason>" +
|
||||||
" <ram:CategoryTradeTax>\n" +
|
"<ram:CategoryTradeTax>" +
|
||||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
"<ram:TypeCode>VAT</ram:TypeCode>" +
|
||||||
" <ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>\n" +
|
"<ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>" +
|
||||||
" <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" +
|
"<ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>" +
|
||||||
" </ram:CategoryTradeTax>\n" +
|
"</ram:CategoryTradeTax>" +
|
||||||
"</ram:SpecifiedTradeAllowanceCharge> \n";
|
"</ram:SpecifiedTradeAllowanceCharge> \n";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -434,17 +427,17 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
if ((trans.getZFAllowances() != null) && (trans.getZFAllowances().length > 0)) {
|
if ((trans.getZFAllowances() != null) && (trans.getZFAllowances().length > 0)) {
|
||||||
for (final BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
for (final BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||||
if (calc.getAllowancesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
if (calc.getAllowancesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
||||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>" +
|
||||||
" <ram:ChargeIndicator>\n" +
|
"<ram:ChargeIndicator>" +
|
||||||
" <udt:Indicator>false</udt:Indicator>\n" +
|
"<udt:Indicator>false</udt:Indicator>" +
|
||||||
" </ram:ChargeIndicator>\n" +
|
"</ram:ChargeIndicator>" +
|
||||||
" <ram:ActualAmount>" + currencyFormat(calc.getAllowancesForPercent(currentTaxPercent)) + "</ram:ActualAmount>\n" +
|
"<ram:ActualAmount>" + currencyFormat(calc.getAllowancesForPercent(currentTaxPercent)) + "</ram:ActualAmount>" +
|
||||||
" <ram:Reason>" + XMLTools.encodeXML(calc.getAllowanceReasonForPercent(currentTaxPercent)) + "</ram:Reason>\n" +
|
"<ram:Reason>" + XMLTools.encodeXML(calc.getAllowanceReasonForPercent(currentTaxPercent)) + "</ram:Reason>" +
|
||||||
" <ram:CategoryTradeTax>\n" +
|
"<ram:CategoryTradeTax>" +
|
||||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
"<ram:TypeCode>VAT</ram:TypeCode>" +
|
||||||
" <ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>\n" +
|
"<ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>" +
|
||||||
" <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" +
|
"<ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>" +
|
||||||
" </ram:CategoryTradeTax>\n" +
|
"</ram:CategoryTradeTax>" +
|
||||||
"</ram:SpecifiedTradeAllowanceCharge> \n";
|
"</ram:SpecifiedTradeAllowanceCharge> \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -452,10 +445,10 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
|
|
||||||
|
|
||||||
if ((trans.getPaymentTerms() == null) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) {
|
if ((trans.getPaymentTerms() == null) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) {
|
||||||
xml = xml + "<ram:SpecifiedTradePaymentTerms>\n";
|
xml = xml + "<ram:SpecifiedTradePaymentTerms>";
|
||||||
|
|
||||||
if (paymentTermsDescription != null) {
|
if (paymentTermsDescription != null) {
|
||||||
xml = xml + "<ram:Description>" + paymentTermsDescription + "</ram:Description>\n";
|
xml = xml + "<ram:Description>" + paymentTermsDescription + "</ram:Description>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans.getTradeSettlement() != null) {
|
if (trans.getTradeSettlement() != null) {
|
||||||
@@ -469,10 +462,10 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
if (hasDueDate && (trans.getDueDate() != null)) {
|
if (hasDueDate && (trans.getDueDate() != null)) {
|
||||||
xml = xml + "<ram:DueDateDateTime>" // $NON-NLS-2$
|
xml = xml + "<ram:DueDateDateTime>" // $NON-NLS-2$
|
||||||
+ DATE.udtFormat(trans.getDueDate())
|
+ DATE.udtFormat(trans.getDueDate())
|
||||||
+ "</ram:DueDateDateTime>\n";// 20130704
|
+ "</ram:DueDateDateTime>";// 20130704
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:SpecifiedTradePaymentTerms>\n";
|
xml = xml + "</ram:SpecifiedTradePaymentTerms>";
|
||||||
} else {
|
} else {
|
||||||
xml = xml + buildPaymentTermsXml();
|
xml = xml + buildPaymentTermsXml();
|
||||||
}
|
}
|
||||||
@@ -482,44 +475,44 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
|
|||||||
|
|
||||||
final String chargesTotalLine = "<ram:ChargeTotalAmount>" + currencyFormat(calc.getChargesForPercent(null)) + "</ram:ChargeTotalAmount>";
|
final String chargesTotalLine = "<ram:ChargeTotalAmount>" + currencyFormat(calc.getChargesForPercent(null)) + "</ram:ChargeTotalAmount>";
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n"
|
xml = xml + "<ram:SpecifiedTradeSettlementHeaderMonetarySummation>"
|
||||||
+ " <ram:LineTotalAmount>" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>\n"
|
+ "<ram:LineTotalAmount>" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>"
|
||||||
+ chargesTotalLine
|
+ chargesTotalLine
|
||||||
+ allowanceTotalLine
|
+ allowanceTotalLine
|
||||||
+ " <ram:TaxBasisTotalAmount>" + currencyFormat(calc.getTaxBasis()) + "</ram:TaxBasisTotalAmount>\n"
|
+ "<ram:TaxBasisTotalAmount>" + currencyFormat(calc.getTaxBasis()) + "</ram:TaxBasisTotalAmount>"
|
||||||
// //
|
// //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
+ "<ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
|
+ "<ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
|
||||||
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTaxBasis())) + "</ram:TaxTotalAmount>\n"
|
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTaxBasis())) + "</ram:TaxTotalAmount>"
|
||||||
+ " <ram:GrandTotalAmount>" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>\n"
|
+ "<ram:GrandTotalAmount>" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>"
|
||||||
// //
|
// //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
//+ " <ram:TotalPrepaidAmount>" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>\n"
|
//+ "<ram:TotalPrepaidAmount>" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>"
|
||||||
//+ " <ram:DuePayableAmount>" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>\n"
|
//+ "<ram:DuePayableAmount>" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>"
|
||||||
+ " </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n";
|
+ "</ram:SpecifiedTradeSettlementHeaderMonetarySummation>";
|
||||||
if (trans.getInvoiceReferencedDocumentID() != null) {
|
if (trans.getInvoiceReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:InvoiceReferencedDocument>\n"
|
xml = xml + "<ram:InvoiceReferencedDocument>"
|
||||||
+ "<ram:IssuerAssignedID>"
|
+ "<ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getInvoiceReferencedDocumentID()) + "</ram:IssuerAssignedID>\n";
|
+ XMLTools.encodeXML(trans.getInvoiceReferencedDocumentID()) + "</ram:IssuerAssignedID>";
|
||||||
if (trans.getInvoiceReferencedIssueDate() != null) {
|
if (trans.getInvoiceReferencedIssueDate() != null) {
|
||||||
xml += "<ram:FormattedIssueDateTime>"
|
xml += "<ram:FormattedIssueDateTime>"
|
||||||
+ DATE.qdtFormat(trans.getInvoiceReferencedIssueDate())
|
+ DATE.qdtFormat(trans.getInvoiceReferencedIssueDate())
|
||||||
+ "</ram:FormattedIssueDateTime>\n";
|
+ "</ram:FormattedIssueDateTime>";
|
||||||
}
|
}
|
||||||
xml += " </ram:InvoiceReferencedDocument>\n";
|
xml += "</ram:InvoiceReferencedDocument>";
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + " </ram:ApplicableHeaderTradeSettlement>\n";
|
xml = xml + "</ram:ApplicableHeaderTradeSettlement>";
|
||||||
// + " <IncludedSupplyChainTradeLineItem>\n"
|
// + " <IncludedSupplyChainTradeLineItem>"
|
||||||
// + " <AssociatedDocumentLineDocument>\n"
|
// + " <AssociatedDocumentLineDocument>"
|
||||||
// + " <IncludedNote>\n"
|
// + " <IncludedNote>"
|
||||||
// + " <Content>Wir erlauben uns Ihnen folgende Positionen aus der Lieferung Nr.
|
// + " <Content>Wir erlauben uns Ihnen folgende Positionen aus der Lieferung Nr.
|
||||||
// 2013-51112 in Rechnung zu stellen:</Content>\n"
|
// 2013-51112 in Rechnung zu stellen:</Content>\n"
|
||||||
// + " </IncludedNote>\n"
|
// + " </IncludedNote>\n"
|
||||||
// + " </AssociatedDocumentLineDocument>\n"
|
// + " </AssociatedDocumentLineDocument>\n"
|
||||||
// + " </IncludedSupplyChainTradeLineItem>\n";
|
// + " </IncludedSupplyChainTradeLineItem>\n";
|
||||||
|
|
||||||
xml = xml + " </rsm:SupplyChainTradeTransaction>\n"
|
xml = xml + "</rsm:SupplyChainTradeTransaction>"
|
||||||
+ "</rsm:SCRDMCCBDACIOMessageStructure>";
|
+ "</rsm:SCRDMCCBDACIOMessageStructure>";
|
||||||
|
|
||||||
final byte[] zugferdRaw;
|
final byte[] zugferdRaw;
|
||||||
|
|||||||
@@ -57,18 +57,22 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
public void setTest() {
|
public void setTest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String vatFormat(BigDecimal value) {
|
protected String vatFormat(BigDecimal value) {
|
||||||
return XMLTools.nDigitFormat(value, 2);
|
return XMLTools.nDigitFormat(value, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String currencyFormat(BigDecimal value) {
|
protected String currencyFormat(BigDecimal value) {
|
||||||
return XMLTools.nDigitFormat(value, 2);
|
return XMLTools.nDigitFormat(value, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String priceFormat(BigDecimal value) {
|
protected String priceFormat(BigDecimal value) {
|
||||||
return XMLTools.nDigitFormat(value, 4);
|
return XMLTools.nDigitFormat(value, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String quantityFormat(BigDecimal value) {
|
protected String quantityFormat(BigDecimal value) {
|
||||||
return XMLTools.nDigitFormat(value, 4);
|
return XMLTools.nDigitFormat(value, 4);
|
||||||
}
|
}
|
||||||
@@ -127,52 +131,52 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
|
|
||||||
String senderReg = "";
|
String senderReg = "";
|
||||||
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
||||||
senderReg = "" + "<ram:IncludedNote>\n" + " <ram:Content>\n"
|
senderReg = "<ram:IncludedNote><ram:Content>"
|
||||||
+ XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + " </ram:Content>\n"
|
+ XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + "</ram:Content>"
|
||||||
+ "<ram:SubjectCode>REG</ram:SubjectCode>\n" + "</ram:IncludedNote>\n";
|
+ "<ram:SubjectCode>REG</ram:SubjectCode></ram:IncludedNote>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String rebateAgreement = "";
|
String rebateAgreement = "";
|
||||||
if (trans.rebateAgreementExists()) {
|
if (trans.rebateAgreementExists()) {
|
||||||
rebateAgreement = "<ram:IncludedNote>\n" + " <ram:Content>"
|
rebateAgreement = "<ram:IncludedNote><ram:Content>"
|
||||||
+ "Es bestehen Rabatt- und Bonusvereinbarungen.</ram:Content>\n"
|
+ "Es bestehen Rabatt- und Bonusvereinbarungen.</ram:Content>"
|
||||||
+ "<ram:SubjectCode>AAK</ram:SubjectCode>\n" + "</ram:IncludedNote>\n";
|
+ "<ram:SubjectCode>AAK</ram:SubjectCode></ram:IncludedNote>";
|
||||||
}
|
}
|
||||||
|
|
||||||
String subjectNote = "";
|
String subjectNote = "";
|
||||||
if (trans.getSubjectNote() != null) {
|
if (trans.getSubjectNote() != null) {
|
||||||
subjectNote = "<ram:IncludedNote>\n" + " <ram:Content>"
|
subjectNote = "<ram:IncludedNote><ram:Content>"
|
||||||
+ XMLTools.encodeXML(trans.getSubjectNote()) + "</ram:Content>\n"
|
+ XMLTools.encodeXML(trans.getSubjectNote()) + "</ram:Content>"
|
||||||
+ "</ram:IncludedNote>\n";
|
+ "</ram:IncludedNote>";
|
||||||
}
|
}
|
||||||
String typecode = "380";
|
String typecode = "380";
|
||||||
if (trans.getDocumentCode() != null) {
|
if (trans.getDocumentCode() != null) {
|
||||||
typecode = trans.getDocumentCode();
|
typecode = trans.getDocumentCode();
|
||||||
}
|
}
|
||||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
|
|
||||||
+ "<rsm:CrossIndustryDocument xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:ferd:CrossIndustryDocument:invoice:1p0\""
|
+ "<rsm:CrossIndustryDocument xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:ferd:CrossIndustryDocument:invoice:1p0\""
|
||||||
// + "
|
// + "
|
||||||
// xsi:schemaLocation=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100
|
// xsi:schemaLocation=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100
|
||||||
// ../Schema/ZUGFeRD1p0.xsd\""
|
// ../Schema/ZUGFeRD1p0.xsd\""
|
||||||
+ " xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12\""
|
+ " xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12\""
|
||||||
+ " xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15\">\n"
|
+ " xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15\">"
|
||||||
+ "<!-- generated by: mustangproject.org v" + ZUGFeRD1PullProvider.class.getPackage().getImplementationVersion() + "-->\n"
|
+ "<!-- generated by: mustangproject.org v" + ZUGFeRD1PullProvider.class.getPackage().getImplementationVersion() + "-->"
|
||||||
+ " <rsm:SpecifiedExchangedDocumentContext>\n"
|
+ "<rsm:SpecifiedExchangedDocumentContext>"
|
||||||
// + "
|
// + "
|
||||||
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>\n"
|
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>"
|
||||||
//
|
//
|
||||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
+ "<ram:GuidelineSpecifiedDocumentContextParameter>"
|
||||||
+ " <ram:ID>" + getProfile().getID() + "</ram:ID>\n"
|
+ "<ram:ID>" + getProfile().getID() + "</ram:ID>"
|
||||||
+ " </ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
+ "</ram:GuidelineSpecifiedDocumentContextParameter>"
|
||||||
+ " </rsm:SpecifiedExchangedDocumentContext>\n"
|
+ "</rsm:SpecifiedExchangedDocumentContext>"
|
||||||
+ " <rsm:HeaderExchangedDocument>\n"
|
+ "<rsm:HeaderExchangedDocument>"
|
||||||
+ " <ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>\n"
|
+ "<ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>"
|
||||||
+ " <ram:Name>RECHNUNG</ram:Name>\n"
|
+ "<ram:Name>RECHNUNG</ram:Name>"
|
||||||
+ " <ram:TypeCode>" + typecode + "</ram:TypeCode>\n"
|
+ "<ram:TypeCode>" + typecode + "</ram:TypeCode>"
|
||||||
+ "<ram:IssueDateTime>"
|
+ "<ram:IssueDateTime>"
|
||||||
+ DATE.udtFormat(trans.getIssueDate()) + "</ram:IssueDateTime>\n" // date
|
+ DATE.udtFormat(trans.getIssueDate()) + "</ram:IssueDateTime>" // date
|
||||||
// format
|
// format
|
||||||
// was
|
// was
|
||||||
// 20130605
|
// 20130605
|
||||||
@@ -180,50 +184,50 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
+ rebateAgreement
|
+ rebateAgreement
|
||||||
+ senderReg
|
+ senderReg
|
||||||
|
|
||||||
+ " </rsm:HeaderExchangedDocument>\n"
|
+ "</rsm:HeaderExchangedDocument>"
|
||||||
+ " <rsm:SpecifiedSupplyChainTradeTransaction>\n";
|
+ "<rsm:SpecifiedSupplyChainTradeTransaction>";
|
||||||
xml = xml + " <ram:ApplicableSupplyChainTradeAgreement>\n";
|
xml = xml + "<ram:ApplicableSupplyChainTradeAgreement>";
|
||||||
if (trans.getReferenceNumber() != null) {
|
if (trans.getReferenceNumber() != null) {
|
||||||
xml = xml + " <ram:BuyerReference>" + XMLTools.encodeXML(trans.getReferenceNumber()) + "</ram:BuyerReference>\n";
|
xml = xml + "<ram:BuyerReference>" + XMLTools.encodeXML(trans.getReferenceNumber()) + "</ram:BuyerReference>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " <ram:SellerTradeParty>\n";
|
xml = xml + "<ram:SellerTradeParty>";
|
||||||
xml += getTradePartyAsXML(trans.getSender(), true, false);
|
xml += getTradePartyAsXML(trans.getSender(), true, false);
|
||||||
xml += " </ram:SellerTradeParty>\n"
|
xml += "</ram:SellerTradeParty>"
|
||||||
+ " <ram:BuyerTradeParty>\n";
|
+ "<ram:BuyerTradeParty>";
|
||||||
// + " <ID>GE2020211</ID>\n"
|
// + " <ID>GE2020211</ID>"
|
||||||
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>"
|
||||||
|
|
||||||
xml += getTradePartyAsXML(trans.getRecipient(), false, false);
|
xml += getTradePartyAsXML(trans.getRecipient(), false, false);
|
||||||
if ((trans.getOwnVATID() != null) && (trans.getOwnOrganisationName() != null)) {
|
if ((trans.getOwnVATID() != null) && (trans.getOwnOrganisationName() != null)) {
|
||||||
xml = xml + " <ram:SpecifiedTaxRegistration>\n" + " <ram:ID schemeID=\"VA\">"
|
xml = xml + "<ram:SpecifiedTaxRegistration>\n<ram:ID schemeID=\"VA\">"
|
||||||
+ XMLTools.encodeXML(trans.getOwnVATID()) + "</ram:ID>\n"
|
+ XMLTools.encodeXML(trans.getOwnVATID()) + "</ram:ID>"
|
||||||
+ "</ram:SpecifiedTaxRegistration>";
|
+ "</ram:SpecifiedTaxRegistration>";
|
||||||
}
|
}
|
||||||
|
|
||||||
xml += " </ram:BuyerTradeParty>\n";
|
xml += "</ram:BuyerTradeParty>";
|
||||||
|
|
||||||
if (trans.getSellerOrderReferencedDocumentID() != null) {
|
if (trans.getSellerOrderReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:SellerOrderReferencedDocument>\n"
|
xml = xml + "<ram:SellerOrderReferencedDocument>"
|
||||||
+ "<ram:IssuerAssignedID>"
|
+ "<ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getSellerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getSellerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:SellerOrderReferencedDocument>\n";
|
+ "</ram:SellerOrderReferencedDocument>";
|
||||||
}
|
}
|
||||||
if (trans.getBuyerOrderReferencedDocumentID() != null) {
|
if (trans.getBuyerOrderReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:BuyerOrderReferencedDocument>\n"
|
xml = xml + "<ram:BuyerOrderReferencedDocument>"
|
||||||
+ "<ram:IssuerAssignedID>"
|
+ "<ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
+ "</ram:BuyerOrderReferencedDocument>";
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:ApplicableSupplyChainTradeAgreement>\n"
|
xml = xml + "</ram:ApplicableSupplyChainTradeAgreement>"
|
||||||
+ " <ram:ApplicableSupplyChainTradeDelivery>\n";
|
+ "<ram:ApplicableSupplyChainTradeDelivery>";
|
||||||
if (this.trans.getDeliveryAddress() != null) {
|
if (this.trans.getDeliveryAddress() != null) {
|
||||||
xml += "<ram:ShipToTradeParty>" +
|
xml += "<ram:ShipToTradeParty>" +
|
||||||
getTradePartyAsXML(this.trans.getDeliveryAddress(), false, true) +
|
getTradePartyAsXML(this.trans.getDeliveryAddress(), false, true) +
|
||||||
"</ram:ShipToTradeParty>";
|
"</ram:ShipToTradeParty>";
|
||||||
}
|
}
|
||||||
|
|
||||||
xml += " <ram:ActualDeliverySupplyChainEvent>\n"
|
xml += "<ram:ActualDeliverySupplyChainEvent>"
|
||||||
+ "<ram:OccurrenceDateTime>";
|
+ "<ram:OccurrenceDateTime>";
|
||||||
|
|
||||||
if (trans.getDeliveryDate() != null) {
|
if (trans.getDeliveryDate() != null) {
|
||||||
@@ -231,17 +235,17 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("No delivery date provided");
|
throw new IllegalStateException("No delivery date provided");
|
||||||
}
|
}
|
||||||
xml += "</ram:OccurrenceDateTime>\n";
|
xml += "</ram:OccurrenceDateTime>";
|
||||||
xml += " </ram:ActualDeliverySupplyChainEvent>\n"
|
xml += "</ram:ActualDeliverySupplyChainEvent>"
|
||||||
/*
|
/*
|
||||||
* + " <DeliveryNoteReferencedDocument>\n" +
|
* + "<DeliveryNoteReferencedDocument>" +
|
||||||
* " <IssueDateTime format=\"102\">20130603</IssueDateTime>\n" +
|
* "<IssueDateTime format=\"102\">20130603</IssueDateTime>" +
|
||||||
* " <ID>2013-51112</ID>\n" +
|
* "<ID>2013-51112</ID>" +
|
||||||
* " </DeliveryNoteReferencedDocument>\n"
|
* "</DeliveryNoteReferencedDocument>"
|
||||||
*/
|
*/
|
||||||
+ " </ram:ApplicableSupplyChainTradeDelivery>\n" + " <ram:ApplicableSupplyChainTradeSettlement>\n"
|
+ "</ram:ApplicableSupplyChainTradeDelivery>\n<ram:ApplicableSupplyChainTradeSettlement>"
|
||||||
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>\n"
|
+ "<ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>"
|
||||||
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>\n";
|
+ "<ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>";
|
||||||
|
|
||||||
if (trans.getTradeSettlementPayment() != null) {
|
if (trans.getTradeSettlementPayment() != null) {
|
||||||
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
|
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
|
||||||
@@ -268,21 +272,21 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
if (amount != null) {
|
if (amount != null) {
|
||||||
final String amountCategoryCode = amount.getCategoryCode();
|
final String amountCategoryCode = amount.getCategoryCode();
|
||||||
final boolean displayExemptionReason = CATEGORY_CODES_WITH_EXEMPTION_REASON.contains(amountCategoryCode);
|
final boolean displayExemptionReason = CATEGORY_CODES_WITH_EXEMPTION_REASON.contains(amountCategoryCode);
|
||||||
xml += " <ram:ApplicableTradeTax>\n"
|
xml += "<ram:ApplicableTradeTax>"
|
||||||
+ "<ram:CalculatedAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(amount.getCalculated())
|
+ "<ram:CalculatedAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(amount.getCalculated())
|
||||||
+ "</ram:CalculatedAmount>\n" //currencyID=\"EUR\"
|
+ "</ram:CalculatedAmount>" //currencyID=\"EUR\"
|
||||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
+ "<ram:TypeCode>VAT</ram:TypeCode>"
|
||||||
+ (displayExemptionReason ? exemptionReason : "")
|
+ (displayExemptionReason ? exemptionReason : "")
|
||||||
+ " <ram:BasisAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
+ "<ram:BasisAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>" // currencyID=\"EUR\"
|
||||||
+ " <ram:CategoryCode>" + amount.getCategoryCode() + "</ram:CategoryCode>\n"
|
+ "<ram:CategoryCode>" + amount.getCategoryCode() + "</ram:CategoryCode>"
|
||||||
+ "<ram:ApplicablePercent>" + vatFormat(currentTaxPercent)
|
+ "<ram:ApplicablePercent>" + vatFormat(currentTaxPercent)
|
||||||
+ "</ram:ApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n";
|
+ "</ram:ApplicablePercent>\n</ram:ApplicableTradeTax>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans.getPaymentTerms() == null) {
|
if (trans.getPaymentTerms() == null) {
|
||||||
xml = xml + " <ram:SpecifiedTradePaymentTerms>\n"
|
xml = xml + "<ram:SpecifiedTradePaymentTerms>"
|
||||||
+ " <ram:Description>" + paymentTermsDescription + "</ram:Description>\n";
|
+ "<ram:Description>" + paymentTermsDescription + "</ram:Description>";
|
||||||
|
|
||||||
if (trans.getTradeSettlement() != null) {
|
if (trans.getTradeSettlement() != null) {
|
||||||
for (final IZUGFeRDTradeSettlement payment : trans.getTradeSettlement()) {
|
for (final IZUGFeRDTradeSettlement payment : trans.getTradeSettlement()) {
|
||||||
@@ -295,36 +299,36 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
if (hasDueDate && (trans.getDueDate() != null)) {
|
if (hasDueDate && (trans.getDueDate() != null)) {
|
||||||
xml = xml + "<ram:DueDateDateTime>" // $NON-NLS-2$
|
xml = xml + "<ram:DueDateDateTime>" // $NON-NLS-2$
|
||||||
+ DATE.udtFormat(trans.getDueDate())
|
+ DATE.udtFormat(trans.getDueDate())
|
||||||
+ "</ram:DueDateDateTime>\n";// 20130704
|
+ "</ram:DueDateDateTime>";// 20130704
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:SpecifiedTradePaymentTerms>\n";
|
xml = xml + "</ram:SpecifiedTradePaymentTerms>";
|
||||||
} else {
|
} else {
|
||||||
xml = xml + buildPaymentTermsXml();
|
xml = xml + buildPaymentTermsXml();
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedTradeSettlementMonetarySummation>\n"
|
xml = xml + "<ram:SpecifiedTradeSettlementMonetarySummation>"
|
||||||
+ " <ram:LineTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>\n"
|
+ "<ram:LineTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>"
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
+ " <ram:ChargeTotalAmount currencyID=\"" + trans.getCurrency() + "\">0.00</ram:ChargeTotalAmount>\n" // currencyID=\"EUR\"
|
+ "<ram:ChargeTotalAmount currencyID=\"" + trans.getCurrency() + "\">0.00</ram:ChargeTotalAmount>" // currencyID=\"EUR\"
|
||||||
+ " <ram:AllowanceTotalAmount currencyID=\"" + trans.getCurrency() + "\">0.00</ram:AllowanceTotalAmount>\n" //
|
+ "<ram:AllowanceTotalAmount currencyID=\"" + trans.getCurrency() + "\">0.00</ram:AllowanceTotalAmount>" //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
// + " <ChargeTotalAmount currencyID=\"EUR\">5.80</ChargeTotalAmount>\n"
|
// + " <ChargeTotalAmount currencyID=\"EUR\">5.80</ChargeTotalAmount>"
|
||||||
// + " <AllowanceTotalAmount currencyID=\"EUR\">14.73</AllowanceTotalAmount>\n"
|
// + " <AllowanceTotalAmount currencyID=\"EUR\">14.73</AllowanceTotalAmount>"
|
||||||
+ " <ram:TaxBasisTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getTotal()) + "</ram:TaxBasisTotalAmount>\n"
|
+ "<ram:TaxBasisTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getTotal()) + "</ram:TaxBasisTotalAmount>"
|
||||||
// //
|
// //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
+ "<ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
|
+ "<ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
|
||||||
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTotal())) + "</ram:TaxTotalAmount>\n"
|
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTotal())) + "</ram:TaxTotalAmount>"
|
||||||
+ " <ram:GrandTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>\n"
|
+ "<ram:GrandTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>"
|
||||||
// //
|
// //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
+ " <ram:TotalPrepaidAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>\n"
|
+ "<ram:TotalPrepaidAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>"
|
||||||
+ " <ram:DuePayableAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>\n"
|
+ "<ram:DuePayableAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>"
|
||||||
// //
|
// //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
+ " </ram:SpecifiedTradeSettlementMonetarySummation>\n"
|
+ "</ram:SpecifiedTradeSettlementMonetarySummation>"
|
||||||
+ " </ram:ApplicableSupplyChainTradeSettlement>\n";
|
+ "</ram:ApplicableSupplyChainTradeSettlement>";
|
||||||
|
|
||||||
|
|
||||||
int lineID = 0;
|
int lineID = 0;
|
||||||
@@ -336,69 +340,69 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
|
|
||||||
|
|
||||||
final LineCalculator lc = new LineCalculator(currentItem);
|
final LineCalculator lc = new LineCalculator(currentItem);
|
||||||
xml = xml + " <ram:IncludedSupplyChainTradeLineItem>\n" +
|
xml = xml + "<ram:IncludedSupplyChainTradeLineItem>" +
|
||||||
" <ram:AssociatedDocumentLineDocument>\n"
|
"<ram:AssociatedDocumentLineDocument>"
|
||||||
+ " <ram:LineID>" + lineID + "</ram:LineID>\n"
|
+ "<ram:LineID>" + lineID + "</ram:LineID>"
|
||||||
+ " </ram:AssociatedDocumentLineDocument>\n"
|
+ "</ram:AssociatedDocumentLineDocument>"
|
||||||
+ " <ram:SpecifiedSupplyChainTradeAgreement>\n"
|
+ "<ram:SpecifiedSupplyChainTradeAgreement>"
|
||||||
+ " <ram:GrossPriceProductTradePrice>\n"
|
+ "<ram:GrossPriceProductTradePrice>"
|
||||||
+ "<ram:ChargeAmount currencyID=\"" + trans.getCurrency() + "\">" + priceFormat(lc.getPriceGross())
|
+ "<ram:ChargeAmount currencyID=\"" + trans.getCurrency() + "\">" + priceFormat(lc.getPriceGross())
|
||||||
+ "</ram:ChargeAmount>\n"
|
+ "</ram:ChargeAmount>"
|
||||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>"
|
||||||
// + " <AppliedTradeAllowanceCharge>\n"
|
// + " <AppliedTradeAllowanceCharge>"
|
||||||
// + " <ChargeIndicator>false</ChargeIndicator>\n"
|
// + " <ChargeIndicator>false</ChargeIndicator>"
|
||||||
// + " <ActualAmount currencyID=\"EUR\">0.6667</ActualAmount>\n"
|
// + " <ActualAmount currencyID=\"EUR\">0.6667</ActualAmount>"
|
||||||
// + " <Reason>Rabatt</Reason>\n"
|
// + " <Reason>Rabatt</Reason>"
|
||||||
// + " </AppliedTradeAllowanceCharge>\n"
|
// + " </AppliedTradeAllowanceCharge>"
|
||||||
+ " </ram:GrossPriceProductTradePrice>\n"
|
+ "</ram:GrossPriceProductTradePrice>"
|
||||||
+ " <ram:NetPriceProductTradePrice>\n"
|
+ "<ram:NetPriceProductTradePrice>"
|
||||||
+ "<ram:ChargeAmount currencyID=\"" + trans.getCurrency() + "\">" + priceFormat(currentItem.getPrice())
|
+ "<ram:ChargeAmount currencyID=\"" + trans.getCurrency() + "\">" + priceFormat(currentItem.getPrice())
|
||||||
+ "</ram:ChargeAmount>\n"
|
+ "</ram:ChargeAmount>"
|
||||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>"
|
||||||
+ " </ram:NetPriceProductTradePrice>\n"
|
+ "</ram:NetPriceProductTradePrice>"
|
||||||
+ " </ram:SpecifiedSupplyChainTradeAgreement>\n"
|
+ "</ram:SpecifiedSupplyChainTradeAgreement>"
|
||||||
|
|
||||||
|
|
||||||
+ " <ram:SpecifiedSupplyChainTradeDelivery>\n"
|
+ "<ram:SpecifiedSupplyChainTradeDelivery>"
|
||||||
+ "<ram:BilledQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">"
|
+ "<ram:BilledQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">"
|
||||||
+ quantityFormat(currentItem.getQuantity()) + "</ram:BilledQuantity>\n"
|
+ quantityFormat(currentItem.getQuantity()) + "</ram:BilledQuantity>"
|
||||||
+ " </ram:SpecifiedSupplyChainTradeDelivery>\n"
|
+ "</ram:SpecifiedSupplyChainTradeDelivery>"
|
||||||
+ " <ram:SpecifiedSupplyChainTradeSettlement>\n"
|
+ "<ram:SpecifiedSupplyChainTradeSettlement>"
|
||||||
+ " <ram:ApplicableTradeTax>\n"
|
+ "<ram:ApplicableTradeTax>"
|
||||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
+ "<ram:TypeCode>VAT</ram:TypeCode>"
|
||||||
+ exemptionReason
|
+ exemptionReason
|
||||||
+ " <ram:CategoryCode>" + currentItem.getProduct().getTaxCategoryCode() + "</ram:CategoryCode>\n"
|
+ "<ram:CategoryCode>" + currentItem.getProduct().getTaxCategoryCode() + "</ram:CategoryCode>"
|
||||||
|
|
||||||
+ "<ram:ApplicablePercent>"
|
+ "<ram:ApplicablePercent>"
|
||||||
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:ApplicablePercent>\n"
|
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:ApplicablePercent>"
|
||||||
+ " </ram:ApplicableTradeTax>\n"
|
+ "</ram:ApplicableTradeTax>"
|
||||||
+ " <ram:SpecifiedTradeSettlementMonetarySummation>\n"
|
+ "<ram:SpecifiedTradeSettlementMonetarySummation>"
|
||||||
+ "<ram:LineTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(lc.getItemTotalNetAmount())
|
+ "<ram:LineTotalAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(lc.getItemTotalNetAmount())
|
||||||
+ "</ram:LineTotalAmount>\n"
|
+ "</ram:LineTotalAmount>"
|
||||||
+ " </ram:SpecifiedTradeSettlementMonetarySummation>\n";
|
+ "</ram:SpecifiedTradeSettlementMonetarySummation>";
|
||||||
if (currentItem.getAdditionalReferencedDocumentID() != null) {
|
if (currentItem.getAdditionalReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:AdditionalReferencedDocument><ram:ID>" + currentItem.getAdditionalReferencedDocumentID() + "</ram:ID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>\n";
|
xml = xml + "<ram:AdditionalReferencedDocument><ram:ID>" + currentItem.getAdditionalReferencedDocumentID() + "</ram:ID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:SpecifiedSupplyChainTradeSettlement>\n"
|
xml = xml + "</ram:SpecifiedSupplyChainTradeSettlement>"
|
||||||
+ " <ram:SpecifiedTradeProduct>\n";
|
+ "<ram:SpecifiedTradeProduct>";
|
||||||
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>"
|
||||||
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
||||||
xml = xml + "<ram:SellerAssignedID>"
|
xml = xml + "<ram:SellerAssignedID>"
|
||||||
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>\n";
|
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>";
|
||||||
}
|
}
|
||||||
if (currentItem.getProduct().getBuyerAssignedID() != null) {
|
if (currentItem.getProduct().getBuyerAssignedID() != null) {
|
||||||
xml = xml + "<ram:BuyerAssignedID>"
|
xml = xml + "<ram:BuyerAssignedID>"
|
||||||
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>\n";
|
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>";
|
||||||
}
|
}
|
||||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>\n"
|
xml = xml + "<ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>"
|
||||||
+ "<ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription())
|
+ "<ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription())
|
||||||
+ "</ram:Description>\n"
|
+ "</ram:Description>"
|
||||||
+ " </ram:SpecifiedTradeProduct>\n"
|
+ "</ram:SpecifiedTradeProduct>"
|
||||||
|
|
||||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n";
|
+ "</ram:IncludedSupplyChainTradeLineItem>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +415,7 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
// + " </AssociatedDocumentLineDocument>\n"
|
// + " </AssociatedDocumentLineDocument>\n"
|
||||||
// + " </IncludedSupplyChainTradeLineItem>\n";
|
// + " </IncludedSupplyChainTradeLineItem>\n";
|
||||||
|
|
||||||
xml = xml + " </rsm:SpecifiedSupplyChainTradeTransaction>\n"
|
xml = xml + "</rsm:SpecifiedSupplyChainTradeTransaction>"
|
||||||
+ "</rsm:CrossIndustryDocument>";
|
+ "</rsm:CrossIndustryDocument>";
|
||||||
|
|
||||||
final byte[] zugferdRaw;
|
final byte[] zugferdRaw;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import java.io.IOException;
|
|||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -92,7 +93,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
format.setTrimText(false);
|
format.setTrimText(false);
|
||||||
final XMLWriter writer = new XMLWriter(sw, format);
|
final XMLWriter writer = new XMLWriter(sw, format);
|
||||||
writer.write(document);
|
writer.write(document);
|
||||||
res = sw.toString().getBytes("UTF-8");
|
res = sw.toString().getBytes(StandardCharsets.UTF_8);
|
||||||
|
|
||||||
} catch (final IOException e) {
|
} catch (final IOException e) {
|
||||||
Logger.getLogger(ZUGFeRD2PullProvider.class.getName()).log(Level.SEVERE, null, e);
|
Logger.getLogger(ZUGFeRD2PullProvider.class.getName()).log(Level.SEVERE, null, e);
|
||||||
@@ -123,12 +124,12 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
// According EN16931 either GlobalID or seller assigned ID might be present for BuyerTradeParty
|
// According EN16931 either GlobalID or seller assigned ID might be present for BuyerTradeParty
|
||||||
// and ShipToTradeParty, but not both. Prefer seller assigned ID for now.
|
// and ShipToTradeParty, but not both. Prefer seller assigned ID for now.
|
||||||
if (party.getID() != null) {
|
if (party.getID() != null) {
|
||||||
xml += " <ram:ID>" + XMLTools.encodeXML(party.getID()) + "</ram:ID>\n";
|
xml += "<ram:ID>" + XMLTools.encodeXML(party.getID()) + "</ram:ID>";
|
||||||
} else if ((party.getGlobalIDScheme() != null) && (party.getGlobalID() != null)) {
|
} else if ((party.getGlobalIDScheme() != null) && (party.getGlobalID() != null)) {
|
||||||
xml = xml + "<ram:GlobalID schemeID=\"" + XMLTools.encodeXML(party.getGlobalIDScheme()) + "\">"
|
xml = xml + "<ram:GlobalID schemeID=\"" + XMLTools.encodeXML(party.getGlobalIDScheme()) + "\">"
|
||||||
+ XMLTools.encodeXML(party.getGlobalID()) + "</ram:GlobalID>\n";
|
+ XMLTools.encodeXML(party.getGlobalID()) + "</ram:GlobalID>";
|
||||||
}
|
}
|
||||||
xml += " <ram:Name>" + XMLTools.encodeXML(party.getName()) + "</ram:Name>\n";
|
xml += "<ram:Name>" + XMLTools.encodeXML(party.getName()) + "</ram:Name>";
|
||||||
|
|
||||||
if (party.getLegalOrganisation() != null) {
|
if (party.getLegalOrganisation() != null) {
|
||||||
xml += "<ram:SpecifiedLegalOrganization> ";
|
xml += "<ram:SpecifiedLegalOrganization> ";
|
||||||
@@ -137,60 +138,60 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((party.getContact() != null) && (isSender || profile == Profiles.getByName("Extended") || profile == Profiles.getByName("XRechnung"))) {
|
if ((party.getContact() != null) && (isSender || profile == Profiles.getByName("Extended") || profile == Profiles.getByName("XRechnung"))) {
|
||||||
xml = xml + "<ram:DefinedTradeContact>\n";
|
xml = xml + "<ram:DefinedTradeContact>";
|
||||||
if (party.getContact().getName() != null) {
|
if (party.getContact().getName() != null) {
|
||||||
xml = xml + "<ram:PersonName>" + XMLTools.encodeXML(party.getContact().getName())
|
xml = xml + "<ram:PersonName>" + XMLTools.encodeXML(party.getContact().getName())
|
||||||
+ "</ram:PersonName>\n";
|
+ "</ram:PersonName>";
|
||||||
}
|
}
|
||||||
if (party.getContact().getPhone() != null) {
|
if (party.getContact().getPhone() != null) {
|
||||||
|
|
||||||
xml = xml + " <ram:TelephoneUniversalCommunication>\n" + " <ram:CompleteNumber>"
|
xml = xml + "<ram:TelephoneUniversalCommunication><ram:CompleteNumber>"
|
||||||
+ XMLTools.encodeXML(party.getContact().getPhone()) + "</ram:CompleteNumber>\n"
|
+ XMLTools.encodeXML(party.getContact().getPhone()) + "</ram:CompleteNumber>"
|
||||||
+ " </ram:TelephoneUniversalCommunication>\n";
|
+ "</ram:TelephoneUniversalCommunication>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((party.getContact().getFax() != null) && (profile == Profiles.getByName("Extended"))) {
|
if ((party.getContact().getFax() != null) && (profile == Profiles.getByName("Extended"))) {
|
||||||
xml = xml + " <ram:FaxUniversalCommunication>\n" + " <ram:CompleteNumber>"
|
xml = xml + "<ram:FaxUniversalCommunication><ram:CompleteNumber>"
|
||||||
+ XMLTools.encodeXML(party.getContact().getFax()) + "</ram:CompleteNumber>\n"
|
+ XMLTools.encodeXML(party.getContact().getFax()) + "</ram:CompleteNumber>"
|
||||||
+ " </ram:FaxUniversalCommunication>\n";
|
+ "</ram:FaxUniversalCommunication>";
|
||||||
}
|
}
|
||||||
if (party.getContact().getEMail() != null) {
|
if (party.getContact().getEMail() != null) {
|
||||||
|
|
||||||
xml = xml + " <ram:EmailURIUniversalCommunication>\n" + " <ram:URIID>"
|
xml = xml + "<ram:EmailURIUniversalCommunication><ram:URIID>"
|
||||||
+ XMLTools.encodeXML(party.getContact().getEMail()) + "</ram:URIID>\n"
|
+ XMLTools.encodeXML(party.getContact().getEMail()) + "</ram:URIID>"
|
||||||
+ " </ram:EmailURIUniversalCommunication>\n";
|
+ "</ram:EmailURIUniversalCommunication>";
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + "</ram:DefinedTradeContact>";
|
xml = xml + "</ram:DefinedTradeContact>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml += " <ram:PostalTradeAddress>\n"
|
xml += "<ram:PostalTradeAddress>"
|
||||||
+ "<ram:PostcodeCode>" + XMLTools.encodeXML(party.getZIP())
|
+ "<ram:PostcodeCode>" + XMLTools.encodeXML(party.getZIP())
|
||||||
+ "</ram:PostcodeCode>\n";
|
+ "</ram:PostcodeCode>";
|
||||||
if (party.getStreet() != null) {
|
if (party.getStreet() != null) {
|
||||||
xml += "<ram:LineOne>" + XMLTools.encodeXML(party.getStreet())
|
xml += "<ram:LineOne>" + XMLTools.encodeXML(party.getStreet())
|
||||||
+ "</ram:LineOne>\n";
|
+ "</ram:LineOne>";
|
||||||
}
|
}
|
||||||
if (party.getAdditionalAddress() != null) {
|
if (party.getAdditionalAddress() != null) {
|
||||||
xml += "<ram:LineTwo>" + XMLTools.encodeXML(party.getAdditionalAddress())
|
xml += "<ram:LineTwo>" + XMLTools.encodeXML(party.getAdditionalAddress())
|
||||||
+ "</ram:LineTwo>\n";
|
+ "</ram:LineTwo>";
|
||||||
}
|
}
|
||||||
xml += "<ram:CityName>" + XMLTools.encodeXML(party.getLocation())
|
xml += "<ram:CityName>" + XMLTools.encodeXML(party.getLocation())
|
||||||
+ "</ram:CityName>\n"
|
+ "</ram:CityName>"
|
||||||
+ "<ram:CountryID>" + XMLTools.encodeXML(party.getCountry())
|
+ "<ram:CountryID>" + XMLTools.encodeXML(party.getCountry())
|
||||||
+ "</ram:CountryID>\n"
|
+ "</ram:CountryID>"
|
||||||
+ " </ram:PostalTradeAddress>\n";
|
+ "</ram:PostalTradeAddress>";
|
||||||
if ((party.getVATID() != null) && (!isShipToTradeParty)) {
|
if ((party.getVATID() != null) && (!isShipToTradeParty)) {
|
||||||
xml += " <ram:SpecifiedTaxRegistration>\n"
|
xml += "<ram:SpecifiedTaxRegistration>"
|
||||||
+ "<ram:ID schemeID=\"VA\">" + XMLTools.encodeXML(party.getVATID())
|
+ "<ram:ID schemeID=\"VA\">" + XMLTools.encodeXML(party.getVATID())
|
||||||
+ "</ram:ID>\n"
|
+ "</ram:ID>"
|
||||||
+ " </ram:SpecifiedTaxRegistration>\n";
|
+ "</ram:SpecifiedTaxRegistration>";
|
||||||
}
|
}
|
||||||
if ((party.getTaxID() != null) && (!isShipToTradeParty)) {
|
if ((party.getTaxID() != null) && (!isShipToTradeParty)) {
|
||||||
xml += " <ram:SpecifiedTaxRegistration>\n"
|
xml += "<ram:SpecifiedTaxRegistration>"
|
||||||
+ "<ram:ID schemeID=\"FC\">" + XMLTools.encodeXML(party.getTaxID())
|
+ "<ram:ID schemeID=\"FC\">" + XMLTools.encodeXML(party.getTaxID())
|
||||||
+ "</ram:ID>\n"
|
+ "</ram:ID>"
|
||||||
+ " </ram:SpecifiedTaxRegistration>\n";
|
+ "</ram:SpecifiedTaxRegistration>";
|
||||||
|
|
||||||
}
|
}
|
||||||
return xml;
|
return xml;
|
||||||
@@ -249,24 +250,24 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
|
|
||||||
String senderReg = "";
|
String senderReg = "";
|
||||||
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
||||||
senderReg = "" + "<ram:IncludedNote>\n" + " <ram:Content>\n"
|
senderReg = "<ram:IncludedNote><ram:Content>"
|
||||||
+ XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + " </ram:Content>\n"
|
+ XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + "</ram:Content>"
|
||||||
+ "<ram:SubjectCode>REG</ram:SubjectCode>\n" + "</ram:IncludedNote>\n";
|
+ "<ram:SubjectCode>REG</ram:SubjectCode>\n</ram:IncludedNote>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String rebateAgreement = "";
|
String rebateAgreement = "";
|
||||||
if (trans.rebateAgreementExists()) {
|
if (trans.rebateAgreementExists()) {
|
||||||
rebateAgreement = "<ram:IncludedNote>\n" + " <ram:Content>"
|
rebateAgreement = "<ram:IncludedNote>\n<ram:Content>"
|
||||||
+ "Es bestehen Rabatt- und Bonusvereinbarungen.</ram:Content>\n"
|
+ "Es bestehen Rabatt- und Bonusvereinbarungen.</ram:Content>"
|
||||||
+ "<ram:SubjectCode>AAK</ram:SubjectCode>\n" + "</ram:IncludedNote>\n";
|
+ "<ram:SubjectCode>AAK</ram:SubjectCode>\n</ram:IncludedNote>";
|
||||||
}
|
}
|
||||||
|
|
||||||
String subjectNote = "";
|
String subjectNote = "";
|
||||||
if (trans.getSubjectNote() != null) {
|
if (trans.getSubjectNote() != null) {
|
||||||
subjectNote = "<ram:IncludedNote>\n" + " <ram:Content>"
|
subjectNote = "<ram:IncludedNote>\n<ram:Content>"
|
||||||
+ XMLTools.encodeXML(trans.getSubjectNote()) + "</ram:Content>\n"
|
+ XMLTools.encodeXML(trans.getSubjectNote()) + "</ram:Content>"
|
||||||
+ "</ram:IncludedNote>\n";
|
+ "</ram:IncludedNote>";
|
||||||
}
|
}
|
||||||
|
|
||||||
String typecode = "380";
|
String typecode = "380";
|
||||||
@@ -280,7 +281,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
|
||||||
|
|
||||||
+ "<rsm:CrossIndustryInvoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\""
|
+ "<rsm:CrossIndustryInvoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\""
|
||||||
// + "
|
// + "
|
||||||
@@ -288,30 +289,30 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
// ../Schema/ZUGFeRD1p0.xsd\""
|
// ../Schema/ZUGFeRD1p0.xsd\""
|
||||||
+ " xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\""
|
+ " xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\""
|
||||||
+ " xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\""
|
+ " xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\""
|
||||||
+ " xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType:100\">\n"
|
+ " xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType:100\">"
|
||||||
+ "<!-- generated by: mustangproject.org v" + ZUGFeRD2PullProvider.class.getPackage().getImplementationVersion() + "-->\n"
|
+ "<!-- generated by: mustangproject.org v" + ZUGFeRD2PullProvider.class.getPackage().getImplementationVersion() + "-->"
|
||||||
+ " <rsm:ExchangedDocumentContext>\n"
|
+ "<rsm:ExchangedDocumentContext>"
|
||||||
// + "
|
// + "
|
||||||
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>\n"
|
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>"
|
||||||
//
|
//
|
||||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
+ "<ram:GuidelineSpecifiedDocumentContextParameter>"
|
||||||
+ " <ram:ID>" + getProfile().getID() + "</ram:ID>\n"
|
+ "<ram:ID>" + getProfile().getID() + "</ram:ID>"
|
||||||
+ " </ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
+ "</ram:GuidelineSpecifiedDocumentContextParameter>"
|
||||||
+ " </rsm:ExchangedDocumentContext>\n"
|
+ "</rsm:ExchangedDocumentContext>"
|
||||||
+ " <rsm:ExchangedDocument>\n"
|
+ "<rsm:ExchangedDocument>"
|
||||||
+ " <ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>\n"
|
+ "<ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>"
|
||||||
// + " <ram:Name>RECHNUNG</ram:Name>\n"
|
// + " <ram:Name>RECHNUNG</ram:Name>"
|
||||||
// + " <ram:TypeCode>380</ram:TypeCode>\n"
|
// + "<ram:TypeCode>380</ram:TypeCode>"
|
||||||
+ " <ram:TypeCode>" + typecode + "</ram:TypeCode>\n"
|
+ "<ram:TypeCode>" + typecode + "</ram:TypeCode>"
|
||||||
+ "<ram:IssueDateTime>"
|
+ "<ram:IssueDateTime>"
|
||||||
+ DATE.udtFormat(trans.getIssueDate()) + "</ram:IssueDateTime>\n" // date
|
+ DATE.udtFormat(trans.getIssueDate()) + "</ram:IssueDateTime>" // date
|
||||||
+ notes
|
+ notes
|
||||||
+ subjectNote
|
+ subjectNote
|
||||||
+ rebateAgreement
|
+ rebateAgreement
|
||||||
+ senderReg
|
+ senderReg
|
||||||
|
|
||||||
+ " </rsm:ExchangedDocument>\n"
|
+ "</rsm:ExchangedDocument>"
|
||||||
+ " <rsm:SupplyChainTradeTransaction>\n";
|
+ "<rsm:SupplyChainTradeTransaction>";
|
||||||
int lineID = 0;
|
int lineID = 0;
|
||||||
for (final IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
for (final IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||||
lineID++;
|
lineID++;
|
||||||
@@ -326,21 +327,21 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
final LineCalculator lc = new LineCalculator(currentItem);
|
final LineCalculator lc = new LineCalculator(currentItem);
|
||||||
xml = xml + " <ram:IncludedSupplyChainTradeLineItem>\n" +
|
xml = xml + "<ram:IncludedSupplyChainTradeLineItem>" +
|
||||||
" <ram:AssociatedDocumentLineDocument>\n"
|
"<ram:AssociatedDocumentLineDocument>"
|
||||||
+ " <ram:LineID>" + lineID + "</ram:LineID>\n"
|
+ "<ram:LineID>" + lineID + "</ram:LineID>"
|
||||||
+ notes
|
+ notes
|
||||||
+ " </ram:AssociatedDocumentLineDocument>\n"
|
+ "</ram:AssociatedDocumentLineDocument>"
|
||||||
|
|
||||||
+ " <ram:SpecifiedTradeProduct>\n";
|
+ "<ram:SpecifiedTradeProduct>";
|
||||||
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>"
|
||||||
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
||||||
xml = xml + "<ram:SellerAssignedID>"
|
xml = xml + "<ram:SellerAssignedID>"
|
||||||
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>\n";
|
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>";
|
||||||
}
|
}
|
||||||
if (currentItem.getProduct().getBuyerAssignedID() != null) {
|
if (currentItem.getProduct().getBuyerAssignedID() != null) {
|
||||||
xml = xml + "<ram:BuyerAssignedID>"
|
xml = xml + "<ram:BuyerAssignedID>"
|
||||||
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>\n";
|
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>";
|
||||||
}
|
}
|
||||||
String allowanceChargeStr = "";
|
String allowanceChargeStr = "";
|
||||||
if (currentItem.getItemAllowances() != null && currentItem.getItemAllowances().length > 0) {
|
if (currentItem.getItemAllowances() != null && currentItem.getItemAllowances().length > 0) {
|
||||||
@@ -356,19 +357,19 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>\n"
|
xml = xml + "<ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>"
|
||||||
+ "<ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription())
|
+ "<ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription())
|
||||||
+ "</ram:Description>\n"
|
+ "</ram:Description>"
|
||||||
+ " </ram:SpecifiedTradeProduct>\n"
|
+ "</ram:SpecifiedTradeProduct>"
|
||||||
|
|
||||||
+ " <ram:SpecifiedLineTradeAgreement>\n";
|
+ "<ram:SpecifiedLineTradeAgreement>";
|
||||||
if (currentItem.getReferencedDocuments() != null) {
|
if (currentItem.getReferencedDocuments() != null) {
|
||||||
for (IReferencedDocument currentReferencedDocument : currentItem.getReferencedDocuments()) {
|
for (final IReferencedDocument currentReferencedDocument : currentItem.getReferencedDocuments()) {
|
||||||
xml = xml + "<ram:AdditionalReferencedDocument>\n" +
|
xml = xml + "<ram:AdditionalReferencedDocument>" +
|
||||||
"<ram:IssuerAssignedID>" + XMLTools.encodeXML(currentReferencedDocument.getIssuerAssignedID()) + "</ram:IssuerAssignedID>\n" +
|
"<ram:IssuerAssignedID>" + XMLTools.encodeXML(currentReferencedDocument.getIssuerAssignedID()) + "</ram:IssuerAssignedID>" +
|
||||||
"<ram:TypeCode>" + XMLTools.encodeXML(currentReferencedDocument.getTypeCode()) + "</ram:TypeCode>\n" +
|
"<ram:TypeCode>" + XMLTools.encodeXML(currentReferencedDocument.getTypeCode()) + "</ram:TypeCode>" +
|
||||||
"<ram:ReferenceTypeCode>" + XMLTools.encodeXML(currentReferencedDocument.getReferenceTypeCode()) + "</ram:ReferenceTypeCode>\n" +
|
"<ram:ReferenceTypeCode>" + XMLTools.encodeXML(currentReferencedDocument.getReferenceTypeCode()) + "</ram:ReferenceTypeCode>" +
|
||||||
"</ram:AdditionalReferencedDocument>\n";
|
"</ram:AdditionalReferencedDocument>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -376,43 +377,43 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
}
|
}
|
||||||
if (currentItem.getBuyerOrderReferencedDocumentLineID() != null) {
|
if (currentItem.getBuyerOrderReferencedDocumentLineID() != null) {
|
||||||
xml = xml + "<ram:BuyerOrderReferencedDocument> \n"
|
xml = xml + "<ram:BuyerOrderReferencedDocument> \n"
|
||||||
+ " <ram:LineID>" + XMLTools.encodeXML(currentItem.getBuyerOrderReferencedDocumentLineID()) + "</ram:LineID>\n"
|
+ "<ram:LineID>" + XMLTools.encodeXML(currentItem.getBuyerOrderReferencedDocumentLineID()) + "</ram:LineID>"
|
||||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
+ "</ram:BuyerOrderReferencedDocument>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " <ram:GrossPriceProductTradePrice>\n"
|
xml = xml + "<ram:GrossPriceProductTradePrice>"
|
||||||
+ "<ram:ChargeAmount>" + priceFormat(lc.getPriceGross())
|
+ "<ram:ChargeAmount>" + priceFormat(lc.getPriceGross())
|
||||||
+ "</ram:ChargeAmount>\n" //currencyID=\"EUR\"
|
+ "</ram:ChargeAmount>" //currencyID=\"EUR\"
|
||||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>"
|
||||||
+ allowanceChargeStr
|
+ allowanceChargeStr
|
||||||
// + " <AppliedTradeAllowanceCharge>\n"
|
// + " <AppliedTradeAllowanceCharge>"
|
||||||
// + " <ChargeIndicator>false</ChargeIndicator>\n"
|
// + " <ChargeIndicator>false</ChargeIndicator>"
|
||||||
// + " <ActualAmount currencyID=\"EUR\">0.6667</ActualAmount>\n"
|
// + " <ActualAmount currencyID=\"EUR\">0.6667</ActualAmount>"
|
||||||
// + " <Reason>Rabatt</Reason>\n"
|
// + " <Reason>Rabatt</Reason>"
|
||||||
// + " </AppliedTradeAllowanceCharge>\n"
|
// + " </AppliedTradeAllowanceCharge>"
|
||||||
+ " </ram:GrossPriceProductTradePrice>\n"
|
+ "</ram:GrossPriceProductTradePrice>"
|
||||||
+ " <ram:NetPriceProductTradePrice>\n"
|
+ "<ram:NetPriceProductTradePrice>"
|
||||||
+ "<ram:ChargeAmount>" + priceFormat(lc.getPrice())
|
+ "<ram:ChargeAmount>" + priceFormat(lc.getPrice())
|
||||||
+ "</ram:ChargeAmount>\n" // currencyID=\"EUR\"
|
+ "</ram:ChargeAmount>" // currencyID=\"EUR\"
|
||||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>"
|
||||||
+ " </ram:NetPriceProductTradePrice>\n"
|
+ "</ram:NetPriceProductTradePrice>"
|
||||||
+ " </ram:SpecifiedLineTradeAgreement>\n"
|
+ "</ram:SpecifiedLineTradeAgreement>"
|
||||||
|
|
||||||
+ " <ram:SpecifiedLineTradeDelivery>\n"
|
+ "<ram:SpecifiedLineTradeDelivery>"
|
||||||
+ "<ram:BilledQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">"
|
+ "<ram:BilledQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">"
|
||||||
+ quantityFormat(currentItem.getQuantity()) + "</ram:BilledQuantity>\n"
|
+ quantityFormat(currentItem.getQuantity()) + "</ram:BilledQuantity>"
|
||||||
+ " </ram:SpecifiedLineTradeDelivery>\n"
|
+ "</ram:SpecifiedLineTradeDelivery>"
|
||||||
+ " <ram:SpecifiedLineTradeSettlement>\n"
|
+ "<ram:SpecifiedLineTradeSettlement>"
|
||||||
+ " <ram:ApplicableTradeTax>\n"
|
+ "<ram:ApplicableTradeTax>"
|
||||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
+ "<ram:TypeCode>VAT</ram:TypeCode>"
|
||||||
+ exemptionReason
|
+ exemptionReason
|
||||||
+ " <ram:CategoryCode>" + currentItem.getProduct().getTaxCategoryCode() + "</ram:CategoryCode>\n"
|
+ "<ram:CategoryCode>" + currentItem.getProduct().getTaxCategoryCode() + "</ram:CategoryCode>"
|
||||||
|
|
||||||
+ "<ram:RateApplicablePercent>"
|
+ "<ram:RateApplicablePercent>"
|
||||||
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n"
|
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>"
|
||||||
+ " </ram:ApplicableTradeTax>\n";
|
+ "</ram:ApplicableTradeTax>";
|
||||||
if ((currentItem.getDetailedDeliveryPeriodFrom() != null) || (currentItem.getDetailedDeliveryPeriodTo() != null)) {
|
if ((currentItem.getDetailedDeliveryPeriodFrom() != null) || (currentItem.getDetailedDeliveryPeriodTo() != null)) {
|
||||||
xml = xml + "<ram:BillingSpecifiedPeriod>";
|
xml = xml + "<ram:BillingSpecifiedPeriod>";
|
||||||
if (currentItem.getDetailedDeliveryPeriodFrom() != null) {
|
if (currentItem.getDetailedDeliveryPeriodFrom() != null) {
|
||||||
@@ -425,85 +426,85 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedTradeSettlementLineMonetarySummation>\n"
|
xml = xml + "<ram:SpecifiedTradeSettlementLineMonetarySummation>"
|
||||||
+ "<ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount())
|
+ "<ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount())
|
||||||
+ "</ram:LineTotalAmount>\n" // currencyID=\"EUR\"
|
+ "</ram:LineTotalAmount>" // currencyID=\"EUR\"
|
||||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n";
|
+ "</ram:SpecifiedTradeSettlementLineMonetarySummation>";
|
||||||
if (currentItem.getAdditionalReferencedDocumentID() != null) {
|
if (currentItem.getAdditionalReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:AdditionalReferencedDocument><ram:IssuerAssignedID>" + currentItem.getAdditionalReferencedDocumentID() + "</ram:IssuerAssignedID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>\n";
|
xml = xml + "<ram:AdditionalReferencedDocument><ram:IssuerAssignedID>" + currentItem.getAdditionalReferencedDocumentID() + "</ram:IssuerAssignedID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:SpecifiedLineTradeSettlement>\n"
|
xml = xml + "</ram:SpecifiedLineTradeSettlement>"
|
||||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n";
|
+ "</ram:IncludedSupplyChainTradeLineItem>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + " <ram:ApplicableHeaderTradeAgreement>\n";
|
xml = xml + "<ram:ApplicableHeaderTradeAgreement>";
|
||||||
if (trans.getReferenceNumber() != null) {
|
if (trans.getReferenceNumber() != null) {
|
||||||
xml = xml + " <ram:BuyerReference>" + XMLTools.encodeXML(trans.getReferenceNumber()) + "</ram:BuyerReference>\n";
|
xml = xml + "<ram:BuyerReference>" + XMLTools.encodeXML(trans.getReferenceNumber()) + "</ram:BuyerReference>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " <ram:SellerTradeParty>\n"
|
xml = xml + "<ram:SellerTradeParty>"
|
||||||
+ getTradePartyAsXML(trans.getSender(), true, false)
|
+ getTradePartyAsXML(trans.getSender(), true, false)
|
||||||
+ " </ram:SellerTradeParty>\n"
|
+ "</ram:SellerTradeParty>"
|
||||||
+ " <ram:BuyerTradeParty>\n";
|
+ "<ram:BuyerTradeParty>";
|
||||||
// + " <ID>GE2020211</ID>\n"
|
// + " <ID>GE2020211</ID>"
|
||||||
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n"
|
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>"
|
||||||
|
|
||||||
xml += getTradePartyAsXML(trans.getRecipient(), false, false);
|
xml += getTradePartyAsXML(trans.getRecipient(), false, false);
|
||||||
xml += " </ram:BuyerTradeParty>\n";
|
xml += "</ram:BuyerTradeParty>";
|
||||||
|
|
||||||
if (trans.getSellerOrderReferencedDocumentID() != null) {
|
if (trans.getSellerOrderReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:SellerOrderReferencedDocument>\n"
|
xml = xml + " <ram:SellerOrderReferencedDocument>"
|
||||||
+ " <ram:IssuerAssignedID>"
|
+ " <ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getSellerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getSellerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:SellerOrderReferencedDocument>\n";
|
+ " </ram:SellerOrderReferencedDocument>";
|
||||||
}
|
}
|
||||||
if (trans.getBuyerOrderReferencedDocumentID() != null) {
|
if (trans.getBuyerOrderReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:BuyerOrderReferencedDocument>\n"
|
xml = xml + " <ram:BuyerOrderReferencedDocument>"
|
||||||
+ " <ram:IssuerAssignedID>"
|
+ " <ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
+ " </ram:BuyerOrderReferencedDocument>";
|
||||||
}
|
}
|
||||||
if (trans.getContractReferencedDocument() != null) {
|
if (trans.getContractReferencedDocument() != null) {
|
||||||
xml = xml + " <ram:ContractReferencedDocument>\n"
|
xml = xml + " <ram:ContractReferencedDocument>"
|
||||||
+ " <ram:IssuerAssignedID>"
|
+ " <ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getContractReferencedDocument()) + "</ram:IssuerAssignedID>\n"
|
+ XMLTools.encodeXML(trans.getContractReferencedDocument()) + "</ram:IssuerAssignedID>"
|
||||||
+ " </ram:ContractReferencedDocument>\n";
|
+ " </ram:ContractReferencedDocument>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional Documents of XRechnung (Rechnungsbegruendende Unterlagen - BG-24 XRechnung)
|
// Additional Documents of XRechnung (Rechnungsbegruendende Unterlagen - BG-24 XRechnung)
|
||||||
if (trans.getAdditionalReferencedDocuments() != null) {
|
if (trans.getAdditionalReferencedDocuments() != null) {
|
||||||
for (final FileAttachment f : trans.getAdditionalReferencedDocuments()) {
|
for (final FileAttachment f : trans.getAdditionalReferencedDocuments()) {
|
||||||
final String documentContent = new String(Base64.getEncoder().encodeToString(f.getData()));
|
final String documentContent = new String(Base64.getEncoder().encodeToString(f.getData()));
|
||||||
xml = xml + " <ram:AdditionalReferencedDocument>\n"
|
xml = xml + " <ram:AdditionalReferencedDocument>"
|
||||||
+ " <ram:IssuerAssignedID>" + f.getFilename() + "</ram:IssuerAssignedID>\n"
|
+ " <ram:IssuerAssignedID>" + f.getFilename() + "</ram:IssuerAssignedID>"
|
||||||
+ " <ram:TypeCode>916</ram:TypeCode>\n"
|
+ " <ram:TypeCode>916</ram:TypeCode>"
|
||||||
+ " <ram:Name>" + f.getDescription() + "</ram:Name>\n"
|
+ " <ram:Name>" + f.getDescription() + "</ram:Name>"
|
||||||
+ " <ram:AttachmentBinaryObject mimeCode=\"" + f.getMimetype() + "\"\n"
|
+ " <ram:AttachmentBinaryObject mimeCode=\"" + f.getMimetype() + "\"\n"
|
||||||
+ " filename=\"" + f.getFilename() + "\">" + documentContent + "</ram:AttachmentBinaryObject>\n"
|
+ " filename=\"" + f.getFilename() + "\">" + documentContent + "</ram:AttachmentBinaryObject>"
|
||||||
+ " </ram:AdditionalReferencedDocument>\n";
|
+ " </ram:AdditionalReferencedDocument>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans.getSpecifiedProcuringProjectID() != null) {
|
if (trans.getSpecifiedProcuringProjectID() != null) {
|
||||||
xml = xml + " <ram:SpecifiedProcuringProject>\n"
|
xml = xml + " <ram:SpecifiedProcuringProject>"
|
||||||
+ " <ram:ID>"
|
+ " <ram:ID>"
|
||||||
+ XMLTools.encodeXML(trans.getSpecifiedProcuringProjectID()) + "</ram:ID>\n";
|
+ XMLTools.encodeXML(trans.getSpecifiedProcuringProjectID()) + "</ram:ID>";
|
||||||
if (trans.getSpecifiedProcuringProjectName() != null) {
|
if (trans.getSpecifiedProcuringProjectName() != null) {
|
||||||
xml += " <ram:Name >" + XMLTools.encodeXML(trans.getSpecifiedProcuringProjectName()) + "</ram:Name>\n";
|
xml += " <ram:Name >" + XMLTools.encodeXML(trans.getSpecifiedProcuringProjectName()) + "</ram:Name>";
|
||||||
}
|
}
|
||||||
xml += " </ram:SpecifiedProcuringProject>\n";
|
xml += " </ram:SpecifiedProcuringProject>";
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:ApplicableHeaderTradeAgreement>\n"
|
xml = xml + "</ram:ApplicableHeaderTradeAgreement>"
|
||||||
+ " <ram:ApplicableHeaderTradeDelivery>\n";
|
+ "<ram:ApplicableHeaderTradeDelivery>";
|
||||||
if (this.trans.getDeliveryAddress() != null) {
|
if (this.trans.getDeliveryAddress() != null) {
|
||||||
xml += "<ram:ShipToTradeParty>" +
|
xml += "<ram:ShipToTradeParty>" +
|
||||||
getTradePartyAsXML(this.trans.getDeliveryAddress(), false, true) +
|
getTradePartyAsXML(this.trans.getDeliveryAddress(), false, true) +
|
||||||
"</ram:ShipToTradeParty>";
|
"</ram:ShipToTradeParty>";
|
||||||
}
|
}
|
||||||
|
|
||||||
xml += " <ram:ActualDeliverySupplyChainEvent>\n"
|
xml += "<ram:ActualDeliverySupplyChainEvent>"
|
||||||
+ "<ram:OccurrenceDateTime>";
|
+ "<ram:OccurrenceDateTime>";
|
||||||
|
|
||||||
if (trans.getDeliveryDate() != null) {
|
if (trans.getDeliveryDate() != null) {
|
||||||
@@ -511,14 +512,13 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("No delivery date provided");
|
throw new IllegalStateException("No delivery date provided");
|
||||||
}
|
}
|
||||||
xml += "</ram:OccurrenceDateTime>\n";
|
xml += "</ram:OccurrenceDateTime>";
|
||||||
xml += " </ram:ActualDeliverySupplyChainEvent>\n";
|
xml += " </ram:ActualDeliverySupplyChainEvent>";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* + " <DeliveryNoteReferencedDocument>\n" +
|
* + "<DeliveryNoteReferencedDocument>" +
|
||||||
* " <IssueDateTime format=\"102\">20130603</IssueDateTime>\n" +
|
* "<IssueDateTime format=\"102\">20130603</IssueDateTime>" +
|
||||||
* " <ID>2013-51112</ID>\n" +
|
* "<ID>2013-51112</ID>" +
|
||||||
* " </DeliveryNoteReferencedDocument>\n"
|
* "</DeliveryNoteReferencedDocument>"
|
||||||
*/
|
*/
|
||||||
if (trans.getDespatchAdviceReferencedDocumentID() != null) {
|
if (trans.getDespatchAdviceReferencedDocumentID() != null) {
|
||||||
xml += "<ram:DespatchAdviceReferencedDocument>";
|
xml += "<ram:DespatchAdviceReferencedDocument>";
|
||||||
@@ -526,9 +526,9 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
xml += "</ram:DespatchAdviceReferencedDocument>";
|
xml += "</ram:DespatchAdviceReferencedDocument>";
|
||||||
|
|
||||||
}
|
}
|
||||||
xml += " </ram:ApplicableHeaderTradeDelivery>\n" + " <ram:ApplicableHeaderTradeSettlement>\n"
|
xml += " </ram:ApplicableHeaderTradeDelivery>\n <ram:ApplicableHeaderTradeSettlement>"
|
||||||
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>\n"
|
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>"
|
||||||
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>\n";
|
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>";
|
||||||
|
|
||||||
if (trans.getTradeSettlementPayment() != null) {
|
if (trans.getTradeSettlementPayment() != null) {
|
||||||
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
|
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
|
||||||
@@ -558,15 +558,15 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
if (amount != null) {
|
if (amount != null) {
|
||||||
final String amountCategoryCode = amount.getCategoryCode();
|
final String amountCategoryCode = amount.getCategoryCode();
|
||||||
final boolean displayExemptionReason = CATEGORY_CODES_WITH_EXEMPTION_REASON.contains(amountCategoryCode);
|
final boolean displayExemptionReason = CATEGORY_CODES_WITH_EXEMPTION_REASON.contains(amountCategoryCode);
|
||||||
xml += " <ram:ApplicableTradeTax>\n"
|
xml += "<ram:ApplicableTradeTax>"
|
||||||
+ "<ram:CalculatedAmount>" + currencyFormat(amount.getCalculated())
|
+ "<ram:CalculatedAmount>" + currencyFormat(amount.getCalculated())
|
||||||
+ "</ram:CalculatedAmount>\n" //currencyID=\"EUR\"
|
+ "</ram:CalculatedAmount>" //currencyID=\"EUR\"
|
||||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
+ "<ram:TypeCode>VAT</ram:TypeCode>"
|
||||||
+ (displayExemptionReason ? exemptionReason : "")
|
+ (displayExemptionReason ? exemptionReason : "")
|
||||||
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
+ "<ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>" // currencyID=\"EUR\"
|
||||||
+ " <ram:CategoryCode>" + amountCategoryCode + "</ram:CategoryCode>\n"
|
+ "<ram:CategoryCode>" + amountCategoryCode + "</ram:CategoryCode>"
|
||||||
+ "<ram:RateApplicablePercent>"
|
+ "<ram:RateApplicablePercent>"
|
||||||
+ vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n";
|
+ vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n</ram:ApplicableTradeTax>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((trans.getDetailedDeliveryPeriodFrom() != null) || (trans.getDetailedDeliveryPeriodTo() != null)) {
|
if ((trans.getDetailedDeliveryPeriodFrom() != null) || (trans.getDetailedDeliveryPeriodTo() != null)) {
|
||||||
@@ -588,17 +588,17 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
if (calc.getChargesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
if (calc.getChargesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>" +
|
||||||
" <ram:ChargeIndicator>\n" +
|
" <ram:ChargeIndicator>" +
|
||||||
" <udt:Indicator>true</udt:Indicator>\n" +
|
" <udt:Indicator>true</udt:Indicator>" +
|
||||||
" </ram:ChargeIndicator>\n" +
|
" </ram:ChargeIndicator>" +
|
||||||
" <ram:ActualAmount>" + currencyFormat(calc.getChargesForPercent(currentTaxPercent)) + "</ram:ActualAmount>\n" +
|
" <ram:ActualAmount>" + currencyFormat(calc.getChargesForPercent(currentTaxPercent)) + "</ram:ActualAmount>" +
|
||||||
" <ram:Reason>" + XMLTools.encodeXML(calc.getChargeReasonForPercent(currentTaxPercent)) + "</ram:Reason>\n" +
|
" <ram:Reason>" + XMLTools.encodeXML(calc.getChargeReasonForPercent(currentTaxPercent)) + "</ram:Reason>" +
|
||||||
" <ram:CategoryTradeTax>\n" +
|
" <ram:CategoryTradeTax>" +
|
||||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
" <ram:TypeCode>VAT</ram:TypeCode>" +
|
||||||
" <ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>\n" +
|
" <ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>" +
|
||||||
" <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" +
|
" <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>" +
|
||||||
" </ram:CategoryTradeTax>\n" +
|
" </ram:CategoryTradeTax>" +
|
||||||
" </ram:SpecifiedTradeAllowanceCharge> \n";
|
" </ram:SpecifiedTradeAllowanceCharge> \n";
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -609,17 +609,17 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
if ((trans.getZFAllowances() != null) && (trans.getZFAllowances().length > 0)) {
|
if ((trans.getZFAllowances() != null) && (trans.getZFAllowances().length > 0)) {
|
||||||
for (final BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
for (final BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||||
if (calc.getAllowancesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
if (calc.getAllowancesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO) != 0) {
|
||||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>" +
|
||||||
" <ram:ChargeIndicator>\n" +
|
" <ram:ChargeIndicator>" +
|
||||||
" <udt:Indicator>false</udt:Indicator>\n" +
|
" <udt:Indicator>false</udt:Indicator>" +
|
||||||
" </ram:ChargeIndicator>\n" +
|
" </ram:ChargeIndicator>" +
|
||||||
" <ram:ActualAmount>" + currencyFormat(calc.getAllowancesForPercent(currentTaxPercent)) + "</ram:ActualAmount>\n" +
|
" <ram:ActualAmount>" + currencyFormat(calc.getAllowancesForPercent(currentTaxPercent)) + "</ram:ActualAmount>" +
|
||||||
" <ram:Reason>" + XMLTools.encodeXML(calc.getAllowanceReasonForPercent(currentTaxPercent)) + "</ram:Reason>\n" +
|
" <ram:Reason>" + XMLTools.encodeXML(calc.getAllowanceReasonForPercent(currentTaxPercent)) + "</ram:Reason>" +
|
||||||
" <ram:CategoryTradeTax>\n" +
|
" <ram:CategoryTradeTax>" +
|
||||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
" <ram:TypeCode>VAT</ram:TypeCode>" +
|
||||||
" <ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>\n" +
|
" <ram:CategoryCode>" + VATPercentAmountMap.get(currentTaxPercent).getCategoryCode() + "</ram:CategoryCode>" +
|
||||||
" <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" +
|
" <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>" +
|
||||||
" </ram:CategoryTradeTax>\n" +
|
" </ram:CategoryTradeTax>" +
|
||||||
" </ram:SpecifiedTradeAllowanceCharge> \n";
|
" </ram:SpecifiedTradeAllowanceCharge> \n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -627,10 +627,10 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
|
|
||||||
|
|
||||||
if ((trans.getPaymentTerms() == null) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) {
|
if ((trans.getPaymentTerms() == null) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) {
|
||||||
xml = xml + "<ram:SpecifiedTradePaymentTerms>\n";
|
xml = xml + "<ram:SpecifiedTradePaymentTerms>";
|
||||||
|
|
||||||
if (paymentTermsDescription != null) {
|
if (paymentTermsDescription != null) {
|
||||||
xml = xml + "<ram:Description>" + paymentTermsDescription + "</ram:Description>\n";
|
xml = xml + "<ram:Description>" + paymentTermsDescription + "</ram:Description>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans.getTradeSettlement() != null) {
|
if (trans.getTradeSettlement() != null) {
|
||||||
@@ -644,10 +644,10 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
if (hasDueDate && (trans.getDueDate() != null)) {
|
if (hasDueDate && (trans.getDueDate() != null)) {
|
||||||
xml = xml + "<ram:DueDateDateTime>" // $NON-NLS-2$
|
xml = xml + "<ram:DueDateDateTime>" // $NON-NLS-2$
|
||||||
+ DATE.udtFormat(trans.getDueDate())
|
+ DATE.udtFormat(trans.getDueDate())
|
||||||
+ "</ram:DueDateDateTime>\n";// 20130704
|
+ "</ram:DueDateDateTime>";// 20130704
|
||||||
|
|
||||||
}
|
}
|
||||||
xml = xml + " </ram:SpecifiedTradePaymentTerms>\n";
|
xml = xml + "</ram:SpecifiedTradePaymentTerms>";
|
||||||
} else {
|
} else {
|
||||||
xml = xml + buildPaymentTermsXml();
|
xml = xml + buildPaymentTermsXml();
|
||||||
}
|
}
|
||||||
@@ -657,34 +657,34 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
|
|
||||||
final String chargesTotalLine = "<ram:ChargeTotalAmount>" + currencyFormat(calc.getChargesForPercent(null)) + "</ram:ChargeTotalAmount>";
|
final String chargesTotalLine = "<ram:ChargeTotalAmount>" + currencyFormat(calc.getChargesForPercent(null)) + "</ram:ChargeTotalAmount>";
|
||||||
|
|
||||||
xml = xml + " <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n"
|
xml = xml + "<ram:SpecifiedTradeSettlementHeaderMonetarySummation>"
|
||||||
+ " <ram:LineTotalAmount>" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>\n"
|
+ "<ram:LineTotalAmount>" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>"
|
||||||
+ chargesTotalLine
|
+ chargesTotalLine
|
||||||
+ allowanceTotalLine
|
+ allowanceTotalLine
|
||||||
+ " <ram:TaxBasisTotalAmount>" + currencyFormat(calc.getTaxBasis()) + "</ram:TaxBasisTotalAmount>\n"
|
+ "<ram:TaxBasisTotalAmount>" + currencyFormat(calc.getTaxBasis()) + "</ram:TaxBasisTotalAmount>"
|
||||||
// //
|
// //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
+ "<ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
|
+ "<ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
|
||||||
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTaxBasis())) + "</ram:TaxTotalAmount>\n"
|
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTaxBasis())) + "</ram:TaxTotalAmount>"
|
||||||
+ " <ram:GrandTotalAmount>" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>\n"
|
+ "<ram:GrandTotalAmount>" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>"
|
||||||
// //
|
// //
|
||||||
// currencyID=\"EUR\"
|
// currencyID=\"EUR\"
|
||||||
+ " <ram:TotalPrepaidAmount>" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>\n"
|
+ " <ram:TotalPrepaidAmount>" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>"
|
||||||
+ " <ram:DuePayableAmount>" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>\n"
|
+ "<ram:DuePayableAmount>" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>"
|
||||||
+ " </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n";
|
+ "</ram:SpecifiedTradeSettlementHeaderMonetarySummation>";
|
||||||
if (trans.getInvoiceReferencedDocumentID() != null) {
|
if (trans.getInvoiceReferencedDocumentID() != null) {
|
||||||
xml = xml + " <ram:InvoiceReferencedDocument>\n"
|
xml = xml + " <ram:InvoiceReferencedDocument>"
|
||||||
+ " <ram:IssuerAssignedID>"
|
+ " <ram:IssuerAssignedID>"
|
||||||
+ XMLTools.encodeXML(trans.getInvoiceReferencedDocumentID()) + "</ram:IssuerAssignedID>\n";
|
+ XMLTools.encodeXML(trans.getInvoiceReferencedDocumentID()) + "</ram:IssuerAssignedID>";
|
||||||
if (trans.getInvoiceReferencedIssueDate() != null) {
|
if (trans.getInvoiceReferencedIssueDate() != null) {
|
||||||
xml += "<ram:FormattedIssueDateTime>"
|
xml += "<ram:FormattedIssueDateTime>"
|
||||||
+ DATE.qdtFormat(trans.getInvoiceReferencedIssueDate())
|
+ DATE.qdtFormat(trans.getInvoiceReferencedIssueDate())
|
||||||
+ "</ram:FormattedIssueDateTime>\n";
|
+ "</ram:FormattedIssueDateTime>";
|
||||||
}
|
}
|
||||||
xml += " </ram:InvoiceReferencedDocument>\n";
|
xml += " </ram:InvoiceReferencedDocument>";
|
||||||
}
|
}
|
||||||
|
|
||||||
xml = xml + " </ram:ApplicableHeaderTradeSettlement>\n";
|
xml = xml + "</ram:ApplicableHeaderTradeSettlement>";
|
||||||
// + " <IncludedSupplyChainTradeLineItem>\n"
|
// + " <IncludedSupplyChainTradeLineItem>\n"
|
||||||
// + " <AssociatedDocumentLineDocument>\n"
|
// + " <AssociatedDocumentLineDocument>\n"
|
||||||
// + " <IncludedNote>\n"
|
// + " <IncludedNote>\n"
|
||||||
@@ -694,7 +694,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
// + " </AssociatedDocumentLineDocument>\n"
|
// + " </AssociatedDocumentLineDocument>\n"
|
||||||
// + " </IncludedSupplyChainTradeLineItem>\n";
|
// + " </IncludedSupplyChainTradeLineItem>\n";
|
||||||
|
|
||||||
xml = xml + " </rsm:SupplyChainTradeTransaction>\n"
|
xml = xml + "</rsm:SupplyChainTradeTransaction>"
|
||||||
+ "</rsm:CrossIndustryInvoice>";
|
+ "</rsm:CrossIndustryInvoice>";
|
||||||
|
|
||||||
final byte[] zugferdRaw;
|
final byte[] zugferdRaw;
|
||||||
|
|||||||
Reference in New Issue
Block a user