File tree Expand file tree Collapse file tree
main/java/org/mustangproject
java/org/mustangproject/ZUGFeRD Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,21 @@ public Contact(NodeList nodes) {
130130 } else if (currentItemNode .getLocalName ().equals ("Telephone" )) { /* UBL */
131131 setPhone (currentItemNode .getTextContent ());
132132 }
133+
134+ // CII: only for Extended profile
135+ if (currentItemNode .getLocalName ().equals ("FaxUniversalCommunication" )) { /* CII */
136+ NodeList fax = currentItemNode .getChildNodes ();
137+ for (int faxChildIndex = 0 ; faxChildIndex < fax .getLength (); faxChildIndex ++) {
138+ if (fax .item (faxChildIndex ).getLocalName () != null ) {
139+ if (fax .item (faxChildIndex ).getLocalName ().equals ("CompleteNumber" )) {
140+ setFax (fax .item (faxChildIndex ).getTextContent ());
141+ }
142+ }
143+ }
144+ } else if (currentItemNode .getLocalName ().equals ("Telefax" )) { /* UBL */
145+ setFax (currentItemNode .getTextContent ());
146+ }
147+
133148 if (currentItemNode .getLocalName ().equals ("EmailURIUniversalCommunication" )) { /* CII */
134149 NodeList email = currentItemNode .getChildNodes ();
135150 for (int emailChildIndex = 0 ; emailChildIndex < email .getLength (); emailChildIndex ++) {
Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ public void testEdgeInvoiceImportUBL2() {
139139 assertFalse (hasExceptions );
140140
141141 assertEquals (new BigDecimal ("10000.0" ), invoice .getTotalPrepaidAmount ());
142+ assertEquals ("4621231" , invoice .getSender ().getContact ().getFax ());
142143 }
143144
144145}
Original file line number Diff line number Diff line change @@ -603,6 +603,8 @@ public void testPushEdge() {
603603 assertEquals ("Verwendungszweck" , i .getPaymentReference ());
604604 assertEquals ("Rechnung" , i .getDocumentName ());
605605
606+ assertEquals ("++49555123456" ,i .getRecipient ().getContact ().getFax ());
607+
606608 } catch (XPathExpressionException e ) {
607609 fail ("XPathExpressionException should not be raised" );
608610 } catch (ParseException e ) {
Original file line number Diff line number Diff line change 4040 <cac : Contact >
4141 <cbc : Name >M. Meier Handwerk GbR</cbc : Name >
4242 <cbc : Telephone >010/12345</cbc : Telephone >
43+ <cbc : Telefax >4621231</cbc : Telefax >
4344 <cbc : ElectronicMail >info@m-meier.de</cbc : ElectronicMail >
4445 </cac : Contact >
4546 </cac : Party >
You can’t perform that action at this time.
0 commit comments