Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
#3: Updates based on clarifications from stepcom
Browse files Browse the repository at this point in the history
  • Loading branch information
haneloreianoseck committed Apr 12, 2019
1 parent 743ffac commit fdf4687
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
31 changes: 15 additions & 16 deletions src/main/java/de/metas/edi/esb/bean/invoice/EDIXMLInvoiceBean.java
Expand Up @@ -47,13 +47,17 @@ public class EDIXMLInvoiceBean
public static final String METHOD_createXMLEDIData = "createXMLEDIData";

private static final ObjectFactory INVOICE_objectFactory = new ObjectFactory();
private static final int DOC_CREDIT_NOTE_ID = 83;
private static final int DOC_DEBIT_NOTE_ID = 380;
//Debit note to financial adjustments
private static final int DOC_DBNF_ID = 382;
private static final int DOC_DBNF2_ID = 84;
//Credit note to financial adjustments
private static final int DOC_CRNF_ID = 381;

//Credit note - metasfresh "ARC" base doc type and "CR" sub doc type
private static final int DOC_CRNO_ID = 83;
//Credit note - metasfresh "ARC" base doc type and "CQ", "CS" sub doc types
private static final int DOC_CRNO2_ID = 381;
//Commercial invoice - metasfresh "ARI" base doc type
private static final int DOC_CMIV_ID = 380;
// Debit note - metasfresh "ARI" base doc type and "AQ" sub doc type
private static final int DOC_DBNO_ID = 383;
// Debit note - metasfresh "ARI" base doc type and "AP" sub doc type
private static final int DOC_DBNO2_ID = 84;

public void createXMLEDIData(final Exchange exchange)
{
Expand Down Expand Up @@ -126,21 +130,17 @@ private DocumentType mapDocumentType(final String eancomDocType)
{
int incomingDocType = Integer.parseInt(eancomDocType);
DocumentType documentType = null;
if (incomingDocType == DOC_CREDIT_NOTE_ID)
if (incomingDocType == DOC_CRNO_ID || incomingDocType == DOC_CRNO2_ID)
{
documentType = DocumentType.CRNO;
}
else if (incomingDocType == DOC_DEBIT_NOTE_ID)
else if (incomingDocType == DOC_DBNO_ID || incomingDocType == DOC_DBNO2_ID)
{
documentType = DocumentType.DBNO;
}
else if (incomingDocType == DOC_DBNF_ID || incomingDocType == DOC_DBNF2_ID)
{
documentType = DocumentType.DBNF;
}
else if (incomingDocType == DOC_CRNF_ID)
else if (incomingDocType == DOC_CMIV_ID)
{
documentType = DocumentType.CRNF;
documentType = DocumentType.CMIV;
}
return documentType;
}
Expand Down Expand Up @@ -489,7 +489,6 @@ private void mapDates(final EDICctopInvoicVType invoice, final HEADERXrech heade
final HDATE1 valueDate = INVOICE_objectFactory.createHDATE1();
valueDate.setDOCUMENTID(headerXrech.getDOCUMENTID());
valueDate.setDATEQUAL(DateQual.VALU.name());
// not sure what value date is
valueDate.setDATEFROM(toFormattedStringDate(toDate(invoice.getDateInvoiced()), dateFormat));

headerXrech.getHDATE1().add(documentDate);
Expand Down
Expand Up @@ -12,9 +12,8 @@ public enum MeasurementUnit
SQMT("MTK"),
CBMT("MTQ"),
PIEC("PCE"),
PACK("CNP"), //TODO not sure
CART("KRT"),
BAGS("Bund"); //TODO not sure
PACK("TU"),
CART("KRT");

private final String cuom;

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/application.properties
Expand Up @@ -115,14 +115,14 @@ edi.file.desadv.xml=file://{{edi.file.desadv.dir}}/xml?charset={{edi.generated.c
#
#Supplier-ID
edi.props.000.sender.gln=9876543210987
#partner id used in the document header
#take this out
edi.props.stepcom.partner.id=partnerId
#owner id used in the document header
edi.props.stepcom.owner.id=ownerId
edi.props.stepcom.owner.id=CHEESE
#application ref used in the document header
edi.props.stepcom.application.ref=applicationRef
edi.props.stepcom.application.ref=metasfresh
#supplier gln used for desadv supplier address
edi.props.desadv.stepcom.supplier.gln=suppliergln
edi.props.desadv.stepcom.supplier.gln=9876543210987
#supplier additional id used for address reference
edi.props.desadv.stepcom.supplier.additional.id=apaiID

Expand Down

0 comments on commit fdf4687

Please sign in to comment.