@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $this->estado = $t['estado']; |
| 62 | 62 | $this->fecha_creacion = $t['fecha_creacion']; |
| 63 | 63 | $this->fecha_modificacion = $t['fecha_modificacion']; |
| 64 | - } else { |
|
| 64 | + }else { |
|
| 65 | 65 | $this->id = null; |
| 66 | 66 | $this->descripcion = ''; |
| 67 | 67 | $this->forma_pago = ''; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | "WHERE id = ".$this->intval($this->id).";"; |
| 111 | 111 | $data = $this->db->exec($sql); |
| 112 | 112 | return $data; |
| 113 | - } else { |
|
| 113 | + }else { |
|
| 114 | 114 | $sql = "INSERT INTO ".$this->table_name. |
| 115 | 115 | " (descripcion, forma_pago, formato_factura, fecha_envio, hora_envio, residentes_facturar, ". |
| 116 | 116 | "facturas_generadas, usuario_creacion, fecha_creacion, estado) VALUES (". |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $this->var2str($this->estado).");"; |
| 127 | 127 | if ($this->db->exec($sql)) { |
| 128 | 128 | return $this->db->lastval(); |
| 129 | - } else { |
|
| 129 | + }else { |
|
| 130 | 130 | return false; |
| 131 | 131 | } |
| 132 | 132 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $jobDisponible->fecha_modificacion = \date('Y-m-d H:i:s'); |
| 290 | 290 | $jobDisponible->save(); |
| 291 | 291 | $this->startJob($jobDisponible); |
| 292 | - } else { |
|
| 292 | + }else { |
|
| 293 | 293 | echo " ** No coincide la hora de proceso con la de ejecucion de cron se omite el proceso ". |
| 294 | 294 | "$ahora $horaActual ** \n"; |
| 295 | 295 | $this->new_advice(' ** No coincide la hora de proceso con la de ejecucion de cron se omite el proceso ** '); |
@@ -318,10 +318,10 @@ discard block |
||
| 318 | 318 | $this->nuevoTotalFactura($factura, $resProgramado, $empresaTable); |
| 319 | 319 | ++$jobDisponible->facturas_generadas; |
| 320 | 320 | $jobDisponible->save(); |
| 321 | - } else { |
|
| 321 | + }else { |
|
| 322 | 322 | $this->new_error_msg('Imposible guardar la factura.'); |
| 323 | 323 | } |
| 324 | - } else { |
|
| 324 | + }else { |
|
| 325 | 325 | $this->new_error_msg('Cliente no encontrado.'); |
| 326 | 326 | } |
| 327 | 327 | } |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | $residenteProgramado->idfactura = $factura->idfactura; |
| 398 | 398 | $residenteProgramado->procesado = true; |
| 399 | 399 | $residenteProgramado->save(); |
| 400 | - } else { |
|
| 400 | + }else { |
|
| 401 | 401 | $factura->delete(); |
| 402 | 402 | } |
| 403 | 403 | } |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | if ($empresaTable->contintegrada) { |
| 454 | 454 | $asiento_factura = new asiento_factura(); |
| 455 | 455 | $asiento_factura->generar_asiento_venta($factura); |
| 456 | - } else { |
|
| 456 | + }else { |
|
| 457 | 457 | /// de todas formas forzamos la generación de las líneas de iva |
| 458 | 458 | $factura->get_lineas_iva(); |
| 459 | 459 | } |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | public $importe; |
| 38 | 38 | |
| 39 | 39 | public function __construct($t = FALSE) { |
| 40 | - parent::__construct('residentes_fact_prog_conceptos','plugins/residentes'); |
|
| 41 | - if($t){ |
|
| 40 | + parent::__construct('residentes_fact_prog_conceptos', 'plugins/residentes'); |
|
| 41 | + if ($t) { |
|
| 42 | 42 | $this->id = $t['id']; |
| 43 | 43 | $this->idprogramacion = $t['idprogramacion']; |
| 44 | 44 | $this->referencia = $t['referencia']; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $this->cantidad = floatval($t['cantidad']); |
| 47 | 47 | $this->codimpuesto = $t['codimpuesto']; |
| 48 | 48 | $this->importe = floatval($t['importe']); |
| 49 | - }else{ |
|
| 49 | + }else { |
|
| 50 | 50 | $this->id = null; |
| 51 | 51 | $this->idprogramacion = null; |
| 52 | 52 | $this->referencia = ''; |
@@ -57,13 +57,13 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public function install(){ |
|
| 60 | + public function install() { |
|
| 61 | 61 | return ""; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function exists() |
| 65 | 65 | { |
| 66 | - if(is_null($this->id)) { |
|
| 66 | + if (is_null($this->id)) { |
|
| 67 | 67 | return false; |
| 68 | 68 | } |
| 69 | 69 | return true; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | public function save() |
| 73 | 73 | { |
| 74 | - if($this->exists()){ |
|
| 74 | + if ($this->exists()) { |
|
| 75 | 75 | $sql = "UPDATE ".$this->table_name." SET ". |
| 76 | 76 | "referencia = ".$this->var2str($this->referencia).", ". |
| 77 | 77 | "pvp = ".$this->var2str($this->pvp).", ". |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | "WHERE id = ".$this->intval($this->id).";"; |
| 82 | 82 | $data = $this->db->exec($sql); |
| 83 | 83 | return $data; |
| 84 | - }else{ |
|
| 84 | + }else { |
|
| 85 | 85 | $sql = "INSERT INTO ".$this->table_name. |
| 86 | 86 | " (idprogramacion, referencia, pvp, cantidad, codimpuesto, importe) VALUES (". |
| 87 | 87 | $this->intval($this->idprogramacion).", ". |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | $this->var2str($this->codimpuesto).", ". |
| 92 | 92 | $this->var2str($this->importe).");"; |
| 93 | 93 | |
| 94 | - if($this->db->exec($sql)){ |
|
| 94 | + if ($this->db->exec($sql)) { |
|
| 95 | 95 | return true; |
| 96 | - }else{ |
|
| 96 | + }else { |
|
| 97 | 97 | return false; |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | $sql = "select * from ".$this->table_name." WHERE id = ".$this->intval($id); |
| 106 | 106 | $data = $this->db->select($sql); |
| 107 | - if($data) { |
|
| 107 | + if ($data) { |
|
| 108 | 108 | return new residentes_facturacion_programada_conceptos($data[0]); |
| 109 | 109 | } |
| 110 | 110 | return false; |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | $sql = "select * from ".$this->table_name." WHERE idprogramacion = ".$this->intval($idProg)." ORDER BY id"; |
| 116 | 116 | $data = $this->db->select($sql); |
| 117 | 117 | $lista = array(); |
| 118 | - if($data) { |
|
| 119 | - foreach($data as $d) { |
|
| 118 | + if ($data) { |
|
| 119 | + foreach ($data as $d) { |
|
| 120 | 120 | $lista[] = new residentes_facturacion_programada_conceptos($d); |
| 121 | 121 | } |
| 122 | 122 | return $lista; |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | $sql = "select * from ".$this->table_name." WHERE fecha_envio = ".$this->var2str($date)." ORDER BY fecha_envio, hora_envio"; |
| 130 | 130 | $data = $this->db->select($sql); |
| 131 | 131 | $lista = array(); |
| 132 | - if($data) { |
|
| 133 | - foreach($data as $d) { |
|
| 132 | + if ($data) { |
|
| 133 | + foreach ($data as $d) { |
|
| 134 | 134 | $lista[] = new residentes_facturacion_programada_conceptos($d); |
| 135 | 135 | } |
| 136 | 136 | return $lista; |
@@ -144,8 +144,8 @@ discard block |
||
| 144 | 144 | ." AND "."estado = ".$this->var2str($status)." ORDER BY fecha_envio, hora_envio"; |
| 145 | 145 | $data = $this->db->select($sql); |
| 146 | 146 | $lista = array(); |
| 147 | - if($data) { |
|
| 148 | - foreach($data as $d) { |
|
| 147 | + if ($data) { |
|
| 148 | + foreach ($data as $d) { |
|
| 149 | 149 | $lista[] = new residentes_facturacion_programada_conceptos($d); |
| 150 | 150 | } |
| 151 | 151 | return $lista; |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | $sql = "select * from ".$this->table_name." ORDER BY fecha_envio, hora_envio"; |
| 159 | 159 | $data = $this->db->select($sql); |
| 160 | 160 | $lista = array(); |
| 161 | - if($data) { |
|
| 162 | - foreach($data as $d) { |
|
| 161 | + if ($data) { |
|
| 162 | + foreach ($data as $d) { |
|
| 163 | 163 | $lista[] = new residentes_facturacion_programada_conceptos($d); |
| 164 | 164 | } |
| 165 | 165 | return $lista; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | $sql = "DELETE from ".$this->table_name." WHERE id = ".$this->intval($this->id); |
| 173 | 173 | $data = $this->db->exec($sql); |
| 174 | - if($data) { |
|
| 174 | + if ($data) { |
|
| 175 | 175 | return true; |
| 176 | 176 | } |
| 177 | 177 | return false; |
@@ -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 | */ |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | foreach ($extensiones as $ext) { |
| 123 | 123 | $fsext0 = new fs_extension($ext); |
| 124 | 124 | if (!$fsext0->save()) { |
| 125 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
| 125 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | if ($estado === true) { |
| 175 | 175 | $this->new_message('Programación eliminada correctamente.'); |
| 176 | - } else { |
|
| 176 | + }else { |
|
| 177 | 177 | $this->new_error_msg('La Programación no pudo ser eliminada, verifique los datos o sus permisos.'); |
| 178 | 178 | } |
| 179 | 179 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | } |
| 195 | 195 | if ($estado === true) { |
| 196 | 196 | $this->new_message('Programación reiniciada correctamente.'); |
| 197 | - } else { |
|
| 197 | + }else { |
|
| 198 | 198 | $this->new_error_msg('La Programación no pudo ser reiniciada, verifique los datos o sus permisos.'); |
| 199 | 199 | } |
| 200 | 200 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | public function guardarProgramacion() |
| 203 | 203 | { |
| 204 | 204 | $residentesProcesar = $this->cantidadResidentesProcesar(); |
| 205 | - $cantidadResidentesProcesar = count($residentesProcesar); |
|
| 205 | + $cantidadResidentesProcesar = count($residentesProcesar); |
|
| 206 | 206 | $idProgramacion = $this->cabeceraProgramacion($cantidadResidentesProcesar); |
| 207 | 207 | |
| 208 | 208 | if ($idProgramacion) { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $hora_envio = $this->filter_request('hora_envio'); |
| 223 | 223 | |
| 224 | 224 | $rfp = new residentes_facturacion_programada(); |
| 225 | - $rfp->id = (isset($id) && $id != '')?$id:null; |
|
| 225 | + $rfp->id = (isset($id) && $id != '') ? $id : null; |
|
| 226 | 226 | $rfp->descripcion = htmlentities(trim($descripcion)); |
| 227 | 227 | $rfp->forma_pago = $forma_pago; |
| 228 | 228 | $rfp->fecha_envio = $fecha_envio; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $edificacionesDisponibles = $edificaciones_residentes->get_by_field('id_edificacion', $edificacion); |
| 294 | 294 | foreach ($edificacionesDisponibles as $edif) { |
| 295 | 295 | if ($edif->ocupado === true) { |
| 296 | - $residentesDisponibles[] = ['id_edificacion'=>$edif->id_edificacion,'codcliente'=>$edif->codcliente]; |
|
| 296 | + $residentesDisponibles[] = ['id_edificacion'=>$edif->id_edificacion, 'codcliente'=>$edif->codcliente]; |
|
| 297 | 297 | } |
| 298 | 298 | } |
| 299 | 299 | $this->cargarResidentesFacturables($residentesDisponibles, $listaResidentes); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public function init() |
| 94 | 94 | { |
| 95 | - $this->allow_delete = ($this->user->admin)?TRUE:$this->user->allow_delete_on(__CLASS__); |
|
| 95 | + $this->allow_delete = ($this->user->admin) ?TRUE:$this->user->allow_delete_on(__CLASS__); |
|
| 96 | 96 | $this->edificaciones_tipo = new residentes_edificaciones_tipo(); |
| 97 | 97 | $this->edificaciones_mapa = new residentes_edificaciones_mapa(); |
| 98 | 98 | $this->edificaciones = new residentes_edificaciones(); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | return 'index.php?page='.__CLASS__.'&interior='.$interior; |
| 142 | 142 | } elseif ($inmuebles) { |
| 143 | 143 | return 'index.php?page='.__CLASS__.'&inmuebles='.$inmuebles; |
| 144 | - } else { |
|
| 144 | + }else { |
|
| 145 | 145 | return 'index.php?page='.__CLASS__; |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $edificacion->codcliente = ''; |
| 162 | 162 | $edificacion->fecha_disponibilidad = NULL; |
| 163 | 163 | $edificacion->fecha_ocupacion = NULL; |
| 164 | - try{ |
|
| 164 | + try { |
|
| 165 | 165 | $edificacion->save(); |
| 166 | 166 | $this->new_message('Inmueble desocupado exitosamente.'); |
| 167 | 167 | } catch (Exception $ex) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $this->new_error_msg('Esta edificacion tiene un residente, '. |
| 180 | 180 | 'primero debe quitar al residente para proceder '. |
| 181 | 181 | 'a eliminar esta edificacion.'); |
| 182 | - } else { |
|
| 182 | + }else { |
|
| 183 | 183 | try { |
| 184 | 184 | $edificacion->delete(); |
| 185 | 185 | $this->new_message('Edificación eliminada correctamente.'); |
@@ -210,15 +210,15 @@ discard block |
||
| 210 | 210 | public function buscar_padre($id, &$codigo, &$unir = false) |
| 211 | 211 | { |
| 212 | 212 | $dato = $this->edificaciones_mapa->get($id); |
| 213 | - $codigo[] = ($unir)?'"'.$dato->id_tipo.'":"'.$dato->codigo_edificacion.'"':$dato->codigo_edificacion; |
|
| 214 | - if ($dato->padre_id==0) { |
|
| 213 | + $codigo[] = ($unir) ? '"'.$dato->id_tipo.'":"'.$dato->codigo_edificacion.'"' : $dato->codigo_edificacion; |
|
| 214 | + if ($dato->padre_id == 0) { |
|
| 215 | 215 | return $codigo; |
| 216 | - } else { |
|
| 216 | + }else { |
|
| 217 | 217 | $this->buscar_padre($dato->padre_id, $codigo, $unir); |
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - public function crear_codigo($id,$unir = false) |
|
| 221 | + public function crear_codigo($id, $unir = false) |
|
| 222 | 222 | { |
| 223 | 223 | $codigo = array(); |
| 224 | 224 | $this->buscar_padre($id, $codigo, $unir); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | array_unshift($lista, $linea); |
| 229 | 229 | } |
| 230 | 230 | $codigo = $lista; |
| 231 | - } else { |
|
| 231 | + }else { |
|
| 232 | 232 | rsort($codigo); |
| 233 | 233 | } |
| 234 | 234 | return $codigo; |
@@ -240,16 +240,16 @@ discard block |
||
| 240 | 240 | $final_p = \filter_input(INPUT_POST, 'final'); |
| 241 | 241 | $cantidad = \filter_input(INPUT_POST, 'cantidad'); |
| 242 | 242 | $incremento = \filter_input(INPUT_POST, 'incremento'); |
| 243 | - $final=(!empty($final_p))?$final_p:$inicio; |
|
| 243 | + $final = (!empty($final_p)) ? $final_p : $inicio; |
|
| 244 | 244 | $inmuebles = 0; |
| 245 | 245 | $error = 0; |
| 246 | 246 | $linea = 0; |
| 247 | 247 | if ($inicio === $final) { |
| 248 | 248 | $this->inmueble($inicio, $inmuebles, $error); |
| 249 | - } else { |
|
| 250 | - for ($i = $inicio; $i<=($final); $i++) { |
|
| 251 | - if ($linea === $cantidad and $cantidad!=0) { |
|
| 252 | - $i = ($i-$cantidad)+$incremento; |
|
| 249 | + }else { |
|
| 250 | + for ($i = $inicio; $i <= ($final); $i++) { |
|
| 251 | + if ($linea === $cantidad and $cantidad != 0) { |
|
| 252 | + $i = ($i - $cantidad) + $incremento; |
|
| 253 | 253 | $linea = 0; |
| 254 | 254 | } |
| 255 | 255 | $this->inmueble($i, $inmuebles, $error); |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $ubicacion = ""; |
| 275 | 275 | $codcliente = ""; |
| 276 | 276 | $ocupado = false; |
| 277 | - $item = (is_int($inicio))?str_pad($inicio, 3, "0", STR_PAD_LEFT):$inicio; |
|
| 277 | + $item = (is_int($inicio)) ?str_pad($inicio, 3, "0", STR_PAD_LEFT) : $inicio; |
|
| 278 | 278 | $edif0 = new residentes_edificaciones(); |
| 279 | 279 | $edif0->id = \filter_input(INPUT_POST, 'id'); |
| 280 | 280 | $edif0->id_edificacion = \filter_input(INPUT_POST, 'id_edificacion'); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $edif0->numero = $item; |
| 284 | 284 | $edif0->ubicacion = trim($ubicacion); |
| 285 | 285 | $edif0->codcliente = trim($codcliente); |
| 286 | - $edif0->ocupado = (bool)$ocupado; |
|
| 286 | + $edif0->ocupado = (bool) $ocupado; |
|
| 287 | 287 | try { |
| 288 | 288 | $edif0->save(); |
| 289 | 289 | $inmuebles++; |
@@ -311,13 +311,13 @@ discard block |
||
| 311 | 311 | $iddireccion, |
| 312 | 312 | $descripcion_direccion |
| 313 | 313 | ); |
| 314 | - $inmueble->fecha_ocupacion = ($fecha_ocupacion)?\date('Y-m-d', strtotime($fecha_ocupacion)):null; |
|
| 314 | + $inmueble->fecha_ocupacion = ($fecha_ocupacion) ?\date('Y-m-d', strtotime($fecha_ocupacion)) : null; |
|
| 315 | 315 | $inmueble->fecha_disponibilidad = ($fecha_disponibilidad) |
| 316 | 316 | ?\date('Y-m-d', strtotime($fecha_disponibilidad)) |
| 317 | 317 | :null; |
| 318 | 318 | if ($inmueble->save()) { |
| 319 | 319 | $this->new_message('Residente agregado exitosamente.'); |
| 320 | - } else { |
|
| 320 | + }else { |
|
| 321 | 321 | $this->new_error_msg('No se pudo agregar al residente confirme el '. |
| 322 | 322 | 'nombre del residente y las fechs de ocupación y disponibilidad'); |
| 323 | 323 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $inmueble->fecha_disponibilidad = ''; |
| 330 | 330 | if ($inmueble->save()) { |
| 331 | 331 | $this->new_message('Residente removido exitosamente.'); |
| 332 | - } else { |
|
| 332 | + }else { |
|
| 333 | 333 | $this->new_error_msg('No se pudo remover al residente'); |
| 334 | 334 | } |
| 335 | 335 | } |
@@ -344,13 +344,13 @@ discard block |
||
| 344 | 344 | $campo = "campo_".$i->id; |
| 345 | 345 | $linea = filter_input(INPUT_POST, $campo); |
| 346 | 346 | $precodigo .= $linea; |
| 347 | - $precodigo_interno[$i->id]=$linea; |
|
| 347 | + $precodigo_interno[$i->id] = $linea; |
|
| 348 | 348 | } |
| 349 | 349 | $codigo_p = filter_input(INPUT_POST, 'codigo'); |
| 350 | 350 | $codigo_interno_p = filter_input(INPUT_POST, 'codigo_interno'); |
| 351 | - $codigo = ($codigo_p)?$codigo_p:$precodigo; |
|
| 351 | + $codigo = ($codigo_p) ? $codigo_p : $precodigo; |
|
| 352 | 352 | $codigo_interno = ($codigo_interno_p) |
| 353 | - ?$codigo_interno_p |
|
| 353 | + ? $codigo_interno_p |
|
| 354 | 354 | : \json_encode($precodigo_interno, JSON_THROW_ON_ERROR); |
| 355 | 355 | $numero = filter_input(INPUT_POST, 'numero_edificacion'); |
| 356 | 356 | $ubicacion = filter_input(INPUT_POST, 'ubicacion'); |
@@ -367,10 +367,10 @@ discard block |
||
| 367 | 367 | $this->new_error_msg('Ocurrió un error al querer eliminar la Edificación. '. |
| 368 | 368 | $exc->getTraceAsString()); |
| 369 | 369 | } |
| 370 | - } else { |
|
| 370 | + }else { |
|
| 371 | 371 | $this->new_error_msg('¡No se puede eliminar una edificación que está ocupada!'); |
| 372 | 372 | } |
| 373 | - } else { |
|
| 373 | + }else { |
|
| 374 | 374 | $edif0 = new FacturaScripts\model\residentes_edificaciones(); |
| 375 | 375 | $edif0->id = $id; |
| 376 | 376 | $edif0->codigo = $codigo; |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $edif0->numero = trim($numero); |
| 379 | 379 | $edif0->ubicacion = trim($ubicacion); |
| 380 | 380 | $edif0->codcliente = trim($codcliente); |
| 381 | - $edif0->ocupado = ($ocupado)?"TRUE":"FALSE"; |
|
| 381 | + $edif0->ocupado = ($ocupado) ? "TRUE" : "FALSE"; |
|
| 382 | 382 | try { |
| 383 | 383 | $edif0->save(); |
| 384 | 384 | $this->new_message('¡Edificación guardada exitosamente!'); |
@@ -405,11 +405,11 @@ discard block |
||
| 405 | 405 | $this->new_error_msg('Ocurrió un error al querer eliminar el tipo de edificación. '. |
| 406 | 406 | $e->getTraceAsString()); |
| 407 | 407 | } |
| 408 | - } else { |
|
| 408 | + }else { |
|
| 409 | 409 | $this->new_error_msg('No se puede eliminar un Tipo de edificación que es padre de otros '. |
| 410 | 410 | 'tipos de edificación.'); |
| 411 | 411 | } |
| 412 | - } else { |
|
| 412 | + }else { |
|
| 413 | 413 | $tipo0 = new residentes_edificaciones_tipo(); |
| 414 | 414 | $tipo0->id = $id; |
| 415 | 415 | $tipo0->descripcion = ucfirst(strtolower(trim(htmlspecialchars($descripcion)))); |
@@ -454,12 +454,12 @@ discard block |
||
| 454 | 454 | $id = \filter_input(INPUT_POST, 'id'); |
| 455 | 455 | $codigo_padre = \filter_input(INPUT_POST, 'codigo_padre'); |
| 456 | 456 | $padre_id = \filter_input(INPUT_POST, 'padre_id'); |
| 457 | - $final=(!empty($final_p))?$final_p:$inicio; |
|
| 457 | + $final = (!empty($final_p)) ? $final_p : $inicio; |
|
| 458 | 458 | $inmuebles = 0; |
| 459 | 459 | $error = 0; |
| 460 | 460 | $linea = 0; |
| 461 | 461 | foreach (range($inicio, $final) as $item) { |
| 462 | - $item = (is_int($item))?str_pad($item, 3, "0", STR_PAD_LEFT):$item; |
|
| 462 | + $item = (is_int($item)) ?str_pad($item, 3, "0", STR_PAD_LEFT) : $item; |
|
| 463 | 463 | $punto = new residentes_edificaciones_mapa(); |
| 464 | 464 | $punto->id = $id; |
| 465 | 465 | $punto->id_tipo = $objeto->id; |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | $punto->numero = ''; |
| 471 | 471 | if ($punto->save()) { |
| 472 | 472 | $inmuebles++; |
| 473 | - } else { |
|
| 473 | + }else { |
|
| 474 | 474 | $error++; |
| 475 | 475 | } |
| 476 | 476 | $linea++; |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | foreach ($extensiones as $ext) { |
| 535 | 535 | $fsext0 = new fs_extension($ext); |
| 536 | 536 | if (!$fsext0->delete()) { |
| 537 | - $this->new_error_msg('Imposible eliminar los datos de la extensión ' . $ext['name'] . '.'); |
|
| 537 | + $this->new_error_msg('Imposible eliminar los datos de la extensión '.$ext['name'].'.'); |
|
| 538 | 538 | } |
| 539 | 539 | } |
| 540 | 540 | |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | foreach ($extensiones2 as $ext) { |
| 572 | 572 | $fsext0 = new fs_extension($ext); |
| 573 | 573 | if (!$fsext0->save()) { |
| 574 | - $this->new_error_msg('Imposible guardar los datos de la extensión ' . $ext['name'] . '.'); |
|
| 574 | + $this->new_error_msg('Imposible guardar los datos de la extensión '.$ext['name'].'.'); |
|
| 575 | 575 | } |
| 576 | 576 | } |
| 577 | 577 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $this->cliente_data = $this->cliente->get($this->residente->codcliente); |
| 77 | 77 | $this->cliente_data->codcontacto = ''; |
| 78 | 78 | |
| 79 | - if(class_exists('contacto_cliente')) { |
|
| 79 | + if (class_exists('contacto_cliente')) { |
|
| 80 | 80 | $concli = new contacto_cliente(); |
| 81 | 81 | $infoCRM = $concli->all_from_cliente($this->residente->codcliente); |
| 82 | 82 | $this->cliente_data->codcontacto = $infoCRM[0]->codcontacto; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $this->informacionResidente(); |
| 93 | 93 | |
| 94 | - } else { |
|
| 94 | + }else { |
|
| 95 | 95 | $this->new_error_msg('Residente no encontrado.'); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | if (\filter_input(INPUT_GET, 'id')) { |
| 102 | 102 | return $this->residente->url(); |
| 103 | - } else |
|
| 103 | + }else |
|
| 104 | 104 | return parent::url(); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | public function informacionResidente() |
| 108 | 108 | { |
| 109 | - $this->page->title = 'Residente ' . $this->residente->nombre; |
|
| 109 | + $this->page->title = 'Residente '.$this->residente->nombre; |
|
| 110 | 110 | $factura = new factura_cliente(); |
| 111 | 111 | $facts = $factura->all_from_cliente($this->residente->codcliente); |
| 112 | 112 | $this->facturas = array(); |
@@ -116,10 +116,10 @@ discard block |
||
| 116 | 116 | $fac->referencias = ""; |
| 117 | 117 | foreach ($fac->get_lineas() as $linea) { |
| 118 | 118 | if ($linea->referencia) { |
| 119 | - $fac->referencias .= $linea->referencia . " "; |
|
| 119 | + $fac->referencias .= $linea->referencia." "; |
|
| 120 | 120 | $this->validarArticulos($articulos_cobrados, $fac, $linea); |
| 121 | - } else { |
|
| 122 | - $fac->referencias .= $linea->descripcion . " "; |
|
| 121 | + }else { |
|
| 122 | + $fac->referencias .= $linea->descripcion." "; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | $this->facturas[] = $fac; |
@@ -129,13 +129,13 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | public function validarArticulos(&$articulos_cobrados, &$fac, &$linea) |
| 131 | 131 | { |
| 132 | - if(!$fac->idfacturarect) { |
|
| 132 | + if (!$fac->idfacturarect) { |
|
| 133 | 133 | $rectificativas = $fac->get_rectificativas(); |
| 134 | 134 | $articulosDevueltos = array(); |
| 135 | 135 | |
| 136 | 136 | $this->validarDevoluciones($articulosDevueltos, $rectificativas); |
| 137 | 137 | |
| 138 | - if(!isset($articulosDevueltos[$linea->referencia])) { |
|
| 138 | + if (!isset($articulosDevueltos[$linea->referencia])) { |
|
| 139 | 139 | $articulos_cobrados[$linea->referencia] = 1; |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -143,9 +143,9 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | public function validarDevoluciones(&$articulosDevueltos, $rectificativas) |
| 145 | 145 | { |
| 146 | - foreach($rectificativas as $rectificativa) { |
|
| 146 | + foreach ($rectificativas as $rectificativa) { |
|
| 147 | 147 | $lineas_r = $rectificativa->get_lineas(); |
| 148 | - foreach($lineas_r as $linea_r) { |
|
| 148 | + foreach ($lineas_r as $linea_r) { |
|
| 149 | 149 | $articulosDevueltos[$linea_r->referencia] = 1; |
| 150 | 150 | } |
| 151 | 151 | } |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | public function generarArticulosCobrables($articulos_cobrados) |
| 155 | 155 | { |
| 156 | - foreach($this->familia->get_articulos(0, 1000) as $art) { |
|
| 157 | - if(!isset($articulos_cobrados[$art->referencia]) AND $art->bloqueado == 0) { |
|
| 156 | + foreach ($this->familia->get_articulos(0, 1000) as $art) { |
|
| 157 | + if (!isset($articulos_cobrados[$art->referencia]) AND $art->bloqueado == 0) { |
|
| 158 | 158 | $this->articulos_cobrables[] = $art; |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -182,10 +182,10 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $this->totalFactura($factura); |
| 184 | 184 | |
| 185 | - } else { |
|
| 185 | + }else { |
|
| 186 | 186 | $this->new_error_msg('Imposible guardar la factura.'); |
| 187 | 187 | } |
| 188 | - } else { |
|
| 188 | + }else { |
|
| 189 | 189 | $this->new_error_msg('Cliente no encontrado.'); |
| 190 | 190 | } |
| 191 | 191 | } |
@@ -250,15 +250,15 @@ discard block |
||
| 250 | 250 | $art0 = new articulo(); |
| 251 | 251 | $lineas = \filter_input(INPUT_POST, 'numlineas'); |
| 252 | 252 | for ($x = 0; $x < $lineas; $x++) { |
| 253 | - $referencia = \filter_input(INPUT_POST, 'referencia_' . $x); |
|
| 254 | - $importe = \filter_input(INPUT_POST, 'importe_' . $x); |
|
| 255 | - $impuesto = \filter_input(INPUT_POST, 'impuesto_' . $x); |
|
| 253 | + $referencia = \filter_input(INPUT_POST, 'referencia_'.$x); |
|
| 254 | + $importe = \filter_input(INPUT_POST, 'importe_'.$x); |
|
| 255 | + $impuesto = \filter_input(INPUT_POST, 'impuesto_'.$x); |
|
| 256 | 256 | $art = $art0->get($referencia); |
| 257 | 257 | if (floatval($importe)) { |
| 258 | 258 | $linea = new linea_factura_cliente(); |
| 259 | 259 | $linea->idfactura = $factura->idfactura; |
| 260 | 260 | $linea->referencia = $referencia; |
| 261 | - $linea->descripcion = ($art) ? $art->descripcion : $referencia . ' Articulo libre'; |
|
| 261 | + $linea->descripcion = ($art) ? $art->descripcion : $referencia.' Articulo libre'; |
|
| 262 | 262 | $linea->cantidad = 1; |
| 263 | 263 | $imp = $this->impuesto->get($impuesto); |
| 264 | 264 | if ($imp) { |
@@ -278,19 +278,19 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | private function lineasLibresFactura(&$factura, $linea_nombre) |
| 280 | 280 | { |
| 281 | - if (\filter_input(INPUT_POST,'desc_'.$linea_nombre) != '') { |
|
| 281 | + if (\filter_input(INPUT_POST, 'desc_'.$linea_nombre) != '') { |
|
| 282 | 282 | $art0 = new articulo(); |
| 283 | 283 | $linea = new linea_factura_cliente(); |
| 284 | 284 | $linea->idfactura = $factura->idfactura; |
| 285 | - $linea->descripcion = \filter_input(INPUT_POST,'desc_'.$linea_nombre); |
|
| 285 | + $linea->descripcion = \filter_input(INPUT_POST, 'desc_'.$linea_nombre); |
|
| 286 | 286 | $linea->cantidad = 1; |
| 287 | - $imp = $this->impuesto->get(\filter_input(INPUT_POST,'impuesto_'.$linea_nombre)); |
|
| 287 | + $imp = $this->impuesto->get(\filter_input(INPUT_POST, 'impuesto_'.$linea_nombre)); |
|
| 288 | 288 | if ($imp) { |
| 289 | 289 | $linea->codimpuesto = $imp->codimpuesto; |
| 290 | 290 | $linea->iva = $imp->iva; |
| 291 | - $linea->pvpsindto = $linea->pvptotal = $linea->pvpunitario = (100 * floatval(\filter_input(INPUT_POST,$linea_nombre))) / (100 + $imp->iva); |
|
| 291 | + $linea->pvpsindto = $linea->pvptotal = $linea->pvpunitario = (100 * floatval(\filter_input(INPUT_POST, $linea_nombre))) / (100 + $imp->iva); |
|
| 292 | 292 | |
| 293 | - $articulo = (\filter_input(INPUT_POST,'ref_'.$linea_nombre))?$art0->get(\filter_input(INPUT_POST,'ref_'.$linea_nombre)):''; |
|
| 293 | + $articulo = (\filter_input(INPUT_POST, 'ref_'.$linea_nombre)) ? $art0->get(\filter_input(INPUT_POST, 'ref_'.$linea_nombre)) : ''; |
|
| 294 | 294 | if ($articulo !== '') { |
| 295 | 295 | $linea->referencia = $articulo->referencia; |
| 296 | 296 | $articulo->sum_stock($this->empresa->codalmacen, -1); |
@@ -314,17 +314,17 @@ discard block |
||
| 314 | 314 | $factura->total = $factura->neto + $factura->totaliva - $factura->totalirpf + $factura->totalrecargo; |
| 315 | 315 | |
| 316 | 316 | if (abs(floatval(\filter_input(INPUT_POST, 'total_importe')) - $factura->total) > .01) { |
| 317 | - $this->new_error_msg("El total difiere entre la vista y el controlador (" . \filter_input(INPUT_POST,'total_importe') . |
|
| 318 | - " frente a " . $factura->total . "). Debes informar del error."); |
|
| 317 | + $this->new_error_msg("El total difiere entre la vista y el controlador (".\filter_input(INPUT_POST, 'total_importe'). |
|
| 318 | + " frente a ".$factura->total."). Debes informar del error."); |
|
| 319 | 319 | $factura->delete(); |
| 320 | - } else if ($factura->save()) { |
|
| 320 | + }else if ($factura->save()) { |
|
| 321 | 321 | $this->generar_asiento($factura); |
| 322 | 322 | /// Función de ejecución de tareas post guardado correcto de la factura |
| 323 | 323 | fs_documento_post_save($factura); |
| 324 | - $this->new_message("<a href='" . $factura->url() . "'>Factura</a> guardada correctamente."); |
|
| 325 | - $this->new_change('Factura Cliente ' . $factura->codigo, $factura->url(), TRUE); |
|
| 326 | - } else { |
|
| 327 | - $this->new_error_msg("¡Imposible actualizar la <a href='" . $factura->url() . "'>Factura</a>!"); |
|
| 324 | + $this->new_message("<a href='".$factura->url()."'>Factura</a> guardada correctamente."); |
|
| 325 | + $this->new_change('Factura Cliente '.$factura->codigo, $factura->url(), TRUE); |
|
| 326 | + }else { |
|
| 327 | + $this->new_error_msg("¡Imposible actualizar la <a href='".$factura->url()."'>Factura</a>!"); |
|
| 328 | 328 | } |
| 329 | 329 | } |
| 330 | 330 | |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | if ($this->empresa->contintegrada) { |
| 337 | 337 | $asiento_factura = new asiento_factura(); |
| 338 | 338 | $asiento_factura->generar_asiento_venta($factura); |
| 339 | - } else { |
|
| 339 | + }else { |
|
| 340 | 340 | /// de todas formas forzamos la generación de las líneas de iva |
| 341 | 341 | $factura->get_lineas_iva(); |
| 342 | 342 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $accion_p = \filter_input(INPUT_POST, 'accion'); |
| 47 | 47 | $accion_g = \filter_input(INPUT_GET, 'accion'); |
| 48 | - $accion = ($accion_p)?$accion_p:$accion_g; |
|
| 48 | + $accion = ($accion_p) ? $accion_p : $accion_g; |
|
| 49 | 49 | if ($accion === 'agregar_base') { |
| 50 | 50 | $this->agregar($this->padre); |
| 51 | 51 | } elseif ($accion === 'agregar_hijo') { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | if ($estructura->tiene_hijos()) { |
| 59 | 59 | $this->new_error_msg('Esta estructura tiene edificaciones internas, '. |
| 60 | 60 | 'primero debe eliminarlas para eliminar esta.'); |
| 61 | - } else { |
|
| 61 | + }else { |
|
| 62 | 62 | try { |
| 63 | 63 | $estructura->delete(); |
| 64 | 64 | $this->new_message('Edificación eliminada correctamente.'); |
@@ -92,15 +92,15 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $inicio = \filter_input(INPUT_POST, 'inicio'); |
| 94 | 94 | $final_p = \filter_input(INPUT_POST, 'final'); |
| 95 | - $final=(!empty($final_p))?$final_p:$inicio; |
|
| 95 | + $final = (!empty($final_p)) ? $final_p : $inicio; |
|
| 96 | 96 | $inmuebles = 0; |
| 97 | 97 | $error = 0; |
| 98 | 98 | $linea = 0; |
| 99 | 99 | if ($inicio == $final) { |
| 100 | 100 | $this->edificacion($inicio, $inmuebles, $error, $objeto); |
| 101 | 101 | $linea++; |
| 102 | - } else { |
|
| 103 | - foreach (range($inicio,$final) as $item) { |
|
| 102 | + }else { |
|
| 103 | + foreach (range($inicio, $final) as $item) { |
|
| 104 | 104 | $this->edificacion($item, $inmuebles, $error, $objeto); |
| 105 | 105 | $linea++; |
| 106 | 106 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $id = \filter_input(INPUT_POST, 'id'); |
| 117 | 117 | $codigo_padre = \filter_input(INPUT_POST, 'codigo_padre'); |
| 118 | 118 | $padre_id = \filter_input(INPUT_POST, 'padre_id'); |
| 119 | - $item = (is_int($i))?str_pad($i, 3, "0", STR_PAD_LEFT):$i; |
|
| 119 | + $item = (is_int($i)) ?str_pad($i, 3, "0", STR_PAD_LEFT) : $i; |
|
| 120 | 120 | $punto = new residentes_edificaciones_mapa(); |
| 121 | 121 | $punto->id = $id; |
| 122 | 122 | $punto->id_tipo = $objeto->id; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $punto->numero = ''; |
| 128 | 128 | if ($punto->save()) { |
| 129 | 129 | $inmuebles++; |
| 130 | - } else { |
|
| 130 | + }else { |
|
| 131 | 131 | $error++; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -75,10 +75,10 @@ discard block |
||
| 75 | 75 | $inq->fecha_ocupacion = null; |
| 76 | 76 | if ($inq->save()) { |
| 77 | 77 | $this->new_message('Inquilino removido correctamente.'); |
| 78 | - } else { |
|
| 78 | + }else { |
|
| 79 | 79 | $this->new_error_msg('Error al remover el inquilino.'); |
| 80 | 80 | } |
| 81 | - } else { |
|
| 81 | + }else { |
|
| 82 | 82 | $this->new_error_msg('Inquilino no encontrado.'); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -188,22 +188,22 @@ discard block |
||
| 188 | 188 | public function buscar_residentes($param) |
| 189 | 189 | { |
| 190 | 190 | if (is_numeric($param)) { |
| 191 | - $where = "(r.codcliente LIKE '%" . $param . "%'" |
|
| 192 | - . " OR c.cifnif LIKE '%" . $param . "%'" |
|
| 193 | - . " OR c.telefono1 LIKE '" . $param . "%'" |
|
| 194 | - . " OR c.telefono2 LIKE '" . $param . "%'" |
|
| 195 | - . " OR ca_telefono LIKE '" . $param . "%'" |
|
| 196 | - . " OR r.observaciones LIKE '%" . $param . "%')"; |
|
| 197 | - } else { |
|
| 191 | + $where = "(r.codcliente LIKE '%".$param."%'" |
|
| 192 | + . " OR c.cifnif LIKE '%".$param."%'" |
|
| 193 | + . " OR c.telefono1 LIKE '".$param."%'" |
|
| 194 | + . " OR c.telefono2 LIKE '".$param."%'" |
|
| 195 | + . " OR ca_telefono LIKE '".$param."%'" |
|
| 196 | + . " OR r.observaciones LIKE '%".$param."%')"; |
|
| 197 | + }else { |
|
| 198 | 198 | $buscar = str_replace(' ', '%', $param); |
| 199 | - $where = "(lower(nombre) LIKE '%" . $buscar . "%'" |
|
| 200 | - . " OR lower(razonsocial) LIKE '%" . $buscar . "%'" |
|
| 201 | - . " OR lower(ca_apellidos) LIKE '%" . $buscar . "%'" |
|
| 202 | - . " OR lower(ca_nombres) LIKE '%" . $buscar . "%'" |
|
| 203 | - . " OR lower(cifnif) LIKE '%" . $buscar . "%'" |
|
| 204 | - . " OR lower(observaciones) LIKE '%" . $buscar . "%'" |
|
| 205 | - . " OR lower(ca_email) LIKE '%" . $buscar . "%'" |
|
| 206 | - . " OR lower(email) LIKE '%" . $buscar . "%')"; |
|
| 199 | + $where = "(lower(nombre) LIKE '%".$buscar."%'" |
|
| 200 | + . " OR lower(razonsocial) LIKE '%".$buscar."%'" |
|
| 201 | + . " OR lower(ca_apellidos) LIKE '%".$buscar."%'" |
|
| 202 | + . " OR lower(ca_nombres) LIKE '%".$buscar."%'" |
|
| 203 | + . " OR lower(cifnif) LIKE '%".$buscar."%'" |
|
| 204 | + . " OR lower(observaciones) LIKE '%".$buscar."%'" |
|
| 205 | + . " OR lower(ca_email) LIKE '%".$buscar."%'" |
|
| 206 | + . " OR lower(email) LIKE '%".$buscar."%')"; |
|
| 207 | 207 | } |
| 208 | 208 | return $where; |
| 209 | 209 | } |
@@ -211,14 +211,14 @@ discard block |
||
| 211 | 211 | public function buscar_inmuebles($param) |
| 212 | 212 | { |
| 213 | 213 | if (is_numeric($param)) { |
| 214 | - $where = " r.codigo LIKE '%" . $param . "%'" |
|
| 215 | - . " OR r.numero LIKE '%" . $param . "%'" |
|
| 216 | - . " OR CONCAT(r.codigo, r.numero) LIKE '%" . $param . "%'"; |
|
| 217 | - } else { |
|
| 214 | + $where = " r.codigo LIKE '%".$param."%'" |
|
| 215 | + . " OR r.numero LIKE '%".$param."%'" |
|
| 216 | + . " OR CONCAT(r.codigo, r.numero) LIKE '%".$param."%'"; |
|
| 217 | + }else { |
|
| 218 | 218 | $buscar = str_replace(' ', '%', $param); |
| 219 | - $where = " lower(r.codigo) LIKE '%" . $buscar . "%'" |
|
| 220 | - . " OR lower(r.numero) LIKE '%" . $buscar . "%'" |
|
| 221 | - . " OR CONCAT(lower(r.codigo), r.numero) LIKE '%" . $param . "%'"; |
|
| 219 | + $where = " lower(r.codigo) LIKE '%".$buscar."%'" |
|
| 220 | + . " OR lower(r.numero) LIKE '%".$buscar."%'" |
|
| 221 | + . " OR CONCAT(lower(r.codigo), r.numero) LIKE '%".$param."%'"; |
|
| 222 | 222 | } |
| 223 | 223 | return $where; |
| 224 | 224 | } |
@@ -226,19 +226,19 @@ discard block |
||
| 226 | 226 | public function buscar_vehiculos($param) |
| 227 | 227 | { |
| 228 | 228 | if (is_numeric($param)) { |
| 229 | - $where = "(r.codcliente LIKE '%" . $param . "%'" |
|
| 230 | - . " OR vehiculo_placa LIKE '%" . $param . "%'" |
|
| 231 | - . " OR CAST(idvehiculo AS CHAR) LIKE '" . $param . "%'" |
|
| 232 | - . " OR telefono2 LIKE '" . $param . "%'" |
|
| 233 | - . " OR observaciones LIKE '%" . $param . "%')"; |
|
| 234 | - } else { |
|
| 229 | + $where = "(r.codcliente LIKE '%".$param."%'" |
|
| 230 | + . " OR vehiculo_placa LIKE '%".$param."%'" |
|
| 231 | + . " OR CAST(idvehiculo AS CHAR) LIKE '".$param."%'" |
|
| 232 | + . " OR telefono2 LIKE '".$param."%'" |
|
| 233 | + . " OR observaciones LIKE '%".$param."%')"; |
|
| 234 | + }else { |
|
| 235 | 235 | $buscar = str_replace(' ', '%', $param); |
| 236 | - $where = "(lower(vehiculo_marca) LIKE '%" . $buscar . "%'" |
|
| 237 | - . " OR lower(vehiculo_modelo) LIKE '%" . $buscar . "%'" |
|
| 238 | - . " OR lower(vehiculo_color) LIKE '%" . $buscar . "%'" |
|
| 239 | - . " OR lower(vehiculo_placa) LIKE '%" . $buscar . "%'" |
|
| 240 | - . " OR lower(vehiculo_tipo) LIKE '%" . $buscar . "%'" |
|
| 241 | - . " OR lower(codigo_tarjeta) LIKE '%" . $buscar . "%')"; |
|
| 236 | + $where = "(lower(vehiculo_marca) LIKE '%".$buscar."%'" |
|
| 237 | + . " OR lower(vehiculo_modelo) LIKE '%".$buscar."%'" |
|
| 238 | + . " OR lower(vehiculo_color) LIKE '%".$buscar."%'" |
|
| 239 | + . " OR lower(vehiculo_placa) LIKE '%".$buscar."%'" |
|
| 240 | + . " OR lower(vehiculo_tipo) LIKE '%".$buscar."%'" |
|
| 241 | + . " OR lower(codigo_tarjeta) LIKE '%".$buscar."%')"; |
|
| 242 | 242 | } |
| 243 | 243 | return $where; |
| 244 | 244 | } |
@@ -257,13 +257,13 @@ discard block |
||
| 257 | 257 | $inmueble->ocupado = true; |
| 258 | 258 | $inmueble->codcliente = $codcliente; |
| 259 | 259 | $inmueble->iddireccion = $this->actualizar_direccion_residente($codcliente, $iddireccion, $nueva_direccion); |
| 260 | - $inmueble->fecha_ocupacion = ($fecha_ocupacion)?\date('Y-m-d', strtotime($fecha_ocupacion)):null; |
|
| 260 | + $inmueble->fecha_ocupacion = ($fecha_ocupacion) ?\date('Y-m-d', strtotime($fecha_ocupacion)) : null; |
|
| 261 | 261 | $inmueble->fecha_disponibilidad = ($fecha_disponibilidad) |
| 262 | 262 | ?\date('Y-m-d', strtotime($fecha_disponibilidad)) |
| 263 | 263 | :null; |
| 264 | 264 | if ($inmueble->save()) { |
| 265 | 265 | $this->new_message('Residente agregado exitosamente.'); |
| 266 | - } else { |
|
| 266 | + }else { |
|
| 267 | 267 | $this->new_error_msg('No se pudo agregar al residente confirme el nombre '. |
| 268 | 268 | 'del residente y las fechs de ocupación y disponibilidad'); |
| 269 | 269 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | $inmueble->fecha_disponibilidad = ''; |
| 276 | 276 | if ($inmueble->save()) { |
| 277 | 277 | $this->new_message('Residente removido exitosamente.'); |
| 278 | - } else { |
|
| 278 | + }else { |
|
| 279 | 279 | $this->new_error_msg('No se pudo remover al residente'); |
| 280 | 280 | } |
| 281 | 281 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | 'nombre' => $cli->nombre, |
| 311 | 311 | 'asignado' => true); |
| 312 | 312 | } |
| 313 | - } else { |
|
| 313 | + }else { |
|
| 314 | 314 | $json[$cli->codcliente] = array('value' => $cli->nombre, |
| 315 | 315 | 'data' => $cli->codcliente, |
| 316 | 316 | 'nombre' => $cli->nombre, |
@@ -367,13 +367,13 @@ discard block |
||
| 367 | 367 | |
| 368 | 368 | public function paginas() |
| 369 | 369 | { |
| 370 | - $url = $this->url() . "&query=" . $this->query |
|
| 371 | - . "&query_r=" . $this->query_r |
|
| 372 | - . "&query_v=" . $this->query_v |
|
| 373 | - . "&query_i=" . $this->query_i |
|
| 374 | - . "&orden=" . $this->order |
|
| 375 | - . "&deudores=" . $this->deudores |
|
| 376 | - . "&disponibles=" . $this->disponibles; |
|
| 370 | + $url = $this->url()."&query=".$this->query |
|
| 371 | + . "&query_r=".$this->query_r |
|
| 372 | + . "&query_v=".$this->query_v |
|
| 373 | + . "&query_i=".$this->query_i |
|
| 374 | + . "&orden=".$this->order |
|
| 375 | + . "&deudores=".$this->deudores |
|
| 376 | + . "&disponibles=".$this->disponibles; |
|
| 377 | 377 | |
| 378 | 378 | $paginas = array(); |
| 379 | 379 | $i = 0; |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | /// añadimos todas la página |
| 384 | 384 | while ($num < $this->total_resultados) { |
| 385 | 385 | $paginas[$i] = array( |
| 386 | - 'url' => $url . "&offset=" . ($i * FS_ITEM_LIMIT), |
|
| 386 | + 'url' => $url."&offset=".($i * FS_ITEM_LIMIT), |
|
| 387 | 387 | 'num' => $i + 1, |
| 388 | 388 | 'actual' => ($num === $this->offset) |
| 389 | 389 | ); |
@@ -398,20 +398,20 @@ discard block |
||
| 398 | 398 | |
| 399 | 399 | /// ahora descartamos |
| 400 | 400 | foreach ($paginas as $j => $value) { |
| 401 | - $enmedio = (int)($i / 2); |
|
| 401 | + $enmedio = (int) ($i / 2); |
|
| 402 | 402 | |
| 403 | 403 | /** |
| 404 | 404 | * descartamos todo excepto la primera, la última, la de enmedio, |
| 405 | 405 | * la actual, las 5 anteriores y las 5 siguientes |
| 406 | 406 | */ |
| 407 | - if (($j>1 && $j<$actual-5 && $j !== $enmedio) || ($j > $actual + 5 && $j < $i - 1 && $j !== $enmedio)) { |
|
| 407 | + if (($j > 1 && $j < $actual - 5 && $j !== $enmedio) || ($j > $actual + 5 && $j < $i - 1 && $j !== $enmedio)) { |
|
| 408 | 408 | unset($paginas[$j]); |
| 409 | 409 | } |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | if (count($paginas) > 1) { |
| 413 | 413 | return $paginas; |
| 414 | - } else { |
|
| 414 | + }else { |
|
| 415 | 415 | return array(); |
| 416 | 416 | } |
| 417 | 417 | } |
@@ -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 | } |