Completed
Push — master ( 37efbc...b75b92 )
by Esteban De La Fuente
01:39
created
examples/008-verificar_enviodte.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
     $Signatures->item($Signatures->length-1)->getElementsByTagName('Modulus')->item(0)->nodeValue,
54 54
     $Signatures->item($Signatures->length-1)->getElementsByTagName('Exponent')->item(0)->nodeValue
55 55
 );*/
56
-$valid = openssl_verify($SignedInfo->C14N(), base64_decode($SignatureValue), $X509Certificate) === 1 ? true : false;
57
-echo 'Verificando SetDTE:',"\n";
58
-echo '  Digest SetDTE: ',base64_encode(sha1($SetDTE, true)),"\n";
59
-echo '  Digest SignedInfo: ',base64_encode(sha1($SignedInfo->C14N(), true)),"\n";
60
-echo '  Digest SignedInfo: ',bin2hex(sha1($SignedInfo->C14N(), true)),"\n";
61
-echo '  Digest SetDTE valido: ',($DigestValue===base64_encode(sha1($SetDTE, true))?'si':'no'),"\n";
62
-echo '  Digest SignedInfo valido: ',($valid?'si':'no'),"\n\n";
56
+$valid = openssl_verify($SignedInfo->C14N(), base64_decode($SignatureValue), $X509Certificate)===1 ? true : false;
57
+echo 'Verificando SetDTE:', "\n";
58
+echo '  Digest SetDTE: ', base64_encode(sha1($SetDTE, true)), "\n";
59
+echo '  Digest SignedInfo: ', base64_encode(sha1($SignedInfo->C14N(), true)), "\n";
60
+echo '  Digest SignedInfo: ', bin2hex(sha1($SignedInfo->C14N(), true)), "\n";
61
+echo '  Digest SetDTE valido: ', ($DigestValue===base64_encode(sha1($SetDTE, true)) ? 'si' : 'no'), "\n";
62
+echo '  Digest SignedInfo valido: ', ($valid ? 'si' : 'no'), "\n\n";
63 63
 
64 64
 // verificar firma de documentos
65 65
 $i = 0;
@@ -81,18 +81,18 @@  discard block
 block discarded – undo
81 81
         $Signatures->item($i)->getElementsByTagName('Modulus')->item(0)->nodeValue,
82 82
         $Signatures->item($i)->getElementsByTagName('Exponent')->item(0)->nodeValue
83 83
     );*/
84
-    $valid = openssl_verify($SignedInfo->C14N(), base64_decode($SignatureValue), $X509Certificate) === 1 ? true : false;
85
-    echo 'Verificando Documento:',"\n";
86
-    echo '  Digest Documento: ',base64_encode(sha1($Documento->C14N(), true)),"\n";
87
-    echo '  Digest SignedInfo: ',base64_encode(sha1($SignedInfo->C14N(), true)),"\n";
88
-    echo '  Digest Documento valido: ',($DigestValue===base64_encode(sha1($Documento->C14N(), true))?'si':'no'),"\n";
89
-    echo '  Digest SignedInfo valido: ',($valid?'si':'no'),"\n\n";
84
+    $valid = openssl_verify($SignedInfo->C14N(), base64_decode($SignatureValue), $X509Certificate)===1 ? true : false;
85
+    echo 'Verificando Documento:', "\n";
86
+    echo '  Digest Documento: ', base64_encode(sha1($Documento->C14N(), true)), "\n";
87
+    echo '  Digest SignedInfo: ', base64_encode(sha1($SignedInfo->C14N(), true)), "\n";
88
+    echo '  Digest Documento valido: ', ($DigestValue===base64_encode(sha1($Documento->C14N(), true)) ? 'si' : 'no'), "\n";
89
+    echo '  Digest SignedInfo valido: ', ($valid ? 'si' : 'no'), "\n\n";
90 90
     $i++;
91 91
 }
92 92
 
93 93
 // si hubo errores mostrar
94 94
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
95
-    echo $error,"\n";
95
+    echo $error, "\n";
96 96
 
97 97
 // para el XML de ejemplo del SII la clave pública obtenida desde el certificado
98 98
 // no sirvió para validar las firmas del documento, se probó obteniendo la clave
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
91 91
 }
92 92
 
93 93
 // si hubo errores mostrar
94
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
94
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
95 95
     echo $error,"\n";
96
+}
96 97
 
97 98
 // para el XML de ejemplo del SII la clave pública obtenida desde el certificado
98 99
 // no sirvió para validar las firmas del documento, se probó obteniendo la clave
Please login to merge, or discard this patch.
examples/010-set_pruebas_basico.php 2 patches
Braces   +10 added lines, -6 removed lines patch added patch discarded remove patch
@@ -411,17 +411,20 @@  discard block
 block discarded – undo
411 411
 // Objetos de Firma, Folios y EnvioDTE
412 412
 $Firma = new \sasco\LibreDTE\FirmaElectronica($config['firma']);
413 413
 $Folios = [];
414
-foreach ($folios as $tipo => $cantidad)
414
+foreach ($folios as $tipo => $cantidad) {
415 415
     $Folios[$tipo] = new \sasco\LibreDTE\Sii\Folios(file_get_contents('xml/folios/'.$tipo.'.xml'));
416
+}
416 417
 $EnvioDTE = new \sasco\LibreDTE\Sii\EnvioDte();
417 418
 
418 419
 // generar cada DTE, timbrar, firmar y agregar al sobre de EnvioDTE
419 420
 foreach ($set_pruebas as $documento) {
420 421
     $DTE = new \sasco\LibreDTE\Sii\Dte($documento);
421
-    if (!$DTE->timbrar($Folios[$DTE->getTipo()]))
422
-        break;
423
-    if (!$DTE->firmar($Firma))
424
-        break;
422
+    if (!$DTE->timbrar($Folios[$DTE->getTipo()])) {
423
+            break;
424
+    }
425
+    if (!$DTE->firmar($Firma)) {
426
+            break;
427
+    }
425 428
     $EnvioDTE->agregar($DTE);
426 429
 }
427 430
 
@@ -433,5 +436,6 @@  discard block
 block discarded – undo
433 436
 var_dump($track_id);
434 437
 
435 438
 // si hubo errores mostrar
436
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
439
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
437 440
     echo $error,"\n";
441
+}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,4 +66,4 @@
 block discarded – undo
66 66
 
67 67
 // si hubo errores mostrar
68 68
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
69
-    echo $error,"\n";
69
+    echo $error, "\n";
Please login to merge, or discard this patch.
examples/033-cesion_de_documentos.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,5 +82,6 @@
 block discarded – undo
82 82
 //echo $AEC->enviar();
83 83
 
84 84
 // si hubo errores mostrar
85
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
85
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
86 86
     echo $error, "\n";
87
+}
Please login to merge, or discard this patch.
examples/029-set_boleta.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         ],
421 421
         'Detalle' => [
422 422
             [
423
-                'QtyItem' => $set_pruebas[6]['Detalle'][0]['QtyItem']*0.4,
423
+                'QtyItem' => $set_pruebas[6]['Detalle'][0]['QtyItem'] * 0.4,
424 424
             ]
425 425
         ],
426 426
         'Referencia' => [
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
         ],
448 448
         'Detalle' => [
449 449
             [
450
-                'QtyItem' => $set_pruebas[9]['Detalle'][0]['QtyItem']*0.4,
450
+                'QtyItem' => $set_pruebas[9]['Detalle'][0]['QtyItem'] * 0.4,
451 451
             ]
452 452
         ],
453 453
         'Referencia' => [
@@ -480,4 +480,4 @@  discard block
 block discarded – undo
480 480
 
481 481
 // si hubo errores mostrar
482 482
 foreach (\sasco\LibreDTE\Log::readAll() as $error)
483
-    echo $error,"\n";
483
+    echo $error, "\n";
Please login to merge, or discard this patch.
Braces   +24 added lines, -14 removed lines patch added patch discarded remove patch
@@ -313,25 +313,30 @@  discard block
 block discarded – undo
313 313
 // Objetos de Firma y Folios
314 314
 $Firma = new \sasco\LibreDTE\FirmaElectronica($config['firma']);
315 315
 $Folios = [];
316
-foreach ($folios as $tipo => $cantidad)
316
+foreach ($folios as $tipo => $cantidad) {
317 317
     $Folios[$tipo] = new \sasco\LibreDTE\Sii\Folios(file_get_contents('xml/folios/'.$tipo.'.xml'));
318
+}
318 319
 
319 320
 // generar cada DTE, timbrar, firmar y agregar al sobre de EnvioBOLETA
320 321
 $EnvioDTE = new \sasco\LibreDTE\Sii\EnvioDte();
321 322
 foreach ($set_pruebas as $documento) {
322 323
     $DTE = new \sasco\LibreDTE\Sii\Dte($documento);
323
-    if (!$DTE->timbrar($Folios[$DTE->getTipo()]))
324
-        break;
325
-    if (!$DTE->firmar($Firma))
326
-        break;
324
+    if (!$DTE->timbrar($Folios[$DTE->getTipo()])) {
325
+            break;
326
+    }
327
+    if (!$DTE->firmar($Firma)) {
328
+            break;
329
+    }
327 330
     $EnvioDTE->agregar($DTE);
328 331
 }
329 332
 $EnvioDTE->setFirma($Firma);
330 333
 $EnvioDTE->setCaratula($caratula);
331 334
 $EnvioDTE->generar();
332 335
 if ($EnvioDTE->schemaValidate()) {
333
-    if (is_writable('xml/EnvioBOLETA.xml'))
334
-        file_put_contents('xml/EnvioBOLETA.xml', $EnvioDTE->generar()); // guardar XML en sistema de archivos
336
+    if (is_writable('xml/EnvioBOLETA.xml')) {
337
+            file_put_contents('xml/EnvioBOLETA.xml', $EnvioDTE->generar());
338
+    }
339
+    // guardar XML en sistema de archivos
335 340
     echo $EnvioDTE->generar();
336 341
 }
337 342
 
@@ -463,21 +468,26 @@  discard block
 block discarded – undo
463 468
 $EnvioDTE = new \sasco\LibreDTE\Sii\EnvioDte();
464 469
 foreach ($notas_credito as $documento) {
465 470
     $DTE = new \sasco\LibreDTE\Sii\Dte($documento);
466
-    if (!$DTE->timbrar($Folios[$DTE->getTipo()]))
467
-        break;
468
-    if (!$DTE->firmar($Firma))
469
-        break;
471
+    if (!$DTE->timbrar($Folios[$DTE->getTipo()])) {
472
+            break;
473
+    }
474
+    if (!$DTE->firmar($Firma)) {
475
+            break;
476
+    }
470 477
     $EnvioDTE->agregar($DTE);
471 478
 }
472 479
 $EnvioDTE->setFirma($Firma);
473 480
 $EnvioDTE->setCaratula($caratula);
474 481
 $EnvioDTE->generar();
475 482
 if ($EnvioDTE->schemaValidate()) {
476
-    if (is_writable('xml/EnvioDTE.xml'))
477
-        file_put_contents('xml/EnvioDTE.xml', $EnvioDTE->generar()); // guardar XML en sistema de archivos
483
+    if (is_writable('xml/EnvioDTE.xml')) {
484
+            file_put_contents('xml/EnvioDTE.xml', $EnvioDTE->generar());
485
+    }
486
+    // guardar XML en sistema de archivos
478 487
     echo $EnvioDTE->generar();
479 488
 }
480 489
 
481 490
 // si hubo errores mostrar
482
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
491
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
483 492
     echo $error,"\n";
493
+}
Please login to merge, or discard this patch.
examples/004-envioDte.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 $token = \sasco\LibreDTE\Sii\Autenticacion::getToken($config['firma']);
44 44
 if (!$token) {
45 45
     foreach (\sasco\LibreDTE\Log::readAll() as $error)
46
-        echo $error,"\n";
46
+        echo $error, "\n";
47 47
     exit;
48 48
 }
49 49
 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 // si hubo algún error al enviar al servidor mostrar
54 54
 if ($result===false) {
55 55
     foreach (\sasco\LibreDTE\Log::readAll() as $error)
56
-        echo $error,"\n";
56
+        echo $error, "\n";
57 57
     exit;
58 58
 }
59 59
 
60 60
 // Mostrar resultado del envío
61 61
 if ($result->STATUS!='0') {
62 62
     foreach (\sasco\LibreDTE\Log::readAll() as $error)
63
-        echo $error,"\n";
63
+        echo $error, "\n";
64 64
     exit;
65 65
 }
66
-echo 'DTE envíado. Track ID '.$result->TRACKID,"\n";
66
+echo 'DTE envíado. Track ID '.$result->TRACKID, "\n";
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,8 +42,9 @@  discard block
 block discarded – undo
42 42
 // solicitar token
43 43
 $token = \sasco\LibreDTE\Sii\Autenticacion::getToken($config['firma']);
44 44
 if (!$token) {
45
-    foreach (\sasco\LibreDTE\Log::readAll() as $error)
46
-        echo $error,"\n";
45
+    foreach (\sasco\LibreDTE\Log::readAll() as $error) {
46
+            echo $error,"\n";
47
+    }
47 48
     exit;
48 49
 }
49 50
 
@@ -52,15 +53,17 @@  discard block
 block discarded – undo
52 53
 
53 54
 // si hubo algún error al enviar al servidor mostrar
54 55
 if ($result===false) {
55
-    foreach (\sasco\LibreDTE\Log::readAll() as $error)
56
-        echo $error,"\n";
56
+    foreach (\sasco\LibreDTE\Log::readAll() as $error) {
57
+            echo $error,"\n";
58
+    }
57 59
     exit;
58 60
 }
59 61
 
60 62
 // Mostrar resultado del envío
61 63
 if ($result->STATUS!='0') {
62
-    foreach (\sasco\LibreDTE\Log::readAll() as $error)
63
-        echo $error,"\n";
64
+    foreach (\sasco\LibreDTE\Log::readAll() as $error) {
65
+            echo $error,"\n";
66
+    }
64 67
     exit;
65 68
 }
66 69
 echo 'DTE envíado. Track ID '.$result->TRACKID,"\n";
Please login to merge, or discard this patch.
lib/Sii/EnvioRecibos.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,8 +98,9 @@  discard block
 block discarded – undo
98 98
     public function generar()
99 99
     {
100 100
         // si ya se había generado se entrega directamente
101
-        if ($this->xml_data)
102
-            return $this->xml_data;
101
+        if ($this->xml_data) {
102
+                    return $this->xml_data;
103
+        }
103 104
         // si no hay respuestas para generar entregar falso
104 105
         if (!isset($this->recibos[0])) {
105 106
             \sasco\LibreDTE\Log::write(
@@ -173,8 +174,9 @@  discard block
 block discarded – undo
173 174
             }
174 175
             // crear recibos a partir del arreglo
175 176
             $Recibos = $this->arreglo['EnvioRecibos']['SetRecibos']['Recibo'];
176
-            if (!isset($Recibos[0]))
177
-                $Recibos = [$Recibos];
177
+            if (!isset($Recibos[0])) {
178
+                            $Recibos = [$Recibos];
179
+            }
178 180
             foreach ($Recibos as $Recibo) {
179 181
                 $this->recibos[] = $Recibo;
180 182
             }
Please login to merge, or discard this patch.
lib/Sii/LibroGuia.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
40 40
      */
41 41
     public function agregar(array $detalle, $normalizar = true)
42 42
     {
43
-        if ($normalizar)
44
-            $this->normalizarDetalle($detalle);
43
+        if ($normalizar) {
44
+                    $this->normalizarDetalle($detalle);
45
+        }
45 46
         $this->detalles[] = $detalle;
46 47
         return true;
47 48
     }
@@ -138,8 +139,9 @@  discard block
 block discarded – undo
138 139
             'TipoEnvio' => 'TOTAL',
139 140
             'FolioNotificacion' => null,
140 141
         ], $caratula);
141
-        if ($this->caratula['TipoEnvio']=='ESPECIAL')
142
-            $this->caratula['FolioNotificacion'] = null;
142
+        if ($this->caratula['TipoEnvio']=='ESPECIAL') {
143
+                    $this->caratula['FolioNotificacion'] = null;
144
+        }
143 145
         $this->id = 'LibreDTE_LIBRO_GUIA_'.str_replace('-', '', $this->caratula['RutEmisorLibro']).'_'.str_replace('-', '', $this->caratula['PeriodoTributario']).'_'.date('U');
144 146
     }
145 147
 
@@ -153,8 +155,9 @@  discard block
 block discarded – undo
153 155
     public function generar($incluirDetalle = true)
154 156
     {
155 157
         // si ya se había generado se entrega directamente
156
-        if ($this->xml_data)
157
-            return $this->xml_data;
158
+        if ($this->xml_data) {
159
+                    return $this->xml_data;
160
+        }
158 161
         // generar XML del envío
159 162
         $xmlEnvio = (new \sasco\LibreDTE\XML())->generate([
160 163
             'LibroGuia' => [
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
         }
80 80
         // calcular valores que no se hayan entregado
81 81
         if (!$detalle['IVA'] and $detalle['TasaImp'] and $detalle['MntNeto']) {
82
-            $detalle['IVA'] = round($detalle['MntNeto'] * ($detalle['TasaImp']/100));
82
+            $detalle['IVA'] = round($detalle['MntNeto'] * ($detalle['TasaImp'] / 100));
83 83
         }
84 84
         // calcular monto total si no se especificó
85 85
         if ($detalle['MntTotal']===false) {
86
-            $detalle['MntTotal'] = $detalle['MntNeto'] + $detalle['IVA'];
86
+            $detalle['MntTotal'] = $detalle['MntNeto']+$detalle['IVA'];
87 87
         }
88 88
     }
89 89
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $data = \sasco\LibreDTE\CSV::read($archivo);
101 101
         $n_data = count($data);
102 102
         $detalles = [];
103
-        for ($i=1; $i<$n_data; $i++) {
103
+        for ($i = 1; $i<$n_data; $i++) {
104 104
             // detalle genérico
105 105
             $detalle = [
106 106
                 'Folio' => $data[$i][0],
@@ -203,17 +203,17 @@  discard block
 block discarded – undo
203 203
             // se contabiliza si la guía está anulada
204 204
             if ($d['Anulado']==1 or $d['Anulado']==2) {
205 205
                 if ($d['Anulado']==1) {
206
-                    $ResumenPeriodo['TotFolAnulado'] = (int)$ResumenPeriodo['TotFolAnulado'] + 1;
206
+                    $ResumenPeriodo['TotFolAnulado'] = (int)$ResumenPeriodo['TotFolAnulado']+1;
207 207
                 } else {
208
-                    $ResumenPeriodo['TotGuiaAnulada'] = (int)$ResumenPeriodo['TotGuiaAnulada'] + 1;
208
+                    $ResumenPeriodo['TotGuiaAnulada'] = (int)$ResumenPeriodo['TotGuiaAnulada']+1;
209 209
                 }
210 210
             }
211 211
             // si no está anulado
212 212
             else {
213 213
                 // si es de venta
214 214
                 if ($d['TpoOper']==1) {
215
-                    $ResumenPeriodo['TotGuiaVenta'] = (int)$ResumenPeriodo['TotGuiaVenta'] + 1;
216
-                    $ResumenPeriodo['TotMntGuiaVta'] = (int)$ResumenPeriodo['TotMntGuiaVta'] + $d['MntTotal'];
215
+                    $ResumenPeriodo['TotGuiaVenta'] = (int)$ResumenPeriodo['TotGuiaVenta']+1;
216
+                    $ResumenPeriodo['TotMntGuiaVta'] = (int)$ResumenPeriodo['TotMntGuiaVta']+$d['MntTotal'];
217 217
                 }
218 218
                 // si no es de venta
219 219
                 else {
Please login to merge, or discard this patch.
lib/Sii/RespuestaEnvio.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -73,10 +73,12 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function agregarRespuestaEnvio(array $datos)
75 75
     {
76
-        if (isset($this->respuesta_documentos[0]))
77
-            return false;
78
-        if (isset($this->respuesta_envios[$this->config['respuesta_envios_max']-1]))
79
-            return false;
76
+        if (isset($this->respuesta_documentos[0])) {
77
+                    return false;
78
+        }
79
+        if (isset($this->respuesta_envios[$this->config['respuesta_envios_max']-1])) {
80
+                    return false;
81
+        }
80 82
         $this->respuesta_envios[] = array_merge([
81 83
             'NmbEnvio' => false,
82 84
             'FchRecep' => date('Y-m-d\TH:i:s'),
@@ -102,10 +104,12 @@  discard block
 block discarded – undo
102 104
      */
103 105
     public function agregarRespuestaDocumento(array $datos)
104 106
     {
105
-        if (isset($this->respuesta_envios[0]))
106
-            return false;
107
-        if (isset($this->respuesta_documentos[$this->config['respuesta_documentos_max']-1]))
108
-            return false;
107
+        if (isset($this->respuesta_envios[0])) {
108
+                    return false;
109
+        }
110
+        if (isset($this->respuesta_documentos[$this->config['respuesta_documentos_max']-1])) {
111
+                    return false;
112
+        }
109 113
         $this->respuesta_documentos[] = array_merge([
110 114
             'TipoDTE' => false,
111 115
             'Folio' => false,
@@ -156,8 +160,9 @@  discard block
 block discarded – undo
156 160
     public function generar()
157 161
     {
158 162
         // si ya se había generado se entrega directamente
159
-        if ($this->xml_data)
160
-            return $this->xml_data;
163
+        if ($this->xml_data) {
164
+                    return $this->xml_data;
165
+        }
161 166
         // si no hay respuestas para generar entregar falso
162 167
         if (!isset($this->respuesta_envios[0]) and !isset($this->respuesta_documentos[0])) {
163 168
             \sasco\LibreDTE\Log::write(
@@ -230,8 +235,9 @@  discard block
 block discarded – undo
230 235
      */
231 236
     public function getRecepciones()
232 237
     {
233
-        if (!$this->esRecepcionEnvio())
234
-            return false;
238
+        if (!$this->esRecepcionEnvio()) {
239
+                    return false;
240
+        }
235 241
         // si no hay respustas se deben crear
236 242
         if (!$this->respuesta_envios) {
237 243
             // si no está creado el arrelgo con los datos error
@@ -242,8 +248,9 @@  discard block
 block discarded – undo
242 248
             if (isset($this->arreglo['RespuestaDTE']['Resultado']['RecepcionEnvio']['RecepcionDTE'])) {
243 249
                 // crear repuestas a partir del arreglo
244 250
                 $Recepciones = $this->arreglo['RespuestaDTE']['Resultado']['RecepcionEnvio']['RecepcionDTE'];
245
-                if (!isset($Recepciones[0]))
246
-                    $Recepciones = [$Recepciones];
251
+                if (!isset($Recepciones[0])) {
252
+                                    $Recepciones = [$Recepciones];
253
+                }
247 254
                 foreach ($Recepciones as $Recepcion) {
248 255
                     $this->respuesta_envios[] = $Recepcion;
249 256
                 }
@@ -260,8 +267,9 @@  discard block
 block discarded – undo
260 267
      */
261 268
     public function getResultados()
262 269
     {
263
-        if (!$this->esResultadoDTE())
264
-            return false;
270
+        if (!$this->esResultadoDTE()) {
271
+                    return false;
272
+        }
265 273
         // si no hay respustas se deben crear
266 274
         if (!$this->respuesta_documentos) {
267 275
             // si no está creado el arrelgo con los datos error
@@ -270,8 +278,9 @@  discard block
 block discarded – undo
270 278
             }
271 279
             // crear repuestas a partir del arreglo
272 280
             $Resultados = $this->arreglo['RespuestaDTE']['Resultado']['ResultadoDTE'];
273
-            if (!isset($Resultados[0]))
274
-                $Resultados = [$Resultados];
281
+            if (!isset($Resultados[0])) {
282
+                            $Resultados = [$Resultados];
283
+            }
275 284
             foreach ($Resultados as $Resultado) {
276 285
                 $this->respuesta_documentos[] = $Resultado;
277 286
             }
Please login to merge, or discard this patch.
lib/Sii/ImpuestosAdicionales.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -162,8 +162,9 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public static function getTipo($codigo)
164 164
     {
165
-        if (isset(self::$impuestos[$codigo]))
166
-            return self::$impuestos[$codigo]['tipo'];
165
+        if (isset(self::$impuestos[$codigo])) {
166
+                    return self::$impuestos[$codigo]['tipo'];
167
+        }
167 168
         return false;
168 169
     }
169 170
 
@@ -175,8 +176,9 @@  discard block
 block discarded – undo
175 176
      */
176 177
     public static function getGlosa($codigo)
177 178
     {
178
-        if (isset(self::$impuestos[$codigo]))
179
-            return self::$impuestos[$codigo]['glosa'];
179
+        if (isset(self::$impuestos[$codigo])) {
180
+                    return self::$impuestos[$codigo]['glosa'];
181
+        }
180 182
         return 'Impto. cód. '.$codigo;
181 183
     }
182 184
 
@@ -188,8 +190,9 @@  discard block
 block discarded – undo
188 190
      */
189 191
     public static function getTasa($codigo)
190 192
     {
191
-        if (isset(self::$impuestos[$codigo]['tasa']))
192
-            return self::$impuestos[$codigo]['tasa'];
193
+        if (isset(self::$impuestos[$codigo]['tasa'])) {
194
+                    return self::$impuestos[$codigo]['tasa'];
195
+        }
193 196
         return false;
194 197
     }
195 198
 
Please login to merge, or discard this patch.