diff --git a/api/contrib/genXML/genXML.php b/api/contrib/genXML/genXML.php index f0d65a51..d74d4b2e 100644 --- a/api/contrib/genXML/genXML.php +++ b/api/contrib/genXML/genXML.php @@ -215,7 +215,7 @@ function genXMLFe() '; } - if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { + if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { $xmlString .= ' ' . $emisorCodPaisTel . ' @@ -1206,7 +1206,7 @@ function genXMLNC() '; } - if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { + if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { $xmlString .= ' ' . $emisorCodPaisTel . ' @@ -2085,7 +2085,7 @@ function genXMLND() '; } - if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { + if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { $xmlString .= ' ' . $emisorCodPaisTel . ' @@ -2954,7 +2954,7 @@ function genXMLTE() '; } - if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { + if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { $xmlString .= ' ' . $emisorCodPaisTel . ' @@ -3883,7 +3883,7 @@ function genXMLFec() ' . $emisorOtrasSenasExtranjero . ''; } - if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { + if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { $xmlString .= ' ' . $emisorCodPaisTel . ' @@ -4583,7 +4583,7 @@ function genXMLFee() '; } - if ($emisorCodPaisTel != '' && $emisorTel != '' && $emisorTel >= EMISORNUMEROTELMIN && $emisorTel <= EMISORNUMEROTELMAX) { + if ($emisorCodPaisTel != '' && $emisorTel != '' && strlen($emisorTel) >= EMISORNUMEROTELMIN && strlen($emisorTel) <= EMISORNUMEROTELMAX) { $xmlString .= ' ' . $emisorCodPaisTel . ' diff --git a/tests/api_contrib_genXML_FE.php b/tests/api_contrib_genXML_FE.php index bf44c387..08cc2143 100644 --- a/tests/api_contrib_genXML_FE.php +++ b/tests/api_contrib_genXML_FE.php @@ -445,6 +445,7 @@ public function testGenXMLFeEmisor() $this->assertEquals('01', (string)$xml->Emisor->Ubicacion->Distrito); $this->assertEquals('Dirección de prueba', (string)$xml->Emisor->Ubicacion->OtrasSenas); $this->assertEquals('empresa@example.com', (string)$xml->Emisor->CorreoElectronico); + $this->assertEquals('22223333', (string)$xml->Emisor->Telefono->NumTelefono); } public function testGenXMLFeDetalleServicio()