@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | parent::__construct(); |
| 75 | 75 | $this->SetTitle('Documento Tributario Electrónico (DTE) de Chile by LibreDTE'); |
| 76 | - $this->papelContinuo = $papelContinuo === true ? 80 : $papelContinuo; |
|
| 76 | + $this->papelContinuo = $papelContinuo===true ? 80 : $papelContinuo; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $this->Ln(); |
| 183 | 183 | // datos del documento |
| 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( |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $this->AddPage('P', [$height ? $height : $this->papel_continuo_alto, $width]); |
| 232 | 232 | $x = 1; |
| 233 | 233 | $y = 5; |
| 234 | - $this->SetXY($x,$y); |
|
| 234 | + $this->SetXY($x, $y); |
|
| 235 | 235 | // agregar datos del documento |
| 236 | 236 | $this->setFont('', '', 8); |
| 237 | 237 | $this->MultiTexto(!empty($dte['Encabezado']['Emisor']['RznSoc']) ? $dte['Encabezado']['Emisor']['RznSoc'] : $dte['Encabezado']['Emisor']['RznSocEmisor'], $x, null, '', $width-2); |
@@ -345,15 +345,15 @@ discard block |
||
| 345 | 345 | $dte['Encabezado']['IdDoc']['TipoDTE'], |
| 346 | 346 | $dte['Encabezado']['IdDoc']['Folio'], |
| 347 | 347 | $dte['Encabezado']['Emisor']['CmnaOrigen'], |
| 348 | - $x_start, $y_start, $width-($x_start*4), 10, |
|
| 349 | - [0,0,0] |
|
| 348 | + $x_start, $y_start, $width-($x_start * 4), 10, |
|
| 349 | + [0, 0, 0] |
|
| 350 | 350 | ); |
| 351 | - $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, $width-($x_start*45), 8, 9, [0,0,0]); |
|
| 351 | + $y = $this->agregarEmisor($dte['Encabezado']['Emisor'], $x_start, $y+2, $width-($x_start * 45), 8, 9, [0, 0, 0]); |
|
| 352 | 352 | // datos del documento |
| 353 | 353 | $this->SetY($y); |
| 354 | 354 | $this->Ln(); |
| 355 | 355 | $this->setFont('', '', 8); |
| 356 | - $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null, $x_start, $offset, false); |
|
| 356 | + $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null, $x_start, $offset, false); |
|
| 357 | 357 | $this->agregarReceptor($dte['Encabezado'], $x_start, $offset); |
| 358 | 358 | $this->agregarTraslado( |
| 359 | 359 | !empty($dte['Encabezado']['IdDoc']['IndTraslado']) ? $dte['Encabezado']['IdDoc']['IndTraslado'] : null, |
@@ -423,14 +423,14 @@ discard block |
||
| 423 | 423 | 2, |
| 424 | 424 | 45, |
| 425 | 425 | 9, |
| 426 | - [0,0,0] |
|
| 426 | + [0, 0, 0] |
|
| 427 | 427 | ); |
| 428 | - $y[] = $this->agregarEmisor($dte['Encabezado']['Emisor'], 1, 2, 20, 30, 9, [0,0,0], $y[0]); |
|
| 428 | + $y[] = $this->agregarEmisor($dte['Encabezado']['Emisor'], 1, 2, 20, 30, 9, [0, 0, 0], $y[0]); |
|
| 429 | 429 | $this->SetY(max($y)); |
| 430 | 430 | $this->Ln(); |
| 431 | 431 | // datos del documento |
| 432 | 432 | $this->setFont('', '', 8); |
| 433 | - $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor'])?$dte['Encabezado']['Emisor']['CdgVendedor']:null, $x_start, $offset, false); |
|
| 433 | + $this->agregarDatosEmision($dte['Encabezado']['IdDoc'], !empty($dte['Encabezado']['Emisor']['CdgVendedor']) ? $dte['Encabezado']['Emisor']['CdgVendedor'] : null, $x_start, $offset, false); |
|
| 434 | 434 | $this->agregarReceptor($dte['Encabezado'], $x_start, $offset); |
| 435 | 435 | $this->agregarTraslado( |
| 436 | 436 | !empty($dte['Encabezado']['IdDoc']['IndTraslado']) ? $dte['Encabezado']['IdDoc']['IndTraslado'] : null, |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | if ($this->cedible and !in_array($dte['Encabezado']['IdDoc']['TipoDTE'], $this->sinAcuseRecibo)) { |
| 463 | 463 | $this->agregarAcuseRecibo(63, $y+6, 45, 40, 15); |
| 464 | 464 | $this->setFont('', 'B', 8); |
| 465 | - $this->Texto('CEDIBLE'.($dte['Encabezado']['IdDoc']['TipoDTE']==52?' CON SU FACTURA':''), $x_start, $this->y+1, 'L'); |
|
| 465 | + $this->Texto('CEDIBLE'.($dte['Encabezado']['IdDoc']['TipoDTE']==52 ? ' CON SU FACTURA' : ''), $x_start, $this->y+1, 'L'); |
|
| 466 | 466 | } |
| 467 | 467 | // si el alto no se pasó, entonces es con autocálculo, se elimina esta página y se pasa el alto |
| 468 | 468 | // que se logró determinar para crear la página con el alto correcto |
@@ -493,16 +493,16 @@ discard block |
||
| 493 | 493 | // logo del documento |
| 494 | 494 | if (isset($this->logo)) { |
| 495 | 495 | // logo centrado (papel continuo) |
| 496 | - if (!empty($this->logo['posicion']) and $this->logo['posicion'] == 'C') { |
|
| 496 | + if (!empty($this->logo['posicion']) and $this->logo['posicion']=='C') { |
|
| 497 | 497 | $logo_w = null; |
| 498 | 498 | $logo_y = null; |
| 499 | 499 | $logo_position = 'C'; |
| 500 | 500 | $logo_next_pointer = 'N'; |
| 501 | 501 | } |
| 502 | 502 | // logo a la derecha (posicion=0) o arriba (posicion=1) |
| 503 | - else if (empty($this->logo['posicion']) or $this->logo['posicion'] == 1) { |
|
| 503 | + else if (empty($this->logo['posicion']) or $this->logo['posicion']==1) { |
|
| 504 | 504 | $logo_w = !$this->logo['posicion'] ? $w_img : null; |
| 505 | - $logo_y = $this->logo['posicion'] ? $w_img/2 : null; |
|
| 505 | + $logo_y = $this->logo['posicion'] ? $w_img / 2 : null; |
|
| 506 | 506 | $logo_position = ''; |
| 507 | 507 | $logo_next_pointer = 'T'; |
| 508 | 508 | } |
@@ -521,17 +521,17 @@ discard block |
||
| 521 | 521 | $logo_w, |
| 522 | 522 | $logo_y, |
| 523 | 523 | 'PNG', |
| 524 | - (isset($emisor['url'])?$emisor['url']:''), |
|
| 524 | + (isset($emisor['url']) ? $emisor['url'] : ''), |
|
| 525 | 525 | $logo_next_pointer, |
| 526 | 526 | 2, |
| 527 | 527 | 300, |
| 528 | 528 | $logo_position |
| 529 | 529 | ); |
| 530 | - if (!empty($this->logo['posicion']) and $this->logo['posicion'] == 'C') { |
|
| 530 | + if (!empty($this->logo['posicion']) and $this->logo['posicion']=='C') { |
|
| 531 | 531 | $w += 40; |
| 532 | 532 | } else { |
| 533 | 533 | if ($this->logo['posicion']) { |
| 534 | - $this->SetY($this->y + ($w_img/2)); |
|
| 534 | + $this->SetY($this->y+($w_img / 2)); |
|
| 535 | 535 | $w += 40; |
| 536 | 536 | } else { |
| 537 | 537 | $x = $this->x+3; |
@@ -544,19 +544,19 @@ discard block |
||
| 544 | 544 | // agregar datos del emisor |
| 545 | 545 | if ($agregarDatosEmisor) { |
| 546 | 546 | $this->setFont('', 'B', $font_size ? $font_size : 14); |
| 547 | - $this->SetTextColorArray($color===null?[32, 92, 144]:$color); |
|
| 548 | - $this->MultiTexto(!empty($emisor['RznSoc']) ? $emisor['RznSoc'] : $emisor['RznSocEmisor'], $x, $this->y+2, 'L', ($h_folio and $h_folio < $this->getY()) ? $w_all : $w); |
|
| 547 | + $this->SetTextColorArray($color===null ? [32, 92, 144] : $color); |
|
| 548 | + $this->MultiTexto(!empty($emisor['RznSoc']) ? $emisor['RznSoc'] : $emisor['RznSocEmisor'], $x, $this->y+2, 'L', ($h_folio and $h_folio<$this->getY()) ? $w_all : $w); |
|
| 549 | 549 | $this->setFont('', 'B', $font_size ? $font_size : 9); |
| 550 | - $this->SetTextColorArray([0,0,0]); |
|
| 551 | - $this->MultiTexto(!empty($emisor['GiroEmis']) ? $emisor['GiroEmis'] : $emisor['GiroEmisor'], $x, $this->y, 'L', ($h_folio and $h_folio < $this->getY()) ? $w_all : $w); |
|
| 550 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 551 | + $this->MultiTexto(!empty($emisor['GiroEmis']) ? $emisor['GiroEmis'] : $emisor['GiroEmisor'], $x, $this->y, 'L', ($h_folio and $h_folio<$this->getY()) ? $w_all : $w); |
|
| 552 | 552 | $comuna = !empty($emisor['CmnaOrigen']) ? $emisor['CmnaOrigen'] : null; |
| 553 | 553 | $ciudad = !empty($emisor['CiudadOrigen']) ? $emisor['CiudadOrigen'] : \sasco\LibreDTE\Chile::getCiudad($comuna); |
| 554 | - $this->MultiTexto($emisor['DirOrigen'].($comuna?(', '.$comuna):'').($ciudad?(', '.$ciudad):''), $x, $this->y, 'L', ($h_folio and $h_folio < $this->getY()) ? $w_all : $w); |
|
| 554 | + $this->MultiTexto($emisor['DirOrigen'].($comuna ? (', '.$comuna) : '').($ciudad ? (', '.$ciudad) : ''), $x, $this->y, 'L', ($h_folio and $h_folio<$this->getY()) ? $w_all : $w); |
|
| 555 | 555 | if (!empty($emisor['Sucursal'])) { |
| 556 | - $this->MultiTexto('Sucursal: '.$emisor['Sucursal'], $x, $this->y, 'L', ($h_folio and $h_folio < $this->getY()) ? $w_all : $w); |
|
| 556 | + $this->MultiTexto('Sucursal: '.$emisor['Sucursal'], $x, $this->y, 'L', ($h_folio and $h_folio<$this->getY()) ? $w_all : $w); |
|
| 557 | 557 | } |
| 558 | 558 | if (!empty($this->casa_matriz)) { |
| 559 | - $this->MultiTexto('Casa matriz: '.$this->casa_matriz, $x, $this->y, 'L', ($h_folio and $h_folio < $this->getY()) ? $w_all : $w); |
|
| 559 | + $this->MultiTexto('Casa matriz: '.$this->casa_matriz, $x, $this->y, 'L', ($h_folio and $h_folio<$this->getY()) ? $w_all : $w); |
|
| 560 | 560 | } |
| 561 | 561 | $contacto = []; |
| 562 | 562 | if (!empty($emisor['Telefono'])) { |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | $contacto[] = $emisor['CorreoEmisor']; |
| 572 | 572 | } |
| 573 | 573 | if ($contacto) { |
| 574 | - $this->MultiTexto(implode(' / ', $contacto), $x, $this->y, 'L', ($h_folio and $h_folio < $this->getY()) ? $w_all : $w); |
|
| 574 | + $this->MultiTexto(implode(' / ', $contacto), $x, $this->y, 'L', ($h_folio and $h_folio<$this->getY()) ? $w_all : $w); |
|
| 575 | 575 | } |
| 576 | 576 | } |
| 577 | 577 | return $this->y; |
@@ -601,12 +601,12 @@ discard block |
||
| 601 | 601 | protected function agregarFolio($rut, $tipo, $folio, $sucursal_sii = null, $x = 130, $y = 15, $w = 70, $font_size = null, array $color = null) |
| 602 | 602 | { |
| 603 | 603 | if ($color===null) { |
| 604 | - $color = $tipo ? ($tipo==52 ? [0,172,140] : [255,0,0]) : [0,0,0]; |
|
| 604 | + $color = $tipo ? ($tipo==52 ? [0, 172, 140] : [255, 0, 0]) : [0, 0, 0]; |
|
| 605 | 605 | } |
| 606 | 606 | $this->SetTextColorArray($color); |
| 607 | 607 | // colocar rut emisor, glosa documento y folio |
| 608 | 608 | list($rut, $dv) = explode('-', $rut); |
| 609 | - $this->setFont ('', 'B', $font_size ? $font_size : 15); |
|
| 609 | + $this->setFont('', 'B', $font_size ? $font_size : 15); |
|
| 610 | 610 | $this->MultiTexto('R.U.T.: '.$this->num($rut).'-'.$dv, $x, $y+4, 'C', $w); |
| 611 | 611 | $this->setFont('', 'B', $font_size ? $font_size : 12); |
| 612 | 612 | $this->MultiTexto($this->getTipo($tipo, $folio), $x, null, 'C', $w); |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | if ($tipo) { |
| 620 | 620 | $this->Texto('S.I.I. - '.\sasco\LibreDTE\Sii::getDireccionRegional($sucursal_sii), $x, $this->getY()+4, 'C', $w); |
| 621 | 621 | } |
| 622 | - $this->SetTextColorArray([0,0,0]); |
|
| 622 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 623 | 623 | $this->Ln(); |
| 624 | 624 | return $this->y; |
| 625 | 625 | } |
@@ -733,10 +733,10 @@ discard block |
||
| 733 | 733 | } |
| 734 | 734 | if (!empty($receptor['RznSocRecep'])) { |
| 735 | 735 | $this->setFont('', 'B', null); |
| 736 | - $this->Texto(in_array($this->dte, [39, 41]) ? 'Nombre' : ($x==10?'Razón social':'Razón soc.'), $x); |
|
| 736 | + $this->Texto(in_array($this->dte, [39, 41]) ? 'Nombre' : ($x==10 ? 'Razón social' : 'Razón soc.'), $x); |
|
| 737 | 737 | $this->Texto(':', $x+$offset); |
| 738 | 738 | $this->setFont('', '', null); |
| 739 | - $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10?105:0); |
|
| 739 | + $this->MultiTexto($receptor['RznSocRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0); |
|
| 740 | 740 | } |
| 741 | 741 | if (!empty($receptor['GiroRecep'])) { |
| 742 | 742 | $this->setFont('', 'B', null); |
@@ -753,7 +753,7 @@ discard block |
||
| 753 | 753 | $ciudad = !empty($receptor['CiudadRecep']) ? $receptor['CiudadRecep'] : ( |
| 754 | 754 | !empty($receptor['CmnaRecep']) ? \sasco\LibreDTE\Chile::getCiudad($receptor['CmnaRecep']) : '' |
| 755 | 755 | ); |
| 756 | - $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep'])?(', '.$receptor['CmnaRecep']):'').($ciudad?(', '.$ciudad):''), $x+$offset+2); |
|
| 756 | + $this->MultiTexto($receptor['DirRecep'].(!empty($receptor['CmnaRecep']) ? (', '.$receptor['CmnaRecep']) : '').($ciudad ? (', '.$ciudad) : ''), $x+$offset+2); |
|
| 757 | 757 | } |
| 758 | 758 | if (!empty($receptor['Extranjero']['Nacionalidad'])) { |
| 759 | 759 | $this->setFont('', 'B', null); |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | $this->Texto('Cód. recep.', $x); |
| 795 | 795 | $this->Texto(':', $x+$offset); |
| 796 | 796 | $this->setFont('', '', null); |
| 797 | - $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10?105:0); |
|
| 797 | + $this->MultiTexto($receptor['CdgIntRecep'], $x+$offset+2, null, '', $x==10 ? 105 : 0); |
|
| 798 | 798 | } |
| 799 | 799 | return $this->GetY(); |
| 800 | 800 | } |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | { |
| 892 | 892 | if (!isset($referencias[0])) |
| 893 | 893 | $referencias = [$referencias]; |
| 894 | - foreach($referencias as $r) { |
|
| 894 | + foreach ($referencias as $r) { |
|
| 895 | 895 | $texto = $r['NroLinRef'].' - '; |
| 896 | 896 | if (!empty($r['TpoDocRef'])) { |
| 897 | 897 | $texto .= $this->getTipo($r['TpoDocRef']).' '; |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | // quitar columnas |
| 953 | 953 | foreach ($item as $col => $valor) { |
| 954 | 954 | if ($col=='DscItem' and !empty($item['DscItem'])) { |
| 955 | - $item['NmbItem'] .= !$this->item_detalle_posicion ? ($html?'<br/>':"\n") : ': '; |
|
| 955 | + $item['NmbItem'] .= !$this->item_detalle_posicion ? ($html ? '<br/>' : "\n") : ': '; |
|
| 956 | 956 | if ($html) { |
| 957 | 957 | $item['NmbItem'] .= '<span style="font-size:0.7em">'.$item['DscItem'].'</span>'; |
| 958 | 958 | } else { |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | } |
| 1001 | 1001 | $item = array_merge($item_default, $item); |
| 1002 | 1002 | // si hay código de item se extrae su valor |
| 1003 | - if (!empty($item['CdgItem']['VlrCodigo'])){ |
|
| 1003 | + if (!empty($item['CdgItem']['VlrCodigo'])) { |
|
| 1004 | 1004 | $item['CdgItem'] = $item['CdgItem']['VlrCodigo']; |
| 1005 | 1005 | } |
| 1006 | 1006 | // dar formato a números |
@@ -1043,9 +1043,9 @@ discard block |
||
| 1043 | 1043 | $this->SetY($this->getY()+1); |
| 1044 | 1044 | $p1x = $x; |
| 1045 | 1045 | $p1y = $this->y; |
| 1046 | - $p2x = $this->getPageWidth() - 2; |
|
| 1047 | - $p2y = $p1y; // Use same y for a straight line |
|
| 1048 | - $style = array('width' => 0.2,'color' => array(0, 0, 0)); |
|
| 1046 | + $p2x = $this->getPageWidth()-2; |
|
| 1047 | + $p2y = $p1y; // Use same y for a straight line |
|
| 1048 | + $style = array('width' => 0.2, 'color' => array(0, 0, 0)); |
|
| 1049 | 1049 | $this->Line($p1x, $p1y, $p2x, $p2y, $style); |
| 1050 | 1050 | $this->Texto($this->detalle_cols['NmbItem']['title'], $x+$offsets[0], $this->y, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']); |
| 1051 | 1051 | $this->Texto($this->detalle_cols['PrcItem']['title'], $x+$offsets[1], $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']); |
@@ -1057,7 +1057,7 @@ discard block |
||
| 1057 | 1057 | } |
| 1058 | 1058 | // mostrar items |
| 1059 | 1059 | $this->SetY($this->getY()+2); |
| 1060 | - foreach($detalle as &$d) { |
|
| 1060 | + foreach ($detalle as &$d) { |
|
| 1061 | 1061 | // nombre y descripción del item |
| 1062 | 1062 | $item = $d['NmbItem']; |
| 1063 | 1063 | if (!empty($d['DscItem'])) { |
@@ -1067,14 +1067,14 @@ discard block |
||
| 1067 | 1067 | // descuento |
| 1068 | 1068 | if (!empty($d['DescuentoPct']) or !empty($d['DescuentoMonto'])) { |
| 1069 | 1069 | if (!empty($d['DescuentoPct'])) { |
| 1070 | - $descuento = number_format($d['DescuentoPct'],0,',','.').'%'; |
|
| 1070 | + $descuento = number_format($d['DescuentoPct'], 0, ',', '.').'%'; |
|
| 1071 | 1071 | } else { |
| 1072 | - $descuento = number_format($d['DescuentoMonto'],0,',','.'); |
|
| 1072 | + $descuento = number_format($d['DescuentoMonto'], 0, ',', '.'); |
|
| 1073 | 1073 | } |
| 1074 | 1074 | $this->Texto('Desc.: '.$descuento, $x+$offsets[0], $this->y, ucfirst($this->detalle_cols['NmbItem']['align'][0]), $this->detalle_cols['NmbItem']['width']); |
| 1075 | 1075 | } |
| 1076 | 1076 | // precio y cantidad |
| 1077 | - $this->Texto(number_format($d['PrcItem'],0,',','.'), $x+$offsets[1], $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']); |
|
| 1077 | + $this->Texto(number_format($d['PrcItem'], 0, ',', '.'), $x+$offsets[1], $this->y, ucfirst($this->detalle_cols['PrcItem']['align'][0]), $this->detalle_cols['PrcItem']['width']); |
|
| 1078 | 1078 | $this->Texto($this->num($d['QtyItem']), $x+$offsets[2], $this->y, ucfirst($this->detalle_cols['QtyItem']['align'][0]), $this->detalle_cols['QtyItem']['width']); |
| 1079 | 1079 | $this->Texto($this->num($d['MontoItem']), $x+$offsets[3], $this->y, ucfirst($this->detalle_cols['MontoItem']['align'][0]), $this->detalle_cols['MontoItem']['width']); |
| 1080 | 1080 | } |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | if (!isset($detalle[0])) { |
| 1095 | 1095 | $detalle = [$detalle]; |
| 1096 | 1096 | } |
| 1097 | - foreach($detalle as &$d) { |
|
| 1097 | + foreach ($detalle as &$d) { |
|
| 1098 | 1098 | if (!empty($d['MontoItem'])) { |
| 1099 | 1099 | $subtotal += $d['MontoItem']; |
| 1100 | 1100 | } |
@@ -1120,16 +1120,16 @@ discard block |
||
| 1120 | 1120 | if (!isset($descuentosRecargos[0])) { |
| 1121 | 1121 | $descuentosRecargos = [$descuentosRecargos]; |
| 1122 | 1122 | } |
| 1123 | - foreach($descuentosRecargos as $dr) { |
|
| 1123 | + foreach ($descuentosRecargos as $dr) { |
|
| 1124 | 1124 | $tipo = $dr['TpoMov']=='D' ? 'Descuento' : 'Recargo'; |
| 1125 | 1125 | if (!empty($dr['IndExeDR'])) { |
| 1126 | 1126 | $tipo .= ' EX'; |
| 1127 | 1127 | } |
| 1128 | 1128 | $valor = $dr['TpoValor']=='%' ? $dr['ValorDR'].'%' : $this->num($dr['ValorDR']); |
| 1129 | 1129 | if ($this->papelContinuo) { |
| 1130 | - $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR'])?(' ('.$dr['GlosaDR'].')'):''), $x); |
|
| 1130 | + $this->Texto($tipo.' global: '.$valor.(!empty($dr['GlosaDR']) ? (' ('.$dr['GlosaDR'].')') : ''), $x); |
|
| 1131 | 1131 | } else { |
| 1132 | - $this->Texto($tipo.(!empty($dr['GlosaDR'])?(' ('.$dr['GlosaDR'].')'):'').':', 77, null, 'R', 100); |
|
| 1132 | + $this->Texto($tipo.(!empty($dr['GlosaDR']) ? (' ('.$dr['GlosaDR'].')') : '').':', 77, null, 'R', 100); |
|
| 1133 | 1133 | $this->Texto($valor, 177, null, 'R', 22); |
| 1134 | 1134 | } |
| 1135 | 1135 | $this->Ln(); |
@@ -1149,8 +1149,8 @@ discard block |
||
| 1149 | 1149 | $pagos = [$pagos]; |
| 1150 | 1150 | $this->Texto('Pago(s) programado(s):', $x); |
| 1151 | 1151 | $this->Ln(); |
| 1152 | - foreach($pagos as $p) { |
|
| 1153 | - $this->Texto(' - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos'])?(' ('.$p['GlosaPagos'].')'):''), $x); |
|
| 1152 | + foreach ($pagos as $p) { |
|
| 1153 | + $this->Texto(' - '.$this->date($p['FchPago'], false).': $'.$this->num($p['MntPago']).'.-'.(!empty($p['GlosaPagos']) ? (' ('.$p['GlosaPagos'].')') : ''), $x); |
|
| 1154 | 1154 | $this->Ln(); |
| 1155 | 1155 | } |
| 1156 | 1156 | } |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | if (!isset($ImptoReten[0])) { |
| 1202 | 1202 | $ImptoReten = [$ImptoReten]; |
| 1203 | 1203 | } |
| 1204 | - foreach($ImptoReten as $i) { |
|
| 1204 | + foreach ($ImptoReten as $i) { |
|
| 1205 | 1205 | $totales['ImptoReten_'.$i['TipoImp']] = $i['MontoImp']; |
| 1206 | 1206 | if (!empty($i['TasaImp'])) { |
| 1207 | 1207 | $glosas['ImptoReten_'.$i['TipoImp']] = \sasco\LibreDTE\Sii\ImpuestosAdicionales::getGlosa($i['TipoImp']).' ('.$i['TasaImp'].'%) $'; |
@@ -1314,9 +1314,9 @@ discard block |
||
| 1314 | 1314 | 'vpadding' => 0, |
| 1315 | 1315 | 'module_width' => 1, // width of a single module in points |
| 1316 | 1316 | 'module_height' => 1, // height of a single module in points |
| 1317 | - 'fgcolor' => [0,0,0], |
|
| 1317 | + 'fgcolor' => [0, 0, 0], |
|
| 1318 | 1318 | 'bgcolor' => false, // [255,255,255] |
| 1319 | - 'position' => $position === null ? ($this->papelContinuo ? 'C' : 'S') : $position, |
|
| 1319 | + 'position' => $position===null ? ($this->papelContinuo ? 'C' : 'S') : $position, |
|
| 1320 | 1320 | ]; |
| 1321 | 1321 | $ecl = version_compare(phpversion(), '7.0.0', '<') ? -1 : $this->ecl; |
| 1322 | 1322 | $this->write2DBarcode($timbre, 'PDF417,,'.$ecl, $x_timbre, $y, $w, 0, $style, 'B'); |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | protected function agregarAcuseRecibo($x = 83, $y = 190, $w = 60, $h = 40, $line = 25) |
| 1348 | 1348 | { |
| 1349 | 1349 | $y = (!$this->papelContinuo and !$this->timbre_pie) ? $this->x_fin_datos : $y; |
| 1350 | - $this->SetTextColorArray([0,0,0]); |
|
| 1350 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 1351 | 1351 | $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]); |
| 1352 | 1352 | $this->setFont('', 'B', 10); |
| 1353 | 1353 | $this->Texto('Acuse de recibo', $x, $y+1, 'C', $w); |
@@ -1377,9 +1377,9 @@ discard block |
||
| 1377 | 1377 | */ |
| 1378 | 1378 | protected function agregarAcuseReciboContinuo($x = 3, $y = null, $w = 68, $h = 40) |
| 1379 | 1379 | { |
| 1380 | - $this->SetTextColorArray([0,0,0]); |
|
| 1380 | + $this->SetTextColorArray([0, 0, 0]); |
|
| 1381 | 1381 | $this->Rect($x, $y, $w, $h, 'D', ['all' => ['width' => 0.1, 'color' => [0, 0, 0]]]); |
| 1382 | - $style = array('width' => 0.2,'color' => array(0, 0, 0)); |
|
| 1382 | + $style = array('width' => 0.2, 'color' => array(0, 0, 0)); |
|
| 1383 | 1383 | $this->Line($x, $y+22, $w+3, $y+22, $style); |
| 1384 | 1384 | //$this->setFont('', 'B', 10); |
| 1385 | 1385 | //$this->Texto('Acuse de recibo', $x, $y+1, 'C', $w); |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | $y = (!$this->papelContinuo and !$this->timbre_pie and $this->x_fin_datos<=$y) ? $this->x_fin_datos : $y; |
| 1410 | 1410 | $y += 48; |
| 1411 | 1411 | $this->setFont('', 'B', $font_size); |
| 1412 | - $this->Texto('CEDIBLE'.($tipo==52?' CON SU FACTURA':''), null, $y, 'R'); |
|
| 1412 | + $this->Texto('CEDIBLE'.($tipo==52 ? ' CON SU FACTURA' : ''), null, $y, 'R'); |
|
| 1413 | 1413 | } |
| 1414 | 1414 | |
| 1415 | 1415 | /** |
@@ -1420,7 +1420,7 @@ discard block |
||
| 1420 | 1420 | protected function agregarLeyendaDestinoContinuo($tipo) |
| 1421 | 1421 | { |
| 1422 | 1422 | $this->setFont('', 'B', 8); |
| 1423 | - $this->Texto('CEDIBLE'.($tipo==52?' CON SU FACTURA':''), null, $this->y+6, 'R'); |
|
| 1423 | + $this->Texto('CEDIBLE'.($tipo==52 ? ' CON SU FACTURA' : ''), null, $this->y+6, 'R'); |
|
| 1424 | 1424 | } |
| 1425 | 1425 | |
| 1426 | 1426 | } |