@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | " AND ". |
| 140 | 140 | $this->empresa->var2str(\date('Y-m-d', strtotime($this->hasta))); |
| 141 | 141 | } |
| 142 | - $tipo_pagada = ($pagada)?'TRUE':'FALSE'; |
|
| 142 | + $tipo_pagada = ($pagada) ? 'TRUE' : 'FALSE'; |
|
| 143 | 143 | $sql = "SELECT f.idfactura, f.numero2, f.vencimiento, lf.referencia, lf.descripcion, f.fecha, lf.pvpsindto, ". |
| 144 | 144 | "lf.dtopor, lf.pvptotal". |
| 145 | 145 | " FROM facturascli as f left join lineasfacturascli as lf ON (f.idfactura = lf.idfactura)". |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | foreach ($data as $l) { |
| 153 | 153 | $linea = (object) $l; |
| 154 | 154 | $linea->f_pago = $linea->fecha; |
| 155 | - $linea->dias_atraso = ($pagada)?0:$this->diasAtraso($linea->vencimiento, \date('d-m-Y')); |
|
| 155 | + $linea->dias_atraso = ($pagada) ? 0 : $this->diasAtraso($linea->vencimiento, \date('d-m-Y')); |
|
| 156 | 156 | $linea->abono = 0; |
| 157 | 157 | if (in_array('tesoreria', $GLOBALS['plugins'], true)) { |
| 158 | 158 | //TO-DO Restar recibos de pagos realizados |
@@ -183,14 +183,14 @@ discard block |
||
| 183 | 183 | $cliente = $cli->get($codcliente); |
| 184 | 184 | if ($iddireccion !== '') { |
| 185 | 185 | foreach ($cliente->get_direcciones() as $dir) { |
| 186 | - if ($dir->id === (int)$iddireccion) { |
|
| 186 | + if ($dir->id === (int) $iddireccion) { |
|
| 187 | 187 | $dir->direccion = $nueva_direccion; |
| 188 | 188 | $dir->save(); |
| 189 | 189 | break; |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | return $iddireccion; |
| 193 | - } else { |
|
| 193 | + }else { |
|
| 194 | 194 | $dir = new direccion_cliente(); |
| 195 | 195 | $dir->direccion = $nueva_direccion; |
| 196 | 196 | $dir->codcliente = $codcliente; |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | if ($this->codigo_edificacion) { |
| 106 | - $this->where_code = " AND r.codigo like '" . $this->codigo_edificacion . "%' "; |
|
| 106 | + $this->where_code = " AND r.codigo like '".$this->codigo_edificacion."%' "; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if ($this->tipo === 'informacion') { |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | $this->offset = $this->confirmarValor($this->filter_request('offset'), 0); |
| 143 | 143 | $this->limit = $this->confirmarValor($this->filter_request('limit'), FS_ITEM_LIMIT); |
| 144 | 144 | $this->search = $this->confirmarValor($this->filter_request('search'), false); |
| 145 | - $this->sort = ($sort and $sort!='undefined')?$sort:'r.codigo, r.numero'; |
|
| 146 | - $this->order = ($order and $order!='undefined')?$order:'ASC'; |
|
| 145 | + $this->sort = ($sort and $sort != 'undefined') ? $sort : 'r.codigo, r.numero'; |
|
| 146 | + $this->order = ($order and $order != 'undefined') ? $order : 'ASC'; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | public function informacion_edificaciones() |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | //Verificamos los que están ocupados |
| 167 | - $this->inmuebles_libres = $inmuebles-$inmuebles_ocupados; |
|
| 167 | + $this->inmuebles_libres = $inmuebles - $inmuebles_ocupados; |
|
| 168 | 168 | $this->inmuebles_ocupados = $inmuebles_ocupados; |
| 169 | 169 | $this->total_vehiculos = $vehiculos; |
| 170 | 170 | $this->carpetasPlugin(); |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | public function generarArchivoExcel() |
| 175 | 175 | { |
| 176 | - $this->archivoXLSX = $this->exportDir . DIRECTORY_SEPARATOR . |
|
| 177 | - $this->archivo . "_" . $this->user->nick . ".xlsx"; |
|
| 178 | - $this->archivoXLSXPath = $this->publicPath . DIRECTORY_SEPARATOR . |
|
| 179 | - $this->archivo . "_" . $this->user->nick . ".xlsx"; |
|
| 176 | + $this->archivoXLSX = $this->exportDir.DIRECTORY_SEPARATOR. |
|
| 177 | + $this->archivo."_".$this->user->nick.".xlsx"; |
|
| 178 | + $this->archivoXLSXPath = $this->publicPath.DIRECTORY_SEPARATOR. |
|
| 179 | + $this->archivo."_".$this->user->nick.".xlsx"; |
|
| 180 | 180 | if (file_exists($this->archivoXLSX)) { |
| 181 | 181 | unlink($this->archivoXLSX); |
| 182 | 182 | } |
@@ -256,10 +256,10 @@ discard block |
||
| 256 | 256 | public function datosInformacion() |
| 257 | 257 | { |
| 258 | 258 | //Cantidad de Edificaciones |
| 259 | - $sql_edificaciones = "SELECT ret.id,ret.descripcion, count(rme.id) as total " . |
|
| 260 | - "FROM residentes_edificaciones_tipo as ret " . |
|
| 261 | - " join residentes_mapa_edificaciones as rme on (rme.id_tipo = ret.id) " . |
|
| 262 | - " group by ret.id,ret.descripcion " . |
|
| 259 | + $sql_edificaciones = "SELECT ret.id,ret.descripcion, count(rme.id) as total ". |
|
| 260 | + "FROM residentes_edificaciones_tipo as ret ". |
|
| 261 | + " join residentes_mapa_edificaciones as rme on (rme.id_tipo = ret.id) ". |
|
| 262 | + " group by ret.id,ret.descripcion ". |
|
| 263 | 263 | " order by ret.padre;"; |
| 264 | 264 | $data_edificaciones = $this->db->select($sql_edificaciones); |
| 265 | 265 | //cantidad de Inmuebles |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | echo json_encode($data, JSON_THROW_ON_ERROR); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - public function lista_residentes ($todo = false) |
|
| 305 | + public function lista_residentes($todo = false) |
|
| 306 | 306 | { |
| 307 | 307 | $sql = " select r.codcliente, c.nombre, c.cifnif, c.telefono1, c.email, codigo, numero, fecha_ocupacion ". |
| 308 | 308 | " from residentes_edificaciones as r, clientes as c ". |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | " order by ".$this->sort." ".$this->order; |
| 311 | 311 | if ($todo) { |
| 312 | 312 | $data = $this->db->select($sql); |
| 313 | - } else { |
|
| 313 | + }else { |
|
| 314 | 314 | $data = $this->db->select_limit($sql, $this->limit, $this->offset); |
| 315 | 315 | } |
| 316 | 316 | $sql_cantidad = "select count(r.id) as total from residentes_edificaciones as r ". |
@@ -332,13 +332,13 @@ discard block |
||
| 332 | 332 | " order by ".$this->sort." ".$this->order; |
| 333 | 333 | if ($todo) { |
| 334 | 334 | $data = $this->db->select($sql); |
| 335 | - } else { |
|
| 335 | + }else { |
|
| 336 | 336 | $data = $this->db->select_limit($sql, $this->limit, $this->offset); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | $sql_cantidad = "select count(r.id) as total from residentes_edificaciones as r"; |
| 340 | 340 | if ($this->where_code) { |
| 341 | - $sql_cantidad.=" WHERE r.codigo!='' ".$this->where_code; |
|
| 341 | + $sql_cantidad .= " WHERE r.codigo!='' ".$this->where_code; |
|
| 342 | 342 | } |
| 343 | 343 | $data_cantidad = $this->db->select($sql_cantidad); |
| 344 | 344 | return array($data, $data_cantidad[0]['total']); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | " order by ".$this->sort." ".$this->order; |
| 361 | 361 | if ($todo) { |
| 362 | 362 | $data = $this->db->select($sql); |
| 363 | - } else { |
|
| 363 | + }else { |
|
| 364 | 364 | $data = $this->db->select_limit($sql, $this->limit, $this->offset); |
| 365 | 365 | } |
| 366 | 366 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | |
| 442 | 442 | public function crearXLSX(&$writer, $hoja_nombre, $header, $headerText, $data) |
| 443 | 443 | { |
| 444 | - $style_header = array('border'=>'left,right,top,bottom','font'=>'Arial','font-size'=>10,'font-style'=>'bold'); |
|
| 444 | + $style_header = array('border'=>'left,right,top,bottom', 'font'=>'Arial', 'font-size'=>10, 'font-style'=>'bold'); |
|
| 445 | 445 | $writer->writeSheetRow($hoja_nombre, $headerText, $style_header); |
| 446 | 446 | $writer->writeSheetHeader($hoja_nombre, $header, true); |
| 447 | 447 | $this->agregarDatosXLSX($writer, $hoja_nombre, $data, $headerText); |
@@ -473,9 +473,9 @@ discard block |
||
| 473 | 473 | public function carpetasPlugin() |
| 474 | 474 | { |
| 475 | 475 | $basepath = dirname(__DIR__, 3); |
| 476 | - $this->documentosDir = $basepath . DIRECTORY_SEPARATOR . FS_MYDOCS . 'documentos'; |
|
| 477 | - $this->exportDir = $this->documentosDir . DIRECTORY_SEPARATOR . "informes_residentes"; |
|
| 478 | - $this->publicPath = FS_PATH . FS_MYDOCS . 'documentos' . DIRECTORY_SEPARATOR . 'informes_residentes'; |
|
| 476 | + $this->documentosDir = $basepath.DIRECTORY_SEPARATOR.FS_MYDOCS.'documentos'; |
|
| 477 | + $this->exportDir = $this->documentosDir.DIRECTORY_SEPARATOR."informes_residentes"; |
|
| 478 | + $this->publicPath = FS_PATH.FS_MYDOCS.'documentos'.DIRECTORY_SEPARATOR.'informes_residentes'; |
|
| 479 | 479 | if (!is_dir($this->documentosDir)) { |
| 480 | 480 | if (!mkdir($concurrentDirectory = $this->documentosDir) && !is_dir($concurrentDirectory)) { |
| 481 | 481 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | public function url() |
| 493 | 493 | { |
| 494 | 494 | if (isset($_REQUEST['inmueble'])) { |
| 495 | - return 'index.php?page=informe_residentes&inmueble=' . $_REQUEST['inmueble']; |
|
| 495 | + return 'index.php?page=informe_residentes&inmueble='.$_REQUEST['inmueble']; |
|
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | return parent::url(); |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | 'page_from' => __CLASS__, |
| 512 | 512 | 'page_to' => __CLASS__, |
| 513 | 513 | 'type' => 'head', |
| 514 | - 'text' => '<script src="' . FS_PATH . |
|
| 514 | + 'text' => '<script src="'.FS_PATH. |
|
| 515 | 515 | 'plugins/residentes/view/js/1/bootstrap-table.min.js" type="text/javascript"></script>', |
| 516 | 516 | 'params' => '' |
| 517 | 517 | ), |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | 'page_from' => __CLASS__, |
| 521 | 521 | 'page_to' => __CLASS__, |
| 522 | 522 | 'type' => 'head', |
| 523 | - 'text' => '<script src="' . FS_PATH . |
|
| 523 | + 'text' => '<script src="'.FS_PATH. |
|
| 524 | 524 | 'plugins/residentes/view/js/1/bootstrap-table-locale-all.min.js" type="text/javascript"></script>', |
| 525 | 525 | 'params' => '' |
| 526 | 526 | ), |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | 'page_from' => __CLASS__, |
| 530 | 530 | 'page_to' => __CLASS__, |
| 531 | 531 | 'type' => 'head', |
| 532 | - 'text' => '<script src="' . FS_PATH . |
|
| 532 | + 'text' => '<script src="'.FS_PATH. |
|
| 533 | 533 | 'plugins/residentes/view/js/plugins/bootstrap-table-filter.min.js" type="text/javascript"></script>', |
| 534 | 534 | 'params' => '' |
| 535 | 535 | ), |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | 'page_from' => __CLASS__, |
| 539 | 539 | 'page_to' => __CLASS__, |
| 540 | 540 | 'type' => 'head', |
| 541 | - 'text' => '<script src="' . FS_PATH . |
|
| 541 | + 'text' => '<script src="'.FS_PATH. |
|
| 542 | 542 | 'plugins/residentes/view/js/plugins/bootstrap-table-toolbar.min.js" type="text/javascript"></script>', |
| 543 | 543 | 'params' => '' |
| 544 | 544 | ), |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | 'page_from' => __CLASS__, |
| 548 | 548 | 'page_to' => __CLASS__, |
| 549 | 549 | 'type' => 'head', |
| 550 | - 'text' => '<script src="' . FS_PATH . |
|
| 550 | + 'text' => '<script src="'.FS_PATH. |
|
| 551 | 551 | 'plugins/residentes/view/js/plugins/bootstrap-table-mobile.min.js" type="text/javascript"></script>', |
| 552 | 552 | 'params' => '' |
| 553 | 553 | ), |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | 'page_from' => __CLASS__, |
| 557 | 557 | 'page_to' => __CLASS__, |
| 558 | 558 | 'type' => 'head', |
| 559 | - 'text' => '<script src="' . FS_PATH . 'view/js/chart.bundle.min.js" type="text/javascript"></script>', |
|
| 559 | + 'text' => '<script src="'.FS_PATH.'view/js/chart.bundle.min.js" type="text/javascript"></script>', |
|
| 560 | 560 | 'params' => '' |
| 561 | 561 | ), |
| 562 | 562 | array( |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | 'page_from' => __CLASS__, |
| 565 | 565 | 'page_to' => __CLASS__, |
| 566 | 566 | 'type' => 'head', |
| 567 | - 'text' => '<link rel="stylesheet" type="text/css" media="screen" href="' . FS_PATH . |
|
| 567 | + 'text' => '<link rel="stylesheet" type="text/css" media="screen" href="'.FS_PATH. |
|
| 568 | 568 | 'plugins/residentes/view/css/bootstrap-table.min.css"/>', |
| 569 | 569 | 'params' => '' |
| 570 | 570 | ), |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | foreach ($extensiones as $ext) { |
| 574 | 574 | $fsext0 = new fs_extension($ext); |
| 575 | 575 | if (!$fsext0->save()) { |
| 576 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
| 576 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
| 577 | 577 | } |
| 578 | 578 | } |
| 579 | 579 | } |
@@ -71,81 +71,81 @@ discard block |
||
| 71 | 71 | if (imagepng(imagecreatefromstring(file_get_contents($this->logo)), FS_MYDOCS |
| 72 | 72 | . 'images/logo.png')) { |
| 73 | 73 | $this->pdf->addPngFromFile( |
| 74 | - FS_MYDOCS . 'images/logo.png', |
|
| 74 | + FS_MYDOCS.'images/logo.png', |
|
| 75 | 75 | self::LOGO_X, |
| 76 | 76 | self::LOGO_Y, |
| 77 | 77 | $tamanyo[0], |
| 78 | 78 | $tamanyo[1] |
| 79 | 79 | ); |
| 80 | - } else { |
|
| 80 | + }else { |
|
| 81 | 81 | $this->pdf->addJpegFromFile($this->logo, self::LOGO_X, self::LOGO_Y, $tamanyo[0], $tamanyo[1]); |
| 82 | 82 | } |
| 83 | - } else { |
|
| 83 | + }else { |
|
| 84 | 84 | $this->pdf->addJpegFromFile($this->logo, self::LOGO_X, self::LOGO_Y, $tamanyo[0], $tamanyo[1]); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $this->pdf->ez['rightMargin'] = 40; |
| 88 | 88 | $this->pdf->ezText( |
| 89 | - "<b>" . fs_fix_html($empresa->nombre) . "</b>", |
|
| 89 | + "<b>".fs_fix_html($empresa->nombre)."</b>", |
|
| 90 | 90 | 12, |
| 91 | 91 | array('justification' => 'right') |
| 92 | 92 | ); |
| 93 | - $this->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'right')); |
|
| 93 | + $this->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'right')); |
|
| 94 | 94 | |
| 95 | - $direccion = $empresa->direccion . "\n"; |
|
| 95 | + $direccion = $empresa->direccion."\n"; |
|
| 96 | 96 | if ($empresa->apartado) { |
| 97 | - $direccion .= ucfirst(FS_APARTADO) . ': ' . $empresa->apartado . ' - '; |
|
| 97 | + $direccion .= ucfirst(FS_APARTADO).': '.$empresa->apartado.' - '; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if ($empresa->codpostal) { |
| 101 | - $direccion .= 'CP: ' . $empresa->codpostal . ' - '; |
|
| 101 | + $direccion .= 'CP: '.$empresa->codpostal.' - '; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if ($empresa->ciudad) { |
| 105 | - $direccion .= $empresa->ciudad . ' - '; |
|
| 105 | + $direccion .= $empresa->ciudad.' - '; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | if ($empresa->provincia) { |
| 109 | - $direccion .= '(' . $empresa->provincia . ')'; |
|
| 109 | + $direccion .= '('.$empresa->provincia.')'; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | if ($empresa->telefono) { |
| 113 | - $direccion .= "\nTeléfono: " . $empresa->telefono; |
|
| 113 | + $direccion .= "\nTeléfono: ".$empresa->telefono; |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $this->pdf->ezText(fs_fix_html($direccion) . "\n", 8, array('justification' => 'right')); |
|
| 116 | + $this->pdf->ezText(fs_fix_html($direccion)."\n", 8, array('justification' => 'right')); |
|
| 117 | 117 | $this->set_y(self::LOGO_Y + 10); |
| 118 | - } else { |
|
| 118 | + }else { |
|
| 119 | 119 | die('ERROR: no se encuentra la función imagecreatefromstring(). ' |
| 120 | 120 | . 'Y por tanto no se puede usar el logotipo en los documentos.'); |
| 121 | 121 | } |
| 122 | - } else { |
|
| 122 | + }else { |
|
| 123 | 123 | $this->pdf->ezText( |
| 124 | - "<b>" . fs_fix_html($empresa->nombre) . "</b>", |
|
| 124 | + "<b>".fs_fix_html($empresa->nombre)."</b>", |
|
| 125 | 125 | 12, |
| 126 | 126 | array('justification' => 'center') |
| 127 | 127 | ); |
| 128 | - $this->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'center')); |
|
| 128 | + $this->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'center')); |
|
| 129 | 129 | |
| 130 | 130 | $direccion = $empresa->direccion; |
| 131 | 131 | if ($empresa->apartado) { |
| 132 | - $direccion .= ' - ' . ucfirst(FS_APARTADO) . ': ' . $empresa->apartado; |
|
| 132 | + $direccion .= ' - '.ucfirst(FS_APARTADO).': '.$empresa->apartado; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if ($empresa->codpostal) { |
| 136 | - $direccion .= ' - CP: ' . $empresa->codpostal; |
|
| 136 | + $direccion .= ' - CP: '.$empresa->codpostal; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if ($empresa->ciudad) { |
| 140 | - $direccion .= ' - ' . $empresa->ciudad; |
|
| 140 | + $direccion .= ' - '.$empresa->ciudad; |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if ($empresa->provincia) { |
| 144 | - $direccion .= ' (' . $empresa->provincia . ')'; |
|
| 144 | + $direccion .= ' ('.$empresa->provincia.')'; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if ($empresa->telefono) { |
| 148 | - $direccion .= ' - Teléfono: ' . $empresa->telefono; |
|
| 148 | + $direccion .= ' - Teléfono: '.$empresa->telefono; |
|
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | $this->pdf->ezText(fs_fix_html($direccion), 8, array('justification' => 'center')); |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | $pdf_doc->new_table(); |
| 167 | 167 | $pdf_doc->add_table_row( |
| 168 | 168 | array( |
| 169 | - 'campo1' => "<b>" . $tipo_doc . "</b>", |
|
| 169 | + 'campo1' => "<b>".$tipo_doc."</b>", |
|
| 170 | 170 | 'dato1' => '', |
| 171 | - 'campo2' => "<b>Fecha Impresión:</b> " . \date('d-m-Y H:i:s') |
|
| 171 | + 'campo2' => "<b>Fecha Impresión:</b> ".\date('d-m-Y H:i:s') |
|
| 172 | 172 | ) |
| 173 | 173 | ); |
| 174 | 174 | |
@@ -176,27 +176,27 @@ discard block |
||
| 176 | 176 | array( |
| 177 | 177 | 'campo1' => "<b>Residente:</b>", |
| 178 | 178 | 'dato1' => fs_fix_html($this->cliente_residente->nombre), |
| 179 | - 'campo2' => "<b>Tipo Residente:</b> " . $tipo_residente |
|
| 179 | + 'campo2' => "<b>Tipo Residente:</b> ".$tipo_residente |
|
| 180 | 180 | ) |
| 181 | 181 | ); |
| 182 | 182 | |
| 183 | 183 | $row = array( |
| 184 | 184 | 'campo1' => "<b>Inmueble:</b>", |
| 185 | - 'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo() . |
|
| 186 | - ' - ' . $this->cliente_residente->inmueble->numero), |
|
| 185 | + 'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo(). |
|
| 186 | + ' - '.$this->cliente_residente->inmueble->numero), |
|
| 187 | 187 | 'campo2' => '' |
| 188 | 188 | ); |
| 189 | 189 | |
| 190 | 190 | if (!$this->cliente_residente) { |
| 191 | 191 | /// nada |
| 192 | 192 | } elseif ($this->cliente_residente->telefono1) { |
| 193 | - $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono1; |
|
| 193 | + $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono1; |
|
| 194 | 194 | if ($this->cliente_residente->telefono2) { |
| 195 | - $row['campo2'] .= "\n" . $this->cliente_residente->telefono2; |
|
| 195 | + $row['campo2'] .= "\n".$this->cliente_residente->telefono2; |
|
| 196 | 196 | $lppag -= 2; |
| 197 | 197 | } |
| 198 | 198 | } elseif ($this->cliente_residente->telefono2) { |
| 199 | - $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono2; |
|
| 199 | + $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono2; |
|
| 200 | 200 | } |
| 201 | 201 | $pdf_doc->add_table_row($row); |
| 202 | 202 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | [$table_header, $array_cols] = $this->generar_pdf_lineas_tablas($tipo); |
| 245 | 245 | $pdf_doc->add_table_header($table_header); |
| 246 | 246 | |
| 247 | - for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ( $linea_actual < count($items)));) { |
|
| 247 | + for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ($linea_actual < count($items)));) { |
|
| 248 | 248 | $fila = $this->generar_pdf_lineas_fila($tipo, $items, $linea_actual); |
| 249 | 249 | $pdf_doc->add_table_row($fila); |
| 250 | 250 | $linea_actual++; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | ); |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | - return array($table_header,$array_cols); |
|
| 289 | + return array($table_header, $array_cols); |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | public function generar_pdf_lineas_fila($tipo, $items, $linea_actual) |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | true, |
| 304 | 304 | FS_NF0 |
| 305 | 305 | ), |
| 306 | - 'descuento' => $residentes_controller->show_numero($items[$linea_actual]->dtopor) . " %", |
|
| 306 | + 'descuento' => $residentes_controller->show_numero($items[$linea_actual]->dtopor)." %", |
|
| 307 | 307 | 'total' => $residentes_controller->show_precio( |
| 308 | 308 | $items[$linea_actual]->pvptotal, |
| 309 | 309 | $residentes_controller->empresa->coddivisa, |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | $aux = explode("\n", $lin->descripcion); |
| 342 | 342 | if (count($aux) > 1) { |
| 343 | - $linea_size += 0.5 * ( count($aux) - 1); |
|
| 343 | + $linea_size += 0.5 * (count($aux) - 1); |
|
| 344 | 344 | } |
| 345 | 345 | if ($linea_size > 1) { |
| 346 | 346 | $lppag2 -= $linea_size - 1; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | public function crear_documento($tipo_documento) |
| 80 | 80 | { |
| 81 | - $this->archivo = \date('dmYhis') . '.pdf'; |
|
| 81 | + $this->archivo = \date('dmYhis').'.pdf'; |
|
| 82 | 82 | switch ($tipo_documento) { |
| 83 | 83 | case 'informacion_cobros': |
| 84 | 84 | $this->crearEstadoCuenta(); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $this->documento = new residentes_pdf('letter', 'portrait'); |
| 127 | 127 | $this->documento->cliente_residente = $this->cliente_residente; |
| 128 | - $this->documento->pdf->addInfo('Title', 'Pagos Residente ' . |
|
| 128 | + $this->documento->pdf->addInfo('Title', 'Pagos Residente '. |
|
| 129 | 129 | $this->cliente_residente->codcliente); |
| 130 | - $this->documento->pdf->addInfo('Subject', 'Pagos del Residente ' . |
|
| 130 | + $this->documento->pdf->addInfo('Subject', 'Pagos del Residente '. |
|
| 131 | 131 | $this->cliente_residente->codcliente); |
| 132 | 132 | $this->documento->pdf->addInfo('Author', $this->empresa->nombre); |
| 133 | 133 | $this->documento->pdf->ezSetMargins(10, 10, 10, 10); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | public function crearFacturaDetallada() |
| 138 | 138 | { |
| 139 | 139 | $customerInfo = (array) $this->cliente_residente; |
| 140 | - $customerInfo['direccion'] = trim($this->cliente_residente->inmueble->codigo_externo()) . ' numero ' |
|
| 140 | + $customerInfo['direccion'] = trim($this->cliente_residente->inmueble->codigo_externo()).' numero ' |
|
| 141 | 141 | . $this->cliente_residente->inmueble->numero; |
| 142 | 142 | $datosFactura = $this->datosFactura(); |
| 143 | 143 | $datosEmpresa = (array) $this->empresa; |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | if ($this->filter_request('info_accion') == 'enviar') { |
| 151 | 151 | $this->documento->Output( |
| 152 | - 'tmp/' . FS_TMP_NAME . 'enviar/', |
|
| 152 | + 'tmp/'.FS_TMP_NAME.'enviar/', |
|
| 153 | 153 | $this->archivo |
| 154 | 154 | ); |
| 155 | - } else { |
|
| 155 | + }else { |
|
| 156 | 156 | $this->documento->Output( |
| 157 | 157 | 'I', |
| 158 | - 'factura_' .$datosFactura[0]['numero2']. '_' . \date('dmYhis') . '.pdf' |
|
| 158 | + 'factura_'.$datosFactura[0]['numero2'].'_'.\date('dmYhis').'.pdf' |
|
| 159 | 159 | ); |
| 160 | 160 | } |
| 161 | 161 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | $this->documento->set_y(80); |
| 206 | 206 | if ($this->empresa->pie_factura) { |
| 207 | - $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> ' . |
|
| 207 | + $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> '. |
|
| 208 | 208 | $this->user->get_agente_fullname()), 0); |
| 209 | 209 | $this->documento->pdf->addText( |
| 210 | 210 | 10, |
@@ -215,9 +215,9 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | if ($this->filter_request('info_accion') == 'enviar') { |
| 218 | - $this->documento->save('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo); |
|
| 219 | - } else { |
|
| 220 | - $this->documento->show('documento_cobros_' . \date('dmYhis') . '.pdf'); |
|
| 218 | + $this->documento->save('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo); |
|
| 219 | + }else { |
|
| 220 | + $this->documento->show('documento_cobros_'.\date('dmYhis').'.pdf'); |
|
| 221 | 221 | } |
| 222 | 222 | } |
| 223 | 223 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | { |
| 226 | 226 | $this->crear_documento($tipo_documento); |
| 227 | 227 | $tipo_doc = $this->generar_tipo_doc($tipo_documento); |
| 228 | - if (file_exists('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo)) { |
|
| 228 | + if (file_exists('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo)) { |
|
| 229 | 229 | $mail = $this->empresa->new_mail(); |
| 230 | 230 | $mail->FromName = $this->user->get_agente_fullname(); |
| 231 | 231 | |
@@ -237,22 +237,22 @@ discard block |
||
| 237 | 237 | if ($_POST['email_copia']) { |
| 238 | 238 | if (isset($_POST['cco'])) { |
| 239 | 239 | $mail->addBCC($_POST['email_copia'], $this->cliente_residente->nombre); |
| 240 | - } else { |
|
| 240 | + }else { |
|
| 241 | 241 | $mail->addCC($_POST['email_copia'], $this->cliente_residente->nombre); |
| 242 | 242 | } |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - $mail->Subject = $this->empresa->nombre . ': ' . $tipo_doc; |
|
| 245 | + $mail->Subject = $this->empresa->nombre.': '.$tipo_doc; |
|
| 246 | 246 | |
| 247 | 247 | if ($this->is_html($_POST['mensaje'])) { |
| 248 | 248 | $mail->AltBody = strip_tags($_POST['mensaje']); |
| 249 | 249 | $mail->msgHTML($_POST['mensaje']); |
| 250 | 250 | $mail->isHTML(true); |
| 251 | - } else { |
|
| 251 | + }else { |
|
| 252 | 252 | $mail->Body = $_POST['mensaje']; |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | - $mail->addAttachment('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo); |
|
| 255 | + $mail->addAttachment('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo); |
|
| 256 | 256 | if (is_uploaded_file($_FILES['adjunto']['tmp_name'])) { |
| 257 | 257 | $mail->addAttachment($_FILES['adjunto']['tmp_name'], $_FILES['adjunto']['name']); |
| 258 | 258 | } |
@@ -260,12 +260,12 @@ discard block |
||
| 260 | 260 | if ($this->empresa->mail_connect($mail) && $mail->send()) { |
| 261 | 261 | $this->new_message('Mensaje enviado correctamente.'); |
| 262 | 262 | $this->empresa->save_mail($mail); |
| 263 | - } else { |
|
| 264 | - $this->new_error_msg("Error al enviar el email: " . $mail->ErrorInfo); |
|
| 263 | + }else { |
|
| 264 | + $this->new_error_msg("Error al enviar el email: ".$mail->ErrorInfo); |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - unlink('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo); |
|
| 268 | - } else { |
|
| 267 | + unlink('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo); |
|
| 268 | + }else { |
|
| 269 | 269 | $this->new_error_msg('Imposible generar el PDF.'); |
| 270 | 270 | } |
| 271 | 271 | } |
@@ -501,8 +501,8 @@ discard block |
||
| 501 | 501 | { |
| 502 | 502 | $this->existe_tesoreria(); |
| 503 | 503 | $this->cliente_residente = false; |
| 504 | - if (!file_exists('tmp/' . FS_TMP_NAME . 'enviar') && |
|
| 505 | - !mkdir($concurrentDirectory = 'tmp/' . FS_TMP_NAME . 'enviar') && |
|
| 504 | + if (!file_exists('tmp/'.FS_TMP_NAME.'enviar') && |
|
| 505 | + !mkdir($concurrentDirectory = 'tmp/'.FS_TMP_NAME.'enviar') && |
|
| 506 | 506 | !is_dir($concurrentDirectory)) { |
| 507 | 507 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); |
| 508 | 508 | } |