Merge branch 'master' of github.com:ZUGFeRD/mustangproject
# Conflicts: # library/src/main/java/org/mustangproject/Allowance.java # library/src/main/java/org/mustangproject/Charge.java # library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableProduct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -40,13 +39,14 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Charge setReason(String reason) {
|
||||
this.reason = reason;
|
||||
return this;
|
||||
|
||||
@Override
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public Charge setCategoryCode(String categoryCode) {
|
||||
this.categoryCode = categoryCode;
|
||||
public Charge setReason(String reason) {
|
||||
this.reason = reason;
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -56,19 +56,15 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getTaxPercent() {
|
||||
return taxPercent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategoryCode() {
|
||||
return categoryCode;
|
||||
}
|
||||
|
||||
public Charge setCategoryCode(String categoryCode) {
|
||||
this.categoryCode = categoryCode;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,10 @@ public class Invoice implements IExportableTransaction {
|
||||
protected BigDecimal totalPrepaidAmount = null;
|
||||
protected IZUGFeRDExportableContact ownContact = null, recipient = null, deliveryAddress = null;
|
||||
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
|
||||
protected String contractReferencedDocument = null;
|
||||
|
||||
protected IZUGFeRDAllowanceCharge[] ZFAllowances = null, ZFCharges = null, ZFLogisticsServiceCharges = null;
|
||||
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(),
|
||||
Charges = new ArrayList<IZUGFeRDAllowanceCharge>(), LogisticsServiceCharges = new ArrayList<IZUGFeRDAllowanceCharge>();
|
||||
protected IZUGFeRDTradeSettlement[] getTradeSettlement = null;
|
||||
protected IZUGFeRDPaymentTerms paymentTerms = null;
|
||||
|
||||
@@ -49,6 +51,8 @@ public class Invoice implements IExportableTransaction {
|
||||
return documentName;
|
||||
}
|
||||
|
||||
public String getContractReferencedDocument() { return contractReferencedDocument; }
|
||||
|
||||
public Invoice setDocumentName(String documentName) {
|
||||
this.documentName = documentName;
|
||||
return this;
|
||||
@@ -334,33 +338,30 @@ public class Invoice implements IExportableTransaction {
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFAllowances() {
|
||||
return ZFAllowances;
|
||||
if (Allowances.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Allowances.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public Invoice setZFAllowances(IZUGFeRDAllowanceCharge[] ZFAllowances) {
|
||||
this.ZFAllowances = ZFAllowances;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFCharges() {
|
||||
return ZFCharges;
|
||||
if (Charges.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Charges.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public Invoice setZFCharges(IZUGFeRDAllowanceCharge[] ZFCharges) {
|
||||
this.ZFCharges = ZFCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges() {
|
||||
return ZFLogisticsServiceCharges;
|
||||
if (LogisticsServiceCharges.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return LogisticsServiceCharges.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public Invoice setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge[] ZFLogisticsServiceCharges) {
|
||||
this.ZFLogisticsServiceCharges = ZFLogisticsServiceCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDTradeSettlement[] getGetTradeSettlement() {
|
||||
return getTradeSettlement;
|
||||
@@ -403,16 +404,6 @@ public class Invoice implements IExportableTransaction {
|
||||
|
||||
|
||||
|
||||
public Invoice addCharge(IZUGFeRDAllowanceCharge charge) {
|
||||
//@todo
|
||||
return this;
|
||||
}
|
||||
|
||||
public Invoice addAllowance(IZUGFeRDAllowanceCharge allowance) {
|
||||
//@todo
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* checks if all required items are set in order to be able to export it
|
||||
@@ -429,4 +420,17 @@ public class Invoice implements IExportableTransaction {
|
||||
// this.country = country;
|
||||
}
|
||||
|
||||
public Invoice addCharge(IZUGFeRDAllowanceCharge izac) {
|
||||
Charges.add(izac);
|
||||
return this;
|
||||
}
|
||||
public Invoice addAllowance(IZUGFeRDAllowanceCharge izac) {
|
||||
Allowances.add(izac);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Invoice setContractReferencedDocument(String s) {
|
||||
contractReferencedDocument=s;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,14 @@ import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableItem;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Item implements IZUGFeRDExportableItem {
|
||||
protected BigDecimal price, quantity, tax, grossPrice, lineTotalAmount;
|
||||
protected String id;
|
||||
protected Product product;
|
||||
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(),
|
||||
Charges = new ArrayList<IZUGFeRDAllowanceCharge>();
|
||||
|
||||
public Item(Product product, BigDecimal price, BigDecimal quantity) {
|
||||
this.price = price;
|
||||
@@ -25,16 +28,6 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Item addCharge(IZUGFeRDAllowanceCharge charge) {
|
||||
//@todo
|
||||
return this;
|
||||
}
|
||||
|
||||
public Item addAllowance(IZUGFeRDAllowanceCharge allowance) {
|
||||
//@todo
|
||||
return this;
|
||||
}
|
||||
|
||||
public BigDecimal getGrossPrice() {
|
||||
return grossPrice;
|
||||
}
|
||||
@@ -91,16 +84,32 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemAllowances() {
|
||||
return null;
|
||||
if (Allowances.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Allowances.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemCharges() {
|
||||
return null;
|
||||
if (Charges.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Charges.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public Item setProduct(Product product) {
|
||||
this.product = product;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Item addCharge(IZUGFeRDAllowanceCharge izac) {
|
||||
Charges.add(izac);
|
||||
return this;
|
||||
}
|
||||
public Item addAllowance(IZUGFeRDAllowanceCharge izac) {
|
||||
Allowances.add(izac);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,10 @@ public interface IExportableTransaction {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getContractReferencedDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* who processed the order
|
||||
|
||||
@@ -208,6 +208,9 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
||||
ensurePDFisUpgraded = false;
|
||||
}
|
||||
|
||||
public void attachFile(String filename, byte[] data, String mimetype, String relation) {
|
||||
//throw new RuntimeException("Not implemented");
|
||||
}
|
||||
|
||||
/***
|
||||
* Perform the final export to a now ZUGFeRD-enriched PDF file
|
||||
|
||||
Reference in New Issue
Block a user