closiong #247
This commit is contained in:
@@ -14,6 +14,7 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
protected BigDecimal price, quantity, tax, grossPrice, lineTotalAmount;
|
||||
protected Date detailedDeliveryPeriodFrom=null, detailedDeliveryPeriodTo=null;
|
||||
protected String id;
|
||||
protected String referencedLineID=null;
|
||||
protected Product product;
|
||||
protected ArrayList<String> notes = null;
|
||||
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(),
|
||||
@@ -31,6 +32,21 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
|
||||
public Item addReferencedLineID(String s) {
|
||||
referencedLineID=s;
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* BT 132 (issue https://github.com/ZUGFeRD/mustangproject/issues/247)
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getBuyerOrderReferencedDocumentLineID() {
|
||||
return referencedLineID;
|
||||
}
|
||||
|
||||
public BigDecimal getLineTotalAmount() {
|
||||
return lineTotalAmount;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,15 @@ public interface IZUGFeRDExportableItem extends IAbsoluteValueProvider{
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* BT 132 (issue https://github.com/ZUGFeRD/mustangproject/issues/247)
|
||||
* @return
|
||||
*/
|
||||
default String getBuyerOrderReferencedDocumentLineID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The price of one item excl. taxes
|
||||
*
|
||||
|
||||
@@ -350,8 +350,14 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
+ "</ram:Description>\n"
|
||||
+ " </ram:SpecifiedTradeProduct>\n"
|
||||
|
||||
+ " <ram:SpecifiedLineTradeAgreement>\n"
|
||||
+ " <ram:GrossPriceProductTradePrice>\n"
|
||||
+ " <ram:SpecifiedLineTradeAgreement>\n";
|
||||
if (currentItem.getBuyerOrderReferencedDocumentLineID() != null) {
|
||||
xml = xml + " <ram:BuyerOrderReferencedDocument> \n"
|
||||
+ " <ram:LineID>"+XMLTools.encodeXML(currentItem.getBuyerOrderReferencedDocumentLineID())+"</ram:LineID>\n"
|
||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
||||
|
||||
}
|
||||
xml = xml + " <ram:GrossPriceProductTradePrice>\n"
|
||||
+ " <ram:ChargeAmount>" + priceFormat(lc.getPriceGross())
|
||||
+ "</ram:ChargeAmount>\n" //currencyID=\"EUR\"
|
||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||
@@ -512,17 +518,17 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
for (final BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
final VATAmount amount = VATPercentAmountMap.get(currentTaxPercent);
|
||||
if (amount != null) {
|
||||
final String amountCategoryCode = amount.getCategoryCode();
|
||||
final boolean displayExemptionReason = CATEGORY_CODES_WITH_EXEMPTION_REASON.contains(amountCategoryCode);
|
||||
xml += " <ram:ApplicableTradeTax>\n"
|
||||
+ " <ram:CalculatedAmount>" + currencyFormat(amount.getCalculated())
|
||||
+ "</ram:CalculatedAmount>\n" //currencyID=\"EUR\"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
||||
+ (displayExemptionReason ? exemptionReason : "")
|
||||
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||
+ " <ram:CategoryCode>" + amountCategoryCode + "</ram:CategoryCode>\n"
|
||||
+ " <ram:RateApplicablePercent>"
|
||||
+ vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n" ;
|
||||
final String amountCategoryCode = amount.getCategoryCode();
|
||||
final boolean displayExemptionReason = CATEGORY_CODES_WITH_EXEMPTION_REASON.contains(amountCategoryCode);
|
||||
xml += " <ram:ApplicableTradeTax>\n"
|
||||
+ " <ram:CalculatedAmount>" + currencyFormat(amount.getCalculated())
|
||||
+ "</ram:CalculatedAmount>\n" //currencyID=\"EUR\"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
||||
+ (displayExemptionReason ? exemptionReason : "")
|
||||
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||
+ " <ram:CategoryCode>" + amountCategoryCode + "</ram:CategoryCode>\n"
|
||||
+ " <ram:RateApplicablePercent>"
|
||||
+ vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n";
|
||||
}
|
||||
}
|
||||
if ((trans.getDetailedDeliveryPeriodFrom() != null) || (trans.getDetailedDeliveryPeriodTo() != null)) {
|
||||
|
||||
Reference in New Issue
Block a user