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