@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->nueva_factura(); |
| 83 | 83 | } |
| 84 | 84 | $this->informacionResidente(); |
| 85 | - } else { |
|
| 85 | + }else { |
|
| 86 | 86 | $this->new_error_msg('Residente no encontrado.'); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function informacionResidente() |
| 99 | 99 | { |
| 100 | - $this->page->title = 'Residente ' . $this->residente->nombre; |
|
| 100 | + $this->page->title = 'Residente '.$this->residente->nombre; |
|
| 101 | 101 | $factura = new factura_cliente(); |
| 102 | 102 | $factura->all(); |
| 103 | 103 | $facts = $factura->all_desde('2001-01-01', date('Y-m-d'), null, null, $this->residente->codcliente, null); |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | $fac->referencias = ""; |
| 109 | 109 | foreach ($fac->get_lineas() as $linea) { |
| 110 | 110 | if ($linea->referencia) { |
| 111 | - $fac->referencias .= $linea->referencia . " "; |
|
| 111 | + $fac->referencias .= $linea->referencia." "; |
|
| 112 | 112 | $this->validarArticulos($articulos_cobrados, $fac, $linea); |
| 113 | - } else { |
|
| 114 | - $fac->referencias .= $linea->descripcion . " "; |
|
| 113 | + }else { |
|
| 114 | + $fac->referencias .= $linea->descripcion." "; |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | $this->facturas[] = $fac; |
@@ -173,10 +173,10 @@ discard block |
||
| 173 | 173 | $this->lineasLibresFactura($factura, 'otro2'); |
| 174 | 174 | |
| 175 | 175 | $this->totalFactura($factura); |
| 176 | - } else { |
|
| 176 | + }else { |
|
| 177 | 177 | $this->new_error_msg('Imposible guardar la factura.'); |
| 178 | 178 | } |
| 179 | - } else { |
|
| 179 | + }else { |
|
| 180 | 180 | $this->new_error_msg('Cliente no encontrado.'); |
| 181 | 181 | } |
| 182 | 182 | } |
@@ -241,15 +241,15 @@ discard block |
||
| 241 | 241 | $art0 = new articulo(); |
| 242 | 242 | $lineas = \filter_input(INPUT_POST, 'numlineas'); |
| 243 | 243 | for ($x = 0; $x < $lineas; $x++) { |
| 244 | - $referencia = \filter_input(INPUT_POST, 'referencia_' . $x); |
|
| 245 | - $importe = \filter_input(INPUT_POST, 'importe_' . $x); |
|
| 246 | - $impuesto = \filter_input(INPUT_POST, 'impuesto_' . $x); |
|
| 244 | + $referencia = \filter_input(INPUT_POST, 'referencia_'.$x); |
|
| 245 | + $importe = \filter_input(INPUT_POST, 'importe_'.$x); |
|
| 246 | + $impuesto = \filter_input(INPUT_POST, 'impuesto_'.$x); |
|
| 247 | 247 | $art = $art0->get($referencia); |
| 248 | - if ((float)$importe) { |
|
| 248 | + if ((float) $importe) { |
|
| 249 | 249 | $linea = new linea_factura_cliente(); |
| 250 | 250 | $linea->idfactura = $factura->idfactura; |
| 251 | 251 | $linea->referencia = $referencia; |
| 252 | - $linea->descripcion = ($art) ? $art->descripcion : $referencia . ' Articulo libre'; |
|
| 252 | + $linea->descripcion = ($art) ? $art->descripcion : $referencia.' Articulo libre'; |
|
| 253 | 253 | $linea->cantidad = 1; |
| 254 | 254 | $imp = $this->impuesto->get($impuesto); |
| 255 | 255 | if ($imp) { |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $linea->codimpuesto = $imp->codimpuesto; |
| 281 | 281 | $linea->iva = $imp->iva; |
| 282 | 282 | $linea->pvpsindto = $linea->pvptotal = $linea->pvpunitario = |
| 283 | - (100 * (float)\filter_input(INPUT_POST, $linea_nombre)) / (100 + $imp->iva); |
|
| 283 | + (100 * (float) \filter_input(INPUT_POST, $linea_nombre)) / (100 + $imp->iva); |
|
| 284 | 284 | |
| 285 | 285 | $articulo = (\filter_input(INPUT_POST, 'ref_'.$linea_nombre)) |
| 286 | 286 | ? $art0->get(\filter_input(INPUT_POST, 'ref_'.$linea_nombre)) |
@@ -306,19 +306,19 @@ discard block |
||
| 306 | 306 | $factura->totalrecargo = round($factura->totalrecargo, FS_NF0); |
| 307 | 307 | $factura->total = $factura->neto + $factura->totaliva - $factura->totalirpf + $factura->totalrecargo; |
| 308 | 308 | |
| 309 | - if (abs((float)(\filter_input(INPUT_POST, 'total_importe')) - $factura->total) > .01) { |
|
| 310 | - $this->new_error_msg("El total difiere entre la vista y el controlador (" . |
|
| 311 | - \filter_input(INPUT_POST, 'total_importe') . |
|
| 312 | - " frente a " . $factura->total . "). Debes informar del error."); |
|
| 309 | + if (abs((float) (\filter_input(INPUT_POST, 'total_importe')) - $factura->total) > .01) { |
|
| 310 | + $this->new_error_msg("El total difiere entre la vista y el controlador (". |
|
| 311 | + \filter_input(INPUT_POST, 'total_importe'). |
|
| 312 | + " frente a ".$factura->total."). Debes informar del error."); |
|
| 313 | 313 | $factura->delete(); |
| 314 | 314 | } elseif ($factura->save()) { |
| 315 | 315 | $this->generar_asiento($factura); |
| 316 | 316 | /// Función de ejecución de tareas post guardado correcto de la factura |
| 317 | 317 | fs_documento_post_save($factura); |
| 318 | - $this->new_message("<a href='" . $factura->url() . "'>Factura</a> guardada correctamente."); |
|
| 319 | - $this->new_change('Factura Cliente ' . $factura->codigo, $factura->url(), true); |
|
| 320 | - } else { |
|
| 321 | - $this->new_error_msg("¡Imposible actualizar la <a href='" . $factura->url() . "'>Factura</a>!"); |
|
| 318 | + $this->new_message("<a href='".$factura->url()."'>Factura</a> guardada correctamente."); |
|
| 319 | + $this->new_change('Factura Cliente '.$factura->codigo, $factura->url(), true); |
|
| 320 | + }else { |
|
| 321 | + $this->new_error_msg("¡Imposible actualizar la <a href='".$factura->url()."'>Factura</a>!"); |
|
| 322 | 322 | } |
| 323 | 323 | } |
| 324 | 324 | |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | if ($this->empresa->contintegrada) { |
| 332 | 332 | $asiento_factura = new asiento_factura(); |
| 333 | 333 | $asiento_factura->generar_asiento_venta($factura); |
| 334 | - } else { |
|
| 334 | + }else { |
|
| 335 | 335 | /// de todas formas forzamos la generación de las líneas de iva |
| 336 | 336 | $factura->get_lineas_iva(); |
| 337 | 337 | } |