UBL updates

This commit is contained in:
Bharti
2024-11-18 10:58:21 +01:00
parent 69228a4a76
commit 135a577c9f
3 changed files with 81 additions and 119 deletions

View File

@@ -84,19 +84,19 @@ public class BankDetails implements IZUGFeRDTradeSettlementPayment {
/***
* getOwn... methods will be removed in the future in favor of Tradeparty (e.g. Sender) class
* */
@Override
@Deprecated
@JsonIgnore
public String getOwnBIC() {
return getBIC();
}
@Override
@Deprecated
@JsonIgnore
public String getOwnIBAN() {
return getIBAN();
}
// @Override
// @Deprecated
// @JsonIgnore
// public String getOwnBIC() {
// return getBIC();
// }
//
// @Override
// @Deprecated
// @JsonIgnore
// public String getOwnIBAN() {
// return getIBAN();
// }
/**

View File

@@ -2,6 +2,7 @@ package org.mustangproject;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -16,6 +17,8 @@ import org.w3c.dom.NodeList;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import static org.apache.fop.fonts.type1.AdobeStandardEncoding.a;
/***
* A organisation, i.e. usually a company
*/
@@ -97,35 +100,13 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName() != null) {
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName().equals("CompanyID")){
setTaxID(partyTaxScheme.item(partyTaxSchemeIndex).getTextContent());
}
}
}
}
}
}
// if (currentTopElementName.equals("PartyTaxScheme")) {
// NodeList partyTaxScheme = party.item(partyIndex).getChildNodes();
// for (int partyTaxSchemeIndex = 0; partyTaxSchemeIndex < partyTaxScheme.getLength(); partyTaxSchemeIndex++) {
// if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName() != null) {
// if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName().equals("TaxScheme")) {
// NodeList taxScheme = partyTaxScheme.item(partyTaxSchemeIndex).getChildNodes();
// for (int taxSchemeIndex = 0 ; taxSchemeIndex < taxScheme.getLength(); taxSchemeIndex++) {
// if (taxScheme.item(taxSchemeIndex).getLocalName() != null) {
// if(taxScheme.item(taxSchemeIndex).getLocalName().equals("ID")){
// if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName().equals("CompanyID")) {
// setTaxID(partyTaxScheme.item(partyTaxSchemeIndex).getTextContent());
// } else {
// setVATID(partyTaxScheme.item(partyTaxSchemeIndex).getTextContent());
// }
// }
// }
// }
// }
//
// }
// }
// }
/*
UBL only: formally it can have a name as well but BT27 party name *should* be stored in
so overwrite if one exists
@@ -209,8 +190,6 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
}
}
}
}
if (currentUBLChild.equals("GlobalID")) {
@@ -252,29 +231,6 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
}
}
if (currentUBLChild.equals("PartyTaxScheme")) {
NodeList taxChilds = nodes.item(nodeIndex).getChildNodes();
for (int taxChildIndex = 0; taxChildIndex < taxChilds.getLength(); taxChildIndex++) {
if (taxChilds.item(taxChildIndex).getLocalName() != null) {
if ((taxChilds.item(taxChildIndex).getLocalName().equals("TaxScheme"))) {
if (taxChilds.item(taxChildIndex).getLocalName().equals("CompanyID")) {
if (taxChilds.item(taxChildIndex).getLocalName().equals("ID")) {
if (taxChilds.item(taxChildIndex).getLocalName().equals("CompanyID")) {
setVATID(taxChilds.item(taxChildIndex).getTextContent());
}
// setTaxID(partyTaxScheme.item(partyTaxSchemeIndex).getTextContent());
if (taxChilds.item(taxChildIndex).getAttributes().getNamedItem("ID").getNodeValue().equals("FC")) {
if (taxChilds.item(taxChildIndex).getLocalName().equals("CompanyID")) {
setTaxID(taxChilds.item(taxChildIndex).getTextContent());
}
}
}
}
}
}
}
}
}
}
}

View File

@@ -587,11 +587,17 @@ public class ZUGFeRDInvoiceImporter {
if (sellerOrderIssuerAssignedID != null) {
zpp.setSellerOrderReferencedDocumentID(sellerOrderIssuerAssignedID);
}
else {
zpp.setSellerOrderReferencedDocumentID(extractString("//*[local-name()=\"OrderReference\"]/*[local-name()=\"SalesOrderID\"]"));
}
if (despatchAdviceReferencedDocument != null) {
zpp.setDespatchAdviceReferencedDocumentID(despatchAdviceReferencedDocument);
}
else {
zpp.setDespatchAdviceReferencedDocumentID(extractString("//*[local-name()=\"DespatchDocumentReference\"]/*[local-name()=\"ID\"]"));
}
zpp.setOwnOrganisationName(extractString("//*[local-name()=\"SellerTradeParty\"]/*[local-name()=\"Name\"]|//*[local-name()=\"AccountingSupplierParty\"]/*[local-name()=\"Party\"]/*[local-name()=\"PartyName\"]").trim());
//zpp.setOwnOrganisationName(extractString("//*[local-name()=\"SellerTradeParty\"]/*[local-name()=\"Name\"]|//*[local-name()=\"AccountingSupplierParty\"]/*[local-name()=\"Party\"]/*[local-name()=\"PartyName\"]").trim());
xpr = xpath.compile("//*[local-name()=\"BuyerReference\"]");
String buyerReference = null;