closes #172, fixes zero rated products, added some lines to the test of the XRechnung, have the XRechnung test actually wriote to file and have the XR test file validated automatically
This commit is contained in:
@@ -26,8 +26,6 @@ package org.mustangproject.ZUGFeRD;
|
||||
* @author jstaerk
|
||||
* */
|
||||
|
||||
import org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public interface IZUGFeRDExportableItem extends IAbsoluteValueProvider{
|
||||
@@ -74,10 +72,6 @@ public interface IZUGFeRDExportableItem extends IAbsoluteValueProvider{
|
||||
return BigDecimal.ONE.setScale(4);
|
||||
}
|
||||
|
||||
default String getCategoryCode() {
|
||||
return TaxCategoryCodeTypeConstants.STANDARDRATE;
|
||||
}
|
||||
|
||||
/***
|
||||
* the ID of an additionally referenced document for this item
|
||||
* @return the id as string
|
||||
|
||||
@@ -106,11 +106,12 @@ public interface IZUGFeRDExportableProduct {
|
||||
}
|
||||
|
||||
default String getTaxCategoryCode() {
|
||||
if (isIntraCommunitySupply()) {
|
||||
if (getVATPercent().equals(new BigDecimal(0))) {
|
||||
return "Z"; // zero rated goods
|
||||
} else if (isIntraCommunitySupply()) {
|
||||
return "K";
|
||||
} else {
|
||||
return "S";
|
||||
|
||||
return "S"; // one of the "standard" rates (not neccessarily a default rate, even a deducted VAT is standard calculation)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public class TransactionCalculator implements IAbsoluteValueProvider {
|
||||
BigDecimal percent = currentItem.getProduct().getVATPercent();
|
||||
LineCalculator lc = new LineCalculator(currentItem);
|
||||
VATAmount itemVATAmount = new VATAmount(lc.getItemTotalNetAmount(), lc.getItemTotalVATAmount(),
|
||||
currentItem.getCategoryCode());
|
||||
currentItem.getProduct().getTaxCategoryCode());
|
||||
VATAmount current = hm.get(percent);
|
||||
if (current == null) {
|
||||
hm.put(percent, itemVATAmount);
|
||||
|
||||
Reference in New Issue
Block a user