working on legelorganisationname
This commit is contained in:
@@ -17,7 +17,6 @@ import org.w3c.dom.NodeList;
|
|||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
|
||||||
import static org.apache.fop.fonts.type1.AdobeStandardEncoding.a;
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* A organisation, i.e. usually a company
|
* A organisation, i.e. usually a company
|
||||||
@@ -83,7 +82,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
if (currentNode.getLocalName().equals("DeliveryLocation")) {
|
if (currentNode.getLocalName().equals("DeliveryLocation")) {
|
||||||
NodeList deliveryLocation = currentNode.getChildNodes();
|
NodeList deliveryLocation = currentNode.getChildNodes();
|
||||||
for (int deliveryLocationIndex = 0; deliveryLocationIndex < deliveryLocation.getLength(); deliveryLocationIndex++) {
|
for (int deliveryLocationIndex = 0; deliveryLocationIndex < deliveryLocation.getLength(); deliveryLocationIndex++) {
|
||||||
if (deliveryLocation.item(deliveryLocationIndex).getLocalName() != null){
|
if (deliveryLocation.item(deliveryLocationIndex).getLocalName() != null) {
|
||||||
if (deliveryLocation.item(deliveryLocationIndex).getLocalName().equals("ID")) {
|
if (deliveryLocation.item(deliveryLocationIndex).getLocalName().equals("ID")) {
|
||||||
//Node currentNode = partyID.item(partyIDIndex);
|
//Node currentNode = partyID.item(partyIDIndex);
|
||||||
setID(deliveryLocation.item(deliveryLocationIndex).getTextContent());
|
setID(deliveryLocation.item(deliveryLocationIndex).getTextContent());
|
||||||
@@ -148,8 +147,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
addGlobalID(sID);
|
addGlobalID(sID);
|
||||||
|
|
||||||
//&& ((currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0110") && currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0100"))
|
//&& ((currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0110") && currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0100"))
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
setID(currentNode.getTextContent());
|
setID(currentNode.getTextContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,17 +162,16 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
String CompanyId = null;
|
String CompanyId = null;
|
||||||
for (int partyTaxSchemeIndex = 0; partyTaxSchemeIndex < partyTaxScheme.getLength(); partyTaxSchemeIndex++) {
|
for (int partyTaxSchemeIndex = 0; partyTaxSchemeIndex < partyTaxScheme.getLength(); partyTaxSchemeIndex++) {
|
||||||
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName() != null) {
|
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName() != null) {
|
||||||
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName().equals("CompanyID")){
|
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName().equals("CompanyID")) {
|
||||||
CompanyId = (partyTaxScheme.item(partyTaxSchemeIndex).getTextContent());
|
CompanyId = (partyTaxScheme.item(partyTaxSchemeIndex).getTextContent());
|
||||||
}
|
}
|
||||||
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName().equals("TaxScheme")){
|
if (partyTaxScheme.item(partyTaxSchemeIndex).getLocalName().equals("TaxScheme")) {
|
||||||
NodeList taxSchemechilds = partyTaxScheme.item(partyTaxSchemeIndex).getChildNodes();
|
NodeList taxSchemechilds = partyTaxScheme.item(partyTaxSchemeIndex).getChildNodes();
|
||||||
for (int taxSchemechildsIndex = 0; taxSchemechildsIndex < taxSchemechilds.getLength(); taxSchemechildsIndex++) {
|
for (int taxSchemechildsIndex = 0; taxSchemechildsIndex < taxSchemechilds.getLength(); taxSchemechildsIndex++) {
|
||||||
if (taxSchemechilds.item(taxSchemechildsIndex).getLocalName() != null){
|
if (taxSchemechilds.item(taxSchemechildsIndex).getLocalName() != null) {
|
||||||
if (taxSchemechilds.item(taxSchemechildsIndex).getTextContent().equals("FC") ||(taxSchemechilds.item(taxSchemechildsIndex).getTextContent().equals("NOVAT"))) {
|
if (taxSchemechilds.item(taxSchemechildsIndex).getTextContent().equals("FC") || (taxSchemechilds.item(taxSchemechildsIndex).getTextContent().equals("NOVAT"))) {
|
||||||
setTaxID(CompanyId);
|
setTaxID(CompanyId);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
setVATID(CompanyId);
|
setVATID(CompanyId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,12 +192,27 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
NodeList legal = party.item(partyIndex).getChildNodes();
|
NodeList legal = party.item(partyIndex).getChildNodes();
|
||||||
for (int legalChildIndex = 0; legalChildIndex < legal.getLength(); legalChildIndex++) {
|
for (int legalChildIndex = 0; legalChildIndex < legal.getLength(); legalChildIndex++) {
|
||||||
if (legal.item(legalChildIndex).getLocalName() != null) {
|
if (legal.item(legalChildIndex).getLocalName() != null) {
|
||||||
|
LegalOrganisation lo = null;
|
||||||
if (legal.item(legalChildIndex).getLocalName().equals("RegistrationName")) {
|
if (legal.item(legalChildIndex).getLocalName().equals("RegistrationName")) {
|
||||||
setName(legal.item(legalChildIndex).getTextContent());
|
if (lo == null) {
|
||||||
|
lo = new LegalOrganisation();
|
||||||
}
|
}
|
||||||
if (legal.item(legalChildIndex).getLocalName().equals("CompanyLegalForm")) {
|
lo.setTradingBusinessName(legal.item(legalChildIndex).getTextContent());
|
||||||
setDescription(legal.item(legalChildIndex).getTextContent());
|
|
||||||
}
|
}
|
||||||
|
if (legal.item(legalChildIndex).getLocalName().equals("CompanyID")) {
|
||||||
|
if (lo == null) {
|
||||||
|
lo = new LegalOrganisation();
|
||||||
|
}
|
||||||
|
if (legal.item(legalChildIndex).getAttributes().getNamedItem("schemeID")!=null) {
|
||||||
|
SchemedID sid = new SchemedID(legal.item(legalChildIndex).getAttributes().getNamedItem("schemeID").getNodeValue(), legal.item(legalChildIndex).getTextContent());
|
||||||
|
lo.setSchemedID(sid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// we dont have that attribute yet in the legalorganisation: CompanyLegalForm
|
||||||
|
if (lo != null) {
|
||||||
|
setLegalOrganisation(lo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,7 +294,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
NodeList contact = nodes.item(nodeIndex).getChildNodes();
|
NodeList contact = nodes.item(nodeIndex).getChildNodes();
|
||||||
setContact(new Contact(contact));
|
setContact(new Contact(contact));
|
||||||
}
|
}
|
||||||
if(currentUBLChild.equals("PayeeParty")){
|
if (currentUBLChild.equals("PayeeParty")) {
|
||||||
NodeList payeeParty = nodes.item(nodeIndex).getChildNodes();
|
NodeList payeeParty = nodes.item(nodeIndex).getChildNodes();
|
||||||
for (int payeePartyIndex = 0; payeePartyIndex < payeeParty.getLength(); payeePartyIndex++) {
|
for (int payeePartyIndex = 0; payeePartyIndex < payeeParty.getLength(); payeePartyIndex++) {
|
||||||
if (payeeParty.item(payeePartyIndex).getLocalName() != null) {
|
if (payeeParty.item(payeePartyIndex).getLocalName() != null) {
|
||||||
@@ -302,8 +314,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
addGlobalID(sID);
|
addGlobalID(sID);
|
||||||
|
|
||||||
//&& ((currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0110") && currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0100"))
|
//&& ((currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0110") && currentNode.getAttributes().getNamedItem("schemeID").getNodeValue().equals("0100"))
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
setID(currentNode.getTextContent());
|
setID(currentNode.getTextContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -600,6 +611,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* primarily for invoiceimporter and JSON
|
* primarily for invoiceimporter and JSON
|
||||||
|
*
|
||||||
* @return the list of sepa mandates
|
* @return the list of sepa mandates
|
||||||
*/
|
*/
|
||||||
public List<DirectDebit> getDebitDetails() {
|
public List<DirectDebit> getDebitDetails() {
|
||||||
|
|||||||
Reference in New Issue
Block a user