Passed
Push — master ( 453b47...d67de9 )
by Joe Nilson
02:07
created
extras/residentes_controller.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
controller/informe_residentes.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
controller/documentos_residentes.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
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->documento = new residentes_pdf('letter', 'portrait');
85
-                $this->documento->pdf->addInfo('Title', 'Pagos Residente ' .
85
+                $this->documento->pdf->addInfo('Title', 'Pagos Residente '.
86 86
                                         $this->cliente_residente->codcliente);
87
-                $this->documento->pdf->addInfo('Subject', 'Pagos del Residente ' .
87
+                $this->documento->pdf->addInfo('Subject', 'Pagos del Residente '.
88 88
                                         $this->cliente_residente->codcliente);
89 89
                 $this->documento->pdf->addInfo('Author', $this->empresa->nombre);
90 90
                 $this->documento->pdf->ezSetMargins(10, 10, 10, 10);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     public function crearFacturaDetallada()
133 133
     {
134 134
         $customerInfo = (array) $this->cliente_residente;
135
-        $customerInfo['direccion'] = trim($this->cliente_residente->inmueble->codigo_externo()) . ' numero '
135
+        $customerInfo['direccion'] = trim($this->cliente_residente->inmueble->codigo_externo()).' numero '
136 136
             . $this->cliente_residente->inmueble->numero;
137 137
         $datosFactura = $this->datosFactura();
138 138
         $datosEmpresa = (array) $this->empresa;
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
 
145 145
         if ($this->filter_request('info_accion') == 'enviar') {
146 146
             $this->documento->Output(
147
-                'tmp/' . FS_TMP_NAME . 'enviar/',
147
+                'tmp/'.FS_TMP_NAME.'enviar/',
148 148
                 $this->archivo
149 149
             );
150
-        } else {
150
+        }else {
151 151
             $this->documento->Output(
152 152
                 'I',
153
-                'factura_' .$datosFactura[0]['numero2']. '_' . \date('dmYhis') . '.pdf'
153
+                'factura_'.$datosFactura[0]['numero2'].'_'.\date('dmYhis').'.pdf'
154 154
             );
155 155
         }
156 156
     }
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
         $this->documento->set_y(80);
186 186
         if ($this->empresa->pie_factura) {
187
-            $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> ' .
187
+            $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> '.
188 188
                 $this->user->get_agente_fullname()), 0);
189 189
             $this->documento->pdf->addText(
190 190
                 10,
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
         }
196 196
 
197 197
         if ($this->filter_request('info_accion') == 'enviar') {
198
-            $this->documento->save('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo);
199
-        } else {
200
-            $this->documento->show('documento_cobros_' . \date('dmYhis') . '.pdf');
198
+            $this->documento->save('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo);
199
+        }else {
200
+            $this->documento->show('documento_cobros_'.\date('dmYhis').'.pdf');
201 201
         }
202 202
     }
203 203
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         }
246 246
         $this->documento->set_y(80);
247 247
         if ($this->empresa->pie_factura) {
248
-            $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> ' .
248
+            $this->documento->pdf->addText(20, 40, 8, fs_fix_html('<b>Generado por:</b> '.
249 249
                 $this->user->get_agente_fullname()), 0);
250 250
             $this->documento->pdf->addText(
251 251
                 10,
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
         }
257 257
 
258 258
         if ($this->filter_request('info_accion') == 'enviar') {
259
-            $this->documento->save('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo);
260
-        } else {
261
-            $this->documento->show('documento_cobros_' . \date('dmYhis') . '.pdf');
259
+            $this->documento->save('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo);
260
+        }else {
261
+            $this->documento->show('documento_cobros_'.\date('dmYhis').'.pdf');
262 262
         }
263 263
     }
264 264
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
     {
267 267
         $this->crear_documento($tipo_documento);
268 268
         $tipo_doc = $this->generar_tipo_doc($tipo_documento);
269
-        if (file_exists('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo)) {
269
+        if (file_exists('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo)) {
270 270
             $mail = $this->empresa->new_mail();
271 271
             $mail->FromName = $this->user->get_agente_fullname();
272 272
 
@@ -278,22 +278,22 @@  discard block
 block discarded – undo
278 278
             if ($_POST['email_copia']) {
279 279
                 if (isset($_POST['cco'])) {
280 280
                     $mail->addBCC($_POST['email_copia'], $this->cliente_residente->nombre);
281
-                } else {
281
+                }else {
282 282
                     $mail->addCC($_POST['email_copia'], $this->cliente_residente->nombre);
283 283
                 }
284 284
             }
285 285
 
286
-            $mail->Subject = $this->empresa->nombre . ': ' . $tipo_doc;
286
+            $mail->Subject = $this->empresa->nombre.': '.$tipo_doc;
287 287
 
288 288
             if ($this->is_html($_POST['mensaje'])) {
289 289
                 $mail->AltBody = strip_tags($_POST['mensaje']);
290 290
                 $mail->msgHTML($_POST['mensaje']);
291 291
                 $mail->isHTML(true);
292
-            } else {
292
+            }else {
293 293
                 $mail->Body = $_POST['mensaje'];
294 294
             }
295 295
 
296
-            $mail->addAttachment('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo);
296
+            $mail->addAttachment('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo);
297 297
             if (is_uploaded_file($_FILES['adjunto']['tmp_name'])) {
298 298
                 $mail->addAttachment($_FILES['adjunto']['tmp_name'], $_FILES['adjunto']['name']);
299 299
             }
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
             if ($this->empresa->mail_connect($mail) && $mail->send()) {
302 302
                 $this->new_message('Mensaje enviado correctamente.');
303 303
                 $this->empresa->save_mail($mail);
304
-            } else {
305
-                $this->new_error_msg("Error al enviar el email: " . $mail->ErrorInfo);
304
+            }else {
305
+                $this->new_error_msg("Error al enviar el email: ".$mail->ErrorInfo);
306 306
             }
307 307
 
308
-            unlink('tmp/' . FS_TMP_NAME . 'enviar/' . $this->archivo);
309
-        } else {
308
+            unlink('tmp/'.FS_TMP_NAME.'enviar/'.$this->archivo);
309
+        }else {
310 310
             $this->new_error_msg('Imposible generar el PDF.');
311 311
         }
312 312
     }
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
         $pdf_doc->new_table();
326 326
         $pdf_doc->add_table_row(
327 327
             array(
328
-                'campo1' => "<b>" . $tipo_doc . "</b>",
328
+                'campo1' => "<b>".$tipo_doc."</b>",
329 329
                 'dato1' => '',
330
-                'campo2' => "<b>Fecha Impresión:</b> " . \date('d-m-Y H:i:s')
330
+                'campo2' => "<b>Fecha Impresión:</b> ".\date('d-m-Y H:i:s')
331 331
             )
332 332
         );
333 333
 
@@ -335,27 +335,27 @@  discard block
 block discarded – undo
335 335
             array(
336 336
                 'campo1' => "<b>Residente:</b>",
337 337
                 'dato1' => fs_fix_html($this->cliente_residente->nombre),
338
-                'campo2' => "<b>Tipo Residente:</b> " . $tipo_residente
338
+                'campo2' => "<b>Tipo Residente:</b> ".$tipo_residente
339 339
             )
340 340
         );
341 341
 
342 342
         $row = array(
343 343
             'campo1' => "<b>Inmueble:</b>",
344
-            'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo() .
345
-                ' - ' . $this->cliente_residente->inmueble->numero),
344
+            'dato1' => fs_fix_html($this->cliente_residente->inmueble->codigo_externo().
345
+                ' - '.$this->cliente_residente->inmueble->numero),
346 346
             'campo2' => ''
347 347
         );
348 348
 
349 349
         if (!$this->cliente_residente) {
350 350
             /// nada
351 351
         } elseif ($this->cliente_residente->telefono1) {
352
-            $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono1;
352
+            $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono1;
353 353
             if ($this->cliente_residente->telefono2) {
354
-                $row['campo2'] .= "\n" . $this->cliente_residente->telefono2;
354
+                $row['campo2'] .= "\n".$this->cliente_residente->telefono2;
355 355
                 $lppag -= 2;
356 356
             }
357 357
         } elseif ($this->cliente_residente->telefono2) {
358
-            $row['campo2'] = "<b>Teléfonos:</b> " . $this->cliente_residente->telefono2;
358
+            $row['campo2'] = "<b>Teléfonos:</b> ".$this->cliente_residente->telefono2;
359 359
         }
360 360
         $pdf_doc->add_table_row($row);
361 361
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         [$table_header, $array_cols] = $this->generar_pdf_lineas_tablas($tipo);
404 404
         $pdf_doc->add_table_header($table_header);
405 405
 
406
-        for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ( $linea_actual < count($items)));) {
406
+        for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ($linea_actual < count($items)));) {
407 407
             $fila = $this->generar_pdf_lineas_fila($tipo, $items, $linea_actual);
408 408
             $pdf_doc->add_table_row($fila);
409 409
             $linea_actual++;
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             );
446 446
         }
447 447
         
448
-        return array($table_header,$array_cols);
448
+        return array($table_header, $array_cols);
449 449
     }
450 450
     
451 451
     public function generar_pdf_lineas_fila($tipo, $items, $linea_actual)
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             'fecha' => $items[$linea_actual]->fecha,
457 457
             'vencimiento' => $items[$linea_actual]->vencimiento,
458 458
             'importe' => $this->show_precio($items[$linea_actual]->pvpsindto, $this->empresa->coddivisa, true, FS_NF0),
459
-            'descuento' => $this->show_numero($items[$linea_actual]->dtopor) . " %",
459
+            'descuento' => $this->show_numero($items[$linea_actual]->dtopor)." %",
460 460
             'total' => $this->show_precio($items[$linea_actual]->pvptotal, $this->empresa->coddivisa, true, FS_NF0),
461 461
             'atraso' => $items[$linea_actual]->dias_atraso
462 462
         );
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
                 }
484 484
                 $aux = explode("\n", $lin->descripcion);
485 485
                 if (count($aux) > 1) {
486
-                    $linea_size += 0.5 * ( count($aux) - 1);
486
+                    $linea_size += 0.5 * (count($aux) - 1);
487 487
                 }
488 488
                 if ($linea_size > 1) {
489 489
                     $lppag2 -= $linea_size - 1;
@@ -511,83 +511,83 @@  discard block
 block discarded – undo
511 511
                     if (imagepng(imagecreatefromstring(file_get_contents($pdf_doc->logo)), FS_MYDOCS
512 512
                         . 'images/logo.png')) {
513 513
                         $pdf_doc->pdf->addPngFromFile(
514
-                            FS_MYDOCS . 'images/logo.png',
514
+                            FS_MYDOCS.'images/logo.png',
515 515
                             $pdf_doc_LOGO_X,
516 516
                             $pdf_doc_LOGO_Y,
517 517
                             $tamanyo[0],
518 518
                             $tamanyo[1]
519 519
                         );
520
-                    } else {
520
+                    }else {
521 521
                         $pdf_doc->pdf->addJpegFromFile($pdf_doc->logo, $pdf_doc_LOGO_X, $pdf_doc_LOGO_Y, $tamanyo[0], $tamanyo[1]);
522 522
                     }
523
-                } else {
523
+                }else {
524 524
                     $pdf_doc->pdf->addJpegFromFile($pdf_doc->logo, $pdf_doc_LOGO_X, $pdf_doc_LOGO_Y, $tamanyo[0], $tamanyo[1]);
525 525
                 }
526 526
                 $pdf_doc->set_y(400);
527 527
                 $pdf_doc->pdf->ez['leftMargin'] = 120;
528 528
                 $pdf_doc->pdf->ezText(
529
-                    "<b>" . fs_fix_html($empresa->nombre) . "</b>",
529
+                    "<b>".fs_fix_html($empresa->nombre)."</b>",
530 530
                     12,
531 531
                     array('justification' => 'left')
532 532
                 );
533
-                $pdf_doc->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'left'));
533
+                $pdf_doc->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'left'));
534 534
 
535
-                $direccion = $empresa->direccion . "\n";
535
+                $direccion = $empresa->direccion."\n";
536 536
                 if ($empresa->apartado) {
537
-                    $direccion .= ucfirst(FS_APARTADO) . ': ' . $empresa->apartado . ' - ';
537
+                    $direccion .= ucfirst(FS_APARTADO).': '.$empresa->apartado.' - ';
538 538
                 }
539 539
 
540 540
                 if ($empresa->codpostal) {
541
-                    $direccion .= 'CP: ' . $empresa->codpostal . ' - ';
541
+                    $direccion .= 'CP: '.$empresa->codpostal.' - ';
542 542
                 }
543 543
 
544 544
                 if ($empresa->ciudad) {
545
-                    $direccion .= $empresa->ciudad . ' - ';
545
+                    $direccion .= $empresa->ciudad.' - ';
546 546
                 }
547 547
 
548 548
                 if ($empresa->provincia) {
549
-                    $direccion .= '(' . $empresa->provincia . ')';
549
+                    $direccion .= '('.$empresa->provincia.')';
550 550
                 }
551 551
 
552 552
                 if ($empresa->telefono) {
553
-                    $direccion .= "\nTeléfono: " . $empresa->telefono . ' - '.$pdf_doc_LOGO_X."/".$pdf_doc_LOGO_Y;
553
+                    $direccion .= "\nTeléfono: ".$empresa->telefono.' - '.$pdf_doc_LOGO_X."/".$pdf_doc_LOGO_Y;
554 554
                 }
555 555
 
556
-                $pdf_doc->pdf->ezText(fs_fix_html($direccion) . "\n", 8, array('justification' => 'left'));
556
+                $pdf_doc->pdf->ezText(fs_fix_html($direccion)."\n", 8, array('justification' => 'left'));
557 557
                 $pdf_doc->set_y($pdf_doc_LOGO_Y);
558 558
 
559 559
                 $pdf_doc->pdf->ez['leftMargin'] = 10;
560
-            } else {
560
+            }else {
561 561
                 die('ERROR: no se encuentra la función imagecreatefromstring(). '
562 562
                     . 'Y por tanto no se puede usar el logotipo en los documentos.');
563 563
             }
564
-        } else {
564
+        }else {
565 565
             $pdf_doc->pdf->ezText(
566
-                "<b>" . fs_fix_html($empresa->nombre) . "</b>",
566
+                "<b>".fs_fix_html($empresa->nombre)."</b>",
567 567
                 12,
568 568
                 array('justification' => 'left')
569 569
             );
570
-            $pdf_doc->pdf->ezText(FS_CIFNIF . ": " . $empresa->cifnif, 8, array('justification' => 'left'));
570
+            $pdf_doc->pdf->ezText(FS_CIFNIF.": ".$empresa->cifnif, 8, array('justification' => 'left'));
571 571
 
572 572
             $direccion = $empresa->direccion;
573 573
             if ($empresa->apartado) {
574
-                $direccion .= ' - ' . ucfirst(FS_APARTADO) . ': ' . $empresa->apartado;
574
+                $direccion .= ' - '.ucfirst(FS_APARTADO).': '.$empresa->apartado;
575 575
             }
576 576
 
577 577
             if ($empresa->codpostal) {
578
-                $direccion .= ' - CP: ' . $empresa->codpostal;
578
+                $direccion .= ' - CP: '.$empresa->codpostal;
579 579
             }
580 580
 
581 581
             if ($empresa->ciudad) {
582
-                $direccion .= ' - ' . $empresa->ciudad;
582
+                $direccion .= ' - '.$empresa->ciudad;
583 583
             }
584 584
 
585 585
             if ($empresa->provincia) {
586
-                $direccion .= ' (' . $empresa->provincia . ')';
586
+                $direccion .= ' ('.$empresa->provincia.')';
587 587
             }
588 588
 
589 589
             if ($empresa->telefono) {
590
-                $direccion .= ' - Teléfono: ' . $empresa->telefono;
590
+                $direccion .= ' - Teléfono: '.$empresa->telefono;
591 591
             }
592 592
 
593 593
             $pdf_doc->pdf->ezText(fs_fix_html($direccion), 8, array('justification' => 'left'));
@@ -612,8 +612,8 @@  discard block
 block discarded – undo
612 612
         $pdf_doc->new_table();
613 613
         $pdf_doc->add_table_row(
614 614
             array(
615
-                'campos' => "<b>" . ucfirst(FS_FACTURA) . ":</b>\n <b>".FS_NUMERO2.":</b>\n<b>Fecha:</b>\n<b>" . 'F. Pago' . ":</b>",
616
-                'factura' => $factura->codigo . "\n" . $factura->numero2 . "\n" . $factura->fecha . "\n" . $factura->codpago,
615
+                'campos' => "<b>".ucfirst(FS_FACTURA).":</b>\n <b>".FS_NUMERO2.":</b>\n<b>Fecha:</b>\n<b>".'F. Pago'.":</b>",
616
+                'factura' => $factura->codigo."\n".$factura->numero2."\n".$factura->fecha."\n".$factura->codpago,
617 617
             )
618 618
         );
619 619
         $pdf_doc->save_table(
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
         $pdf_doc->pdf->ez['leftMargin'] = 10;
633 633
     }
634 634
 
635
-    public function pdfFacturaDetalle(&$pdf_doc, &$empresa, &$lppag,  &$linea_actual)
635
+    public function pdfFacturaDetalle(&$pdf_doc, &$empresa, &$lppag, &$linea_actual)
636 636
     {
637 637
         $facturas = new factura_cliente();
638 638
         $clientes = new cliente();
@@ -651,10 +651,10 @@  discard block
 block discarded – undo
651 651
 
652 652
         $pdf_doc->add_table_header($table_header);
653 653
 
654
-        for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ( $linea_actual < count($lineas)));) {
654
+        for ($i = $linea_actual; (($linea_actual < ($lppag + $i)) && ($linea_actual < count($lineas)));) {
655 655
             $descripcion = fs_fix_html($lineas[$linea_actual]->descripcion);
656 656
             if (!is_null($lineas[$linea_actual]->referencia) && $this->impresion['print_ref']) {
657
-                $descripcion = '<b>' . $lineas[$linea_actual]->referencia . '</b> ' . $descripcion;
657
+                $descripcion = '<b>'.$lineas[$linea_actual]->referencia.'</b> '.$descripcion;
658 658
             }
659 659
 
660 660
             /// ¿El articulo tiene trazabilidad?
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
                 'descripcion' => $descripcion,
667 667
                 'cantidad' => $this->show_numero($lineas[$linea_actual]->cantidad, 0),
668 668
                 'pvp' => $this->show_precio($lineas[$linea_actual]->pvpunitario, $factura->coddivisa, true, FS_NF0_ART),
669
-                'dto' => $this->show_numero($due_lineas) . " %",
669
+                'dto' => $this->show_numero($due_lineas)." %",
670 670
                 'importe' => $this->show_precio($lineas[$linea_actual]->pvptotal, $this->documento->coddivisa)
671 671
             );
672 672
 
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 
708 708
         /// ¿Última página?
709 709
         if ($linea_actual == count($lineas) && $this->documento->observaciones != '') {
710
-            $pdf_doc->pdf->ezText("\n" . fs_fix_html($this->documento->observaciones), 9);
710
+            $pdf_doc->pdf->ezText("\n".fs_fix_html($this->documento->observaciones), 9);
711 711
         }
712 712
     }
713 713
 
@@ -726,8 +726,8 @@  discard block
 block discarded – undo
726 726
     {
727 727
         $this->existe_tesoreria();
728 728
         $this->cliente_residente = false;
729
-        if (!file_exists('tmp/' . FS_TMP_NAME . 'enviar') &&
730
-            !mkdir($concurrentDirectory = 'tmp/' . FS_TMP_NAME . 'enviar') &&
729
+        if (!file_exists('tmp/'.FS_TMP_NAME.'enviar') &&
730
+            !mkdir($concurrentDirectory = 'tmp/'.FS_TMP_NAME.'enviar') &&
731 731
             !is_dir($concurrentDirectory)) {
732 732
             throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory));
733 733
         }
Please login to merge, or discard this patch.