some charges/allowance changes
This commit is contained in:
16
library/src/main/java/org/mustangproject/Allowance.java
Normal file
16
library/src/main/java/org/mustangproject/Allowance.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Allowance extends Charge implements IZUGFeRDAllowanceCharge {
|
||||
|
||||
public Allowance() {
|
||||
|
||||
}
|
||||
public Allowance(BigDecimal totalAmount, BigDecimal taxPercent, String reason, String categoryCode) {
|
||||
super(totalAmount, taxPercent, reason, categoryCode);
|
||||
|
||||
}
|
||||
}
|
||||
74
library/src/main/java/org/mustangproject/Charge.java
Normal file
74
library/src/main/java/org/mustangproject/Charge.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableProduct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
|
||||
protected BigDecimal percent;
|
||||
protected BigDecimal totalAmount;
|
||||
protected BigDecimal taxPercent;
|
||||
protected String reason;
|
||||
protected String categoryCode;
|
||||
|
||||
public Charge() {
|
||||
|
||||
}
|
||||
|
||||
public Charge(BigDecimal totalAmount, BigDecimal taxPercent, String reason, String categoryCode) {
|
||||
this.totalAmount = totalAmount;
|
||||
this.taxPercent = taxPercent;
|
||||
this.reason = reason;
|
||||
this.categoryCode = categoryCode;
|
||||
}
|
||||
|
||||
|
||||
public Charge setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Charge setPercent(BigDecimal percent) {
|
||||
this.percent = percent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Charge setTaxPercent(BigDecimal taxPercent) {
|
||||
this.taxPercent = taxPercent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Charge setReason(String reason) {
|
||||
this.reason = reason;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Charge setCategoryCode(String categoryCode) {
|
||||
this.categoryCode = categoryCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BigDecimal getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getTaxPercent() {
|
||||
return taxPercent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategoryCode() {
|
||||
return categoryCode;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -402,6 +402,22 @@ 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
|
||||
* @return
|
||||
*/
|
||||
public boolean isValid() {
|
||||
return (dueDate != null) && (ownZIP != null) && (ownStreet != null) && (ownLocation != null) && (ownCountry != null) && (ownTaxID != null) && (ownVATID != null) && (recipient != null);
|
||||
//contact
|
||||
|
||||
@@ -25,6 +25,16 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user