Merge branch 'langfr-feature/DeliveryTypeCode'
This commit is contained in:
@@ -41,6 +41,7 @@ public class Invoice implements IExportableTransaction {
|
|||||||
|
|
||||||
protected boolean testIndicator;
|
protected boolean testIndicator;
|
||||||
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownForeignOrganisationID = null, ownOrganisationName = null, currency = null, paymentTermDescription = null;
|
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownForeignOrganisationID = null, ownOrganisationName = null, currency = null, paymentTermDescription = null;
|
||||||
|
protected String deliveryTypeCode;
|
||||||
protected Date issueDate = null, dueDate = null, deliveryDate = null;
|
protected Date issueDate = null, dueDate = null, deliveryDate = null;
|
||||||
protected TradeParty sender = null, recipient = null, deliveryAddress = null, payee = null, invoicer = null, invoicee = null;
|
protected TradeParty sender = null, recipient = null, deliveryAddress = null, payee = null, invoicer = null, invoicee = null;
|
||||||
protected ArrayList<CashDiscount> cashDiscounts = null;
|
protected ArrayList<CashDiscount> cashDiscounts = null;
|
||||||
@@ -332,6 +333,15 @@ public class Invoice implements IExportableTransaction {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDeliveryTypeCode() {
|
||||||
|
return deliveryTypeCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Invoice setDeliveryTypeCode(String deliveryTypeCode) {
|
||||||
|
this.deliveryTypeCode = deliveryTypeCode;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBuyerOrderReferencedDocumentID() {
|
public String getBuyerOrderReferencedDocumentID() {
|
||||||
return buyerOrderReferencedDocumentID;
|
return buyerOrderReferencedDocumentID;
|
||||||
|
|||||||
@@ -438,6 +438,10 @@ public interface IExportableTransaction {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default String getDeliveryTypeCode() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the ID of the SellerOrderReferencedDocument, which sits in the
|
* get the ID of the SellerOrderReferencedDocument, which sits in the
|
||||||
* ApplicableSupplyChainTradeAgreement/ApplicableHeaderTradeAgreement
|
* ApplicableSupplyChainTradeAgreement/ApplicableHeaderTradeAgreement
|
||||||
|
|||||||
@@ -661,6 +661,13 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
xml += "<ram:SellerTradeParty>" + getTradePartyAsXML(trans.getSender(), true, false) + "</ram:SellerTradeParty>";
|
xml += "<ram:SellerTradeParty>" + getTradePartyAsXML(trans.getSender(), true, false) + "</ram:SellerTradeParty>";
|
||||||
xml += "<ram:BuyerTradeParty>" + getTradePartyAsXML(trans.getRecipient(), false, false) + "</ram:BuyerTradeParty>";
|
xml += "<ram:BuyerTradeParty>" + getTradePartyAsXML(trans.getRecipient(), false, false) + "</ram:BuyerTradeParty>";
|
||||||
|
|
||||||
|
if (trans.getDeliveryTypeCode() != null && getProfile() == Profiles.getByName("Extended")) {
|
||||||
|
xml += "<ram:ApplicableTradeDeliveryTerms>"
|
||||||
|
+ "<ram:DeliveryTypeCode>"
|
||||||
|
+ trans.getDeliveryTypeCode()
|
||||||
|
+ "</ram:DeliveryTypeCode>"
|
||||||
|
+ "</ram:ApplicableTradeDeliveryTerms>";
|
||||||
|
}
|
||||||
if (trans.getSellerOrderReferencedDocumentID() != null && !trans.getSellerOrderReferencedDocumentID().trim().isEmpty()) {
|
if (trans.getSellerOrderReferencedDocumentID() != null && !trans.getSellerOrderReferencedDocumentID().trim().isEmpty()) {
|
||||||
xml += "<ram:SellerOrderReferencedDocument>"
|
xml += "<ram:SellerOrderReferencedDocument>"
|
||||||
+ "<ram:IssuerAssignedID>"
|
+ "<ram:IssuerAssignedID>"
|
||||||
|
|||||||
@@ -749,6 +749,16 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
NodeList headerTradeAgreementChilds = headerTradeAgreementNode.getChildNodes();
|
NodeList headerTradeAgreementChilds = headerTradeAgreementNode.getChildNodes();
|
||||||
for (int agreementChildIndex = 0; agreementChildIndex < headerTradeAgreementChilds.getLength(); agreementChildIndex++) {
|
for (int agreementChildIndex = 0; agreementChildIndex < headerTradeAgreementChilds.getLength(); agreementChildIndex++) {
|
||||||
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName() != null) {
|
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName() != null) {
|
||||||
|
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName().equals("ApplicableTradeDeliveryTerms")) {
|
||||||
|
NodeList applicableTradeDeliveryTermsChilds = headerTradeAgreementChilds.item(agreementChildIndex).getChildNodes();
|
||||||
|
for (int applicableTradeDeliveryTermsChildIndex = 0; applicableTradeDeliveryTermsChildIndex < applicableTradeDeliveryTermsChilds.getLength(); applicableTradeDeliveryTermsChildIndex++) {
|
||||||
|
if ((applicableTradeDeliveryTermsChilds.item(applicableTradeDeliveryTermsChildIndex).getLocalName() != null)
|
||||||
|
&& (applicableTradeDeliveryTermsChilds.item(applicableTradeDeliveryTermsChildIndex).getLocalName().equals("DeliveryTypeCode"))) {
|
||||||
|
zpp.setDeliveryTypeCode(XMLTools.trimOrNull(applicableTradeDeliveryTermsChilds.item(applicableTradeDeliveryTermsChildIndex)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName().equals("BuyerOrderReferencedDocument")) {
|
if (headerTradeAgreementChilds.item(agreementChildIndex).getLocalName().equals("BuyerOrderReferencedDocument")) {
|
||||||
NodeList buyerOrderChilds = headerTradeAgreementChilds.item(agreementChildIndex).getChildNodes();
|
NodeList buyerOrderChilds = headerTradeAgreementChilds.item(agreementChildIndex).getChildNodes();
|
||||||
for (int buyerOrderChildIndex = 0; buyerOrderChildIndex < buyerOrderChilds.getLength(); buyerOrderChildIndex++) {
|
for (int buyerOrderChildIndex = 0; buyerOrderChildIndex < buyerOrderChilds.getLength(); buyerOrderChildIndex++) {
|
||||||
|
|||||||
@@ -623,6 +623,7 @@ public class ZF2PushTest extends TestCase {
|
|||||||
.setTenderReferencedDocument(dr1)
|
.setTenderReferencedDocument(dr1)
|
||||||
.setDeliveryDate(sdf.parse("2020-11-02")).setNumber(number).setVATDueDateTypeCode(EventTimeCodeTypeConstants.PAYMENT_DATE)
|
.setDeliveryDate(sdf.parse("2020-11-02")).setNumber(number).setVATDueDateTypeCode(EventTimeCodeTypeConstants.PAYMENT_DATE)
|
||||||
.setInvoiceReferencedDocumentID("abc123").addInvoiceReferencedDocument(new ReferencedDocument("abcd1234"))
|
.setInvoiceReferencedDocumentID("abc123").addInvoiceReferencedDocument(new ReferencedDocument("abcd1234"))
|
||||||
|
.setDeliveryTypeCode("EXW")
|
||||||
);
|
);
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -652,6 +653,7 @@ public class ZF2PushTest extends TestCase {
|
|||||||
assertTrue(zi.getUTF8().contains(occurrenceFrom));
|
assertTrue(zi.getUTF8().contains(occurrenceFrom));
|
||||||
assertTrue(zi.getUTF8().contains(occurrenceTo));
|
assertTrue(zi.getUTF8().contains(occurrenceTo));
|
||||||
assertTrue(zi.getUTF8().contains(contractID));
|
assertTrue(zi.getUTF8().contains(contractID));
|
||||||
|
assertTrue(zi.getUTF8().contains("EXW"));
|
||||||
assertEquals(zi.importedInvoice.getZFItems()[0].getId(), "a123");
|
assertEquals(zi.importedInvoice.getZFItems()[0].getId(), "a123");
|
||||||
assertEquals(zi.importedInvoice.getZFItems()[0].getDeliveryNoteReferencedDocumentID(), "deliverynote123");
|
assertEquals(zi.importedInvoice.getZFItems()[0].getDeliveryNoteReferencedDocumentID(), "deliverynote123");
|
||||||
assertEquals(zi.importedInvoice.getZFItems()[0].getDeliveryNoteReferencedDocumentLineID(), "deliverypos456");
|
assertEquals(zi.importedInvoice.getZFItems()[0].getDeliveryNoteReferencedDocumentLineID(), "deliverypos456");
|
||||||
@@ -677,6 +679,7 @@ public class ZF2PushTest extends TestCase {
|
|||||||
Invoice i = zii.extractInvoice();
|
Invoice i = zii.extractInvoice();
|
||||||
|
|
||||||
assertEquals("abc123", i.getInvoiceReferencedDocumentID());
|
assertEquals("abc123", i.getInvoiceReferencedDocumentID());
|
||||||
|
assertEquals("EXW", i.getDeliveryTypeCode());
|
||||||
assertEquals(1, i.getInvoiceReferencedDocuments().size());
|
assertEquals(1, i.getInvoiceReferencedDocuments().size());
|
||||||
assertEquals("abcd1234", i.getInvoiceReferencedDocuments().get(0).getIssuerAssignedID());
|
assertEquals("abcd1234", i.getInvoiceReferencedDocuments().get(0).getIssuerAssignedID());
|
||||||
assertEquals("4304171000002", i.getRecipient().getGlobalID());
|
assertEquals("4304171000002", i.getRecipient().getGlobalID());
|
||||||
|
|||||||
Reference in New Issue
Block a user