Merge branch 'ZUGFeRD:master' into master
This commit is contained in:
@@ -182,7 +182,6 @@ public class Item implements IZUGFeRDExportableItem {
|
|||||||
icnm.getAllNodes("AdditionalReferencedDocument").map(ReferencedDocument::fromNode).forEach(this::addAdditionalReference);
|
icnm.getAllNodes("AdditionalReferencedDocument").map(ReferencedDocument::fromNode).forEach(this::addAdditionalReference);
|
||||||
});
|
});
|
||||||
|
|
||||||
itemMap.getAsString("Note").ifPresent(this::addNote);
|
|
||||||
itemMap.getAsNodeMap("AssociatedDocumentLineDocument").ifPresent(adld -> {
|
itemMap.getAsNodeMap("AssociatedDocumentLineDocument").ifPresent(adld -> {
|
||||||
List<IncludedNote> includedNotes = new ArrayList<>();
|
List<IncludedNote> includedNotes = new ArrayList<>();
|
||||||
adld.getAllNodes("IncludedNote").forEach(item -> {
|
adld.getAllNodes("IncludedNote").forEach(item -> {
|
||||||
@@ -233,6 +232,11 @@ public class Item implements IZUGFeRDExportableItem {
|
|||||||
return lineTotalAmount;
|
return lineTotalAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Item setNotesWithSubjectCode(List<IncludedNote> theList) {
|
||||||
|
includedNotes=theList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* should only be set by calculator classes or maybe when reading from XML
|
* should only be set by calculator classes or maybe when reading from XML
|
||||||
*
|
*
|
||||||
@@ -378,6 +382,13 @@ public class Item implements IZUGFeRDExportableItem {
|
|||||||
notes = new ArrayList<>();
|
notes = new ArrayList<>();
|
||||||
}
|
}
|
||||||
notes.add(text);
|
notes.add(text);
|
||||||
|
|
||||||
|
if (includedNotes == null) {
|
||||||
|
includedNotes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
includedNotes.add(IncludedNote.unspecifiedNote(text));
|
||||||
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.mustangproject.*;
|
import org.mustangproject.*;
|
||||||
import org.junit.FixMethodOrder;
|
import org.junit.FixMethodOrder;
|
||||||
@@ -138,6 +139,7 @@ public class ZF2PushTest extends TestCase {
|
|||||||
|
|
||||||
String senderDescription = "Kleinunternehmer";
|
String senderDescription = "Kleinunternehmer";
|
||||||
String taxID = "9990815";
|
String taxID = "9990815";
|
||||||
|
String theNote="oh lala";
|
||||||
BigDecimal price = new BigDecimal(priceStr);
|
BigDecimal price = new BigDecimal(priceStr);
|
||||||
try {
|
try {
|
||||||
InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||||
@@ -155,7 +157,7 @@ public class ZF2PushTest extends TestCase {
|
|||||||
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE4711")
|
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE4711")
|
||||||
.setContact(new Contact("Franz Müller", "01779999999", "franz@mueller.de", "teststr. 12", "55232", "Entenhausen", "DE")))
|
.setContact(new Contact("Franz Müller", "01779999999", "franz@mueller.de", "teststr. 12", "55232", "Entenhausen", "DE")))
|
||||||
.setNumber(number)
|
.setNumber(number)
|
||||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)).setTaxExemptionReason("Kleinunternehmer gemäß §19 UStG").setTaxCategoryCode("E"), price, new BigDecimal(1.0)))
|
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)).setTaxExemptionReason("Kleinunternehmer gemäß §19 UStG").setTaxCategoryCode("E"), price, new BigDecimal(1.0)).addNote(theNote))
|
||||||
);
|
);
|
||||||
String theXML = new String(ze.getProvider().getXML());
|
String theXML = new String(ze.getProvider().getXML());
|
||||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||||
@@ -172,6 +174,8 @@ public class ZF2PushTest extends TestCase {
|
|||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assertEquals(i.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),theNote);
|
||||||
assertEquals(senderDescription, i.getSender().getDescription());
|
assertEquals(senderDescription, i.getSender().getDescription());
|
||||||
|
|
||||||
// now check the contents (like MustangReaderTest)
|
// now check the contents (like MustangReaderTest)
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
// Reading ZUGFeRD
|
// Reading ZUGFeRD
|
||||||
assertEquals("Bei Spiel GmbH", invoice.getOwnOrganisationName());
|
assertEquals("Bei Spiel GmbH", invoice.getOwnOrganisationName());
|
||||||
assertEquals(3, invoice.getZFItems().length);
|
assertEquals(3, invoice.getZFItems().length);
|
||||||
|
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),"Something");
|
||||||
|
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(),1);
|
||||||
assertEquals("400", invoice.getZFItems()[1].getQuantity().toString());
|
assertEquals("400", invoice.getZFItems()[1].getQuantity().toString());
|
||||||
|
|
||||||
assertEquals("AB321", invoice.getReferenceNumber());
|
assertEquals("AB321", invoice.getReferenceNumber());
|
||||||
|
|||||||
@@ -123,6 +123,7 @@
|
|||||||
</cac:LegalMonetaryTotal>
|
</cac:LegalMonetaryTotal>
|
||||||
<cac:InvoiceLine>
|
<cac:InvoiceLine>
|
||||||
<cbc:ID>1</cbc:ID>
|
<cbc:ID>1</cbc:ID>
|
||||||
|
<cbc:Note>Something</cbc:Note>
|
||||||
<cbc:InvoicedQuantity unitCode="HUR">1</cbc:InvoicedQuantity>
|
<cbc:InvoicedQuantity unitCode="HUR">1</cbc:InvoicedQuantity>
|
||||||
<cbc:LineExtensionAmount currencyID="EUR">160</cbc:LineExtensionAmount>
|
<cbc:LineExtensionAmount currencyID="EUR">160</cbc:LineExtensionAmount>
|
||||||
<cac:Item>
|
<cac:Item>
|
||||||
|
|||||||
Reference in New Issue
Block a user