mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en guardar presupuesto hasta las lineas de presupuesto
This commit is contained in:
@ -344,7 +344,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$this->viewData['acabadosSobrecubierta'] = $this->getAcabadosSobrecubierta();
|
$this->viewData['acabadosSobrecubierta'] = $this->getAcabadosSobrecubierta();
|
||||||
|
|
||||||
// Lineas Presupuesto
|
// Lineas Presupuesto
|
||||||
[$cambios_lineas, $this->viewData['lineasPresupuesto']] = $this->getLineasPresupuesto($presupuestoEntity);
|
[$cambios_lineas, $this->viewData['lineasPresupuesto']] = $this->loadLineasPresupuesto($presupuestoEntity);
|
||||||
$this->viewData['presupuestoEntity']->cambios_lineas = $cambios_lineas;
|
$this->viewData['presupuestoEntity']->cambios_lineas = $cambios_lineas;
|
||||||
|
|
||||||
// Servicios
|
// Servicios
|
||||||
@ -542,6 +542,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$data['comparador']['lomoRedondo'] = $presupuesto->lomo_redondo;
|
$data['comparador']['lomoRedondo'] = $presupuesto->lomo_redondo;
|
||||||
$data['comparador']['cabezada'] = $presupuesto->cabezada;
|
$data['comparador']['cabezada'] = $presupuesto->cabezada;
|
||||||
|
|
||||||
|
$data['lineasPresupuesto'] = $this->loadLineasPresupuesto($presupuesto);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@ -909,6 +911,11 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
'nombre' => $reqData['papel_generico'] ?? "",
|
'nombre' => $reqData['papel_generico'] ?? "",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if($papel_generico['id'] != 0 && $papel_generico['nombre'] == ""){
|
||||||
|
$modelPapelGenerico = new PapelGenericoModel();
|
||||||
|
$papel_generico['nombre'] = $modelPapelGenerico->getNombre($papel_generico['id'])['nombre'];
|
||||||
|
}
|
||||||
|
|
||||||
$gramaje = $reqData['gramaje'] ?? 0;
|
$gramaje = $reqData['gramaje'] ?? 0;
|
||||||
|
|
||||||
$cliente_id = $reqData['cliente_id'] ?? -1;
|
$cliente_id = $reqData['cliente_id'] ?? -1;
|
||||||
@ -1707,7 +1714,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
return model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
return model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getLineasPresupuesto($presupuestoEntity)
|
protected function loadLineasPresupuesto($presupuestoEntity)
|
||||||
{
|
{
|
||||||
$lineas = (new PresupuestoLineaModel())->getLineasPresupuesto($presupuestoEntity->id);
|
$lineas = (new PresupuestoLineaModel())->getLineasPresupuesto($presupuestoEntity->id);
|
||||||
|
|
||||||
|
|||||||
@ -330,8 +330,9 @@ class PresupuestoLineaModel extends \App\Models\BaseModel
|
|||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->select(
|
->select(
|
||||||
"*"
|
"*, t2.nombre AS papel_generico"
|
||||||
)
|
)
|
||||||
|
->join("lg_papel_generico t2", "t1.papel_id = t2.id", "left")
|
||||||
->where("t1.presupuesto_id", $presupuesto_id);
|
->where("t1.presupuesto_id", $presupuesto_id);
|
||||||
|
|
||||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -88,7 +88,7 @@ class PresupuestoAdminEdit {
|
|||||||
self.datosGenerales.cargarDatos(response.data.datosGenerales);
|
self.datosGenerales.cargarDatos(response.data.datosGenerales);
|
||||||
self.datosLibro.cargarDatos(response.data.datosLibro);
|
self.datosLibro.cargarDatos(response.data.datosLibro);
|
||||||
self.comparador.cargarDatos(response.data.comparador);
|
self.comparador.cargarDatos(response.data.comparador);
|
||||||
|
self.lineasPresupuesto.cargarDatos(response.data.lineasPresupuesto);
|
||||||
/*self.direcciones.handleChangeCliente();
|
/*self.direcciones.handleChangeCliente();
|
||||||
|
|
||||||
self.direcciones.cargarDatos(response.data.direcciones, response.data.datosGenerales);
|
self.direcciones.cargarDatos(response.data.direcciones, response.data.datosGenerales);
|
||||||
|
|||||||
@ -1000,7 +1000,7 @@ class Comparador {
|
|||||||
lomoTotal += parseFloat(rowData.lomo);
|
lomoTotal += parseFloat(rowData.lomo);
|
||||||
}
|
}
|
||||||
else if (tipo_lomo == 'cubierta') {
|
else if (tipo_lomo == 'cubierta') {
|
||||||
if (rowData.row_id == 'lp_cubierta')
|
if (rowData.tipo != 'lp_sobrecubierta')
|
||||||
lomoTotal += parseFloat(rowData.lomo);
|
lomoTotal += parseFloat(rowData.lomo);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user