arreglados problemas al confirmar con direcciones. También se ha arreglado un problema al generar el resumen

This commit is contained in:
2024-12-14 19:29:13 +01:00
parent 2b9de61864
commit e92179697b
8 changed files with 124 additions and 43 deletions

View File

@ -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;
}