mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminada cubierta sin acabados
This commit is contained in:
@ -630,6 +630,13 @@ class Presupuestocliente extends \App\Controllers\GoBaseResourceController
|
||||
**********************/
|
||||
protected function getLineasPresupuesto($reqData)
|
||||
{
|
||||
$error =(object)[
|
||||
'interior' => "",
|
||||
'cubierta' => "",
|
||||
'sobrecubierta' => "",
|
||||
'guardas' => "",
|
||||
];
|
||||
|
||||
$POD = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
|
||||
|
||||
$tirada = $reqData['tirada'] ?? 0;
|
||||
@ -678,10 +685,7 @@ class Presupuestocliente extends \App\Controllers\GoBaseResourceController
|
||||
}
|
||||
|
||||
if ($costeInterior <= 0) {
|
||||
return [
|
||||
'error' => lang('Presupuestos.errores.noInterior'),
|
||||
'precio_u' => 0,
|
||||
];
|
||||
$error->interior = lang('Presupuestos.errores.noInterior');
|
||||
}
|
||||
|
||||
// Si es POD hay que volver a calcular para incluir la merma correcta
|
||||
@ -705,12 +709,11 @@ class Presupuestocliente extends \App\Controllers\GoBaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
if ($costeInterior <= 0) {
|
||||
return [
|
||||
'error' => lang('Presupuestos.errores.noInterior'),
|
||||
'precio_u' => 0,
|
||||
];
|
||||
}
|
||||
if ($costeInterior <= 0)
|
||||
$error->interior = lang('Presupuestos.errores.noInterior');
|
||||
else
|
||||
$error->interior = "";
|
||||
|
||||
|
||||
// Cubierta
|
||||
$papel_generico = [
|
||||
@ -729,8 +732,19 @@ class Presupuestocliente extends \App\Controllers\GoBaseResourceController
|
||||
$input_data['uso'] = 'cubierta';
|
||||
|
||||
$cubierta = PresupuestoClienteService::obtenerCubierta($input_data);
|
||||
$coste_cubierta = 0.0;
|
||||
if (count($cubierta) > 0) {
|
||||
$coste_cubierta += floatval($cubierta['total_impresion']);
|
||||
}
|
||||
if($coste_cubierta <= 0)
|
||||
$error->cubierta = lang('Presupuestos.errores.noCubierta');
|
||||
else
|
||||
$error->cubierta = "";
|
||||
|
||||
return [
|
||||
'errors' => $error,
|
||||
'total_lp' => $costeInterior+$coste_cubierta,
|
||||
|
||||
'interior' => $interior,
|
||||
'cubierta' => $cubierta,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user