Merge pull request #856 from langfr/issue/MissingFaxData
Read contact´s fax number.
This commit is contained in:
@@ -130,6 +130,21 @@ public class Contact implements IZUGFeRDExportableContact {
|
|||||||
} else if (currentItemNode.getLocalName().equals("Telephone")) { /* UBL */
|
} else if (currentItemNode.getLocalName().equals("Telephone")) { /* UBL */
|
||||||
setPhone(currentItemNode.getTextContent());
|
setPhone(currentItemNode.getTextContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CII: only for Extended profile
|
||||||
|
if (currentItemNode.getLocalName().equals("FaxUniversalCommunication")) { /* CII */
|
||||||
|
NodeList fax = currentItemNode.getChildNodes();
|
||||||
|
for (int faxChildIndex = 0; faxChildIndex < fax.getLength(); faxChildIndex++) {
|
||||||
|
if (fax.item(faxChildIndex).getLocalName() != null) {
|
||||||
|
if (fax.item(faxChildIndex).getLocalName().equals("CompleteNumber")) {
|
||||||
|
setFax(fax.item(faxChildIndex).getTextContent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (currentItemNode.getLocalName().equals("Telefax")) { /* UBL */
|
||||||
|
setFax(currentItemNode.getTextContent());
|
||||||
|
}
|
||||||
|
|
||||||
if (currentItemNode.getLocalName().equals("EmailURIUniversalCommunication")) { /* CII */
|
if (currentItemNode.getLocalName().equals("EmailURIUniversalCommunication")) { /* CII */
|
||||||
NodeList email = currentItemNode.getChildNodes();
|
NodeList email = currentItemNode.getChildNodes();
|
||||||
for (int emailChildIndex = 0; emailChildIndex < email.getLength(); emailChildIndex++) {
|
for (int emailChildIndex = 0; emailChildIndex < email.getLength(); emailChildIndex++) {
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ public class UBLTest extends ResourceCase {
|
|||||||
assertFalse(hasExceptions);
|
assertFalse(hasExceptions);
|
||||||
|
|
||||||
assertEquals(new BigDecimal("10000.0"), invoice.getTotalPrepaidAmount());
|
assertEquals(new BigDecimal("10000.0"), invoice.getTotalPrepaidAmount());
|
||||||
|
assertEquals("4621231", invoice.getSender().getContact().getFax());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -602,6 +602,8 @@ public class ZF2PushTest extends TestCase {
|
|||||||
assertEquals("Verwendungszweck", i.getPaymentReference());
|
assertEquals("Verwendungszweck", i.getPaymentReference());
|
||||||
assertEquals("Rechnung", i.getDocumentName());
|
assertEquals("Rechnung", i.getDocumentName());
|
||||||
|
|
||||||
|
assertEquals("++49555123456",i.getRecipient().getContact().getFax());
|
||||||
|
|
||||||
} catch (XPathExpressionException e) {
|
} catch (XPathExpressionException e) {
|
||||||
fail("XPathExpressionException should not be raised");
|
fail("XPathExpressionException should not be raised");
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
<cac:Contact>
|
<cac:Contact>
|
||||||
<cbc:Name>M. Meier Handwerk GbR</cbc:Name>
|
<cbc:Name>M. Meier Handwerk GbR</cbc:Name>
|
||||||
<cbc:Telephone>010/12345</cbc:Telephone>
|
<cbc:Telephone>010/12345</cbc:Telephone>
|
||||||
|
<cbc:Telefax>4621231</cbc:Telefax>
|
||||||
<cbc:ElectronicMail>info@m-meier.de</cbc:ElectronicMail>
|
<cbc:ElectronicMail>info@m-meier.de</cbc:ElectronicMail>
|
||||||
</cac:Contact>
|
</cac:Contact>
|
||||||
</cac:Party>
|
</cac:Party>
|
||||||
|
|||||||
Reference in New Issue
Block a user