@@ -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 | } |
@@ -36,15 +36,15 @@ discard block |
||
| 36 | 36 | public $procesado; |
| 37 | 37 | |
| 38 | 38 | public function __construct($t = FALSE) { |
| 39 | - parent::__construct('residentes_fact_prog_edificaciones','plugins/residentes'); |
|
| 40 | - if($t){ |
|
| 39 | + parent::__construct('residentes_fact_prog_edificaciones', 'plugins/residentes'); |
|
| 40 | + if ($t) { |
|
| 41 | 41 | $this->id = $t['id']; |
| 42 | 42 | $this->idprogramacion = $t['idprogramacion']; |
| 43 | 43 | $this->id_edificacion = $t['id_edificacion']; |
| 44 | 44 | $this->codcliente = $t['codcliente']; |
| 45 | 45 | $this->idfactura = $t['idfactura']; |
| 46 | 46 | $this->procesado = $this->str2bool($t['procesado']); |
| 47 | - }else{ |
|
| 47 | + }else { |
|
| 48 | 48 | $this->id = null; |
| 49 | 49 | $this->idprogramacion = null; |
| 50 | 50 | $this->id_edificacion = null; |
@@ -54,13 +54,13 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public function install(){ |
|
| 57 | + public function install() { |
|
| 58 | 58 | return ""; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function exists() |
| 62 | 62 | { |
| 63 | - if(is_null($this->id)) { |
|
| 63 | + if (is_null($this->id)) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | return true; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | public function save() |
| 70 | 70 | { |
| 71 | - if($this->exists()){ |
|
| 71 | + if ($this->exists()) { |
|
| 72 | 72 | $sql = "UPDATE ".$this->table_name." SET ". |
| 73 | 73 | "idfactura = ".$this->intval($this->idfactura).", ". |
| 74 | 74 | "codcliente = ".$this->var2str($this->codcliente).", ". |
@@ -78,16 +78,16 @@ discard block |
||
| 78 | 78 | "WHERE id = ".$this->intval($this->id).";"; |
| 79 | 79 | $data = $this->db->exec($sql); |
| 80 | 80 | return $data; |
| 81 | - } else { |
|
| 81 | + }else { |
|
| 82 | 82 | $sql = "INSERT INTO ".$this->table_name. |
| 83 | 83 | " (idprogramacion, id_edificacion, codcliente, procesado) VALUES (". |
| 84 | 84 | $this->intval($this->idprogramacion).", ". |
| 85 | 85 | $this->intval($this->id_edificacion).", ". |
| 86 | 86 | $this->var2str($this->codcliente).", ". |
| 87 | 87 | $this->var2str($this->procesado).");"; |
| 88 | - if($this->db->exec($sql)){ |
|
| 88 | + if ($this->db->exec($sql)) { |
|
| 89 | 89 | return true; |
| 90 | - }else{ |
|
| 90 | + }else { |
|
| 91 | 91 | return false; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $sql = "select * from ".$this->table_name." WHERE id = ".$this->intval($id); |
| 100 | 100 | $this->new_advice($sql); |
| 101 | 101 | $data = $this->db->select($sql); |
| 102 | - if($data) { |
|
| 102 | + if ($data) { |
|
| 103 | 103 | return new residentes_facturacion_programada_edificaciones($data[0]); |
| 104 | 104 | } |
| 105 | 105 | return false; |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | $sql = "select * from ".$this->table_name." WHERE idprogramacion = ".$this->intval($idProg)." ORDER BY id"; |
| 111 | 111 | $data = $this->db->select($sql); |
| 112 | 112 | $lista = array(); |
| 113 | - if($data) { |
|
| 114 | - foreach($data as $d) { |
|
| 113 | + if ($data) { |
|
| 114 | + foreach ($data as $d) { |
|
| 115 | 115 | $lista[] = new residentes_facturacion_programada_edificaciones($d); |
| 116 | 116 | } |
| 117 | 117 | return $lista; |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | " AND procesado = FALSE ORDER BY id"; |
| 126 | 126 | $data = $this->db->select($sql); |
| 127 | 127 | $lista = array(); |
| 128 | - if($data) { |
|
| 129 | - foreach($data as $d) { |
|
| 128 | + if ($data) { |
|
| 129 | + foreach ($data as $d) { |
|
| 130 | 130 | $lista[] = new residentes_facturacion_programada_edificaciones($d); |
| 131 | 131 | } |
| 132 | 132 | return $lista; |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | $sql = "select * from ".$this->table_name." WHERE idprogramacion = ".$this->intval($idProg)." ORDER BY id"; |
| 139 | 139 | $data = $this->db->select($sql); |
| 140 | 140 | $lista = array(); |
| 141 | - if($data) { |
|
| 142 | - foreach($data as $d) { |
|
| 141 | + if ($data) { |
|
| 142 | + foreach ($data as $d) { |
|
| 143 | 143 | $item = new residentes_facturacion_programada_edificaciones($d); |
| 144 | 144 | $this->infoAdicional($item); |
| 145 | 145 | $lista[] = $item; |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | ." AND "."estado = ".$this->var2str($status)." ORDER BY idprogramacion, id"; |
| 186 | 186 | $data = $this->db->select($sql); |
| 187 | 187 | $lista = array(); |
| 188 | - if($data) { |
|
| 189 | - foreach($data as $d) { |
|
| 188 | + if ($data) { |
|
| 189 | + foreach ($data as $d) { |
|
| 190 | 190 | $lista[] = new residentes_facturacion_programada_edificaciones($d); |
| 191 | 191 | } |
| 192 | 192 | return $lista; |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | $sql = "select * from ".$this->table_name." ORDER BY idprogramacion, id"; |
| 200 | 200 | $data = $this->db->select($sql); |
| 201 | 201 | $lista = array(); |
| 202 | - if($data) { |
|
| 203 | - foreach($data as $d) { |
|
| 202 | + if ($data) { |
|
| 203 | + foreach ($data as $d) { |
|
| 204 | 204 | $lista[] = new residentes_facturacion_programada_edificaciones($d); |
| 205 | 205 | } |
| 206 | 206 | return $lista; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | { |
| 213 | 213 | $sql = "DELETE from ".$this->table_name." WHERE id = ".$this->intval($this->id); |
| 214 | 214 | $data = $this->db->exec($sql); |
| 215 | - if($data) { |
|
| 215 | + if ($data) { |
|
| 216 | 216 | return true; |
| 217 | 217 | } |
| 218 | 218 | return false; |
@@ -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 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @author Joe Nilson <joenilson at gmail.com> |
| 26 | 26 | */ |
| 27 | -class residentes_vehiculos extends \fs_model{ |
|
| 27 | +class residentes_vehiculos extends \fs_model { |
|
| 28 | 28 | /** |
| 29 | 29 | * El Id del vehiculo |
| 30 | 30 | * @var integer serial |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->vehiculo_placa = $t['vehiculo_placa']; |
| 81 | 81 | $this->vehiculo_tipo = $t['vehiculo_tipo']; |
| 82 | 82 | $this->codigo_tarjeta = $t['codigo_tarjeta']; |
| 83 | - } else { |
|
| 83 | + }else { |
|
| 84 | 84 | $this->idvehiculo = null; |
| 85 | 85 | $this->codcliente = null; |
| 86 | 86 | $this->vehiculo_marca = null; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $lista[] = $item; |
| 121 | 121 | } |
| 122 | 122 | return $lista; |
| 123 | - } else { |
|
| 123 | + }else { |
|
| 124 | 124 | return false; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $data = $this->db->select($sql); |
| 133 | 133 | if ($data) { |
| 134 | 134 | return new residentes_vehiculos($data[0]); |
| 135 | - } else { |
|
| 135 | + }else { |
|
| 136 | 136 | return false; |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function get_by_field($field, $value) |
| 147 | 147 | { |
| 148 | - $query = (is_string($value))?$this->var2str($value):$this->intval($value); |
|
| 148 | + $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value); |
|
| 149 | 149 | $sql = "SELECT * FROM ".$this->table_name." WHERE ".strtoupper(trim($field))." = ".$query.";"; |
| 150 | 150 | $data = $this->db->select($sql); |
| 151 | 151 | if ($data) { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $lista[] = $item; |
| 156 | 156 | } |
| 157 | 157 | return $lista; |
| 158 | - } else { |
|
| 158 | + }else { |
|
| 159 | 159 | return false; |
| 160 | 160 | } |
| 161 | 161 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | { |
| 165 | 165 | if (is_null($this->idvehiculo)) { |
| 166 | 166 | return false; |
| 167 | - } else { |
|
| 167 | + }else { |
|
| 168 | 168 | return $this->get($this->codcliente, $this->idvehiculo); |
| 169 | 169 | } |
| 170 | 170 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | "WHERE idvehiculo = ".$this->intval($this->idvehiculo)." AND ". |
| 183 | 183 | "codcliente = ".$this->var2str($this->codcliente).";"; |
| 184 | 184 | return $this->db->exec($sql); |
| 185 | - } else { |
|
| 185 | + }else { |
|
| 186 | 186 | $sql = "INSERT INTO ".$this->table_name." (codcliente, vehiculo_marca, vehiculo_modelo, vehiculo_color, ". |
| 187 | 187 | "vehiculo_placa, vehiculo_tipo, codigo_tarjeta) VALUES (". |
| 188 | 188 | $this->var2str($this->codcliente).", ". |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $this->var2str($this->codigo_tarjeta).");"; |
| 195 | 195 | if ($this->db->exec($sql)) { |
| 196 | 196 | return $this->db->lastval(); |
| 197 | - } else { |
|
| 197 | + }else { |
|
| 198 | 198 | return false; |
| 199 | 199 | } |
| 200 | 200 | } |
@@ -209,17 +209,17 @@ discard block |
||
| 209 | 209 | $clilist = array(); |
| 210 | 210 | $query = mb_strtolower($this->no_html($busqueda), 'UTF8'); |
| 211 | 211 | |
| 212 | - $consulta = "SELECT * FROM " . $this->table_name . " WHERE "; |
|
| 212 | + $consulta = "SELECT * FROM ".$this->table_name." WHERE "; |
|
| 213 | 213 | if (is_numeric($query)) { |
| 214 | - $consulta .= "(codigo_tarjeta LIKE '%" . $query . "%' OR CAST(idvehiculo as CHAR) = '%" . $query . "%')"; |
|
| 215 | - } else { |
|
| 214 | + $consulta .= "(codigo_tarjeta LIKE '%".$query."%' OR CAST(idvehiculo as CHAR) = '%".$query."%')"; |
|
| 215 | + }else { |
|
| 216 | 216 | $buscar = str_replace(' ', '%', $query); |
| 217 | - $consulta .= "(lower(codigo_tarjeta) LIKE '%" . $buscar . |
|
| 218 | - "%' OR lower(vehiculo_color) LIKE '%" . $buscar . "%'" . |
|
| 219 | - " OR lower(vehiculo_marca) LIKE '%" . $buscar . |
|
| 220 | - "%' OR lower(vehiculo_modelo) LIKE '%" . $buscar . "%'" . |
|
| 221 | - " OR lower(vehiculo_placa) LIKE '%" . $buscar . |
|
| 222 | - "%' OR lower(vehiculo_tipo) LIKE '%" . $buscar . "%')"; |
|
| 217 | + $consulta .= "(lower(codigo_tarjeta) LIKE '%".$buscar. |
|
| 218 | + "%' OR lower(vehiculo_color) LIKE '%".$buscar."%'". |
|
| 219 | + " OR lower(vehiculo_marca) LIKE '%".$buscar. |
|
| 220 | + "%' OR lower(vehiculo_modelo) LIKE '%".$buscar."%'". |
|
| 221 | + " OR lower(vehiculo_placa) LIKE '%".$buscar. |
|
| 222 | + "%' OR lower(vehiculo_tipo) LIKE '%".$buscar."%')"; |
|
| 223 | 223 | } |
| 224 | 224 | $consulta .= " ORDER BY codcliente ASC"; |
| 225 | 225 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | * @author Joe Nilson <joenilson at gmail.com> |
| 26 | 26 | * @version 1 |
| 27 | 27 | */ |
| 28 | -class residentes_informacion extends \fs_model{ |
|
| 28 | +class residentes_informacion extends \fs_model { |
|
| 29 | 29 | /** |
| 30 | 30 | * Codigo del cliente |
| 31 | 31 | * @var string |
@@ -143,60 +143,60 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | parent::__construct('residentes_informacion', 'plugins/residentes'); |
| 145 | 145 | if ($t) { |
| 146 | - $this->codcliente=$t['codcliente']; |
|
| 147 | - $this->codigo=$t['codigo']; |
|
| 148 | - $this->ocupantes=$t['ocupantes']; |
|
| 149 | - $this->ocupantes5anos=$t['ocupantes5anos']; |
|
| 150 | - $this->ocupantes12anos=$t['ocupantes12anos']; |
|
| 151 | - $this->ocupantes18anos=$t['ocupantes18anos']; |
|
| 152 | - $this->ocupantes30anos=$t['ocupantes30anos']; |
|
| 153 | - $this->ocupantes50anos=$t['ocupantes50anos']; |
|
| 154 | - $this->ocupantes70anos=$t['ocupantes70anos']; |
|
| 155 | - $this->ocupantes71anos=$t['ocupantes71anos']; |
|
| 156 | - $this->informacion_discapacidad=$t['informacion_discapacidad']; |
|
| 157 | - $this->propietario=$this->str2bool($t['propietario']); |
|
| 158 | - $this->profesion=$t['profesion']; |
|
| 159 | - $this->ocupacion=$t['ocupacion']; |
|
| 160 | - $this->ca_nombres=$t['ca_nombres']; |
|
| 161 | - $this->ca_apellidos=$t['ca_apellidos']; |
|
| 162 | - $this->ca_telefono=$t['ca_telefono']; |
|
| 163 | - $this->ca_email=$t['ca_email']; |
|
| 164 | - $this->ca_propietario=$this->str2bool($t['ca_propietario']); |
|
| 165 | - $this->ca_parentesco=$t['ca_parentesco']; |
|
| 166 | - $this->ca_parentesco_obs=$t['ca_parentesco_obs']; |
|
| 167 | - $this->vehiculos=$t['vehiculos']; |
|
| 168 | - } else { |
|
| 169 | - $this->codcliente=NULL; |
|
| 170 | - $this->codigo=NULL; |
|
| 171 | - $this->ocupantes=NULL; |
|
| 172 | - $this->ocupantes5anos=NULL; |
|
| 173 | - $this->ocupantes12anos=NULL; |
|
| 174 | - $this->ocupantes18anos=NULL; |
|
| 175 | - $this->ocupantes30anos=NULL; |
|
| 176 | - $this->ocupantes50anos=NULL; |
|
| 177 | - $this->ocupantes70anos=NULL; |
|
| 178 | - $this->ocupantes71anos=NULL; |
|
| 179 | - $this->informacion_discapacidad=NULL; |
|
| 180 | - $this->propietario='FALSE'; |
|
| 181 | - $this->profesion=NULL; |
|
| 182 | - $this->ocupacion=NULL; |
|
| 183 | - $this->ca_nombres=NULL; |
|
| 184 | - $this->ca_apellidos=NULL; |
|
| 185 | - $this->ca_telefono=NULL; |
|
| 186 | - $this->ca_email=NULL; |
|
| 187 | - $this->ca_propietario='FALSE'; |
|
| 188 | - $this->ca_parentesco=NULL; |
|
| 189 | - $this->ca_parentesco_obs=''; |
|
| 190 | - $this->vehiculos=0; |
|
| 146 | + $this->codcliente = $t['codcliente']; |
|
| 147 | + $this->codigo = $t['codigo']; |
|
| 148 | + $this->ocupantes = $t['ocupantes']; |
|
| 149 | + $this->ocupantes5anos = $t['ocupantes5anos']; |
|
| 150 | + $this->ocupantes12anos = $t['ocupantes12anos']; |
|
| 151 | + $this->ocupantes18anos = $t['ocupantes18anos']; |
|
| 152 | + $this->ocupantes30anos = $t['ocupantes30anos']; |
|
| 153 | + $this->ocupantes50anos = $t['ocupantes50anos']; |
|
| 154 | + $this->ocupantes70anos = $t['ocupantes70anos']; |
|
| 155 | + $this->ocupantes71anos = $t['ocupantes71anos']; |
|
| 156 | + $this->informacion_discapacidad = $t['informacion_discapacidad']; |
|
| 157 | + $this->propietario = $this->str2bool($t['propietario']); |
|
| 158 | + $this->profesion = $t['profesion']; |
|
| 159 | + $this->ocupacion = $t['ocupacion']; |
|
| 160 | + $this->ca_nombres = $t['ca_nombres']; |
|
| 161 | + $this->ca_apellidos = $t['ca_apellidos']; |
|
| 162 | + $this->ca_telefono = $t['ca_telefono']; |
|
| 163 | + $this->ca_email = $t['ca_email']; |
|
| 164 | + $this->ca_propietario = $this->str2bool($t['ca_propietario']); |
|
| 165 | + $this->ca_parentesco = $t['ca_parentesco']; |
|
| 166 | + $this->ca_parentesco_obs = $t['ca_parentesco_obs']; |
|
| 167 | + $this->vehiculos = $t['vehiculos']; |
|
| 168 | + }else { |
|
| 169 | + $this->codcliente = NULL; |
|
| 170 | + $this->codigo = NULL; |
|
| 171 | + $this->ocupantes = NULL; |
|
| 172 | + $this->ocupantes5anos = NULL; |
|
| 173 | + $this->ocupantes12anos = NULL; |
|
| 174 | + $this->ocupantes18anos = NULL; |
|
| 175 | + $this->ocupantes30anos = NULL; |
|
| 176 | + $this->ocupantes50anos = NULL; |
|
| 177 | + $this->ocupantes70anos = NULL; |
|
| 178 | + $this->ocupantes71anos = NULL; |
|
| 179 | + $this->informacion_discapacidad = NULL; |
|
| 180 | + $this->propietario = 'FALSE'; |
|
| 181 | + $this->profesion = NULL; |
|
| 182 | + $this->ocupacion = NULL; |
|
| 183 | + $this->ca_nombres = NULL; |
|
| 184 | + $this->ca_apellidos = NULL; |
|
| 185 | + $this->ca_telefono = NULL; |
|
| 186 | + $this->ca_email = NULL; |
|
| 187 | + $this->ca_propietario = 'FALSE'; |
|
| 188 | + $this->ca_parentesco = NULL; |
|
| 189 | + $this->ca_parentesco_obs = ''; |
|
| 190 | + $this->vehiculos = 0; |
|
| 191 | 191 | } |
| 192 | 192 | $this->cliente = new cliente(); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - public function install(){ |
|
| 195 | + public function install() { |
|
| 196 | 196 | return ""; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - public function info_adicional($i){ |
|
| 199 | + public function info_adicional($i) { |
|
| 200 | 200 | $data = $this->cliente->get($i->codcliente); |
| 201 | 201 | $i->nombre = $data->nombre; |
| 202 | 202 | $i->telefono1 = $data->telefono1; |
@@ -206,17 +206,17 @@ discard block |
||
| 206 | 206 | return $i; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - public function all(){ |
|
| 209 | + public function all() { |
|
| 210 | 210 | $sql = "SELECT * FROM ".$this->table_name." ORDER BY codcliente"; |
| 211 | 211 | $data = $this->db->select($sql); |
| 212 | - if($data){ |
|
| 212 | + if ($data) { |
|
| 213 | 213 | $lista = array(); |
| 214 | - foreach($data as $d){ |
|
| 214 | + foreach ($data as $d) { |
|
| 215 | 215 | $item = new residentes_informacion($d); |
| 216 | 216 | $lista[] = $item->info_adicional($item); |
| 217 | 217 | } |
| 218 | 218 | return $lista; |
| 219 | - }else{ |
|
| 219 | + }else { |
|
| 220 | 220 | return false; |
| 221 | 221 | } |
| 222 | 222 | } |
@@ -228,14 +228,14 @@ discard block |
||
| 228 | 228 | * @param type $padre_tipo integer |
| 229 | 229 | * @return \FacturaScripts\model\residentes_informacion|boolean |
| 230 | 230 | */ |
| 231 | - public function get($codcliente){ |
|
| 231 | + public function get($codcliente) { |
|
| 232 | 232 | $sql = "SELECT * FROM ".$this->table_name. |
| 233 | 233 | " WHERE codcliente = ".$this->var2str($codcliente).";"; |
| 234 | 234 | $data = $this->db->select($sql); |
| 235 | - if($data){ |
|
| 235 | + if ($data) { |
|
| 236 | 236 | $item = new residentes_informacion($data[0]); |
| 237 | 237 | return $item->info_adicional($item); |
| 238 | - }else{ |
|
| 238 | + }else { |
|
| 239 | 239 | return false; |
| 240 | 240 | } |
| 241 | 241 | } |
@@ -246,32 +246,32 @@ discard block |
||
| 246 | 246 | * @param type $value string |
| 247 | 247 | * @return boolean|\FacturaScripts\model\residentes_informacion |
| 248 | 248 | */ |
| 249 | - public function get_by_field($field,$value){ |
|
| 250 | - $query = (is_string($value))?$this->var2str($value):$this->intval($value); |
|
| 249 | + public function get_by_field($field, $value) { |
|
| 250 | + $query = (is_string($value)) ? $this->var2str($value) : $this->intval($value); |
|
| 251 | 251 | $sql = "SELECT * FROM ".$this->table_name." WHERE ".strtoupper(trim($field))." = ".$query.";"; |
| 252 | 252 | $data = $this->db->select($sql); |
| 253 | - if($data){ |
|
| 253 | + if ($data) { |
|
| 254 | 254 | $lista = array(); |
| 255 | - foreach($data as $d){ |
|
| 255 | + foreach ($data as $d) { |
|
| 256 | 256 | $item = new residentes_informacion($d); |
| 257 | 257 | $lista[] = $item->info_adicional($item); |
| 258 | 258 | } |
| 259 | 259 | return $lista; |
| 260 | - }else{ |
|
| 260 | + }else { |
|
| 261 | 261 | return false; |
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | public function exists() { |
| 266 | - if(!$this->get($this->codcliente)){ |
|
| 266 | + if (!$this->get($this->codcliente)) { |
|
| 267 | 267 | return false; |
| 268 | - }else{ |
|
| 268 | + }else { |
|
| 269 | 269 | return $this->get($this->codcliente); |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | public function save() { |
| 274 | - if($this->exists()){ |
|
| 274 | + if ($this->exists()) { |
|
| 275 | 275 | $sql = "UPDATE ".$this->table_name." SET ". |
| 276 | 276 | "codigo = ".$this->var2str($this->codigo).", ". |
| 277 | 277 | "ocupantes = ".$this->intval($this->ocupantes).", ". |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | "vehiculos = ".$this->intval($this->vehiculos)." ". |
| 297 | 297 | "WHERE codcliente = ".$this->var2str($this->codcliente).";"; |
| 298 | 298 | return $this->db->exec($sql); |
| 299 | - }else{ |
|
| 299 | + }else { |
|
| 300 | 300 | $sql = "INSERT INTO ".$this->table_name." (codcliente, codigo, ocupantes, ocupantes5anos, ocupantes12anos, ocupantes18anos, ocupantes30anos, ocupantes50anos, ocupantes70anos, ocupantes71anos, informacion_discapacidad, propietario, profesion, ocupacion, ca_nombres, ca_apellidos, ca_telefono, ca_email, ca_propietario, ca_parentesco, ca_parentesco_obs, vehiculos) VALUES (". |
| 301 | 301 | $this->var2str($this->codcliente).", ". |
| 302 | 302 | $this->var2str($this->codigo).", ". |
@@ -320,9 +320,9 @@ discard block |
||
| 320 | 320 | $this->var2str($this->ca_parentesco).", ". |
| 321 | 321 | $this->var2str($this->ca_parentesco_obs).", ". |
| 322 | 322 | $this->intval($this->vehiculos).");"; |
| 323 | - if($this->db->exec($sql)){ |
|
| 323 | + if ($this->db->exec($sql)) { |
|
| 324 | 324 | return true; |
| 325 | - }else{ |
|
| 325 | + }else { |
|
| 326 | 326 | return false; |
| 327 | 327 | } |
| 328 | 328 | } |
@@ -336,14 +336,14 @@ discard block |
||
| 336 | 336 | $clilist = array(); |
| 337 | 337 | $query = mb_strtolower($this->no_html($busqueda), 'UTF8'); |
| 338 | 338 | |
| 339 | - $consulta = "SELECT * FROM " . $this->table_name . " WHERE "; |
|
| 339 | + $consulta = "SELECT * FROM ".$this->table_name." WHERE "; |
|
| 340 | 340 | if (is_numeric($query)) { |
| 341 | - $consulta .= "(ca_telefono LIKE '%" . $query . "%' OR codigo LIKE '%" . $query . "%')"; |
|
| 342 | - } else { |
|
| 341 | + $consulta .= "(ca_telefono LIKE '%".$query."%' OR codigo LIKE '%".$query."%')"; |
|
| 342 | + }else { |
|
| 343 | 343 | $buscar = str_replace(' ', '%', $query); |
| 344 | - $consulta .= "(lower(ca_nombres) LIKE '%" . $buscar . "%' OR lower(ca_apellidos) LIKE '%" . $buscar . "%'" |
|
| 345 | - . " OR lower(ocupacion) LIKE '%" . $buscar . "%' OR lower(profesion) LIKE '%" . $buscar . "%'" |
|
| 346 | - . " OR lower(ca_email) LIKE '%" . $buscar . "%')"; |
|
| 344 | + $consulta .= "(lower(ca_nombres) LIKE '%".$buscar."%' OR lower(ca_apellidos) LIKE '%".$buscar."%'" |
|
| 345 | + . " OR lower(ocupacion) LIKE '%".$buscar."%' OR lower(profesion) LIKE '%".$buscar."%'" |
|
| 346 | + . " OR lower(ca_email) LIKE '%".$buscar."%')"; |
|
| 347 | 347 | } |
| 348 | 348 | $consulta .= " ORDER BY codcliente ASC"; |
| 349 | 349 | |
@@ -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; |