@@ -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; |
@@ -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 = ''; |
@@ -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).", ". |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | if($this->db->exec($sql)){ |
| 95 | 95 | return true; |
| 96 | - }else{ |
|
| 96 | + } else{ |
|
| 97 | 97 | return false; |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -140,9 +140,9 @@ |
||
| 140 | 140 | $lista = array(); |
| 141 | 141 | if($data) { |
| 142 | 142 | foreach($data as $d) { |
| 143 | - $item = new residentes_facturacion_programada_edificaciones($d); |
|
| 144 | - $this->infoAdicional($item); |
|
| 145 | - $lista[] = $item; |
|
| 143 | + $item = new residentes_facturacion_programada_edificaciones($d); |
|
| 144 | + $this->infoAdicional($item); |
|
| 145 | + $lista[] = $item; |
|
| 146 | 146 | } |
| 147 | 147 | return $lista; |
| 148 | 148 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 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; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $this->var2str($this->procesado).");"; |
| 88 | 88 | if($this->db->exec($sql)){ |
| 89 | 89 | return true; |
| 90 | - }else{ |
|
| 90 | + } else{ |
|
| 91 | 91 | return false; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -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; |
@@ -44,7 +44,7 @@ discard block |
||
| 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; |
@@ -74,7 +74,7 @@ discard block |
||
| 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 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 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 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $data = $this->db->select($sql); |
| 99 | 99 | if($data){ |
| 100 | 100 | return new residentes_ayudas($data[0]); |
| 101 | - }else{ |
|
| 101 | + } else{ |
|
| 102 | 102 | return false; |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | public function exists() { |
| 107 | 107 | if(is_null($this->codigo)){ |
| 108 | 108 | return false; |
| 109 | - }else{ |
|
| 109 | + } else{ |
|
| 110 | 110 | return $this->get($this->codigo,$this->tipo); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -117,14 +117,14 @@ discard block |
||
| 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 | 125 | if($this->db->exec($sql)){ |
| 126 | 126 | return $this->db->lastval(); |
| 127 | - }else{ |
|
| 127 | + } else{ |
|
| 128 | 128 | return false; |
| 129 | 129 | } |
| 130 | 130 | } |
@@ -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 | } |
@@ -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 | */ |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | 'page_to' => __CLASS__, |
| 127 | 127 | 'type' => 'head', |
| 128 | 128 | 'text' => '<script src="' . |
| 129 | - FS_PATH . |
|
| 129 | + FS_PATH . |
|
| 130 | 130 | 'plugins/residentes/view/js/jsPDF/plugins/split_text_to_size.min.js" ' . |
| 131 | 131 | 'type="text/javascript"></script>', |
| 132 | 132 | 'params' => '' |
@@ -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 | ), |
@@ -311,7 +311,7 @@ |
||
| 311 | 311 | $listaReferencias = $this->filter_request_array('referencia'); |
| 312 | 312 | foreach ($listaReferencias as $referencia) { |
| 313 | 313 | $sql = "SELECT count(referencia) as facturado from lineasfacturascli where referencia = '".$referencia."' ". |
| 314 | - " AND idfactura IN (select idfactura from facturascli WHERE codcliente = '".$codcliente."');"; |
|
| 314 | + " AND idfactura IN (select idfactura from facturascli WHERE codcliente = '".$codcliente."');"; |
|
| 315 | 315 | $data = $this->db->select($sql); |
| 316 | 316 | if (!$data[0]['facturado']) { |
| 317 | 317 | $listaResidentes[$codcliente][] = $referencia; |
@@ -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); |
@@ -444,9 +444,9 @@ |
||
| 444 | 444 | echo json_encode($hijos, JSON_THROW_ON_ERROR); |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | - /** |
|
| 448 | - * funcion para guardar los codigos de las edificaciones base Manzana, Zona, Grupo, Edificio, etc |
|
| 449 | - */ |
|
| 447 | + /** |
|
| 448 | + * funcion para guardar los codigos de las edificaciones base Manzana, Zona, Grupo, Edificio, etc |
|
| 449 | + */ |
|
| 450 | 450 | public function agregar($objeto) |
| 451 | 451 | { |
| 452 | 452 | $inicio = \filter_input(INPUT_POST, 'inicio'); |
@@ -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 | } |
@@ -100,8 +100,9 @@ |
||
| 100 | 100 | { |
| 101 | 101 | if (\filter_input(INPUT_GET, 'id')) { |
| 102 | 102 | return $this->residente->url(); |
| 103 | - } else |
|
| 104 | - return parent::url(); |
|
| 103 | + } else { |
|
| 104 | + return parent::url(); |
|
| 105 | + } |
|
| 105 | 106 | } |
| 106 | 107 | |
| 107 | 108 | public function informacionResidente() |