Completed
Push — master ( f59f35...5996f2 )
by Esteban De La Fuente
02:50
created
lib/Sii/PDF/Dte.php 2 patches
Doc Comments   +31 added lines, -28 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
     /**
174 174
      * Método que asigna la ubicación del logo de la empresa
175 175
      * @param logo URI del logo (puede ser local o en una URL)
176
-     * @param posicion Posición respecto a datos del emisor (=0 izq, =1 arriba)
176
+     * @param posicion integer respecto a datos del emisor (=0 izq, =1 arriba)
177 177
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
178 178
      * @version 2016-08-04
179 179
      */
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
      * contínuo
329 329
      * @param dte Arreglo con los datos del XML (tag Documento)
330 330
      * @param timbre String XML con el tag TED del DTE
331
-     * @param width Ancho del papel contínuo en mm
331
+     * @param width boolean del papel contínuo en mm
332 332
      * @author Pablo Reyes (https://github.com/pabloxp)
333 333
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
334 334
      * @version 2017-06-15
@@ -401,10 +401,11 @@  discard block
 block discarded – undo
401 401
      *  - Dirección casa central del emisor
402 402
      *  - Dirección sucursales
403 403
      * @param emisor Arreglo con los datos del emisor (tag Emisor del XML)
404
-     * @param x Posición horizontal de inicio en el PDF
405
-     * @param y Posición vertical de inicio en el PDF
406
-     * @param w Ancho de la información del emisor
407
-     * @param w_img Ancho máximo de la imagen
404
+     * @param x integer horizontal de inicio en el PDF
405
+     * @param y integer vertical de inicio en el PDF
406
+     * @param w integer de la información del emisor
407
+     * @param w_img integer máximo de la imagen
408
+     * @param integer $font_size
408 409
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
409 410
      * @version 2016-12-02
410 411
      */
@@ -474,11 +475,13 @@  discard block
 block discarded – undo
474 475
      * @param rut RUT del emisor
475 476
      * @param tipo Código o glosa del tipo de documento
476 477
      * @param sucursal_sii Código o glosa de la sucursal del SII del Emisor
477
-     * @param x Posición horizontal de inicio en el PDF
478
-     * @param y Posición vertical de inicio en el PDF
479
-     * @param w Ancho de la información del emisor
478
+     * @param x integer horizontal de inicio en el PDF
479
+     * @param y integer vertical de inicio en el PDF
480
+     * @param w integer de la información del emisor
481
+     * @param integer $font_size
480 482
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
481 483
      * @version 2016-12-02
484
+     * @return integer
482 485
      */
483 486
     private function agregarFolio($rut, $tipo, $folio, $sucursal_sii = null, $x = 130, $y = 15, $w = 70, $font_size = null, array $color = null)
484 487
     {
@@ -524,7 +527,7 @@  discard block
 block discarded – undo
524 527
      * Método que agrega los datos de la emisión del DTE que no son los dato del
525 528
      * receptor
526 529
      * @param IdDoc Información general del documento
527
-     * @param x Posición horizontal de inicio en el PDF
530
+     * @param x integer horizontal de inicio en el PDF
528 531
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
529 532
      * @version 2017-06-15
530 533
      */
@@ -612,7 +615,7 @@  discard block
 block discarded – undo
612 615
     /**
613 616
      * Método que agrega los datos del receptor
614 617
      * @param receptor Arreglo con los datos del receptor (tag Receptor del XML)
615
-     * @param x Posición horizontal de inicio en el PDF
618
+     * @param x integer horizontal de inicio en el PDF
616 619
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
617 620
      * @version 2017-06-15
618 621
      */
@@ -692,7 +695,7 @@  discard block
 block discarded – undo
692 695
      * Método que agrega los datos del traslado
693 696
      * @param IndTraslado
694 697
      * @param Transporte
695
-     * @param x Posición horizontal de inicio en el PDF
698
+     * @param x integer horizontal de inicio en el PDF
696 699
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
697 700
      * @version 2016-08-03
698 701
      */
@@ -763,7 +766,7 @@  discard block
 block discarded – undo
763 766
     /**
764 767
      * Método que agrega las referencias del documento
765 768
      * @param referencias Arreglo con las referencias del documento (tag Referencia del XML)
766
-     * @param x Posición horizontal de inicio en el PDF
769
+     * @param x integer horizontal de inicio en el PDF
767 770
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
768 771
      * @version 2016-08-03
769 772
      */
@@ -786,7 +789,7 @@  discard block
 block discarded – undo
786 789
     /**
787 790
      * Método que agrega el detalle del documento
788 791
      * @param detalle Arreglo con el detalle del documento (tag Detalle del XML)
789
-     * @param x Posición horizontal de inicio en el PDF
792
+     * @param x integer horizontal de inicio en el PDF
790 793
      * @param y Posición vertical de inicio en el PDF
791 794
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
792 795
      * @version 2016-08-05
@@ -853,7 +856,7 @@  discard block
 block discarded – undo
853 856
     /**
854 857
      * Método que agrega el detalle del documento
855 858
      * @param detalle Arreglo con el detalle del documento (tag Detalle del XML)
856
-     * @param x Posición horizontal de inicio en el PDF
859
+     * @param x integer horizontal de inicio en el PDF
857 860
      * @param y Posición vertical de inicio en el PDF
858 861
      * @author Pablo Reyes (https://github.com/pabloxp)
859 862
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
@@ -889,7 +892,7 @@  discard block
 block discarded – undo
889 892
      * Método que agrega el subtotal del DTE
890 893
      * @param detalle Arreglo con los detalles del documentos para poder
891 894
      * calcular subtotal
892
-     * @param x Posición horizontal de inicio en el PDF
895
+     * @param x integer horizontal de inicio en el PDF
893 896
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
894 897
      * @version 2016-08-17
895 898
      */
@@ -910,7 +913,7 @@  discard block
 block discarded – undo
910 913
     /**
911 914
      * Método que agrega los descuentos y/o recargos globales del documento
912 915
      * @param descuentosRecargos Arreglo con los descuentos y/o recargos del documento (tag DscRcgGlobal del XML)
913
-     * @param x Posición horizontal de inicio en el PDF
916
+     * @param x integer horizontal de inicio en el PDF
914 917
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
915 918
      * @version 2016-08-17
916 919
      */
@@ -929,7 +932,7 @@  discard block
 block discarded – undo
929 932
     /**
930 933
      * Método que agrega los pagos del documento
931 934
      * @param pagos Arreglo con los pagos del documento
932
-     * @param x Posición horizontal de inicio en el PDF
935
+     * @param x integer horizontal de inicio en el PDF
933 936
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
934 937
      * @version 2016-07-24
935 938
      */
@@ -1039,9 +1042,9 @@  discard block
 block discarded – undo
1039 1042
      *  - Se imprime en el tamaño mínimo: 2x5 cms
1040 1043
      *  - En el lado de abajo con margen izquierdo mínimo de 2 cms
1041 1044
      * @param timbre String con los datos del timbre
1042
-     * @param x Posición horizontal de inicio en el PDF
1043
-     * @param y Posición vertical de inicio en el PDF
1044
-     * @param w Ancho del timbre
1045
+     * @param x integer horizontal de inicio en el PDF
1046
+     * @param y integer vertical de inicio en el PDF
1047
+     * @param w integer del timbre
1045 1048
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
1046 1049
      * @version 2016-12-02
1047 1050
      */
@@ -1072,10 +1075,10 @@  discard block
 block discarded – undo
1072 1075
 
1073 1076
     /**
1074 1077
      * Método que agrega el acuse de rebido
1075
-     * @param x Posición horizontal de inicio en el PDF
1076
-     * @param y Posición vertical de inicio en el PDF
1077
-     * @param w Ancho del acuse de recibo
1078
-     * @param h Alto del acuse de recibo
1078
+     * @param x integer horizontal de inicio en el PDF
1079
+     * @param y integer vertical de inicio en el PDF
1080
+     * @param w integer del acuse de recibo
1081
+     * @param h integer del acuse de recibo
1079 1082
      * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
1080 1083
      * @version 2015-09-08
1081 1084
      */
@@ -1102,10 +1105,10 @@  discard block
 block discarded – undo
1102 1105
 
1103 1106
     /**
1104 1107
      * Método que agrega el acuse de rebido
1105
-     * @param x Posición horizontal de inicio en el PDF
1108
+     * @param x integer horizontal de inicio en el PDF
1106 1109
      * @param y Posición vertical de inicio en el PDF
1107
-     * @param w Ancho del acuse de recibo
1108
-     * @param h Alto del acuse de recibo
1110
+     * @param w integer del acuse de recibo
1111
+     * @param h integer del acuse de recibo
1109 1112
      * @author Pablo Reyes (https://github.com/pabloxp)
1110 1113
      * @version 2015-11-17
1111 1114
      */
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
         parent::__construct();
169 169
         $this->SetTitle('Documento Tributario Electrónico (DTE) de Chile by LibreDTE');
170
-        $this->papelContinuo = $papelContinuo === true ? 80 : $papelContinuo;
170
+        $this->papelContinuo = $papelContinuo===true ? 80 : $papelContinuo;
171 171
     }
172 172
 
173 173
     /**
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         $this->setY(max($y));
296 296
         $this->Ln();
297 297
         $y = [];
298
-        $y[] = $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null);
298
+        $y[] = $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null);
299 299
         $y[] = $this->agregarReceptor($dte['Encabezado']);
300 300
         $this->setY(max($y));
301 301
         $this->agregarTraslado(
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         // determinar alto de la página y agregarla
343 343
         $height = 145;
344 344
         $n_detalle = count($dte['Detalle']);
345
-        if ($n_detalle>1) $height += $n_detalle*20;
345
+        if ($n_detalle>1) $height += $n_detalle * 20;
346 346
         if ($this->cedible) $height += 50;
347 347
         $this->AddPage('P', [$height, $width]);
348 348
         // agregar cabecera del documento
@@ -351,15 +351,15 @@  discard block
 block discarded – undo
351 351
             $dte['Encabezado']['IdDoc']['TipoDTE'],
352 352
             $dte['Encabezado']['IdDoc']['Folio'],
353 353
             $dte['Encabezado']['Emisor']['CmnaOrigen'],
354
-            $x_start, $y_start, $width-($x_start*4), 10,
355
-            [0,0,0]
354
+            $x_start, $y_start, $width-($x_start * 4), 10,
355
+            [0, 0, 0]
356 356
         );
357
-        $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, 40, 8, 9, [0,0,0]);
357
+        $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, 40, 8, 9, [0, 0, 0]);
358 358
         // datos del documento
359 359
         $this->SetY($y);
360 360
         $this->Ln();
361 361
         $this->setFont('', '', 8);
362
-        $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null, $x_start, $offset, false);
362
+        $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null, $x_start, $offset, false);
363 363
         $this->agregarReceptor($dte['Encabezado'], $x_start, $offset);
364 364
         $this->agregarTraslado(
365 365
             !empty($dte['Encabezado']['IdDoc']['IndTraslado']) ? $dte['Encabezado']['IdDoc']['IndTraslado'] : null,
@@ -416,13 +416,13 @@  discard block
 block discarded – undo
416 416
                 $this->logo['uri'],
417 417
                 $x,
418 418
                 $y,
419
-                !$this->logo['posicion']?$w_img:null, $this->logo['posicion']?($w_img/2):null,
419
+                !$this->logo['posicion'] ? $w_img : null, $this->logo['posicion'] ? ($w_img / 2) : null,
420 420
                 'PNG',
421
-                (isset($emisor['url'])?$emisor['url']:''),
421
+                (isset($emisor['url']) ? $emisor['url'] : ''),
422 422
                 'T'
423 423
             );
424 424
             if ($this->logo['posicion']) {
425
-                $this->SetY($this->y + ($w_img/2));
425
+                $this->SetY($this->y+($w_img / 2));
426 426
                 $w += 40;
427 427
             } else {
428 428
                 $x = $this->x+3;
@@ -433,13 +433,13 @@  discard block
 block discarded – undo
433 433
         }
434 434
         // agregar datos del emisor
435 435
         $this->setFont('', 'B', $font_size ? $font_size : 14);
436
-        $this->SetTextColorArray($color===null?[32, 92, 144]:$color);
436
+        $this->SetTextColorArray($color===null ? [32, 92, 144] : $color);
437 437
         $this->MultiTexto(!empty($emisor['RznSoc']) ? $emisor['RznSoc'] : $emisor['RznSocEmisor'], $x, $this->y+2, 'L', $w);
438 438
         $this->setFont('', 'B', $font_size ? $font_size : 9);
439
-        $this->SetTextColorArray([0,0,0]);
439
+        $this->SetTextColorArray([0, 0, 0]);
440 440
         $this->MultiTexto(!empty($emisor['GiroEmis']) ? $emisor['GiroEmis'] : $emisor['GiroEmisor'], $x, $this->y, 'L', $w);
441 441
         $ciudad = !empty($emisor['CiudadOrigen']) ? $emisor['CiudadOrigen'] : \sasco\LibreDTE\Chile::getCiudad($emisor['CmnaOrigen']);
442
-        $this->MultiTexto($emisor['DirOrigen'].', '.$emisor['CmnaOrigen'].($ciudad?(', '.$ciudad):''), $x, $this->y, 'L', $w);
442
+        $this->MultiTexto($emisor['DirOrigen'].', '.$emisor['CmnaOrigen'].($ciudad ? (', '.$ciudad) : ''), $x, $this->y, 'L', $w);
443 443
         if (!empty($emisor['Sucursal'])) {
444 444
             $this->MultiTexto('Sucursal: '.$emisor['Sucursal'], $x, $this->y, 'L', $w);
445 445
         }
@@ -483,12 +483,12 @@  discard block
 block discarded – undo
483 483
     private function agregarFolio($rut, $tipo, $folio, $sucursal_sii = null, $x = 130, $y = 15, $w = 70, $font_size = null, array $color = null)
484 484
     {
485 485
         if ($color===null) {
486
-            $color = $tipo ? ($tipo==52 ? [0,172,140] : [255,0,0]) : [0,0,0];
486
+            $color = $tipo ? ($tipo==52 ? [0, 172, 140] : [255, 0, 0]) : [0, 0, 0];
487 487
         }
488 488
         $this->SetTextColorArray($color);
489 489
         // colocar rut emisor, glosa documento y folio
490 490
         list($rut, $dv) = explode('-', $rut);
491
-        $this->setFont ('', 'B', $font_size ? $font_size : 15);
491
+        $this->setFont('', 'B', $font_size ? $font_size : 15);
492 492
         $this->MultiTexto('R.U.T.: '.$this->num($rut).'-'.$dv, $x, $y+4, 'C', $w);
493 493
         $this->setFont('', 'B', $font_size ? $font_size : 12);
494 494
         $this->MultiTexto($this->getTipo($tipo), $x, null, 'C', $w);
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
         if ($tipo) {
502 502
             $this->Texto('S.I.I. - '.\sasco\LibreDTE\Sii::getDireccionRegional($sucursal_sii), $x, $this->getY()+4, 'C', $w);
503 503
         }
504
-        $this->SetTextColorArray([0,0,0]);
504
+        $this->SetTextColorArray([0, 0, 0]);
505 505
         $this->Ln();
506 506
         return $this->y;
507 507
     }
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
             $this->Texto('Señor(es)', $x);
633 633
             $this->Texto(':', $x+$offset);
634 634
             $this->setFont('', '', null);
635
-            $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10?105:0);
635
+            $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0);
636 636
         }
637 637
         if (!empty($receptor['GiroRecep'])) {
638 638
             $this->setFont('', 'B', null);
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
             $ciudad = !empty($receptor['CiudadRecep']) ? $receptor['CiudadRecep'] : (
650 650
                 !empty($receptor['CmnaRecep']) ? \sasco\LibreDTE\Chile::getCiudad($receptor['CmnaRecep']) : ''
651 651
             );
652
-            $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep'])?(', '.$receptor['CmnaRecep']):'').($ciudad?(', '.$ciudad):''), $x+$offset+2);
652
+            $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep']) ? (', '.$receptor['CmnaRecep']) : '').($ciudad ? (', '.$ciudad) : ''), $x+$offset+2);
653 653
         }
654 654
         if (!empty($receptor['Extranjero']['Nacionalidad'])) {
655 655
             $this->setFont('', 'B', null);
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
             $this->Texto('Cód. recep.', $x);
684 684
             $this->Texto(':', $x+$offset);
685 685
             $this->setFont('', '', null);
686
-            $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10?105:0);
686
+            $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0);
687 687
         }
688 688
         return $this->GetY();
689 689
     }
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
     {
772 772
         if (!isset($referencias[0]))
773 773
             $referencias = [$referencias];
774
-        foreach($referencias as $r) {
774
+        foreach ($referencias as $r) {
775 775
             $texto = $r['NroLinRef'].' - '.$this->getTipo($r['TpoDocRef']).' N° '.$r['FolioRef'].' del '.$r['FchRef'];
776 776
             if (isset($r['RazonRef']) and $r['RazonRef']!==false)
777 777
                 $texto = $texto.': '.$r['RazonRef'];
@@ -864,9 +864,9 @@  discard block
 block discarded – undo
864 864
         $this->SetY($this->getY()+1);
865 865
         $p1x = $x;
866 866
         $p1y = $this->y;
867
-        $p2x = $this->getPageWidth() - 2;
868
-        $p2y = $p1y;  // Use same y for a straight line
869
-        $style = array('width' => 0.2,'color' => array(0, 0, 0));
867
+        $p2x = $this->getPageWidth()-2;
868
+        $p2y = $p1y; // Use same y for a straight line
869
+        $style = array('width' => 0.2, 'color' => array(0, 0, 0));
870 870
         $this->Line($p1x, $p1y, $p2x, $p2y, $style);
871 871
         $this->Texto($this->detalle_cols['NmbItem']['title'], $x+1, $this->y, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']);
872 872
         $this->Texto($this->detalle_cols['PrcItem']['title'], $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']);
@@ -876,9 +876,9 @@  discard block
 block discarded – undo
876 876
         if (!isset($detalle[0]))
877 877
             $detalle = [$detalle];
878 878
         $this->SetY($this->getY()+2);
879
-        foreach($detalle as  &$d) {
879
+        foreach ($detalle as  &$d) {
880 880
             $this->MultiTexto($d['NmbItem'], $x+1, $this->y+4, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']);
881
-            $this->Texto(number_format($d['PrcItem'],0,',','.'), $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']);
881
+            $this->Texto(number_format($d['PrcItem'], 0, ',', '.'), $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']);
882 882
             $this->Texto($this->num($d['QtyItem']), $x+35, $this->y, ucfirst($this->detalle_cols['QtyItem']['align'][0]), $this->detalle_cols['QtyItem']['width']);
883 883
             $this->Texto($this->num($d['MontoItem']), $x+45, $this->y, ucfirst($this->detalle_cols['MontoItem']['align'][0]), $this->detalle_cols['MontoItem']['width']);
884 884
         }
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
         if (!isset($detalle[0])) {
899 899
             $detalle = [$detalle];
900 900
         }
901
-        foreach($detalle as  &$d) {
901
+        foreach ($detalle as  &$d) {
902 902
             if (!empty($d['MontoItem'])) {
903 903
                 $subtotal += $d['MontoItem'];
904 904
             }
@@ -918,10 +918,10 @@  discard block
 block discarded – undo
918 918
     {
919 919
         if (!isset($descuentosRecargos[0]))
920 920
             $descuentosRecargos = [$descuentosRecargos];
921
-        foreach($descuentosRecargos as $dr) {
921
+        foreach ($descuentosRecargos as $dr) {
922 922
             $tipo = $dr['TpoMov']=='D' ? 'Descuento' : 'Recargo';
923 923
             $valor = $dr['TpoValor']=='%' ? $dr['ValorDR'].'%' : '$'.$this->num($dr['ValorDR']).'.-';
924
-            $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR'])?(' ('.$dr['GlosaDR'].')'):''), $x);
924
+            $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR']) ? (' ('.$dr['GlosaDR'].')') : ''), $x);
925 925
             $this->Ln();
926 926
         }
927 927
     }
@@ -939,8 +939,8 @@  discard block
 block discarded – undo
939 939
             $pagos = [$pagos];
940 940
         $this->Texto('Pago(s) programado(s):', $x);
941 941
         $this->Ln();
942
-        foreach($pagos as $p) {
943
-            $this->Texto('  - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos'])?(' ('.$p['GlosaPagos'].')'):''), $x);
942
+        foreach ($pagos as $p) {
943
+            $this->Texto('  - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos']) ? (' ('.$p['GlosaPagos'].')') : ''), $x);
944 944
             $this->Ln();
945 945
         }
946 946
     }
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
             if (!isset($ImptoReten[0])) {
991 991
                 $ImptoReten = [$ImptoReten];
992 992
             }
993
-            foreach($ImptoReten as $i) {
993
+            foreach ($ImptoReten as $i) {
994 994
                 $totales['ImptoReten_'.$i['TipoImp']] = $i['MontoImp'];
995 995
                 if (!empty($i['TasaImp'])) {
996 996
                     $glosas['ImptoReten_'.$i['TipoImp']] = \sasco\LibreDTE\Sii\ImpuestosAdicionales::getGlosa($i['TipoImp']).' ('.$i['TasaImp'].'%) $';
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
                 'vpadding' => 0,
1056 1056
                 'module_width' => 1, // width of a single module in points
1057 1057
                 'module_height' => 1, // height of a single module in points
1058
-                'fgcolor' => [0,0,0],
1058
+                'fgcolor' => [0, 0, 0],
1059 1059
                 'bgcolor' => false, // [255,255,255]
1060 1060
                 'position' => $this->papelContinuo ? 'C' : 'S',
1061 1061
             ];
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
      */
1082 1082
     private function agregarAcuseRecibo($x = 93, $y = 190, $w = 50, $h = 40)
1083 1083
     {
1084
-        $this->SetTextColorArray([0,0,0]);
1084
+        $this->SetTextColorArray([0, 0, 0]);
1085 1085
         $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]);
1086 1086
         $this->setFont('', 'B', 10);
1087 1087
         $this->Texto('Acuse de recibo', $x, $y+1, 'C', $w);
@@ -1111,9 +1111,9 @@  discard block
 block discarded – undo
1111 1111
      */
1112 1112
     private function agregarAcuseReciboContinuo($x = 3, $y = null, $w = 68, $h = 40)
1113 1113
     {
1114
-        $this->SetTextColorArray([0,0,0]);
1114
+        $this->SetTextColorArray([0, 0, 0]);
1115 1115
         $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]);
1116
-        $style = array('width' => 0.2,'color' => array(0, 0, 0));
1116
+        $style = array('width' => 0.2, 'color' => array(0, 0, 0));
1117 1117
         $this->Line($x, $y+22, $w+3, $y+22, $style);
1118 1118
         //$this->setFont('', 'B', 10);
1119 1119
         //$this->Texto('Acuse de recibo', $x, $y+1, 'C', $w);
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
     private function agregarLeyendaDestino($tipo, $y = 254, $font_size = 10)
1142 1142
     {
1143 1143
         $this->setFont('', 'B', $font_size);
1144
-        $this->Texto('CEDIBLE'.($tipo==52?' CON SU FACTURA':''), null, $y, 'R');
1144
+        $this->Texto('CEDIBLE'.($tipo==52 ? ' CON SU FACTURA' : ''), null, $y, 'R');
1145 1145
     }
1146 1146
 
1147 1147
     /**
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
         $dias = ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'];
1173 1173
         $meses = ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'];
1174 1174
         $unixtime = strtotime($date);
1175
-        $fecha = date(($mostrar_dia?'\D\I\A ':'').'j \d\e \M\E\S \d\e\l Y', $unixtime);
1175
+        $fecha = date(($mostrar_dia ? '\D\I\A ' : '').'j \d\e \M\E\S \d\e\l Y', $unixtime);
1176 1176
         $dia = $dias[date('w', $unixtime)];
1177 1177
         $mes = $meses[date('n', $unixtime)-1];
1178 1178
         return str_replace(array('DIA', 'MES'), array($dia, $mes), $fecha);
Please login to merge, or discard this patch.