@@ -198,7 +198,7 @@ |
||
| 198 | 198 | /** |
| 199 | 199 | * Método que entrega la glosa del tipo de documento |
| 200 | 200 | * @param tipo Código del tipo de documento |
| 201 | - * @param folio Folio del tipo de documento (usado al ser generados a partir de borradores en formato libredte) |
|
| 201 | + * @param folio integer del tipo de documento (usado al ser generados a partir de borradores en formato libredte) |
|
| 202 | 202 | * @return Glosa del tipo de documento |
| 203 | 203 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 204 | 204 | * @version 2019-08-05 |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | /** |
| 79 | 79 | * Método que asigna la ubicación del logo de la empresa |
| 80 | 80 | * @param logo URI del logo (puede ser local o en una URL) |
| 81 | - * @param posicion Posición respecto a datos del emisor (=0 izq, =1 arriba) |
|
| 81 | + * @param posicion integer respecto a datos del emisor (=0 izq, =1 arriba) |
|
| 82 | 82 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 83 | 83 | * @version 2016-08-04 |
| 84 | 84 | */ |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * contínuo |
| 223 | 223 | * @param dte Arreglo con los datos del XML (tag Documento) |
| 224 | 224 | * @param timbre String XML con el tag TED del DTE |
| 225 | - * @param width Ancho del papel contínuo en mm |
|
| 225 | + * @param width boolean del papel contínuo en mm |
|
| 226 | 226 | * @author Pablo Reyes (https://github.com/pabloxp) |
| 227 | 227 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 228 | 228 | * @version 2017-10-24 |
@@ -384,10 +384,11 @@ discard block |
||
| 384 | 384 | * - Dirección casa central del emisor |
| 385 | 385 | * - Dirección sucursales |
| 386 | 386 | * @param emisor Arreglo con los datos del emisor (tag Emisor del XML) |
| 387 | - * @param x Posición horizontal de inicio en el PDF |
|
| 388 | - * @param y Posición vertical de inicio en el PDF |
|
| 389 | - * @param w Ancho de la información del emisor |
|
| 390 | - * @param w_img Ancho máximo de la imagen |
|
| 387 | + * @param x integer horizontal de inicio en el PDF |
|
| 388 | + * @param y integer vertical de inicio en el PDF |
|
| 389 | + * @param w integer de la información del emisor |
|
| 390 | + * @param w_img integer máximo de la imagen |
|
| 391 | + * @param integer $font_size |
|
| 391 | 392 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 392 | 393 | * @version 2018-06-15 |
| 393 | 394 | */ |
@@ -461,11 +462,13 @@ discard block |
||
| 461 | 462 | * @param rut RUT del emisor |
| 462 | 463 | * @param tipo Código o glosa del tipo de documento |
| 463 | 464 | * @param sucursal_sii Código o glosa de la sucursal del SII del Emisor |
| 464 | - * @param x Posición horizontal de inicio en el PDF |
|
| 465 | - * @param y Posición vertical de inicio en el PDF |
|
| 466 | - * @param w Ancho de la información del emisor |
|
| 465 | + * @param x integer horizontal de inicio en el PDF |
|
| 466 | + * @param y integer vertical de inicio en el PDF |
|
| 467 | + * @param w integer de la información del emisor |
|
| 468 | + * @param integer $font_size |
|
| 467 | 469 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 468 | 470 | * @version 2019-08-05 |
| 471 | + * @return integer |
|
| 469 | 472 | */ |
| 470 | 473 | protected function agregarFolio($rut, $tipo, $folio, $sucursal_sii = null, $x = 130, $y = 15, $w = 70, $font_size = null, array $color = null) |
| 471 | 474 | { |
@@ -497,7 +500,7 @@ discard block |
||
| 497 | 500 | * Método que agrega los datos de la emisión del DTE que no son los dato del |
| 498 | 501 | * receptor |
| 499 | 502 | * @param IdDoc Información general del documento |
| 500 | - * @param x Posición horizontal de inicio en el PDF |
|
| 503 | + * @param x integer horizontal de inicio en el PDF |
|
| 501 | 504 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 502 | 505 | * @version 2017-06-15 |
| 503 | 506 | */ |
@@ -585,7 +588,7 @@ discard block |
||
| 585 | 588 | /** |
| 586 | 589 | * Método que agrega los datos del receptor |
| 587 | 590 | * @param receptor Arreglo con los datos del receptor (tag Receptor del XML) |
| 588 | - * @param x Posición horizontal de inicio en el PDF |
|
| 591 | + * @param x integer horizontal de inicio en el PDF |
|
| 589 | 592 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 590 | 593 | * @version 2019-02-13 |
| 591 | 594 | */ |
@@ -672,7 +675,7 @@ discard block |
||
| 672 | 675 | * Método que agrega los datos del traslado |
| 673 | 676 | * @param IndTraslado |
| 674 | 677 | * @param Transporte |
| 675 | - * @param x Posición horizontal de inicio en el PDF |
|
| 678 | + * @param x integer horizontal de inicio en el PDF |
|
| 676 | 679 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 677 | 680 | * @version 2016-08-03 |
| 678 | 681 | */ |
@@ -752,7 +755,7 @@ discard block |
||
| 752 | 755 | /** |
| 753 | 756 | * Método que agrega las referencias del documento |
| 754 | 757 | * @param referencias Arreglo con las referencias del documento (tag Referencia del XML) |
| 755 | - * @param x Posición horizontal de inicio en el PDF |
|
| 758 | + * @param x integer horizontal de inicio en el PDF |
|
| 756 | 759 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 757 | 760 | * @version 2017-09-25 |
| 758 | 761 | */ |
@@ -789,7 +792,7 @@ discard block |
||
| 789 | 792 | /** |
| 790 | 793 | * Método que agrega el detalle del documento |
| 791 | 794 | * @param detalle Arreglo con el detalle del documento (tag Detalle del XML) |
| 792 | - * @param x Posición horizontal de inicio en el PDF |
|
| 795 | + * @param x integer horizontal de inicio en el PDF |
|
| 793 | 796 | * @param y Posición vertical de inicio en el PDF |
| 794 | 797 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 795 | 798 | * @version 2019-07-09 |
@@ -889,7 +892,7 @@ discard block |
||
| 889 | 892 | /** |
| 890 | 893 | * Método que agrega el detalle del documento |
| 891 | 894 | * @param detalle Arreglo con el detalle del documento (tag Detalle del XML) |
| 892 | - * @param x Posición horizontal de inicio en el PDF |
|
| 895 | + * @param x integer horizontal de inicio en el PDF |
|
| 893 | 896 | * @param y Posición vertical de inicio en el PDF |
| 894 | 897 | * @author Pablo Reyes (https://github.com/pabloxp) |
| 895 | 898 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
@@ -925,7 +928,7 @@ discard block |
||
| 925 | 928 | * Método que agrega el subtotal del DTE |
| 926 | 929 | * @param detalle Arreglo con los detalles del documentos para poder |
| 927 | 930 | * calcular subtotal |
| 928 | - * @param x Posición horizontal de inicio en el PDF |
|
| 931 | + * @param x integer horizontal de inicio en el PDF |
|
| 929 | 932 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 930 | 933 | * @version 2016-08-17 |
| 931 | 934 | */ |
@@ -951,7 +954,7 @@ discard block |
||
| 951 | 954 | /** |
| 952 | 955 | * Método que agrega los descuentos y/o recargos globales del documento |
| 953 | 956 | * @param descuentosRecargos Arreglo con los descuentos y/o recargos del documento (tag DscRcgGlobal del XML) |
| 954 | - * @param x Posición horizontal de inicio en el PDF |
|
| 957 | + * @param x integer horizontal de inicio en el PDF |
|
| 955 | 958 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 956 | 959 | * @version 2018-05-29 |
| 957 | 960 | */ |
@@ -979,7 +982,7 @@ discard block |
||
| 979 | 982 | /** |
| 980 | 983 | * Método que agrega los pagos del documento |
| 981 | 984 | * @param pagos Arreglo con los pagos del documento |
| 982 | - * @param x Posición horizontal de inicio en el PDF |
|
| 985 | + * @param x integer horizontal de inicio en el PDF |
|
| 983 | 986 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 984 | 987 | * @version 2016-07-24 |
| 985 | 988 | */ |
@@ -1137,9 +1140,9 @@ discard block |
||
| 1137 | 1140 | * - Se imprime en el tamaño mínimo: 2x5 cms |
| 1138 | 1141 | * - En el lado de abajo con margen izquierdo mínimo de 2 cms |
| 1139 | 1142 | * @param timbre String con los datos del timbre |
| 1140 | - * @param x Posición horizontal de inicio en el PDF |
|
| 1141 | - * @param y Posición vertical de inicio en el PDF |
|
| 1142 | - * @param w Ancho del timbre |
|
| 1143 | + * @param x integer horizontal de inicio en el PDF |
|
| 1144 | + * @param y integer vertical de inicio en el PDF |
|
| 1145 | + * @param w integer del timbre |
|
| 1143 | 1146 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 1144 | 1147 | * @version 2018-04-12 |
| 1145 | 1148 | */ |
@@ -1177,10 +1180,10 @@ discard block |
||
| 1177 | 1180 | |
| 1178 | 1181 | /** |
| 1179 | 1182 | * Método que agrega el acuse de rebido |
| 1180 | - * @param x Posición horizontal de inicio en el PDF |
|
| 1181 | - * @param y Posición vertical de inicio en el PDF |
|
| 1182 | - * @param w Ancho del acuse de recibo |
|
| 1183 | - * @param h Alto del acuse de recibo |
|
| 1183 | + * @param x integer horizontal de inicio en el PDF |
|
| 1184 | + * @param y integer vertical de inicio en el PDF |
|
| 1185 | + * @param w integer del acuse de recibo |
|
| 1186 | + * @param h integer del acuse de recibo |
|
| 1184 | 1187 | * @author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl) |
| 1185 | 1188 | * @version 2018-04-13 |
| 1186 | 1189 | */ |
@@ -1208,10 +1211,10 @@ discard block |
||
| 1208 | 1211 | |
| 1209 | 1212 | /** |
| 1210 | 1213 | * Método que agrega el acuse de rebido |
| 1211 | - * @param x Posición horizontal de inicio en el PDF |
|
| 1214 | + * @param x integer horizontal de inicio en el PDF |
|
| 1212 | 1215 | * @param y Posición vertical de inicio en el PDF |
| 1213 | - * @param w Ancho del acuse de recibo |
|
| 1214 | - * @param h Alto del acuse de recibo |
|
| 1216 | + * @param w integer del acuse de recibo |
|
| 1217 | + * @param h integer del acuse de recibo |
|
| 1215 | 1218 | * @author Pablo Reyes (https://github.com/pabloxp) |
| 1216 | 1219 | * @version 2015-11-17 |
| 1217 | 1220 | */ |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | parent::__construct(); |
| 74 | 74 | $this->SetTitle('Documento Tributario Electrónico (DTE) de Chile by LibreDTE'); |
| 75 | - $this->papelContinuo = $papelContinuo === true ? 80 : $papelContinuo; |
|
| 75 | + $this->papelContinuo = $papelContinuo===true ? 80 : $papelContinuo; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $this->setY(max($y)); |
| 183 | 183 | $this->Ln(); |
| 184 | 184 | $y = []; |
| 185 | - $y[] = $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null); |
|
| 185 | + $y[] = $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null); |
|
| 186 | 186 | $y[] = $this->agregarReceptor($dte['Encabezado']); |
| 187 | 187 | $this->setY(max($y)); |
| 188 | 188 | $this->agregarTraslado( |
@@ -242,15 +242,15 @@ discard block |
||
| 242 | 242 | $dte['Encabezado']['IdDoc']['TipoDTE'], |
| 243 | 243 | $dte['Encabezado']['IdDoc']['Folio'], |
| 244 | 244 | $dte['Encabezado']['Emisor']['CmnaOrigen'], |
| 245 | - $x_start, $y_start, $width-($x_start*4), 10, |
|
| 246 | - [0,0,0] |
|
| 245 | + $x_start, $y_start, $width-($x_start * 4), 10, |
|
| 246 | + [0, 0, 0] |
|
| 247 | 247 | ); |
| 248 | - $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, $width-($x_start*45), 8, 9, [0,0,0]); |
|
| 248 | + $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, $width-($x_start * 45), 8, 9, [0, 0, 0]); |
|
| 249 | 249 | // datos del documento |
| 250 | 250 | $this->SetY($y); |
| 251 | 251 | $this->Ln(); |
| 252 | 252 | $this->setFont('', '', 8); |
| 253 | - $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null, $x_start, $offset, false); |
|
| 253 | + $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null, $x_start, $offset, false); |
|
| 254 | 254 | $this->agregarReceptor($dte['Encabezado'], $x_start, $offset); |
| 255 | 255 | $this->agregarTraslado( |
| 256 | 256 | !empty($dte['Encabezado']['IdDoc']['IndTraslado']) ? $dte['Encabezado']['IdDoc']['IndTraslado'] : null, |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | $this->AddPage('P', [$height ? $height : $this->papel_continuo_alto, $width]); |
| 304 | 304 | $x = 1; |
| 305 | 305 | $y = 5; |
| 306 | - $this->SetXY($x,$y); |
|
| 306 | + $this->SetXY($x, $y); |
|
| 307 | 307 | // agregar datos del documento |
| 308 | 308 | $this->setFont('', '', 8); |
| 309 | 309 | $this->MultiTexto(!empty($dte['Encabezado']['Emisor']['RznSoc']) ? $dte['Encabezado']['Emisor']['RznSoc'] : $dte['Encabezado']['Emisor']['RznSocEmisor'], $x, null, '', $width-2); |
@@ -399,13 +399,13 @@ discard block |
||
| 399 | 399 | $this->logo['uri'], |
| 400 | 400 | $x, |
| 401 | 401 | $y, |
| 402 | - !$this->logo['posicion']?$w_img:null, $this->logo['posicion']?($w_img/2):null, |
|
| 402 | + !$this->logo['posicion'] ? $w_img : null, $this->logo['posicion'] ? ($w_img / 2) : null, |
|
| 403 | 403 | 'PNG', |
| 404 | - (isset($emisor['url'])?$emisor['url']:''), |
|
| 404 | + (isset($emisor['url']) ? $emisor['url'] : ''), |
|
| 405 | 405 | 'T' |
| 406 | 406 | ); |
| 407 | 407 | if ($this->logo['posicion']) { |
| 408 | - $this->SetY($this->y + ($w_img/2)); |
|
| 408 | + $this->SetY($this->y+($w_img / 2)); |
|
| 409 | 409 | $w += 40; |
| 410 | 410 | } else { |
| 411 | 411 | $x = $this->x+3; |
@@ -416,14 +416,14 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | // agregar datos del emisor |
| 418 | 418 | $this->setFont('', 'B', $font_size ? $font_size : 14); |
| 419 | - $this->SetTextColorArray($color===null?[32, 92, 144]:$color); |
|
| 419 | + $this->SetTextColorArray($color===null ? [32, 92, 144] : $color); |
|
| 420 | 420 | $this->MultiTexto(!empty($emisor['RznSoc']) ? $emisor['RznSoc'] : $emisor['RznSocEmisor'], $x, $this->y+2, 'L', $w); |
| 421 | 421 | $this->setFont('', 'B', $font_size ? $font_size : 9); |
| 422 | - $this->SetTextColorArray([0,0,0]); |
|
| 422 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 423 | 423 | $this->MultiTexto(!empty($emisor['GiroEmis']) ? $emisor['GiroEmis'] : $emisor['GiroEmisor'], $x, $this->y, 'L', $w); |
| 424 | 424 | $comuna = !empty($emisor['CmnaOrigen']) ? $emisor['CmnaOrigen'] : null; |
| 425 | 425 | $ciudad = !empty($emisor['CiudadOrigen']) ? $emisor['CiudadOrigen'] : \sasco\LibreDTE\Chile::getCiudad($comuna); |
| 426 | - $this->MultiTexto($emisor['DirOrigen'].($comuna?(', '.$comuna):'').($ciudad?(', '.$ciudad):''), $x, $this->y, 'L', $w); |
|
| 426 | + $this->MultiTexto($emisor['DirOrigen'].($comuna ? (', '.$comuna) : '').($ciudad ? (', '.$ciudad) : ''), $x, $this->y, 'L', $w); |
|
| 427 | 427 | if (!empty($emisor['Sucursal'])) { |
| 428 | 428 | $this->MultiTexto('Sucursal: '.$emisor['Sucursal'], $x, $this->y, 'L', $w); |
| 429 | 429 | } |
@@ -470,12 +470,12 @@ discard block |
||
| 470 | 470 | protected function agregarFolio($rut, $tipo, $folio, $sucursal_sii = null, $x = 130, $y = 15, $w = 70, $font_size = null, array $color = null) |
| 471 | 471 | { |
| 472 | 472 | if ($color===null) { |
| 473 | - $color = $tipo ? ($tipo==52 ? [0,172,140] : [255,0,0]) : [0,0,0]; |
|
| 473 | + $color = $tipo ? ($tipo==52 ? [0, 172, 140] : [255, 0, 0]) : [0, 0, 0]; |
|
| 474 | 474 | } |
| 475 | 475 | $this->SetTextColorArray($color); |
| 476 | 476 | // colocar rut emisor, glosa documento y folio |
| 477 | 477 | list($rut, $dv) = explode('-', $rut); |
| 478 | - $this->setFont ('', 'B', $font_size ? $font_size : 15); |
|
| 478 | + $this->setFont('', 'B', $font_size ? $font_size : 15); |
|
| 479 | 479 | $this->MultiTexto('R.U.T.: '.$this->num($rut).'-'.$dv, $x, $y+4, 'C', $w); |
| 480 | 480 | $this->setFont('', 'B', $font_size ? $font_size : 12); |
| 481 | 481 | $this->MultiTexto($this->getTipo($tipo, $folio), $x, null, 'C', $w); |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | if ($tipo) { |
| 489 | 489 | $this->Texto('S.I.I. - '.\sasco\LibreDTE\Sii::getDireccionRegional($sucursal_sii), $x, $this->getY()+4, 'C', $w); |
| 490 | 490 | } |
| 491 | - $this->SetTextColorArray([0,0,0]); |
|
| 491 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 492 | 492 | $this->Ln(); |
| 493 | 493 | return $this->y; |
| 494 | 494 | } |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $this->Texto(in_array($this->dte, [39, 41]) ? 'Nombre' : 'Razón social', $x); |
| 606 | 606 | $this->Texto(':', $x+$offset); |
| 607 | 607 | $this->setFont('', '', null); |
| 608 | - $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10?105:0); |
|
| 608 | + $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0); |
|
| 609 | 609 | } |
| 610 | 610 | if (!empty($receptor['GiroRecep'])) { |
| 611 | 611 | $this->setFont('', 'B', null); |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | $ciudad = !empty($receptor['CiudadRecep']) ? $receptor['CiudadRecep'] : ( |
| 623 | 623 | !empty($receptor['CmnaRecep']) ? \sasco\LibreDTE\Chile::getCiudad($receptor['CmnaRecep']) : '' |
| 624 | 624 | ); |
| 625 | - $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep'])?(', '.$receptor['CmnaRecep']):'').($ciudad?(', '.$ciudad):''), $x+$offset+2); |
|
| 625 | + $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep']) ? (', '.$receptor['CmnaRecep']) : '').($ciudad ? (', '.$ciudad) : ''), $x+$offset+2); |
|
| 626 | 626 | } |
| 627 | 627 | if (!empty($receptor['Extranjero']['Nacionalidad'])) { |
| 628 | 628 | $this->setFont('', 'B', null); |
@@ -663,7 +663,7 @@ discard block |
||
| 663 | 663 | $this->Texto('Cód. recep.', $x); |
| 664 | 664 | $this->Texto(':', $x+$offset); |
| 665 | 665 | $this->setFont('', '', null); |
| 666 | - $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10?105:0); |
|
| 666 | + $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0); |
|
| 667 | 667 | } |
| 668 | 668 | return $this->GetY(); |
| 669 | 669 | } |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | { |
| 761 | 761 | if (!isset($referencias[0])) |
| 762 | 762 | $referencias = [$referencias]; |
| 763 | - foreach($referencias as $r) { |
|
| 763 | + foreach ($referencias as $r) { |
|
| 764 | 764 | $texto = $r['NroLinRef'].' - '; |
| 765 | 765 | if (!empty($r['TpoDocRef'])) { |
| 766 | 766 | $texto .= $this->getTipo($r['TpoDocRef']).' '; |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | // quitar columnas |
| 813 | 813 | foreach ($item as $col => $valor) { |
| 814 | 814 | if ($col=='DscItem' and !empty($item['DscItem'])) { |
| 815 | - $item['NmbItem'] .= !$this->item_detalle_posicion ? ($html?'<br/>':"\n") : ': '; |
|
| 815 | + $item['NmbItem'] .= !$this->item_detalle_posicion ? ($html ? '<br/>' : "\n") : ': '; |
|
| 816 | 816 | if ($html) { |
| 817 | 817 | $item['NmbItem'] .= '<span style="font-size:0.7em">'.$item['DscItem'].'</span>'; |
| 818 | 818 | } else { |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | } |
| 861 | 861 | $item = array_merge($item_default, $item); |
| 862 | 862 | // si hay código de item se extrae su valor |
| 863 | - if (!empty($item['CdgItem']['VlrCodigo'])){ |
|
| 863 | + if (!empty($item['CdgItem']['VlrCodigo'])) { |
|
| 864 | 864 | $item['CdgItem'] = $item['CdgItem']['VlrCodigo']; |
| 865 | 865 | } |
| 866 | 866 | // dar formato a números |
@@ -900,9 +900,9 @@ discard block |
||
| 900 | 900 | $this->SetY($this->getY()+1); |
| 901 | 901 | $p1x = $x; |
| 902 | 902 | $p1y = $this->y; |
| 903 | - $p2x = $this->getPageWidth() - 2; |
|
| 904 | - $p2y = $p1y; // Use same y for a straight line |
|
| 905 | - $style = array('width' => 0.2,'color' => array(0, 0, 0)); |
|
| 903 | + $p2x = $this->getPageWidth()-2; |
|
| 904 | + $p2y = $p1y; // Use same y for a straight line |
|
| 905 | + $style = array('width' => 0.2, 'color' => array(0, 0, 0)); |
|
| 906 | 906 | $this->Line($p1x, $p1y, $p2x, $p2y, $style); |
| 907 | 907 | $this->Texto($this->detalle_cols['NmbItem']['title'], $x+1, $this->y, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']); |
| 908 | 908 | $this->Texto($this->detalle_cols['PrcItem']['title'], $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']); |
@@ -912,9 +912,9 @@ discard block |
||
| 912 | 912 | if (!isset($detalle[0])) |
| 913 | 913 | $detalle = [$detalle]; |
| 914 | 914 | $this->SetY($this->getY()+2); |
| 915 | - foreach($detalle as &$d) { |
|
| 915 | + foreach ($detalle as &$d) { |
|
| 916 | 916 | $this->MultiTexto($d['NmbItem'], $x+1, $this->y+4, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']); |
| 917 | - $this->Texto(number_format($d['PrcItem'],0,',','.'), $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']); |
|
| 917 | + $this->Texto(number_format($d['PrcItem'], 0, ',', '.'), $x+15, $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']); |
|
| 918 | 918 | $this->Texto($this->num($d['QtyItem']), $x+35, $this->y, ucfirst($this->detalle_cols['QtyItem']['align'][0]), $this->detalle_cols['QtyItem']['width']); |
| 919 | 919 | $this->Texto($this->num($d['MontoItem']), $x+45, $this->y, ucfirst($this->detalle_cols['MontoItem']['align'][0]), $this->detalle_cols['MontoItem']['width']); |
| 920 | 920 | } |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | if (!isset($detalle[0])) { |
| 935 | 935 | $detalle = [$detalle]; |
| 936 | 936 | } |
| 937 | - foreach($detalle as &$d) { |
|
| 937 | + foreach ($detalle as &$d) { |
|
| 938 | 938 | if (!empty($d['MontoItem'])) { |
| 939 | 939 | $subtotal += $d['MontoItem']; |
| 940 | 940 | } |
@@ -960,16 +960,16 @@ discard block |
||
| 960 | 960 | if (!isset($descuentosRecargos[0])) { |
| 961 | 961 | $descuentosRecargos = [$descuentosRecargos]; |
| 962 | 962 | } |
| 963 | - foreach($descuentosRecargos as $dr) { |
|
| 963 | + foreach ($descuentosRecargos as $dr) { |
|
| 964 | 964 | $tipo = $dr['TpoMov']=='D' ? 'Descuento' : 'Recargo'; |
| 965 | 965 | if (!empty($dr['IndExeDR'])) { |
| 966 | 966 | $tipo .= ' EX'; |
| 967 | 967 | } |
| 968 | 968 | $valor = $dr['TpoValor']=='%' ? $dr['ValorDR'].'%' : $this->num($dr['ValorDR']); |
| 969 | 969 | if ($this->papelContinuo) { |
| 970 | - $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR'])?(' ('.$dr['GlosaDR'].')'):''), $x); |
|
| 970 | + $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR']) ? (' ('.$dr['GlosaDR'].')') : ''), $x); |
|
| 971 | 971 | } else { |
| 972 | - $this->Texto($tipo.(!empty($dr['GlosaDR'])?(' ('.$dr['GlosaDR'].')'):'').':', 77, null, 'R', 100); |
|
| 972 | + $this->Texto($tipo.(!empty($dr['GlosaDR']) ? (' ('.$dr['GlosaDR'].')') : '').':', 77, null, 'R', 100); |
|
| 973 | 973 | $this->Texto($valor, 177, null, 'R', 22); |
| 974 | 974 | } |
| 975 | 975 | $this->Ln(); |
@@ -989,8 +989,8 @@ discard block |
||
| 989 | 989 | $pagos = [$pagos]; |
| 990 | 990 | $this->Texto('Pago(s) programado(s):', $x); |
| 991 | 991 | $this->Ln(); |
| 992 | - foreach($pagos as $p) { |
|
| 993 | - $this->Texto(' - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos'])?(' ('.$p['GlosaPagos'].')'):''), $x); |
|
| 992 | + foreach ($pagos as $p) { |
|
| 993 | + $this->Texto(' - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos']) ? (' ('.$p['GlosaPagos'].')') : ''), $x); |
|
| 994 | 994 | $this->Ln(); |
| 995 | 995 | } |
| 996 | 996 | } |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | if (!isset($ImptoReten[0])) { |
| 1042 | 1042 | $ImptoReten = [$ImptoReten]; |
| 1043 | 1043 | } |
| 1044 | - foreach($ImptoReten as $i) { |
|
| 1044 | + foreach ($ImptoReten as $i) { |
|
| 1045 | 1045 | $totales['ImptoReten_'.$i['TipoImp']] = $i['MontoImp']; |
| 1046 | 1046 | if (!empty($i['TasaImp'])) { |
| 1047 | 1047 | $glosas['ImptoReten_'.$i['TipoImp']] = \sasco\LibreDTE\Sii\ImpuestosAdicionales::getGlosa($i['TipoImp']).' ('.$i['TasaImp'].'%) $'; |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | 'vpadding' => 0, |
| 1155 | 1155 | 'module_width' => 1, // width of a single module in points |
| 1156 | 1156 | 'module_height' => 1, // height of a single module in points |
| 1157 | - 'fgcolor' => [0,0,0], |
|
| 1157 | + 'fgcolor' => [0, 0, 0], |
|
| 1158 | 1158 | 'bgcolor' => false, // [255,255,255] |
| 1159 | 1159 | 'position' => $this->papelContinuo ? 'C' : 'S', |
| 1160 | 1160 | ]; |
@@ -1187,7 +1187,7 @@ discard block |
||
| 1187 | 1187 | protected function agregarAcuseRecibo($x = 83, $y = 190, $w = 60, $h = 40) |
| 1188 | 1188 | { |
| 1189 | 1189 | $y = (!$this->papelContinuo and !$this->timbre_pie) ? $this->x_fin_datos : $y; |
| 1190 | - $this->SetTextColorArray([0,0,0]); |
|
| 1190 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 1191 | 1191 | $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]); |
| 1192 | 1192 | $this->setFont('', 'B', 10); |
| 1193 | 1193 | $this->Texto('Acuse de recibo', $x, $y+1, 'C', $w); |
@@ -1217,9 +1217,9 @@ discard block |
||
| 1217 | 1217 | */ |
| 1218 | 1218 | protected function agregarAcuseReciboContinuo($x = 3, $y = null, $w = 68, $h = 40) |
| 1219 | 1219 | { |
| 1220 | - $this->SetTextColorArray([0,0,0]); |
|
| 1220 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 1221 | 1221 | $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]); |
| 1222 | - $style = array('width' => 0.2,'color' => array(0, 0, 0)); |
|
| 1222 | + $style = array('width' => 0.2, 'color' => array(0, 0, 0)); |
|
| 1223 | 1223 | $this->Line($x, $y+22, $w+3, $y+22, $style); |
| 1224 | 1224 | //$this->setFont('', 'B', 10); |
| 1225 | 1225 | //$this->Texto('Acuse de recibo', $x, $y+1, 'C', $w); |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | $y = (!$this->papelContinuo and !$this->timbre_pie and $this->x_fin_datos<=$y) ? $this->x_fin_datos : $y; |
| 1250 | 1250 | $y += 48; |
| 1251 | 1251 | $this->setFont('', 'B', $font_size); |
| 1252 | - $this->Texto('CEDIBLE'.($tipo==52?' CON SU FACTURA':''), null, $y, 'R'); |
|
| 1252 | + $this->Texto('CEDIBLE'.($tipo==52 ? ' CON SU FACTURA' : ''), null, $y, 'R'); |
|
| 1253 | 1253 | } |
| 1254 | 1254 | |
| 1255 | 1255 | /** |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | protected function agregarLeyendaDestinoContinuo($tipo) |
| 1261 | 1261 | { |
| 1262 | 1262 | $this->setFont('', 'B', 8); |
| 1263 | - $this->Texto('CEDIBLE'.($tipo==52?' CON SU FACTURA':''), null, $this->y+6, 'R'); |
|
| 1263 | + $this->Texto('CEDIBLE'.($tipo==52 ? ' CON SU FACTURA' : ''), null, $this->y+6, 'R'); |
|
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | } |