support basisquantity in items
This commit is contained in:
@@ -15,7 +15,7 @@ import java.util.Date;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class Item implements IZUGFeRDExportableItem {
|
||||
protected BigDecimal price, quantity, tax, grossPrice, lineTotalAmount;
|
||||
protected BigDecimal price, quantity, basisQuantity, tax, grossPrice, lineTotalAmount;
|
||||
protected Date detailedDeliveryPeriodFrom=null, detailedDeliveryPeriodTo=null;
|
||||
protected String id;
|
||||
protected String referencedLineID=null;
|
||||
@@ -118,6 +118,17 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BigDecimal getBasisQuantity() {
|
||||
return basisQuantity;
|
||||
}
|
||||
|
||||
public Item setBasisQuantity(BigDecimal basis) {
|
||||
this.basisQuantity = basis;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public BigDecimal getQuantity() {
|
||||
|
||||
@@ -201,6 +201,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
|
||||
String price = "0";
|
||||
String basisQuantity = "1";
|
||||
String name = "";
|
||||
String description = "";
|
||||
SchemedID gid = null;
|
||||
@@ -260,6 +261,11 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
price = netChilds.item(netIndex).getTextContent();// ChargeAmount
|
||||
|
||||
}
|
||||
if ((netChilds.item(netIndex).getLocalName() != null)
|
||||
&& (netChilds.item(netIndex).getLocalName().equals("BasisQuantity"))) {
|
||||
basisQuantity = netChilds.item(netIndex).getTextContent();// ChargeAmount
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -351,6 +357,7 @@ public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
p.addGlobalID(gid);
|
||||
}
|
||||
Item it = new Item(p, prc, qty);
|
||||
it.setBasisQuantity(new BigDecimal(basisQuantity));
|
||||
if (rdocs != null) {
|
||||
for (ReferencedDocument rdoc : rdocs) {
|
||||
it.addReferencedDocument(rdoc);
|
||||
|
||||
Reference in New Issue
Block a user