closes #148
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
1.7.7
|
||||
=====
|
||||
|
||||
- Refactored comparison operator for ChargeIndicator https://github.com/ZUGFeRD/mustangproject/pull/153
|
||||
- #148 support additional documents for items
|
||||
|
||||
1.7.6
|
||||
=====
|
||||
2020-02-06
|
||||
|
||||
- support different ship to address
|
||||
- allow for diffent namespace prefixes #140
|
||||
|
||||
@@ -56,5 +56,9 @@ public interface IZUGFeRDExportableItem {
|
||||
default String getCategoryCode() {
|
||||
return TaxCategoryCodeTypeConstants.STANDARDRATE;
|
||||
}
|
||||
|
||||
default String getAdditionalReferencedDocumentID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -357,16 +357,21 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
+ " <ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:CategoryCode>"+currentItem.getProduct().getTaxCategoryCode()+"</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
+ exemptionReason
|
||||
+ " <ram:CategoryCode>"+currentItem.getProduct().getTaxCategoryCode()+"</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
|
||||
+ " <ram:RateApplicablePercent>" //$NON-NLS-1$
|
||||
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n" //$NON-NLS-1$
|
||||
+ " </ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount()) //$NON-NLS-1$
|
||||
+ "</ram:LineTotalAmount>\n" //$NON-NLS-1$ // currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n"; //$NON-NLS-1$
|
||||
if (currentItem.getAdditionalReferencedDocumentID()!=null) {
|
||||
xml=xml + " <ram:AdditionalReferencedDocument><ram:IssuerAssignedID>"+currentItem.getAdditionalReferencedDocumentID()+"</ram:IssuerAssignedID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>\n"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
xml=xml + " </ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
@@ -490,9 +495,9 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
+ " <ram:CalculatedAmount>" + currencyFormat(amount.getCalculated()) //$NON-NLS-1$
|
||||
+ "</ram:CalculatedAmount>\n" //$NON-NLS-1$ //currencyID=\"EUR\"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ exemptionReason
|
||||
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||
+ " <ram:CategoryCode>"+taxCategoryCode+"</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
+ exemptionReason
|
||||
+ " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) //$NON-NLS-1$
|
||||
+ "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ import junit.framework.TestCase;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.MustangReaderTestCase.Item;
|
||||
|
||||
public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRDExportableTransaction {
|
||||
|
||||
public MustangReaderTestCase(String testName) {
|
||||
@@ -134,6 +136,11 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
|
||||
private BigDecimal price, quantity;
|
||||
private IZUGFeRDExportableProduct product;
|
||||
private String addReference=null;
|
||||
|
||||
public String getAdditionalReferencedDocumentID() {
|
||||
return addReference;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getPrice() {
|
||||
@@ -172,6 +179,15 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getAddReference() {
|
||||
return addReference;
|
||||
}
|
||||
|
||||
public void setAddReference(String addReference) {
|
||||
this.addReference = addReference;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected class Product implements IZUGFeRDExportableProduct {
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.GregorianCalendar;
|
||||
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.ZUGFeRD.MustangReaderTestCase.Item;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
@@ -202,7 +203,9 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
// 103
|
||||
EdgeProduct airProduct = new EdgeProduct("", "Heiße Luft pro Liter", "LTR");
|
||||
|
||||
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||
Item design=new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||
design.setAddReference("1825");
|
||||
allItems[0] = design;
|
||||
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
||||
return allItems;
|
||||
|
||||
Reference in New Issue
Block a user