support reverse charge
This commit is contained in:
@@ -10,6 +10,8 @@ import java.math.BigDecimal;
|
||||
public class Product implements IZUGFeRDExportableProduct {
|
||||
protected String unit, name, description, sellerAssignedID, buyerAssignedID;
|
||||
protected BigDecimal VATPercent;
|
||||
protected boolean isReverseCharge=false;
|
||||
protected boolean isIntraCommunitySupply=false;
|
||||
|
||||
/***
|
||||
* default constructor
|
||||
@@ -54,6 +56,37 @@ public class Product implements IZUGFeRDExportableProduct {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReverseCharge() {
|
||||
return isReverseCharge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isIntraCommunitySupply() {
|
||||
return isIntraCommunitySupply;
|
||||
}
|
||||
|
||||
/***
|
||||
* sets reverse charge(=delivery to outside EU)
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Product setReverseCharge() {
|
||||
isReverseCharge=true;
|
||||
setVATPercent(BigDecimal.ZERO);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* sets intra community supply(=delivery outside the country inside the EU)
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Product setIntraCommunitySupply() {
|
||||
isIntraCommunitySupply=true;
|
||||
setVATPercent(BigDecimal.ZERO);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
|
||||
@@ -108,10 +108,16 @@ public interface IZUGFeRDExportableProduct {
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isReverseCharge() {
|
||||
return false;
|
||||
}
|
||||
|
||||
default String getTaxCategoryCode() {
|
||||
if (isIntraCommunitySupply()) {
|
||||
return "K";
|
||||
} else if (getVATPercent().equals(new BigDecimal(0))) {
|
||||
return "K"; // within europe
|
||||
} else if (isReverseCharge()) {
|
||||
return "AE"; // to out of europe...
|
||||
} else if (getVATPercent().equals(BigDecimal.ZERO)) {
|
||||
return "Z"; // zero rated goods
|
||||
} else {
|
||||
return "S"; // one of the "standard" rates (not neccessarily a default rate, even a deducted VAT is standard calculation)
|
||||
@@ -119,8 +125,11 @@ public interface IZUGFeRDExportableProduct {
|
||||
}
|
||||
|
||||
default String getTaxExemptionReason() {
|
||||
if (isIntraCommunitySupply())
|
||||
if (isIntraCommunitySupply()) {
|
||||
return "Intra-community supply";
|
||||
} else if (isReverseCharge()) {
|
||||
return "Reverse Charge";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user