set BuyerOrderReferencedDocument and correct TypeCode for correction
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
@@ -87,7 +88,8 @@ public class Invoice implements IExportableTransaction {
|
||||
* @return
|
||||
*/
|
||||
public Invoice setCorrection(String number) {
|
||||
|
||||
setBuyerOrderReferencedDocumentID(number);
|
||||
documentCode= DocumentCodeTypeConstants.CORRECTEDINVOICE;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.io.OutputFormat;
|
||||
import org.dom4j.io.XMLWriter;
|
||||
import org.mustangproject.Invoice;
|
||||
import org.mustangproject.XMLTools;
|
||||
|
||||
public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
@@ -213,8 +214,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
return xml;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public void generateXML(IExportableTransaction trans) {
|
||||
this.trans = trans;
|
||||
|
||||
|
||||
@@ -21,5 +21,6 @@ package org.mustangproject.ZUGFeRD.model;
|
||||
public class DocumentCodeTypeConstants {
|
||||
public static final String INVOICE = "380";
|
||||
public static final String DEBITNOTE = "84";
|
||||
public static final String CORRECTEDINVOICE = "384";
|
||||
public static final String CREDITNOTE = "389";
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ public class ZF2PushTest extends TestCase {
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_CORRECTIONPDF);
|
||||
|
||||
assertTrue(zi.getUTF8().contains("EUR"));
|
||||
|
||||
//totest: typecode 384, BuyerOrderReferencedDocument
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("-3.57", zi.getAmount());
|
||||
assertEquals(zi.getHolder(), orgname);
|
||||
|
||||
Reference in New Issue
Block a user