|
|
|
@@ -21,7 +21,6 @@
|
|
|
|
package org.mustangproject.ZUGFeRD;
|
|
|
|
package org.mustangproject.ZUGFeRD;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.mustangproject.ZUGFeRD.ZUGFeRDDateFormat.DATE;
|
|
|
|
import static org.mustangproject.ZUGFeRD.ZUGFeRDDateFormat.DATE;
|
|
|
|
import static org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants.CORRECTEDINVOICE;
|
|
|
|
|
|
|
|
import static org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants.CATEGORY_CODES_WITH_EXEMPTION_REASON;
|
|
|
|
import static org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants.CATEGORY_CODES_WITH_EXEMPTION_REASON;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
@@ -43,6 +42,7 @@ import org.dom4j.io.OutputFormat;
|
|
|
|
import org.dom4j.io.XMLWriter;
|
|
|
|
import org.dom4j.io.XMLWriter;
|
|
|
|
import org.mustangproject.FileAttachment;
|
|
|
|
import org.mustangproject.FileAttachment;
|
|
|
|
import org.mustangproject.XMLTools;
|
|
|
|
import org.mustangproject.XMLTools;
|
|
|
|
|
|
|
|
import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants;
|
|
|
|
|
|
|
|
|
|
|
|
public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
|
|
|
|
|
|
|
|
@@ -166,9 +166,12 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
xml += "</ram:DefinedTradeContact>";
|
|
|
|
xml += "</ram:DefinedTradeContact>";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xml += "<ram:PostalTradeAddress>"
|
|
|
|
|
|
|
|
+ "<ram:PostcodeCode>" + XMLTools.encodeXML(party.getZIP())
|
|
|
|
xml += "<ram:PostalTradeAddress>";
|
|
|
|
|
|
|
|
if (party.getZIP() != null) {
|
|
|
|
|
|
|
|
xml += "<ram:PostcodeCode>" + XMLTools.encodeXML(party.getZIP())
|
|
|
|
+ "</ram:PostcodeCode>";
|
|
|
|
+ "</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>";
|
|
|
|
+ "</ram:LineOne>";
|
|
|
|
@@ -181,11 +184,16 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
xml += "<ram:LineThree>" + XMLTools.encodeXML(party.getAdditionalAddressExtension())
|
|
|
|
xml += "<ram:LineThree>" + XMLTools.encodeXML(party.getAdditionalAddressExtension())
|
|
|
|
+ "</ram:LineThree>";
|
|
|
|
+ "</ram:LineThree>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (party.getLocation() != null) {
|
|
|
|
xml += "<ram:CityName>" + XMLTools.encodeXML(party.getLocation())
|
|
|
|
xml += "<ram:CityName>" + XMLTools.encodeXML(party.getLocation())
|
|
|
|
+ "</ram:CityName>"
|
|
|
|
+ "</ram:CityName>";
|
|
|
|
+ "<ram:CountryID>" + XMLTools.encodeXML(party.getCountry())
|
|
|
|
}
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
//country IS mandatory
|
|
|
|
|
|
|
|
xml += "<ram:CountryID>" + XMLTools.encodeXML(party.getCountry())
|
|
|
|
+ "</ram:CountryID>"
|
|
|
|
+ "</ram:CountryID>"
|
|
|
|
+ "</ram:PostalTradeAddress>";
|
|
|
|
+ "</ram:PostalTradeAddress>";
|
|
|
|
|
|
|
|
|
|
|
|
if ((party.getVATID() != null) && (!isShipToTradeParty)) {
|
|
|
|
if ((party.getVATID() != null) && (!isShipToTradeParty)) {
|
|
|
|
xml += "<ram:SpecifiedTaxRegistration>"
|
|
|
|
xml += "<ram:SpecifiedTaxRegistration>"
|
|
|
|
+ "<ram:ID schemeID=\"VA\">" + XMLTools.encodeXML(party.getVATID())
|
|
|
|
+ "<ram:ID schemeID=\"VA\">" + XMLTools.encodeXML(party.getVATID())
|
|
|
|
@@ -273,7 +281,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
paymentTermsDescription = XMLTools.encodeXML(trans.getPaymentTermDescription());
|
|
|
|
paymentTermsDescription = XMLTools.encodeXML(trans.getPaymentTermDescription());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ((paymentTermsDescription == null) && (trans.getDocumentCode() != CORRECTEDINVOICE)/* && (trans.getDocumentCode() != DocumentCodeTypeConstants.CREDITNOTE)*/) {
|
|
|
|
if ((paymentTermsDescription == null) && (trans.getDocumentCode() != DocumentCodeTypeConstants.CORRECTEDINVOICE) && (trans.getDocumentCode() != DocumentCodeTypeConstants.CREDITNOTE)) {
|
|
|
|
paymentTermsDescription = "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate());
|
|
|
|
paymentTermsDescription = "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate());
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -357,6 +365,8 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
final LineCalculator lc = new LineCalculator(currentItem);
|
|
|
|
final LineCalculator lc = new LineCalculator(currentItem);
|
|
|
|
|
|
|
|
if ((getProfile() != Profiles.getByName("Minimum")) && (getProfile() != Profiles.getByName("BasicWL"))) {
|
|
|
|
|
|
|
|
|
|
|
|
xml += "<ram:IncludedSupplyChainTradeLineItem>" +
|
|
|
|
xml += "<ram:IncludedSupplyChainTradeLineItem>" +
|
|
|
|
"<ram:AssociatedDocumentLineDocument>"
|
|
|
|
"<ram:AssociatedDocumentLineDocument>"
|
|
|
|
+ "<ram:LineID>" + lineID + "</ram:LineID>"
|
|
|
|
+ "<ram:LineID>" + lineID + "</ram:LineID>"
|
|
|
|
@@ -365,7 +375,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
|
|
|
|
|
|
|
|
+ "<ram:SpecifiedTradeProduct>";
|
|
|
|
+ "<ram:SpecifiedTradeProduct>";
|
|
|
|
if ((currentItem.getProduct().getGlobalIDScheme() != null) && (currentItem.getProduct().getGlobalID() != null)) {
|
|
|
|
if ((currentItem.getProduct().getGlobalIDScheme() != null) && (currentItem.getProduct().getGlobalID() != null)) {
|
|
|
|
xml += "<ram:GlobalID schemeID=\""+XMLTools.encodeXML(currentItem.getProduct().getGlobalIDScheme())+"\">"+XMLTools.encodeXML(currentItem.getProduct().getGlobalID())+"</ram:GlobalID>";
|
|
|
|
xml += "<ram:GlobalID schemeID=\"" + XMLTools.encodeXML(currentItem.getProduct().getGlobalIDScheme()) + "\">" + XMLTools.encodeXML(currentItem.getProduct().getGlobalID()) + "</ram:GlobalID>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
|
|
|
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
|
|
|
@@ -474,6 +484,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xml += "</ram:SpecifiedLineTradeSettlement>"
|
|
|
|
xml += "</ram:SpecifiedLineTradeSettlement>"
|
|
|
|
+ "</ram:IncludedSupplyChainTradeLineItem>";
|
|
|
|
+ "</ram:IncludedSupplyChainTradeLineItem>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -534,24 +545,28 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xml += " </ram:SpecifiedProcuringProject>";
|
|
|
|
xml += " </ram:SpecifiedProcuringProject>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xml += "</ram:ApplicableHeaderTradeAgreement>"
|
|
|
|
xml += "</ram:ApplicableHeaderTradeAgreement>";
|
|
|
|
+ "<ram:ApplicableHeaderTradeDelivery>";
|
|
|
|
xml += "<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>"
|
|
|
|
|
|
|
|
+ "<ram:OccurrenceDateTime>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (trans.getDeliveryDate() != null) {
|
|
|
|
if (trans.getDeliveryDate() != null) {
|
|
|
|
|
|
|
|
xml += "<ram:ActualDeliverySupplyChainEvent>"
|
|
|
|
|
|
|
|
+ "<ram:OccurrenceDateTime>";
|
|
|
|
xml += DATE.udtFormat(trans.getDeliveryDate());
|
|
|
|
xml += DATE.udtFormat(trans.getDeliveryDate());
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw new IllegalStateException("No delivery date provided");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
xml += "</ram:OccurrenceDateTime>";
|
|
|
|
xml += "</ram:OccurrenceDateTime>";
|
|
|
|
xml += " </ram:ActualDeliverySupplyChainEvent>";
|
|
|
|
xml += " </ram:ActualDeliverySupplyChainEvent>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (trans.getDocumentCode() != DocumentCodeTypeConstants.CREDITNOTE) {
|
|
|
|
|
|
|
|
throw new IllegalStateException("No delivery date provided");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* + "<DeliveryNoteReferencedDocument>" +
|
|
|
|
* + "<DeliveryNoteReferencedDocument>" +
|
|
|
|
* "<IssueDateTime format=\"102\">20130603</IssueDateTime>" +
|
|
|
|
* "<IssueDateTime format=\"102\">20130603</IssueDateTime>" +
|
|
|
|
@@ -560,33 +575,41 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (trans.getDespatchAdviceReferencedDocumentID() != null) {
|
|
|
|
if (trans.getDespatchAdviceReferencedDocumentID() != null) {
|
|
|
|
xml += "<ram:DespatchAdviceReferencedDocument>";
|
|
|
|
xml += "<ram:DespatchAdviceReferencedDocument>";
|
|
|
|
xml += "<ram:IssuerAssignedID>"+XMLTools.encodeXML(trans.getDespatchAdviceReferencedDocumentID())+"</ram:IssuerAssignedID>";
|
|
|
|
xml += "<ram:IssuerAssignedID>" + XMLTools.encodeXML(trans.getDespatchAdviceReferencedDocumentID()) + "</ram:IssuerAssignedID>";
|
|
|
|
xml += "</ram:DespatchAdviceReferencedDocument>";
|
|
|
|
xml += "</ram:DespatchAdviceReferencedDocument>";
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xml += " </ram:ApplicableHeaderTradeDelivery> <ram:ApplicableHeaderTradeSettlement>"
|
|
|
|
|
|
|
|
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>"
|
|
|
|
xml += "</ram:ApplicableHeaderTradeDelivery>";
|
|
|
|
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>";
|
|
|
|
xml += "<ram:ApplicableHeaderTradeSettlement>";
|
|
|
|
|
|
|
|
if ((trans.getNumber() != null) && (getProfile() != Profiles.getByName("Minimum"))) {
|
|
|
|
|
|
|
|
xml += " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
xml += " <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()) {
|
|
|
|
if (payment != null) {
|
|
|
|
if (payment != null) {
|
|
|
|
hasDueDate = true;
|
|
|
|
hasDueDate = true;
|
|
|
|
|
|
|
|
if (getProfile() != Profiles.getByName("Minimum")) {
|
|
|
|
xml += payment.getSettlementXML();
|
|
|
|
xml += payment.getSettlementXML();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (trans.getTradeSettlement() != null) {
|
|
|
|
if (trans.getTradeSettlement() != null) {
|
|
|
|
for (final IZUGFeRDTradeSettlement payment : trans.getTradeSettlement()) {
|
|
|
|
for (final IZUGFeRDTradeSettlement payment : trans.getTradeSettlement()) {
|
|
|
|
if (payment != null) {
|
|
|
|
if (payment != null) {
|
|
|
|
if (payment instanceof IZUGFeRDTradeSettlementPayment) {
|
|
|
|
if (payment instanceof IZUGFeRDTradeSettlementPayment) {
|
|
|
|
hasDueDate = true;
|
|
|
|
hasDueDate = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (getProfile() != Profiles.getByName("Minimum")) {
|
|
|
|
xml += payment.getSettlementXML();
|
|
|
|
xml += payment.getSettlementXML();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((trans.getDocumentCode() == CORRECTEDINVOICE)/*||(trans.getDocumentCode() == DocumentCodeTypeConstants.CREDITNOTE)*/) {
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((trans.getDocumentCode() == DocumentCodeTypeConstants.CORRECTEDINVOICE) || (trans.getDocumentCode() == DocumentCodeTypeConstants.CREDITNOTE)) {
|
|
|
|
hasDueDate = false;
|
|
|
|
hasDueDate = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -596,6 +619,8 @@ 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);
|
|
|
|
|
|
|
|
if (getProfile() != Profiles.getByName("Minimum")) {
|
|
|
|
|
|
|
|
|
|
|
|
xml += "<ram:ApplicableTradeTax>"
|
|
|
|
xml += "<ram:ApplicableTradeTax>"
|
|
|
|
+ "<ram:CalculatedAmount>" + currencyFormat(amount.getCalculated())
|
|
|
|
+ "<ram:CalculatedAmount>" + currencyFormat(amount.getCalculated())
|
|
|
|
+ "</ram:CalculatedAmount>" //currencyID=\"EUR\"
|
|
|
|
+ "</ram:CalculatedAmount>" //currencyID=\"EUR\"
|
|
|
|
@@ -607,6 +632,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
+ vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent></ram:ApplicableTradeTax>";
|
|
|
|
+ vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent></ram:ApplicableTradeTax>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if ((trans.getDetailedDeliveryPeriodFrom() != null) || (trans.getDetailedDeliveryPeriodTo() != null)) {
|
|
|
|
if ((trans.getDetailedDeliveryPeriodFrom() != null) || (trans.getDetailedDeliveryPeriodTo() != null)) {
|
|
|
|
xml += "<ram:BillingSpecifiedPeriod>";
|
|
|
|
xml += "<ram:BillingSpecifiedPeriod>";
|
|
|
|
if (trans.getDetailedDeliveryPeriodFrom() != null) {
|
|
|
|
if (trans.getDetailedDeliveryPeriodFrom() != null) {
|
|
|
|
@@ -660,7 +686,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ((trans.getPaymentTerms() == null) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) {
|
|
|
|
if ((trans.getPaymentTerms() == null) && (getProfile() != Profiles.getByName("Minimum")) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) {
|
|
|
|
xml += "<ram:SpecifiedTradePaymentTerms>";
|
|
|
|
xml += "<ram:SpecifiedTradePaymentTerms>";
|
|
|
|
|
|
|
|
|
|
|
|
if (paymentTermsDescription != null) {
|
|
|
|
if (paymentTermsDescription != null) {
|
|
|
|
@@ -691,20 +717,24 @@ 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 += "<ram:SpecifiedTradeSettlementHeaderMonetarySummation>"
|
|
|
|
xml += "<ram:SpecifiedTradeSettlementHeaderMonetarySummation>";
|
|
|
|
+ "<ram:LineTotalAmount>" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>"
|
|
|
|
if (getProfile() != Profiles.getByName("Minimum")) {
|
|
|
|
+ chargesTotalLine
|
|
|
|
xml += "<ram:LineTotalAmount>" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>";
|
|
|
|
+ allowanceTotalLine
|
|
|
|
xml += chargesTotalLine
|
|
|
|
+ "<ram:TaxBasisTotalAmount>" + currencyFormat(calc.getTaxBasis()) + "</ram:TaxBasisTotalAmount>"
|
|
|
|
+ allowanceTotalLine;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
xml += "<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>"
|
|
|
|
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTaxBasis())) + "</ram:TaxTotalAmount>"
|
|
|
|
+ "<ram:GrandTotalAmount>" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>"
|
|
|
|
+ "<ram:GrandTotalAmount>" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>";
|
|
|
|
// //
|
|
|
|
// //
|
|
|
|
// currencyID=\"EUR\"
|
|
|
|
// currencyID=\"EUR\"
|
|
|
|
+ " <ram:TotalPrepaidAmount>" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>"
|
|
|
|
if (getProfile() != Profiles.getByName("Minimum")) {
|
|
|
|
+ "<ram:DuePayableAmount>" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>"
|
|
|
|
xml+=" <ram:TotalPrepaidAmount>" + currencyFormat(calc.getTotalPrepaid()) + "</ram:TotalPrepaidAmount>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
xml+= "<ram:DuePayableAmount>" + currencyFormat(calc.getGrandTotal().subtract(calc.getTotalPrepaid())) + "</ram:DuePayableAmount>"
|
|
|
|
+ "</ram:SpecifiedTradeSettlementHeaderMonetarySummation>";
|
|
|
|
+ "</ram:SpecifiedTradeSettlementHeaderMonetarySummation>";
|
|
|
|
if (trans.getInvoiceReferencedDocumentID() != null) {
|
|
|
|
if (trans.getInvoiceReferencedDocumentID() != null) {
|
|
|
|
xml += " <ram:InvoiceReferencedDocument>"
|
|
|
|
xml += " <ram:InvoiceReferencedDocument>"
|
|
|
|
|