Completed
Push — master ( 9fc349...910333 )
by Esteban De La Fuente
05:10
created
examples/017-etapa_intercambio_ResultadoDTE.php 2 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,5 +98,6 @@
 block discarded – undo
98 98
 }
99 99
 
100 100
 // si hubo errores mostrar
101
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
101
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
102 102
     echo $error,"\n";
103
+}
Please login to merge, or discard this patch.
examples/012-set_pruebas_ventas.php 2 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,5 +65,6 @@
 block discarded – undo
65 65
 var_dump($track_id);
66 66
 
67 67
 // si hubo errores mostrar
68
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
68
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
69 69
     echo $error,"\n";
70
+}
Please login to merge, or discard this patch.
examples/031-libro_boleta.php 2 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,5 +98,6 @@
 block discarded – undo
98 98
 }
99 99
 
100 100
 // si hubo errores mostrar
101
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
101
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
102 102
     echo $error,"\n";
103
+}
Please login to merge, or discard this patch.
examples/022-libro_ventas_csv.php 2 patches
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.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,5 +65,6 @@
 block discarded – undo
65 65
 var_dump($track_id);
66 66
 
67 67
 // si hubo errores mostrar
68
-foreach (\sasco\LibreDTE\Log::readAll() as $error)
68
+foreach (\sasco\LibreDTE\Log::readAll() as $error) {
69 69
     echo $error,"\n";
70
+}
Please login to merge, or discard this patch.
lib/Sii/RegistroCompraVenta.php 2 patches
Doc Comments   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     /**
57 57
      * Constructor, obtiene el token de la sesión y lo guarda
58
-     * @param Firma Objeto con la firma electrónica
58
+     * @param Firma \sasco\LibreDTE\FirmaElectronica con la firma electrónica
59 59
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
60 60
      * @version 2017-08-28
61 61
      */
@@ -97,6 +97,8 @@  discard block
 block discarded – undo
97 97
      * Método que entrega los eventos asociados a un DTE
98 98
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
99 99
      * @version 2017-08-28
100
+     * @param string $dte
101
+     * @param string $folio
100 102
      */
101 103
     public function listarEventosHistDoc($rut, $dv, $dte, $folio)
102 104
     {
@@ -184,10 +186,10 @@  discard block
 block discarded – undo
184 186
 
185 187
     /**
186 188
      * Método para realizar una solicitud al servicio web del SII
187
-     * @param request Nombre de la función que se ejecutará en el servicio web
189
+     * @param request string de la función que se ejecutará en el servicio web
188 190
      * @param args Argumentos que se pasarán al servicio web
189
-     * @param retry Intentos que se realizarán como máximo para obtener respuesta
190
-     * @return Objeto o String con la respuesta (depende servicio web)
191
+     * @param retry integer que se realizarán como máximo para obtener respuesta
192
+     * @return string o String con la respuesta (depende servicio web)
191 193
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
192 194
      * @version 2017-08-28
193 195
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@
 block discarded – undo
220 220
             \sasco\LibreDTE\Log::write(\sasco\LibreDTE\Estado::REQUEST_ERROR_SOAP, \sasco\LibreDTE\Estado::get(\sasco\LibreDTE\Estado::REQUEST_ERROR_SOAP, $msg));
221 221
             return false;
222 222
         }
223
-        for ($i=0; $i<$retry; $i++) {
223
+        for ($i = 0; $i<$retry; $i++) {
224 224
             try {
225 225
                 $body = call_user_func_array([$soap, $request], $args);
226 226
                 break;
Please login to merge, or discard this patch.
lib/Sii/PDF/Dte.php 3 patches
Doc Comments   +31 added lines, -28 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     /**
177 177
      * Método que asigna la ubicación del logo de la empresa
178 178
      * @param logo URI del logo (puede ser local o en una URL)
179
-     * @param posicion Posición respecto a datos del emisor (=0 izq, =1 arriba)
179
+     * @param posicion integer respecto a datos del emisor (=0 izq, =1 arriba)
180 180
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
181 181
      * @version 2016-08-04
182 182
      */
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      * contínuo
356 356
      * @param dte Arreglo con los datos del XML (tag Documento)
357 357
      * @param timbre String XML con el tag TED del DTE
358
-     * @param width Ancho del papel contínuo en mm
358
+     * @param width boolean del papel contínuo en mm
359 359
      * @author Pablo Reyes (https://github.com/pabloxp)
360 360
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
361 361
      * @version 2017-10-05
@@ -511,10 +511,11 @@  discard block
 block discarded – undo
511 511
      *  - Dirección casa central del emisor
512 512
      *  - Dirección sucursales
513 513
      * @param emisor Arreglo con los datos del emisor (tag Emisor del XML)
514
-     * @param x Posición horizontal de inicio en el PDF
515
-     * @param y Posición vertical de inicio en el PDF
516
-     * @param w Ancho de la información del emisor
517
-     * @param w_img Ancho máximo de la imagen
514
+     * @param x integer horizontal de inicio en el PDF
515
+     * @param y integer vertical de inicio en el PDF
516
+     * @param w integer de la información del emisor
517
+     * @param w_img integer máximo de la imagen
518
+     * @param integer $font_size
518 519
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
519 520
      * @version 2016-12-02
520 521
      */
@@ -584,11 +585,13 @@  discard block
 block discarded – undo
584 585
      * @param rut RUT del emisor
585 586
      * @param tipo Código o glosa del tipo de documento
586 587
      * @param sucursal_sii Código o glosa de la sucursal del SII del Emisor
587
-     * @param x Posición horizontal de inicio en el PDF
588
-     * @param y Posición vertical de inicio en el PDF
589
-     * @param w Ancho de la información del emisor
588
+     * @param x integer horizontal de inicio en el PDF
589
+     * @param y integer vertical de inicio en el PDF
590
+     * @param w integer de la información del emisor
591
+     * @param integer $font_size
590 592
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
591 593
      * @version 2016-12-02
594
+     * @return integer
592 595
      */
593 596
     private function agregarFolio($rut, $tipo, $folio, $sucursal_sii = null, $x = 130, $y = 15, $w = 70, $font_size = null, array $color = null)
594 597
     {
@@ -634,7 +637,7 @@  discard block
 block discarded – undo
634 637
      * Método que agrega los datos de la emisión del DTE que no son los dato del
635 638
      * receptor
636 639
      * @param IdDoc Información general del documento
637
-     * @param x Posición horizontal de inicio en el PDF
640
+     * @param x integer horizontal de inicio en el PDF
638 641
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
639 642
      * @version 2017-06-15
640 643
      */
@@ -722,7 +725,7 @@  discard block
 block discarded – undo
722 725
     /**
723 726
      * Método que agrega los datos del receptor
724 727
      * @param receptor Arreglo con los datos del receptor (tag Receptor del XML)
725
-     * @param x Posición horizontal de inicio en el PDF
728
+     * @param x integer horizontal de inicio en el PDF
726 729
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
727 730
      * @version 2017-06-15
728 731
      */
@@ -809,7 +812,7 @@  discard block
 block discarded – undo
809 812
      * Método que agrega los datos del traslado
810 813
      * @param IndTraslado
811 814
      * @param Transporte
812
-     * @param x Posición horizontal de inicio en el PDF
815
+     * @param x integer horizontal de inicio en el PDF
813 816
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
814 817
      * @version 2016-08-03
815 818
      */
@@ -880,7 +883,7 @@  discard block
 block discarded – undo
880 883
     /**
881 884
      * Método que agrega las referencias del documento
882 885
      * @param referencias Arreglo con las referencias del documento (tag Referencia del XML)
883
-     * @param x Posición horizontal de inicio en el PDF
886
+     * @param x integer horizontal de inicio en el PDF
884 887
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
885 888
      * @version 2017-09-25
886 889
      */
@@ -917,7 +920,7 @@  discard block
 block discarded – undo
917 920
     /**
918 921
      * Método que agrega el detalle del documento
919 922
      * @param detalle Arreglo con el detalle del documento (tag Detalle del XML)
920
-     * @param x Posición horizontal de inicio en el PDF
923
+     * @param x integer horizontal de inicio en el PDF
921 924
      * @param y Posición vertical de inicio en el PDF
922 925
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
923 926
      * @version 2016-08-05
@@ -984,7 +987,7 @@  discard block
 block discarded – undo
984 987
     /**
985 988
      * Método que agrega el detalle del documento
986 989
      * @param detalle Arreglo con el detalle del documento (tag Detalle del XML)
987
-     * @param x Posición horizontal de inicio en el PDF
990
+     * @param x integer horizontal de inicio en el PDF
988 991
      * @param y Posición vertical de inicio en el PDF
989 992
      * @author Pablo Reyes (https://github.com/pabloxp)
990 993
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
@@ -1020,7 +1023,7 @@  discard block
 block discarded – undo
1020 1023
      * Método que agrega el subtotal del DTE
1021 1024
      * @param detalle Arreglo con los detalles del documentos para poder
1022 1025
      * calcular subtotal
1023
-     * @param x Posición horizontal de inicio en el PDF
1026
+     * @param x integer horizontal de inicio en el PDF
1024 1027
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
1025 1028
      * @version 2016-08-17
1026 1029
      */
@@ -1046,7 +1049,7 @@  discard block
 block discarded – undo
1046 1049
     /**
1047 1050
      * Método que agrega los descuentos y/o recargos globales del documento
1048 1051
      * @param descuentosRecargos Arreglo con los descuentos y/o recargos del documento (tag DscRcgGlobal del XML)
1049
-     * @param x Posición horizontal de inicio en el PDF
1052
+     * @param x integer horizontal de inicio en el PDF
1050 1053
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
1051 1054
      * @version 2016-08-17
1052 1055
      */
@@ -1070,7 +1073,7 @@  discard block
 block discarded – undo
1070 1073
     /**
1071 1074
      * Método que agrega los pagos del documento
1072 1075
      * @param pagos Arreglo con los pagos del documento
1073
-     * @param x Posición horizontal de inicio en el PDF
1076
+     * @param x integer horizontal de inicio en el PDF
1074 1077
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
1075 1078
      * @version 2016-07-24
1076 1079
      */
@@ -1207,9 +1210,9 @@  discard block
 block discarded – undo
1207 1210
      *  - Se imprime en el tamaño mínimo: 2x5 cms
1208 1211
      *  - En el lado de abajo con margen izquierdo mínimo de 2 cms
1209 1212
      * @param timbre String con los datos del timbre
1210
-     * @param x Posición horizontal de inicio en el PDF
1211
-     * @param y Posición vertical de inicio en el PDF
1212
-     * @param w Ancho del timbre
1213
+     * @param x integer horizontal de inicio en el PDF
1214
+     * @param y integer vertical de inicio en el PDF
1215
+     * @param w integer del timbre
1213 1216
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
1214 1217
      * @version 2017-10-05
1215 1218
      */
@@ -1247,10 +1250,10 @@  discard block
 block discarded – undo
1247 1250
 
1248 1251
     /**
1249 1252
      * Método que agrega el acuse de rebido
1250
-     * @param x Posición horizontal de inicio en el PDF
1251
-     * @param y Posición vertical de inicio en el PDF
1252
-     * @param w Ancho del acuse de recibo
1253
-     * @param h Alto del acuse de recibo
1253
+     * @param x integer horizontal de inicio en el PDF
1254
+     * @param y integer vertical de inicio en el PDF
1255
+     * @param w integer del acuse de recibo
1256
+     * @param h integer del acuse de recibo
1254 1257
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
1255 1258
      * @version 2017-10-05
1256 1259
      */
@@ -1278,10 +1281,10 @@  discard block
 block discarded – undo
1278 1281
 
1279 1282
     /**
1280 1283
      * Método que agrega el acuse de rebido
1281
-     * @param x Posición horizontal de inicio en el PDF
1284
+     * @param x integer horizontal de inicio en el PDF
1282 1285
      * @param y Posición vertical de inicio en el PDF
1283
-     * @param w Ancho del acuse de recibo
1284
-     * @param h Alto del acuse de recibo
1286
+     * @param w integer del acuse de recibo
1287
+     * @param h integer del acuse de recibo
1285 1288
      * @author Pablo Reyes (https://github.com/pabloxp)
1286 1289
      * @version 2015-11-17
1287 1290
      */
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     {
171 171
         parent::__construct();
172 172
         $this->SetTitle('Documento Tributario Electrónico (DTE) de Chile by LibreDTE');
173
-        $this->papelContinuo = $papelContinuo === true ? 80 : $papelContinuo;
173
+        $this->papelContinuo = $papelContinuo===true ? 80 : $papelContinuo;
174 174
     }
175 175
 
176 176
     /**
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         $this->setY(max($y));
316 316
         $this->Ln();
317 317
         $y = [];
318
-        $y[] = $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null);
318
+        $y[] = $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null);
319 319
         $y[] = $this->agregarReceptor($dte['Encabezado']);
320 320
         $this->setY(max($y));
321 321
         $this->agregarTraslado(
@@ -375,15 +375,15 @@  discard block
 block discarded – undo
375 375
             $dte['Encabezado']['IdDoc']['TipoDTE'],
376 376
             $dte['Encabezado']['IdDoc']['Folio'],
377 377
             $dte['Encabezado']['Emisor']['CmnaOrigen'],
378
-            $x_start, $y_start, $width-($x_start*4), 10,
379
-            [0,0,0]
378
+            $x_start, $y_start, $width-($x_start * 4), 10,
379
+            [0, 0, 0]
380 380
         );
381
-        $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, 40, 8, 9, [0,0,0]);
381
+        $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, 40, 8, 9, [0, 0, 0]);
382 382
         // datos del documento
383 383
         $this->SetY($y);
384 384
         $this->Ln();
385 385
         $this->setFont('', '', 8);
386
-        $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null, $x_start, $offset, false);
386
+        $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null, $x_start, $offset, false);
387 387
         $this->agregarReceptor($dte['Encabezado'], $x_start, $offset);
388 388
         $this->agregarTraslado(
389 389
             !empty($dte['Encabezado']['IdDoc']['IndTraslado']) ? $dte['Encabezado']['IdDoc']['IndTraslado'] : null,
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         $this->AddPage('P', [$height ? $height : $this->papel_continuo_alto, $width]);
437 437
         $x = 1;
438 438
         $y = 5;
439
-        $this->SetXY($x,$y);
439
+        $this->SetXY($x, $y);
440 440
         // agregar datos del documento
441 441
         $this->setFont('', '', 8);
442 442
         $this->MultiTexto(!empty($dte['Encabezado']['Emisor']['RznSoc']) ? $dte['Encabezado']['Emisor']['RznSoc'] : $dte['Encabezado']['Emisor']['RznSocEmisor'], $x, null, '', $width-2);
@@ -526,13 +526,13 @@  discard block
 block discarded – undo
526 526
                 $this->logo['uri'],
527 527
                 $x,
528 528
                 $y,
529
-                !$this->logo['posicion']?$w_img:null, $this->logo['posicion']?($w_img/2):null,
529
+                !$this->logo['posicion'] ? $w_img : null, $this->logo['posicion'] ? ($w_img / 2) : null,
530 530
                 'PNG',
531
-                (isset($emisor['url'])?$emisor['url']:''),
531
+                (isset($emisor['url']) ? $emisor['url'] : ''),
532 532
                 'T'
533 533
             );
534 534
             if ($this->logo['posicion']) {
535
-                $this->SetY($this->y + ($w_img/2));
535
+                $this->SetY($this->y+($w_img / 2));
536 536
                 $w += 40;
537 537
             } else {
538 538
                 $x = $this->x+3;
@@ -543,13 +543,13 @@  discard block
 block discarded – undo
543 543
         }
544 544
         // agregar datos del emisor
545 545
         $this->setFont('', 'B', $font_size ? $font_size : 14);
546
-        $this->SetTextColorArray($color===null?[32, 92, 144]:$color);
546
+        $this->SetTextColorArray($color===null ? [32, 92, 144] : $color);
547 547
         $this->MultiTexto(!empty($emisor['RznSoc']) ? $emisor['RznSoc'] : $emisor['RznSocEmisor'], $x, $this->y+2, 'L', $w);
548 548
         $this->setFont('', 'B', $font_size ? $font_size : 9);
549
-        $this->SetTextColorArray([0,0,0]);
549
+        $this->SetTextColorArray([0, 0, 0]);
550 550
         $this->MultiTexto(!empty($emisor['GiroEmis']) ? $emisor['GiroEmis'] : $emisor['GiroEmisor'], $x, $this->y, 'L', $w);
551 551
         $ciudad = !empty($emisor['CiudadOrigen']) ? $emisor['CiudadOrigen'] : \sasco\LibreDTE\Chile::getCiudad($emisor['CmnaOrigen']);
552
-        $this->MultiTexto($emisor['DirOrigen'].', '.$emisor['CmnaOrigen'].($ciudad?(', '.$ciudad):''), $x, $this->y, 'L', $w);
552
+        $this->MultiTexto($emisor['DirOrigen'].', '.$emisor['CmnaOrigen'].($ciudad ? (', '.$ciudad) : ''), $x, $this->y, 'L', $w);
553 553
         if (!empty($emisor['Sucursal'])) {
554 554
             $this->MultiTexto('Sucursal: '.$emisor['Sucursal'], $x, $this->y, 'L', $w);
555 555
         }
@@ -593,12 +593,12 @@  discard block
 block discarded – undo
593 593
     private function agregarFolio($rut, $tipo, $folio, $sucursal_sii = null, $x = 130, $y = 15, $w = 70, $font_size = null, array $color = null)
594 594
     {
595 595
         if ($color===null) {
596
-            $color = $tipo ? ($tipo==52 ? [0,172,140] : [255,0,0]) : [0,0,0];
596
+            $color = $tipo ? ($tipo==52 ? [0, 172, 140] : [255, 0, 0]) : [0, 0, 0];
597 597
         }
598 598
         $this->SetTextColorArray($color);
599 599
         // colocar rut emisor, glosa documento y folio
600 600
         list($rut, $dv) = explode('-', $rut);
601
-        $this->setFont ('', 'B', $font_size ? $font_size : 15);
601
+        $this->setFont('', 'B', $font_size ? $font_size : 15);
602 602
         $this->MultiTexto('R.U.T.: '.$this->num($rut).'-'.$dv, $x, $y+4, 'C', $w);
603 603
         $this->setFont('', 'B', $font_size ? $font_size : 12);
604 604
         $this->MultiTexto($this->getTipo($tipo), $x, null, 'C', $w);
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
         if ($tipo) {
612 612
             $this->Texto('S.I.I. - '.\sasco\LibreDTE\Sii::getDireccionRegional($sucursal_sii), $x, $this->getY()+4, 'C', $w);
613 613
         }
614
-        $this->SetTextColorArray([0,0,0]);
614
+        $this->SetTextColorArray([0, 0, 0]);
615 615
         $this->Ln();
616 616
         return $this->y;
617 617
     }
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
             $this->Texto('Señor(es)', $x);
743 743
             $this->Texto(':', $x+$offset);
744 744
             $this->setFont('', '', null);
745
-            $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10?105:0);
745
+            $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0);
746 746
         }
747 747
         if (!empty($receptor['GiroRecep'])) {
748 748
             $this->setFont('', 'B', null);
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
             $ciudad = !empty($receptor['CiudadRecep']) ? $receptor['CiudadRecep'] : (
760 760
                 !empty($receptor['CmnaRecep']) ? \sasco\LibreDTE\Chile::getCiudad($receptor['CmnaRecep']) : ''
761 761
             );
762
-            $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep'])?(', '.$receptor['CmnaRecep']):'').($ciudad?(', '.$ciudad):''), $x+$offset+2);
762
+            $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep']) ? (', '.$receptor['CmnaRecep']) : '').($ciudad ? (', '.$ciudad) : ''), $x+$offset+2);
763 763
         }
764 764
         if (!empty($receptor['Extranjero']['Nacionalidad'])) {
765 765
             $this->setFont('', 'B', null);
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
             $this->Texto('Cód. recep.', $x);
801 801
             $this->Texto(':', $x+$offset);
802 802
             $this->setFont('', '', null);
803
-            $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10?105:0);
803
+            $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0);
804 804
         }
805 805
         return $this->GetY();
806 806
     }
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
     {
889 889
         if (!isset($referencias[0]))
890 890
             $referencias = [$referencias];
891
-        foreach($referencias as $r) {
891
+        foreach ($referencias as $r) {
892 892
             $texto = $r['NroLinRef'].' - ';
893 893
             if (!empty($r['TpoDocRef'])) {
894 894
                 $texto .= $this->getTipo($r['TpoDocRef']).' ';
@@ -995,9 +995,9 @@  discard block
 block discarded – undo
995 995
         $this->SetY($this->getY()+1);
996 996
         $p1x = $x;
997 997
         $p1y = $this->y;
998
-        $p2x = $this->getPageWidth() - 2;
999
-        $p2y = $p1y;  // Use same y for a straight line
1000
-        $style = array('width' => 0.2,'color' => array(0, 0, 0));
998
+        $p2x = $this->getPageWidth()-2;
999
+        $p2y = $p1y; // Use same y for a straight line
1000
+        $style = array('width' => 0.2, 'color' => array(0, 0, 0));
1001 1001
         $this->Line($p1x, $p1y, $p2x, $p2y, $style);
1002 1002
         $this->Texto($this->detalle_cols['NmbItem']['title'], $x+1, $this->y, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']);
1003 1003
         $this->Texto($this->detalle_cols['PrcItem']['title'], $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']);
@@ -1007,9 +1007,9 @@  discard block
 block discarded – undo
1007 1007
         if (!isset($detalle[0]))
1008 1008
             $detalle = [$detalle];
1009 1009
         $this->SetY($this->getY()+2);
1010
-        foreach($detalle as  &$d) {
1010
+        foreach ($detalle as  &$d) {
1011 1011
             $this->MultiTexto($d['NmbItem'], $x+1, $this->y+4, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']);
1012
-            $this->Texto(number_format($d['PrcItem'],0,',','.'), $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']);
1012
+            $this->Texto(number_format($d['PrcItem'], 0, ',', '.'), $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']);
1013 1013
             $this->Texto($this->num($d['QtyItem']), $x+35, $this->y, ucfirst($this->detalle_cols['QtyItem']['align'][0]), $this->detalle_cols['QtyItem']['width']);
1014 1014
             $this->Texto($this->num($d['MontoItem']), $x+45, $this->y, ucfirst($this->detalle_cols['MontoItem']['align'][0]), $this->detalle_cols['MontoItem']['width']);
1015 1015
         }
@@ -1029,7 +1029,7 @@  discard block
 block discarded – undo
1029 1029
         if (!isset($detalle[0])) {
1030 1030
             $detalle = [$detalle];
1031 1031
         }
1032
-        foreach($detalle as  &$d) {
1032
+        foreach ($detalle as  &$d) {
1033 1033
             if (!empty($d['MontoItem'])) {
1034 1034
                 $subtotal += $d['MontoItem'];
1035 1035
             }
@@ -1054,13 +1054,13 @@  discard block
 block discarded – undo
1054 1054
     {
1055 1055
         if (!isset($descuentosRecargos[0]))
1056 1056
             $descuentosRecargos = [$descuentosRecargos];
1057
-        foreach($descuentosRecargos as $dr) {
1057
+        foreach ($descuentosRecargos as $dr) {
1058 1058
             $tipo = $dr['TpoMov']=='D' ? 'Descuento' : 'Recargo';
1059 1059
             $valor = $dr['TpoValor']=='%' ? $dr['ValorDR'].'%' : $this->num($dr['ValorDR']);
1060 1060
             if ($this->papelContinuo) {
1061
-                $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR'])?(' ('.$dr['GlosaDR'].')'):''), $x);
1061
+                $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR']) ? (' ('.$dr['GlosaDR'].')') : ''), $x);
1062 1062
             } else {
1063
-                $this->Texto($tipo.(!empty($dr['GlosaDR'])?(' ('.$dr['GlosaDR'].')'):'').':', 77, null, 'R', 100);
1063
+                $this->Texto($tipo.(!empty($dr['GlosaDR']) ? (' ('.$dr['GlosaDR'].')') : '').':', 77, null, 'R', 100);
1064 1064
                 $this->Texto($valor, 177, null, 'R', 22);
1065 1065
             }
1066 1066
             $this->Ln();
@@ -1080,8 +1080,8 @@  discard block
 block discarded – undo
1080 1080
             $pagos = [$pagos];
1081 1081
         $this->Texto('Pago(s) programado(s):', $x);
1082 1082
         $this->Ln();
1083
-        foreach($pagos as $p) {
1084
-            $this->Texto('  - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos'])?(' ('.$p['GlosaPagos'].')'):''), $x);
1083
+        foreach ($pagos as $p) {
1084
+            $this->Texto('  - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos']) ? (' ('.$p['GlosaPagos'].')') : ''), $x);
1085 1085
             $this->Ln();
1086 1086
         }
1087 1087
     }
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
             if (!isset($ImptoReten[0])) {
1133 1133
                 $ImptoReten = [$ImptoReten];
1134 1134
             }
1135
-            foreach($ImptoReten as $i) {
1135
+            foreach ($ImptoReten as $i) {
1136 1136
                 $totales['ImptoReten_'.$i['TipoImp']] = $i['MontoImp'];
1137 1137
                 if (!empty($i['TasaImp'])) {
1138 1138
                     $glosas['ImptoReten_'.$i['TipoImp']] = \sasco\LibreDTE\Sii\ImpuestosAdicionales::getGlosa($i['TipoImp']).' ('.$i['TasaImp'].'%) $';
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
                 'vpadding' => 0,
1225 1225
                 'module_width' => 1, // width of a single module in points
1226 1226
                 'module_height' => 1, // height of a single module in points
1227
-                'fgcolor' => [0,0,0],
1227
+                'fgcolor' => [0, 0, 0],
1228 1228
                 'bgcolor' => false, // [255,255,255]
1229 1229
                 'position' => $this->papelContinuo ? 'C' : 'S',
1230 1230
             ];
@@ -1257,7 +1257,7 @@  discard block
 block discarded – undo
1257 1257
     private function agregarAcuseRecibo($x = 93, $y = 190, $w = 50, $h = 40)
1258 1258
     {
1259 1259
         $y = (!$this->papelContinuo and !$this->timbre_pie) ? $this->x_fin_datos : $y;
1260
-        $this->SetTextColorArray([0,0,0]);
1260
+        $this->SetTextColorArray([0, 0, 0]);
1261 1261
         $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]);
1262 1262
         $this->setFont('', 'B', 10);
1263 1263
         $this->Texto('Acuse de recibo', $x, $y+1, 'C', $w);
@@ -1287,9 +1287,9 @@  discard block
 block discarded – undo
1287 1287
      */
1288 1288
     private function agregarAcuseReciboContinuo($x = 3, $y = null, $w = 68, $h = 40)
1289 1289
     {
1290
-        $this->SetTextColorArray([0,0,0]);
1290
+        $this->SetTextColorArray([0, 0, 0]);
1291 1291
         $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]);
1292
-        $style = array('width' => 0.2,'color' => array(0, 0, 0));
1292
+        $style = array('width' => 0.2, 'color' => array(0, 0, 0));
1293 1293
         $this->Line($x, $y+22, $w+3, $y+22, $style);
1294 1294
         //$this->setFont('', 'B', 10);
1295 1295
         //$this->Texto('Acuse de recibo', $x, $y+1, 'C', $w);
@@ -1319,7 +1319,7 @@  discard block
 block discarded – undo
1319 1319
         $y = (!$this->papelContinuo and !$this->timbre_pie) ? $this->x_fin_datos : $y;
1320 1320
         $y += 64;
1321 1321
         $this->setFont('', 'B', $font_size);
1322
-        $this->Texto('CEDIBLE'.($tipo==52?' CON SU FACTURA':''), null, $y, 'R');
1322
+        $this->Texto('CEDIBLE'.($tipo==52 ? ' CON SU FACTURA' : ''), null, $y, 'R');
1323 1323
     }
1324 1324
 
1325 1325
     /**
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
     private function agregarLeyendaDestinoContinuo($tipo)
1331 1331
     {
1332 1332
         $this->setFont('', 'B', 8);
1333
-        $this->Texto('CEDIBLE'.($tipo==52?' CON SU FACTURA':''), null, $this->y+6, 'R');
1333
+        $this->Texto('CEDIBLE'.($tipo==52 ? ' CON SU FACTURA' : ''), null, $this->y+6, 'R');
1334 1334
     }
1335 1335
 
1336 1336
     /**
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
         $dias = ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'];
1362 1362
         $meses = ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'];
1363 1363
         $unixtime = strtotime($date);
1364
-        $fecha = date(($mostrar_dia?'\D\I\A ':'').'j \d\e \M\E\S \d\e\l Y', $unixtime);
1364
+        $fecha = date(($mostrar_dia ? '\D\I\A ' : '').'j \d\e \M\E\S \d\e\l Y', $unixtime);
1365 1365
         $dia = $dias[date('w', $unixtime)];
1366 1366
         $mes = $meses[date('n', $unixtime)-1];
1367 1367
         return str_replace(array('DIA', 'MES'), array($dia, $mes), $fecha);
Please login to merge, or discard this patch.
Braces   +80 added lines, -54 removed lines patch added patch discarded remove patch
@@ -555,10 +555,12 @@  discard block
 block discarded – undo
555 555
         }
556 556
         $contacto = [];
557 557
         if (!empty($emisor['Telefono'])) {
558
-            if (!is_array($emisor['Telefono']))
559
-                $emisor['Telefono'] = [$emisor['Telefono']];
560
-            foreach ($emisor['Telefono'] as $t)
561
-                $contacto[] = $t;
558
+            if (!is_array($emisor['Telefono'])) {
559
+                            $emisor['Telefono'] = [$emisor['Telefono']];
560
+            }
561
+            foreach ($emisor['Telefono'] as $t) {
562
+                            $contacto[] = $t;
563
+            }
562 564
         }
563 565
         if (!empty($emisor['CorreoEmisor'])) {
564 566
             $contacto[] = $emisor['CorreoEmisor'];
@@ -625,8 +627,9 @@  discard block
 block discarded – undo
625 627
      */
626 628
     private function getTipo($tipo)
627 629
     {
628
-        if (!is_numeric($tipo) and !isset($this->tipos[$tipo]))
629
-            return $tipo;
630
+        if (!is_numeric($tipo) and !isset($this->tipos[$tipo])) {
631
+                    return $tipo;
632
+        }
630 633
         return isset($this->tipos[$tipo]) ? strtoupper($this->tipos[$tipo]) : 'Documento '.$tipo;
631 634
     }
632 635
 
@@ -776,10 +779,12 @@  discard block
 block discarded – undo
776 779
             $this->MultiTexto($receptor['Extranjero']['NumId'], $x+$offset+2);
777 780
         }
778 781
         $contacto = [];
779
-        if (!empty($receptor['Contacto']))
780
-            $contacto[] = $receptor['Contacto'];
781
-        if (!empty($receptor['CorreoRecep']))
782
-            $contacto[] = $receptor['CorreoRecep'];
782
+        if (!empty($receptor['Contacto'])) {
783
+                    $contacto[] = $receptor['Contacto'];
784
+        }
785
+        if (!empty($receptor['CorreoRecep'])) {
786
+                    $contacto[] = $receptor['CorreoRecep'];
787
+        }
783 788
         if (!empty($contacto)) {
784 789
             $this->setFont('', 'B', null);
785 790
             $this->Texto('Contacto', $x);
@@ -829,15 +834,19 @@  discard block
 block discarded – undo
829 834
             if (!empty($Transporte['DirDest']) and !empty($Transporte['CmnaDest'])) {
830 835
                 $transporte .= 'a '.$Transporte['DirDest'].', '.$Transporte['CmnaDest'];
831 836
             }
832
-            if (!empty($Transporte['RUTTrans']))
833
-                $transporte .= ' por '.$Transporte['RUTTrans'];
834
-            if (!empty($Transporte['Patente']))
835
-                $transporte .= ' en vehículo '.$Transporte['Patente'];
837
+            if (!empty($Transporte['RUTTrans'])) {
838
+                            $transporte .= ' por '.$Transporte['RUTTrans'];
839
+            }
840
+            if (!empty($Transporte['Patente'])) {
841
+                            $transporte .= ' en vehículo '.$Transporte['Patente'];
842
+            }
836 843
             if (isset($Transporte['Chofer']) and is_array($Transporte['Chofer'])) {
837
-                if (!empty($Transporte['Chofer']['NombreChofer']))
838
-                    $transporte .= ' con chofer '.$Transporte['Chofer']['NombreChofer'];
839
-                if (!empty($Transporte['Chofer']['RUTChofer']))
840
-                    $transporte .= ' ('.$Transporte['Chofer']['RUTChofer'].')';
844
+                if (!empty($Transporte['Chofer']['NombreChofer'])) {
845
+                                    $transporte .= ' con chofer '.$Transporte['Chofer']['NombreChofer'];
846
+                }
847
+                if (!empty($Transporte['Chofer']['RUTChofer'])) {
848
+                                    $transporte .= ' ('.$Transporte['Chofer']['RUTChofer'].')';
849
+                }
841 850
             }
842 851
             if ($transporte) {
843 852
                 $this->setFont('', 'B', null);
@@ -851,8 +860,9 @@  discard block
 block discarded – undo
851 860
         if (!empty($Transporte['Aduana']) and is_array($Transporte['Aduana'])) {
852 861
             $col = 0;
853 862
             foreach ($Transporte['Aduana'] as $tag => $codigo) {
854
-                if ($codigo===false)
855
-                    continue;
863
+                if ($codigo===false) {
864
+                                    continue;
865
+                }
856 866
                 $glosa = \sasco\LibreDTE\Sii\Aduana::getGlosa($tag);
857 867
                 $valor = \sasco\LibreDTE\Sii\Aduana::getValor($tag, $codigo);
858 868
                 if ($glosa!==false and $valor!==false) {
@@ -865,15 +875,18 @@  discard block
 block discarded – undo
865 875
                     $this->Texto(':', $x+$offset+$col);
866 876
                     $this->setFont('', '', null);
867 877
                     $this->Texto($valor, $x+$offset+2+$col);
868
-                    if ($tag=='TipoBultos')
869
-                        $col = abs($col-110);
870
-                    if ($col)
871
-                        $this->Ln();
878
+                    if ($tag=='TipoBultos') {
879
+                                            $col = abs($col-110);
880
+                    }
881
+                    if ($col) {
882
+                                            $this->Ln();
883
+                    }
872 884
                     $col = abs($col-110);
873 885
                 }
874 886
             }
875
-            if ($col)
876
-                $this->Ln();
887
+            if ($col) {
888
+                            $this->Ln();
889
+            }
877 890
         }
878 891
     }
879 892
 
@@ -886,8 +899,9 @@  discard block
 block discarded – undo
886 899
      */
887 900
     private function agregarReferencia($referencias, $x = 10, $offset = 22)
888 901
     {
889
-        if (!isset($referencias[0]))
890
-            $referencias = [$referencias];
902
+        if (!isset($referencias[0])) {
903
+                    $referencias = [$referencias];
904
+        }
891 905
         foreach($referencias as $r) {
892 906
             $texto = $r['NroLinRef'].' - ';
893 907
             if (!empty($r['TpoDocRef'])) {
@@ -924,8 +938,9 @@  discard block
 block discarded – undo
924 938
      */
925 939
     private function agregarDetalle($detalle, $x = 10)
926 940
     {
927
-        if (!isset($detalle[0]))
928
-            $detalle = [$detalle];
941
+        if (!isset($detalle[0])) {
942
+                    $detalle = [$detalle];
943
+        }
929 944
         $this->setFont('', '', $this->detalle_fuente);
930 945
         // titulos
931 946
         $titulos = [];
@@ -942,36 +957,42 @@  discard block
 block discarded – undo
942 957
                     $item['NmbItem'] .= !$this->item_detalle_posicion ? '<br/>' : ': ';
943 958
                     $item['NmbItem'] .= '<span style="font-size:0.7em">'.$item['DscItem'].'</span>';
944 959
                 }
945
-                if (!in_array($col, $titulos_keys) or ($dte_exento and $col=='IndExe'))
946
-                    unset($item[$col]);
960
+                if (!in_array($col, $titulos_keys) or ($dte_exento and $col=='IndExe')) {
961
+                                    unset($item[$col]);
962
+                }
947 963
             }
948 964
             // ajustes a IndExe
949 965
             if (isset($item['IndExe'])) {
950
-                if ($item['IndExe']==1)
951
-                    $item['IndExe'] = 'EX';
952
-                else if ($item['IndExe']==2)
953
-                    $item['IndExe'] = 'NF';
966
+                if ($item['IndExe']==1) {
967
+                                    $item['IndExe'] = 'EX';
968
+                } else if ($item['IndExe']==2) {
969
+                                    $item['IndExe'] = 'NF';
970
+                }
954 971
             }
955 972
             // agregar todas las columnas que se podrían imprimir en la tabla
956 973
             $item_default = [];
957
-            foreach ($this->detalle_cols as $key => $info)
958
-                $item_default[$key] = false;
974
+            foreach ($this->detalle_cols as $key => $info) {
975
+                            $item_default[$key] = false;
976
+            }
959 977
             $item = array_merge($item_default, $item);
960 978
             // si hay código de item se extrae su valor
961
-            if ($item['CdgItem'])
962
-                $item['CdgItem'] = $item['CdgItem']['VlrCodigo'];
979
+            if ($item['CdgItem']) {
980
+                            $item['CdgItem'] = $item['CdgItem']['VlrCodigo'];
981
+            }
963 982
             // dar formato a números
964 983
             foreach (['QtyItem', 'PrcItem', 'DescuentoMonto', 'RecargoMonto', 'MontoItem'] as $col) {
965
-                if ($item[$col])
966
-                    $item[$col] = $this->num($item[$col]);
984
+                if ($item[$col]) {
985
+                                    $item[$col] = $this->num($item[$col]);
986
+                }
967 987
             }
968 988
         }
969 989
         // opciones
970 990
         $options = ['align'=>[]];
971 991
         $i = 0;
972 992
         foreach ($this->detalle_cols as $info) {
973
-            if (isset($info['width']))
974
-                $options['width'][$i] = $info['width'];
993
+            if (isset($info['width'])) {
994
+                            $options['width'][$i] = $info['width'];
995
+            }
975 996
             $options['align'][$i] = $info['align'];
976 997
             $i++;
977 998
         }
@@ -1004,8 +1025,9 @@  discard block
 block discarded – undo
1004 1025
         $this->Texto($this->detalle_cols['QtyItem']['title'], $x+35, $this->y, ucfirst($this->detalle_cols['QtyItem']['align'][0]), $this->detalle_cols['QtyItem']['width']);
1005 1026
         $this->Texto($this->detalle_cols['MontoItem']['title'], $x+45, $this->y, ucfirst($this->detalle_cols['MontoItem']['align'][0]), $this->detalle_cols['MontoItem']['width']);
1006 1027
         $this->Line($p1x, $p1y+4, $p2x, $p2y+4, $style);
1007
-        if (!isset($detalle[0]))
1008
-            $detalle = [$detalle];
1028
+        if (!isset($detalle[0])) {
1029
+                    $detalle = [$detalle];
1030
+        }
1009 1031
         $this->SetY($this->getY()+2);
1010 1032
         foreach($detalle as  &$d) {
1011 1033
             $this->MultiTexto($d['NmbItem'], $x+1, $this->y+4, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']);
@@ -1052,8 +1074,9 @@  discard block
 block discarded – undo
1052 1074
      */
1053 1075
     private function agregarDescuentosRecargos(array $descuentosRecargos, $x = 10)
1054 1076
     {
1055
-        if (!isset($descuentosRecargos[0]))
1056
-            $descuentosRecargos = [$descuentosRecargos];
1077
+        if (!isset($descuentosRecargos[0])) {
1078
+                    $descuentosRecargos = [$descuentosRecargos];
1079
+        }
1057 1080
         foreach($descuentosRecargos as $dr) {
1058 1081
             $tipo = $dr['TpoMov']=='D' ? 'Descuento' : 'Recargo';
1059 1082
             $valor = $dr['TpoValor']=='%' ? $dr['ValorDR'].'%' : $this->num($dr['ValorDR']);
@@ -1076,8 +1099,9 @@  discard block
 block discarded – undo
1076 1099
      */
1077 1100
     private function agregarPagos(array $pagos, $x = 10)
1078 1101
     {
1079
-        if (!isset($pagos[0]))
1080
-            $pagos = [$pagos];
1102
+        if (!isset($pagos[0])) {
1103
+                    $pagos = [$pagos];
1104
+        }
1081 1105
         $this->Texto('Pago(s) programado(s):', $x);
1082 1106
         $this->Ln();
1083 1107
         foreach($pagos as $p) {
@@ -1343,11 +1367,13 @@  discard block
 block discarded – undo
1343 1367
      */
1344 1368
     private function num($n)
1345 1369
     {
1346
-        if (!is_numeric($n))
1347
-            return $n;
1370
+        if (!is_numeric($n)) {
1371
+                    return $n;
1372
+        }
1348 1373
         $broken_number = explode('.', (string)$n);
1349
-        if (isset($broken_number[1]))
1350
-            return number_format($broken_number[0], 0, ',', '.').','.$broken_number[1];
1374
+        if (isset($broken_number[1])) {
1375
+                    return number_format($broken_number[0], 0, ',', '.').','.$broken_number[1];
1376
+        }
1351 1377
         return number_format($broken_number[0], 0, ',', '.');
1352 1378
     }
1353 1379
 
Please login to merge, or discard this patch.