Merge pull request #187 from weclapp-zugferd/CategoryCodeFix
Correct tax category code
This commit is contained in:
@@ -146,7 +146,7 @@ public class TransactionCalculator implements IAbsoluteValueProvider {
|
|||||||
BigDecimal percent = currentItem.getProduct().getVATPercent();
|
BigDecimal percent = currentItem.getProduct().getVATPercent();
|
||||||
LineCalculator lc = new LineCalculator(currentItem);
|
LineCalculator lc = new LineCalculator(currentItem);
|
||||||
VATAmount itemVATAmount = new VATAmount(lc.getItemTotalNetAmount(), lc.getItemTotalVATAmount(),
|
VATAmount itemVATAmount = new VATAmount(lc.getItemTotalNetAmount(), lc.getItemTotalVATAmount(),
|
||||||
trans.getDocumentCode());
|
currentItem.getCategoryCode());
|
||||||
VATAmount current = hm.get(percent);
|
VATAmount current = hm.get(percent);
|
||||||
if (current == null) {
|
if (current == null) {
|
||||||
hm.put(percent, itemVATAmount);
|
hm.put(percent, itemVATAmount);
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
this.calc=new TransactionCalculator(trans);
|
this.calc=new TransactionCalculator(trans);
|
||||||
|
|
||||||
boolean hasDueDate=false;
|
boolean hasDueDate=false;
|
||||||
String taxCategoryCode="";
|
|
||||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||||
String exemptionReason="";
|
String exemptionReason="";
|
||||||
|
|
||||||
@@ -261,7 +260,7 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
||||||
+ exemptionReason
|
+ exemptionReason
|
||||||
+ " <ram:BasisAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
+ " <ram:BasisAmount currencyID=\"" + trans.getCurrency() + "\">" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||||
+ " <ram:CategoryCode>"+taxCategoryCode+"</ram:CategoryCode>\n"
|
+ " <ram:CategoryCode>"+amount.getCategoryCode()+"</ram:CategoryCode>\n"
|
||||||
+ " <ram:ApplicablePercent>" + vatFormat(currentTaxPercent)
|
+ " <ram:ApplicablePercent>" + vatFormat(currentTaxPercent)
|
||||||
+ "</ram:ApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$
|
+ "</ram:ApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$
|
||||||
|
|
||||||
@@ -318,7 +317,6 @@ public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLPr
|
|||||||
int lineID = 0;
|
int lineID = 0;
|
||||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||||
lineID++;
|
lineID++;
|
||||||
taxCategoryCode=currentItem.getProduct().getTaxCategoryCode();
|
|
||||||
if (currentItem.getProduct().getTaxExemptionReason() != null) {
|
if (currentItem.getProduct().getTaxExemptionReason() != null) {
|
||||||
exemptionReason="<ram:ExemptionReason>" + XMLTools.encodeXML(currentItem.getProduct().getTaxExemptionReason()) + "</ram:ExemptionReason>";
|
exemptionReason="<ram:ExemptionReason>" + XMLTools.encodeXML(currentItem.getProduct().getTaxExemptionReason()) + "</ram:ExemptionReason>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -218,7 +218,6 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
this.calc = new TransactionCalculator(trans);
|
this.calc = new TransactionCalculator(trans);
|
||||||
|
|
||||||
boolean hasDueDate = false;
|
boolean hasDueDate = false;
|
||||||
String taxCategoryCode = "";
|
|
||||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||||
|
|
||||||
String exemptionReason = "";
|
String exemptionReason = "";
|
||||||
@@ -298,7 +297,6 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
int lineID = 0;
|
int lineID = 0;
|
||||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||||
lineID++;
|
lineID++;
|
||||||
taxCategoryCode = currentItem.getProduct().getTaxCategoryCode();
|
|
||||||
if (currentItem.getProduct().getTaxExemptionReason() != null) {
|
if (currentItem.getProduct().getTaxExemptionReason() != null) {
|
||||||
exemptionReason = "<ram:ExemptionReason>" + XMLTools.encodeXML(currentItem.getProduct().getTaxExemptionReason()) + "</ram:ExemptionReason>";
|
exemptionReason = "<ram:ExemptionReason>" + XMLTools.encodeXML(currentItem.getProduct().getTaxExemptionReason()) + "</ram:ExemptionReason>";
|
||||||
}
|
}
|
||||||
@@ -492,7 +490,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
||||||
+ exemptionReason
|
+ exemptionReason
|
||||||
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||||
+ " <ram:CategoryCode>" + taxCategoryCode + "</ram:CategoryCode>\n"
|
+ " <ram:CategoryCode>" + amount.getCategoryCode() + "</ram:CategoryCode>\n"
|
||||||
+ " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent)
|
+ " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent)
|
||||||
+ "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$
|
+ "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user