@@ -22,7 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @author Joe Nilson <joenilson at gmail.com> |
24 | 24 | */ |
25 | -class residentes_edificaciones extends FacturaScripts\model\residentes_edificaciones{ |
|
25 | +class residentes_edificaciones extends FacturaScripts\model\residentes_edificaciones { |
|
26 | 26 | /** |
27 | 27 | * @todo Clases específicas para este plugin |
28 | 28 | */ |
@@ -103,31 +103,31 @@ discard block |
||
103 | 103 | $ca_parentesco_obs = $this->clean_text(\filter_input(INPUT_POST, 'ca_parentesco_obs')); |
104 | 104 | $vehiculos = \filter_input(INPUT_POST, 'vehiculos'); |
105 | 105 | $cliinfo = new residentes_informacion(); |
106 | - $cliinfo->codcliente=$codcliente; |
|
107 | - $cliinfo->codigo=$codigo; |
|
108 | - $cliinfo->ocupantes=$ocupantes; |
|
109 | - $cliinfo->ocupantes5anos=$ocupantes5anos; |
|
110 | - $cliinfo->ocupantes12anos=$ocupantes12anos; |
|
111 | - $cliinfo->ocupantes18anos=$ocupantes18anos; |
|
112 | - $cliinfo->ocupantes30anos=$ocupantes30anos; |
|
113 | - $cliinfo->ocupantes50anos=$ocupantes50anos; |
|
114 | - $cliinfo->ocupantes70anos=$ocupantes70anos; |
|
115 | - $cliinfo->ocupantes71anos=$ocupantes71anos; |
|
116 | - $cliinfo->informacion_discapacidad= $informacion_discapacidad; |
|
117 | - $cliinfo->propietario= (bool)$propietario; |
|
118 | - $cliinfo->profesion= $profesion; |
|
119 | - $cliinfo->ocupacion= $ocupacion; |
|
120 | - $cliinfo->ca_nombres= $ca_nombres; |
|
121 | - $cliinfo->ca_apellidos= $ca_apellidos; |
|
122 | - $cliinfo->ca_telefono= $ca_telefono; |
|
123 | - $cliinfo->ca_email= $ca_email; |
|
124 | - $cliinfo->ca_propietario= (bool)$ca_propietario; |
|
125 | - $cliinfo->ca_parentesco= $ca_parentesco; |
|
126 | - $cliinfo->ca_parentesco_obs= $ca_parentesco_obs; |
|
127 | - $cliinfo->vehiculos= $vehiculos; |
|
106 | + $cliinfo->codcliente = $codcliente; |
|
107 | + $cliinfo->codigo = $codigo; |
|
108 | + $cliinfo->ocupantes = $ocupantes; |
|
109 | + $cliinfo->ocupantes5anos = $ocupantes5anos; |
|
110 | + $cliinfo->ocupantes12anos = $ocupantes12anos; |
|
111 | + $cliinfo->ocupantes18anos = $ocupantes18anos; |
|
112 | + $cliinfo->ocupantes30anos = $ocupantes30anos; |
|
113 | + $cliinfo->ocupantes50anos = $ocupantes50anos; |
|
114 | + $cliinfo->ocupantes70anos = $ocupantes70anos; |
|
115 | + $cliinfo->ocupantes71anos = $ocupantes71anos; |
|
116 | + $cliinfo->informacion_discapacidad = $informacion_discapacidad; |
|
117 | + $cliinfo->propietario = (bool) $propietario; |
|
118 | + $cliinfo->profesion = $profesion; |
|
119 | + $cliinfo->ocupacion = $ocupacion; |
|
120 | + $cliinfo->ca_nombres = $ca_nombres; |
|
121 | + $cliinfo->ca_apellidos = $ca_apellidos; |
|
122 | + $cliinfo->ca_telefono = $ca_telefono; |
|
123 | + $cliinfo->ca_email = $ca_email; |
|
124 | + $cliinfo->ca_propietario = (bool) $ca_propietario; |
|
125 | + $cliinfo->ca_parentesco = $ca_parentesco; |
|
126 | + $cliinfo->ca_parentesco_obs = $ca_parentesco_obs; |
|
127 | + $cliinfo->vehiculos = $vehiculos; |
|
128 | 128 | if ($cliinfo->save()) { |
129 | 129 | $this->new_message('¡Información actualizada correctamente!'); |
130 | - } else { |
|
130 | + }else { |
|
131 | 131 | $this->new_error_msg('Ocurrió un error al actualizar la información por favor revise los ". |
132 | 132 | "datos ingresados e intente nuevamente.'); |
133 | 133 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | foreach ($extensiones as $ext) { |
163 | 163 | $fsext0 = new fs_extension($ext); |
164 | 164 | if (!$fsext0->save()) { |
165 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
165 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
166 | 166 | } |
167 | 167 | } |
168 | 168 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if ($logo) { |
59 | 59 | $type = pathinfo($logo, PATHINFO_EXTENSION); |
60 | 60 | $data = file_get_contents($logo); |
61 | - $this->factura_logo_uri = 'data:image/' . $type . ';base64,' . base64_encode($data); |
|
61 | + $this->factura_logo_uri = 'data:image/'.$type.';base64,'.base64_encode($data); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | if ($this->id) { |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | $fac = new factura_cliente(); |
72 | 72 | $this->factura = $fac->get($this->id); |
73 | 73 | //Agregamos la cantidad de lineas multiplicadas por 4 |
74 | - $this->sizeFactura+= count($this->factura->get_lineas())*8; |
|
74 | + $this->sizeFactura += count($this->factura->get_lineas()) * 8; |
|
75 | 75 | //Agregamos la linea de separación del total |
76 | - $this->sizeFactura+=4; |
|
76 | + $this->sizeFactura += 4; |
|
77 | 77 | //Agregamos las 3 lineas de Neto, FS_IVA y Total |
78 | - $this->sizeFactura+=12; |
|
78 | + $this->sizeFactura += 12; |
|
79 | 79 | //Agregamos un espacio de 4 lineas aprox |
80 | - $this->sizeFactura+=20; |
|
80 | + $this->sizeFactura += 20; |
|
81 | 81 | $cli = new cliente(); |
82 | 82 | $this->cliente = $cli->get($this->factura->codcliente); |
83 | 83 | $facturas = $fac->all_from_cliente($this->factura->codcliente); |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | 'fecha'=>$f->fecha, |
90 | 90 | 'monto'=>$f->total |
91 | 91 | ); |
92 | - $this->sizeFactura+=4; |
|
92 | + $this->sizeFactura += 4; |
|
93 | 93 | $this->total_facturas_pendientes += $f->total; |
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
97 | - $this->sizeFactura+=20; |
|
97 | + $this->sizeFactura += 20; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | public function url() |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | 'page_from' => __CLASS__, |
121 | 121 | 'page_to' => __CLASS__, |
122 | 122 | 'type' => 'head', |
123 | - 'text' => '<script src="' . |
|
124 | - FS_PATH . |
|
123 | + 'text' => '<script src="'. |
|
124 | + FS_PATH. |
|
125 | 125 | 'plugins/residentes/view/js/jspdf.min.js" type="text/javascript"></script>', |
126 | 126 | 'params' => '' |
127 | 127 | ), |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | 'page_from' => __CLASS__, |
131 | 131 | 'page_to' => __CLASS__, |
132 | 132 | 'type' => 'head', |
133 | - 'text' => '<script src="' . |
|
134 | - FS_PATH . |
|
135 | - 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" ' . |
|
133 | + 'text' => '<script src="'. |
|
134 | + FS_PATH. |
|
135 | + 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" '. |
|
136 | 136 | 'type="text/javascript"></script>', |
137 | 137 | 'params' => '' |
138 | 138 | ), |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | if ($accion === 'agregar') { |
69 | 69 | if ($vehiculo->save()) { |
70 | 70 | $this->new_message('Vehiculo agregado exitosamente'); |
71 | - } else { |
|
71 | + }else { |
|
72 | 72 | $this->new_error_msg('No se pudieron agregar los datos del vehiculo, revise la información e ". |
73 | 73 | "intentelo nuevamente.'); |
74 | 74 | } |
75 | 75 | } elseif ($accion === 'eliminar') { |
76 | 76 | if ($vehiculo->delete()) { |
77 | 77 | $this->new_message('Vehiculo eliminado exitosamente'); |
78 | - } else { |
|
78 | + }else { |
|
79 | 79 | $this->new_error_msg('No se pudieron eliminar los datos del vehiculo, revise la información e ". |
80 | 80 | "intentelo nuevamente.'); |
81 | 81 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | foreach ($extensiones as $ext) { |
111 | 111 | $fsext0 = new fs_extension($ext); |
112 | 112 | if (!$fsext0->save()) { |
113 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
113 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * |
23 | 23 | * @author Joe Nilson <joenilson at gmail.com> |
24 | 24 | */ |
25 | -class residentes_ayudas extends \fs_model{ |
|
25 | +class residentes_ayudas extends \fs_model { |
|
26 | 26 | /** |
27 | 27 | * El codigo de la ayuda ya sea para parentesco u ocupacion |
28 | 28 | * @var string |
@@ -39,19 +39,19 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public $descripcion; |
41 | 41 | public function __construct($t = FALSE) { |
42 | - parent::__construct('residentes_ayudas','plugins/residentes'); |
|
43 | - if($t){ |
|
42 | + parent::__construct('residentes_ayudas', 'plugins/residentes'); |
|
43 | + if ($t) { |
|
44 | 44 | $this->codigo = $t['codigo']; |
45 | 45 | $this->tipo = $t['tipo']; |
46 | 46 | $this->descripcion = $t['descripcion']; |
47 | - }else{ |
|
47 | + }else { |
|
48 | 48 | $this->codigo = null; |
49 | 49 | $this->tipo = null; |
50 | 50 | $this->descripcion = null; |
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | - public function install(){ |
|
54 | + public function install() { |
|
55 | 55 | return "insert into residentes_ayudas (codigo,tipo, descripcion) VALUES ". |
56 | 56 | "('EMPPUB','OCUPACION','Empleado Publico'),". |
57 | 57 | "('EMPRI','OCUPACION','Empleado Privado'),". |
@@ -65,66 +65,66 @@ discard block |
||
65 | 65 | "('HIJO','PARENTESCO','HermanHijo (a)');"; |
66 | 66 | } |
67 | 67 | |
68 | - public function all(){ |
|
68 | + public function all() { |
|
69 | 69 | $sql = "SELECT * FROM ".$this->table_name." ORDER BY tipo,codigo"; |
70 | 70 | $data = $this->db->select($sql); |
71 | - if($data){ |
|
71 | + if ($data) { |
|
72 | 72 | $lista = array(); |
73 | - foreach($data as $d){ |
|
73 | + foreach ($data as $d) { |
|
74 | 74 | $lista[] = new residentes_ayudas($d); |
75 | 75 | } |
76 | 76 | return $lista; |
77 | - }else{ |
|
77 | + }else { |
|
78 | 78 | return false; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | - public function all_tipo($tipo){ |
|
82 | + public function all_tipo($tipo) { |
|
83 | 83 | $sql = "SELECT * FROM ".$this->table_name." WHERE tipo = ".$this->var2str($tipo)." ORDER BY codigo"; |
84 | 84 | $data = $this->db->select($sql); |
85 | - if($data){ |
|
85 | + if ($data) { |
|
86 | 86 | $lista = array(); |
87 | - foreach($data as $d){ |
|
87 | + foreach ($data as $d) { |
|
88 | 88 | $lista[] = new residentes_ayudas($d); |
89 | 89 | } |
90 | 90 | return $lista; |
91 | - }else{ |
|
91 | + }else { |
|
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | - public function get($codigo,$tipo){ |
|
96 | + public function get($codigo, $tipo) { |
|
97 | 97 | $sql = "SELECT * FROM ".$this->table_name." WHERE codigo = ".$this->var2str($codigo)." AND tipo = ".$this->var2str($tipo).";"; |
98 | 98 | $data = $this->db->select($sql); |
99 | - if($data){ |
|
99 | + if ($data) { |
|
100 | 100 | return new residentes_ayudas($data[0]); |
101 | - }else{ |
|
101 | + }else { |
|
102 | 102 | return false; |
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
106 | 106 | public function exists() { |
107 | - if(is_null($this->codigo)){ |
|
107 | + if (is_null($this->codigo)) { |
|
108 | 108 | return false; |
109 | - }else{ |
|
110 | - return $this->get($this->codigo,$this->tipo); |
|
109 | + }else { |
|
110 | + return $this->get($this->codigo, $this->tipo); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | 114 | public function save() { |
115 | - if($this->exists()){ |
|
115 | + if ($this->exists()) { |
|
116 | 116 | $sql = "UPDATE ".$this->table_name." SET ". |
117 | 117 | "descripcion = ".$this->var2str($this->descripcion)." ". |
118 | 118 | "WHERE codigo = ".$this->var2str($this->codigo)." AND tipo = ".$this->var2str($this->tipo).";"; |
119 | 119 | return $this->db->exec($sql); |
120 | - }else{ |
|
120 | + }else { |
|
121 | 121 | $sql = "INSERT INTO ".$this->table_name." (codigo, tipo, descripcion) VALUES (". |
122 | 122 | $this->var2str($this->codigo).", ". |
123 | 123 | $this->var2str($this->tipo).", ". |
124 | 124 | $this->var2str($this->descripcion).");"; |
125 | - if($this->db->exec($sql)){ |
|
125 | + if ($this->db->exec($sql)) { |
|
126 | 126 | return $this->db->lastval(); |
127 | - }else{ |
|
127 | + }else { |
|
128 | 128 | return false; |
129 | 129 | } |
130 | 130 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if ($logo) { |
59 | 59 | $type = pathinfo($logo, PATHINFO_EXTENSION); |
60 | 60 | $data = file_get_contents($logo); |
61 | - $this->factura_logo_uri = 'data:image/' . $type . ';base64,' . base64_encode($data); |
|
61 | + $this->factura_logo_uri = 'data:image/'.$type.';base64,'.base64_encode($data); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | if ($this->id) { |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | $fac = new factura_cliente(); |
72 | 72 | $this->factura = $fac->get($this->id); |
73 | 73 | //Agregamos la cantidad de lineas multiplicadas por 4 |
74 | - $this->sizeFactura+= count($this->factura->get_lineas())*8; |
|
74 | + $this->sizeFactura += count($this->factura->get_lineas()) * 8; |
|
75 | 75 | //Agregamos la linea de separación del total |
76 | - $this->sizeFactura+=4; |
|
76 | + $this->sizeFactura += 4; |
|
77 | 77 | //Agregamos las 3 lineas de Neto, FS_IVA y Total |
78 | - $this->sizeFactura+=12; |
|
78 | + $this->sizeFactura += 12; |
|
79 | 79 | //Agregamos un espacio de 4 lineas aprox |
80 | - $this->sizeFactura+=20; |
|
80 | + $this->sizeFactura += 20; |
|
81 | 81 | $cli = new cliente(); |
82 | 82 | $this->cliente = $cli->get($this->factura->codcliente); |
83 | 83 | $facturas = $fac->all_from_cliente($this->factura->codcliente); |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | 'fecha'=>$f->fecha, |
90 | 90 | 'monto'=>$f->total |
91 | 91 | ); |
92 | - $this->sizeFactura+=4; |
|
92 | + $this->sizeFactura += 4; |
|
93 | 93 | $this->total_facturas_pendientes += $f->total; |
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
97 | - $this->sizeFactura+=20; |
|
97 | + $this->sizeFactura += 20; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | public function url() |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | 'page_from' => __CLASS__, |
121 | 121 | 'page_to' => __CLASS__, |
122 | 122 | 'type' => 'head', |
123 | - 'text' => '<script src="' . |
|
124 | - FS_PATH . |
|
123 | + 'text' => '<script src="'. |
|
124 | + FS_PATH. |
|
125 | 125 | 'plugins/residentes/view/js/jspdf.min.js" type="text/javascript"></script>', |
126 | 126 | 'params' => '' |
127 | 127 | ), |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | 'page_from' => __CLASS__, |
131 | 131 | 'page_to' => __CLASS__, |
132 | 132 | 'type' => 'head', |
133 | - 'text' => '<script src="' . |
|
134 | - FS_PATH . |
|
135 | - 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" ' . |
|
133 | + 'text' => '<script src="'. |
|
134 | + FS_PATH. |
|
135 | + 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" '. |
|
136 | 136 | 'type="text/javascript"></script>', |
137 | 137 | 'params' => '' |
138 | 138 | ), |
@@ -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; |
@@ -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; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | if ($this->codigo_edificacion) { |
110 | - $this->where_code = " AND r.codigo like '" . $this->codigo_edificacion . "%' "; |
|
110 | + $this->where_code = " AND r.codigo like '".$this->codigo_edificacion."%' "; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | if ($this->tipo === 'informacion') { |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $this->offset = $this->confirmarValor($this->filter_request('offset'), 0); |
147 | 147 | $this->limit = $this->confirmarValor($this->filter_request('limit'), FS_ITEM_LIMIT); |
148 | 148 | $this->search = $this->confirmarValor($this->filter_request('search'), false); |
149 | - $this->sort = ($sort and $sort!='undefined')?$sort:'r.codigo, r.numero'; |
|
150 | - $this->order = ($order and $order!='undefined')?$order:'ASC'; |
|
149 | + $this->sort = ($sort and $sort != 'undefined') ? $sort : 'r.codigo, r.numero'; |
|
150 | + $this->order = ($order and $order != 'undefined') ? $order : 'ASC'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | public function informacion_edificaciones() |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $this->resultado[] = $l; |
168 | 168 | } |
169 | 169 | //Verificamos los que están ocupados |
170 | - $this->inmuebles_libres = $inmuebles-$inmuebles_ocupados; |
|
170 | + $this->inmuebles_libres = $inmuebles - $inmuebles_ocupados; |
|
171 | 171 | $this->inmuebles_ocupados = $inmuebles_ocupados; |
172 | 172 | $this->total_vehiculos = $vehiculos; |
173 | 173 | $this->carpetasPlugin(); |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | |
177 | 177 | public function generarArchivoExcel() |
178 | 178 | { |
179 | - $this->archivoXLSX = $this->exportDir . DIRECTORY_SEPARATOR . |
|
180 | - $this->archivo . "_" . $this->user->nick . ".xlsx"; |
|
181 | - $this->archivoXLSXPath = $this->publicPath . DIRECTORY_SEPARATOR . |
|
182 | - $this->archivo . "_" . $this->user->nick . ".xlsx"; |
|
179 | + $this->archivoXLSX = $this->exportDir.DIRECTORY_SEPARATOR. |
|
180 | + $this->archivo."_".$this->user->nick.".xlsx"; |
|
181 | + $this->archivoXLSXPath = $this->publicPath.DIRECTORY_SEPARATOR. |
|
182 | + $this->archivo."_".$this->user->nick.".xlsx"; |
|
183 | 183 | if (file_exists($this->archivoXLSX)) { |
184 | 184 | unlink($this->archivoXLSX); |
185 | 185 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | |
365 | 365 | public function crearXLSX(&$writer, $hoja_nombre, $header, $headerText, $data) |
366 | 366 | { |
367 | - $style_header = array('border'=>'left,right,top,bottom','font'=>'Arial','font-size'=>10,'font-style'=>'bold'); |
|
367 | + $style_header = array('border'=>'left,right,top,bottom', 'font'=>'Arial', 'font-size'=>10, 'font-style'=>'bold'); |
|
368 | 368 | $writer->writeSheetRow($hoja_nombre, $headerText, $style_header); |
369 | 369 | $writer->writeSheetHeader($hoja_nombre, $header, true); |
370 | 370 | $this->agregarDatosXLSX($writer, $hoja_nombre, $data, $headerText); |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | public function carpetasPlugin() |
397 | 397 | { |
398 | 398 | $basepath = dirname(__DIR__, 3); |
399 | - $this->documentosDir = $basepath . DIRECTORY_SEPARATOR . FS_MYDOCS . 'documentos'; |
|
400 | - $this->exportDir = $this->documentosDir . DIRECTORY_SEPARATOR . "informes_residentes"; |
|
401 | - $this->publicPath = FS_PATH . FS_MYDOCS . 'documentos' . DIRECTORY_SEPARATOR . 'informes_residentes'; |
|
399 | + $this->documentosDir = $basepath.DIRECTORY_SEPARATOR.FS_MYDOCS.'documentos'; |
|
400 | + $this->exportDir = $this->documentosDir.DIRECTORY_SEPARATOR."informes_residentes"; |
|
401 | + $this->publicPath = FS_PATH.FS_MYDOCS.'documentos'.DIRECTORY_SEPARATOR.'informes_residentes'; |
|
402 | 402 | if (!is_dir($this->documentosDir)) { |
403 | 403 | if (!mkdir($concurrentDirectory = $this->documentosDir) && !is_dir($concurrentDirectory)) { |
404 | 404 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | public function url() |
416 | 416 | { |
417 | 417 | if (isset($_REQUEST['inmueble'])) { |
418 | - return 'index.php?page=informe_residentes&inmueble=' . $_REQUEST['inmueble']; |
|
418 | + return 'index.php?page=informe_residentes&inmueble='.$_REQUEST['inmueble']; |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | return parent::url(); |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | 'page_from' => __CLASS__, |
435 | 435 | 'page_to' => __CLASS__, |
436 | 436 | 'type' => 'head', |
437 | - 'text' => '<script src="' . FS_PATH . |
|
437 | + 'text' => '<script src="'.FS_PATH. |
|
438 | 438 | 'plugins/residentes/view/js/1/bootstrap-table.min.js" type="text/javascript"></script>', |
439 | 439 | 'params' => '' |
440 | 440 | ), |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | 'page_from' => __CLASS__, |
444 | 444 | 'page_to' => __CLASS__, |
445 | 445 | 'type' => 'head', |
446 | - 'text' => '<script src="' . FS_PATH . |
|
446 | + 'text' => '<script src="'.FS_PATH. |
|
447 | 447 | 'plugins/residentes/view/js/1/bootstrap-table-locale-all.min.js" type="text/javascript"></script>', |
448 | 448 | 'params' => '' |
449 | 449 | ), |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | 'page_from' => __CLASS__, |
453 | 453 | 'page_to' => __CLASS__, |
454 | 454 | 'type' => 'head', |
455 | - 'text' => '<script src="' . FS_PATH . |
|
455 | + 'text' => '<script src="'.FS_PATH. |
|
456 | 456 | 'plugins/residentes/view/js/plugins/bootstrap-table-filter.min.js" type="text/javascript"></script>', |
457 | 457 | 'params' => '' |
458 | 458 | ), |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | 'page_from' => __CLASS__, |
462 | 462 | 'page_to' => __CLASS__, |
463 | 463 | 'type' => 'head', |
464 | - 'text' => '<script src="' . FS_PATH . |
|
464 | + 'text' => '<script src="'.FS_PATH. |
|
465 | 465 | 'plugins/residentes/view/js/plugins/bootstrap-table-toolbar.min.js" type="text/javascript"></script>', |
466 | 466 | 'params' => '' |
467 | 467 | ), |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | 'page_from' => __CLASS__, |
471 | 471 | 'page_to' => __CLASS__, |
472 | 472 | 'type' => 'head', |
473 | - 'text' => '<script src="' . FS_PATH . |
|
473 | + 'text' => '<script src="'.FS_PATH. |
|
474 | 474 | 'plugins/residentes/view/js/plugins/bootstrap-table-mobile.min.js" type="text/javascript"></script>', |
475 | 475 | 'params' => '' |
476 | 476 | ), |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | 'page_from' => __CLASS__, |
480 | 480 | 'page_to' => __CLASS__, |
481 | 481 | 'type' => 'head', |
482 | - 'text' => '<script src="' . FS_PATH . 'view/js/chart.bundle.min.js" type="text/javascript"></script>', |
|
482 | + 'text' => '<script src="'.FS_PATH.'view/js/chart.bundle.min.js" type="text/javascript"></script>', |
|
483 | 483 | 'params' => '' |
484 | 484 | ), |
485 | 485 | array( |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | 'page_from' => __CLASS__, |
488 | 488 | 'page_to' => __CLASS__, |
489 | 489 | 'type' => 'head', |
490 | - 'text' => '<link rel="stylesheet" type="text/css" media="screen" href="' . FS_PATH . |
|
490 | + 'text' => '<link rel="stylesheet" type="text/css" media="screen" href="'.FS_PATH. |
|
491 | 491 | 'plugins/residentes/view/css/bootstrap-table.min.css"/>', |
492 | 492 | 'params' => '' |
493 | 493 | ), |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | foreach ($extensiones as $ext) { |
497 | 497 | $fsext0 = new fs_extension($ext); |
498 | 498 | if (!$fsext0->save()) { |
499 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
499 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
500 | 500 | } |
501 | 501 | } |
502 | 502 | } |