mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglados problemas al confirmar con direcciones. También se ha arreglado un problema al generar el resumen
This commit is contained in:
@ -974,13 +974,15 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$this->guardarLineaPresupuesto($id, $resultado_presupuesto['info']['guardas']);
|
||||
|
||||
// Servicios
|
||||
if (intval($sobrecubierta['acabado']) > 0) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(intval($sobrecubierta['acabado']), intval($selected_tirada), -1, $POD);
|
||||
if ($sobrecubierta) {
|
||||
if (intval($sobrecubierta['acabado']) > 0) {
|
||||
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||
$servicio = $model->getPrecioTarifa(intval($sobrecubierta['acabado']), intval($selected_tirada), -1, $POD);
|
||||
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
$this->guardarServicio($id, $servicio[0], 'acabado', false, true);
|
||||
if (count($servicio) > 0) {
|
||||
if ($servicio[0]->total > 0) {
|
||||
$this->guardarServicio($id, $servicio[0], 'acabado', false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2431,16 +2433,16 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
foreach ($data as $linea) {
|
||||
if ($linea->tipo == 'lp_bn' || $linea->tipo == 'lp_bnhq' || $linea->tipo == 'lp_rot_bn') {
|
||||
$return_data['interior']['negro']['tipo'] = $linea->tipo == 'lp_bn' || $linea->tipo == 'lp_rot_bn' ? 'negroEstandar' : 'negroPremium';
|
||||
$return_data['interior']['negro']['papel'] = $modelPapelGenerico->getCodeFromId($linea->papel_id);
|
||||
$return_data['interior']['negro']['papel'] = $modelPapelGenerico->getNombre($linea->papel_id);
|
||||
$return_data['interior']['negro']['papel']['id'] = $linea->papel_id;
|
||||
$return_data['interior']['negro']['gramaje'] = $linea->gramaje;
|
||||
} else if ($linea->tipo == 'lp_color' || $linea->tipo == 'lp_colorhq' || $linea->tipo == 'lp_rot_color') {
|
||||
$return_data['interior']['color']['tipo'] = $linea->tipo == 'lp_color' || $linea->tipo == 'lp_rot_color' ? 'colorEstandar' : 'colorPremium';
|
||||
$return_data['interior']['color']['papel'] = $modelPapelGenerico->getCodeFromId($linea->papel_id);
|
||||
$return_data['interior']['color']['papel'] = $modelPapelGenerico->getNombre($linea->papel_id);
|
||||
$return_data['interior']['color']['papel']['id'] = $linea->papel_id;
|
||||
$return_data['interior']['color']['gramaje'] = $linea->gramaje;
|
||||
} else if ($linea->tipo == 'lp_cubierta') {
|
||||
$return_data['cubierta']['papel'] = $modelPapelGenerico->getCodeFromId($linea->papel_id);
|
||||
$return_data['cubierta']['papel'] = $modelPapelGenerico->getNombre($linea->papel_id);
|
||||
$return_data['cubierta']['papel']['id'] = $linea->papel_id;
|
||||
$return_data['cubierta']['gramaje'] = $linea->gramaje;
|
||||
$return_data['cubierta']['paginas'] = $linea->paginas;
|
||||
@ -2449,7 +2451,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$return_data['sobrecubierta']['gramaje'] = $linea->gramaje;
|
||||
$return_data['sobrecubierta']['paginas'] = $linea->paginas;
|
||||
} else if ($linea->tipo == 'lp_guardas') {
|
||||
$return_data['guardas']['papel'] = $modelPapelGenerico->getCodeFromId($linea->papel_id);
|
||||
$return_data['guardas']['papel'] = $modelPapelGenerico->getNombre($linea->papel_id);
|
||||
$return_data['guardas']['gramaje'] = $linea->gramaje;
|
||||
$return_data['guardas']['paginas'] = $linea->paginas;
|
||||
}
|
||||
|
||||
@ -94,6 +94,20 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getNombre($id = 0)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.nombre AS nombre"
|
||||
)
|
||||
->where("t1.id", $id)
|
||||
->where("t1.is_deleted", 0);
|
||||
$data = $builder->get()->getFirstRow();
|
||||
// se convierte a de stdClass a array
|
||||
$data = json_decode(json_encode($data), true);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get resource data.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div id="loader" class="modal modal-transparent" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
<div id="loader" class="modal modal-transparent" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" inert>
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
|
||||
Reference in New Issue
Block a user