- include exemption reason if doing intra community supply

This commit is contained in:
Jochen Stärk
2019-12-07 20:01:05 +01:00
parent 7ee6d91d70
commit 02ae6fbff4
4 changed files with 21 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
- support different ship to address - support different ship to address
- allow for diffent namespace prefixes #140 - allow for diffent namespace prefixes #140
- include exemption reason if doing intra community supply
1.7.5 1.7.5
===== =====

View File

@@ -82,8 +82,17 @@ public interface IZUGFeRDExportableProduct {
*/ */
BigDecimal getVATPercent(); BigDecimal getVATPercent();
default String getTaxCategoryCode() { default boolean isIntraCommunitySupply() {
return "S"; return false;
}
default String getTaxCategoryCode() {
if (isIntraCommunitySupply()) {
return "K";
} else {
return "S";
}
} }

View File

@@ -250,6 +250,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
String taxCategoryCode=""; String taxCategoryCode="";
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$ SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$ SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
String exemptionReason="";
if (paymentTermsDescription==null) { if (paymentTermsDescription==null) {
paymentTermsDescription= "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate()); paymentTermsDescription= "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate());
@@ -311,6 +312,10 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) { for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
lineID++; lineID++;
taxCategoryCode=currentItem.getProduct().getTaxCategoryCode(); taxCategoryCode=currentItem.getProduct().getTaxCategoryCode();
if (currentItem.getProduct().isIntraCommunitySupply()) {
exemptionReason="<ram:ExemptionReason>Intra-community supply</ram:ExemptionReason>";
}
LineCalc lc = new LineCalc(currentItem); LineCalc lc = new LineCalc(currentItem);
xml = xml + " <ram:IncludedSupplyChainTradeLineItem>\n" + //$NON-NLS-1$ xml = xml + " <ram:IncludedSupplyChainTradeLineItem>\n" + //$NON-NLS-1$
" <ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$ " <ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$
@@ -353,6 +358,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
+ " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$ + " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$ + " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
+ " <ram:CategoryCode>"+currentItem.getProduct().getTaxCategoryCode()+"</ram:CategoryCode>\n" //$NON-NLS-1$ + " <ram:CategoryCode>"+currentItem.getProduct().getTaxCategoryCode()+"</ram:CategoryCode>\n" //$NON-NLS-1$
+ exemptionReason
+ " <ram:RateApplicablePercent>" //$NON-NLS-1$ + " <ram:RateApplicablePercent>" //$NON-NLS-1$
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n" //$NON-NLS-1$ + vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n" //$NON-NLS-1$
+ " </ram:ApplicableTradeTax>\n" //$NON-NLS-1$ + " </ram:ApplicableTradeTax>\n" //$NON-NLS-1$
@@ -486,6 +492,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$ + " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
+ " <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" //$NON-NLS-1$ + " <ram:CategoryCode>"+taxCategoryCode+"</ram:CategoryCode>\n" //$NON-NLS-1$
+ exemptionReason
+ " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) //$NON-NLS-1$ + " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) //$NON-NLS-1$
+ "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$ + "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$

View File

@@ -81,8 +81,8 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
} }
@Override @Override
public String getTaxCategoryCode() { public boolean isIntraCommunitySupply() {
return "K"; // simulate intra community supply return true; // simulate intra community supply
} }
} }