mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadidos todos los servicios a falta del solapas grandes (incluido plegado de guardas)
This commit is contained in:
@ -328,12 +328,12 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
$this->viewData['POD'] = $this->getPOD();
|
||||
|
||||
$this->viewData['serviciosAutomaticos'] = [
|
||||
'retractilado' => 3,
|
||||
'retractilado5' => 5,
|
||||
'ferro' => 24,
|
||||
'prototipo' => 9,
|
||||
'fajaColor' => 16,
|
||||
'plegadoGuardas' => 62,
|
||||
'retractilado' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_retractilado')->value,
|
||||
'retractilado5' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_retractilado5')->value,
|
||||
'ferro' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_ferro')->value,
|
||||
'prototipo' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_prototipo')->value,
|
||||
'plegado_guardas' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_plegado_guardas')->value,
|
||||
'solapas_grandes' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_plegado_exceso_solapas')->value,
|
||||
];
|
||||
|
||||
$this->viewData['tipo_impresion_id'] = $presupuestoEntity->tipo_impresion_id; // Cosido tapa blanda JJO
|
||||
@ -496,7 +496,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
$data['comparador']['json_data'] = json_decode($presupuesto->comparador_json_data, true);
|
||||
if ($data['comparador']['json_data'] != null) {
|
||||
foreach ($data['comparador']['json_data'] as &$item) {
|
||||
$item['papel_nombre'] = $modelPapelGenerico->getNombre($item['papel_id'])['nombre'];
|
||||
if(intval($item['papel_id'])>0)
|
||||
$item['papel_nombre'] = $modelPapelGenerico->getNombre($item['papel_id'])['nombre'];
|
||||
}
|
||||
}
|
||||
$data['comparador']['posPagColor'] = $presupuesto->comp_pos_paginas_color;
|
||||
@ -701,6 +702,10 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
$tipo_impresion_id = $this->request->getPost('tipo_impresion_id');
|
||||
$uso = $this->request->getPost('uso');
|
||||
|
||||
// cubierta y sobrecubierta siempre colorhq
|
||||
$isColor = true;
|
||||
$isHq = true;
|
||||
|
||||
// Para el caso de Fresado y Cosido tapa dura, las guardas son un diptico
|
||||
// y hay que imprimirlas como "cosido" (dos hojas pegadas). En el caso de espiral
|
||||
// o wire-o tapa dura, las guardas se imprimen como hojas sueltas
|
||||
|
||||
@ -2286,38 +2286,62 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
// Servicios
|
||||
|
||||
|
||||
/*
|
||||
'retractilado' => 3,
|
||||
'prototipo' => 9,
|
||||
*/
|
||||
|
||||
$serviciosAutomaticos = [];
|
||||
$servicios = [];
|
||||
|
||||
$servicio_ferro = (object) [
|
||||
'nombre' => 'ferro',
|
||||
'id' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_ferro')->value
|
||||
];
|
||||
$servicio_prototipo = (object) [
|
||||
'nombre' => 'prototipo',
|
||||
'id' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_prototipo')->value
|
||||
];
|
||||
$servicio_retractilado = (object) [
|
||||
'nombre' => 'retractilado',
|
||||
'id' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_retractilado')->value
|
||||
];
|
||||
$servicio_retractilado5 = (object) [
|
||||
'nombre' => 'retractilado5',
|
||||
'id' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_retractilado5')->value
|
||||
];
|
||||
$servicio_plegado_guardas = (object) [
|
||||
'nombre' => 'plegado_guardas',
|
||||
'id' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_plegado_guardas')->value
|
||||
];
|
||||
$servicio_solapas_grandes = (object) [
|
||||
'nombre' => 'solapas_grandes',
|
||||
'id' => model('App\Models\Configuracion\ConfigVariableModel')->getVariable('id_servicio_plegado_exceso_solapas')->value
|
||||
];
|
||||
|
||||
// se comprueba si $datos guardas es un array
|
||||
if (is_array($datos_guardas)) {
|
||||
if (count($datos_guardas) > 0) {
|
||||
array_push($servicios, 62); // Plegado de guardas
|
||||
array_push($servicios, $servicio_plegado_guardas); // Plegado de guardas
|
||||
}
|
||||
} else {
|
||||
if ($datos_guardas > 0) {
|
||||
array_push($servicios, 62); // Plegado de guardas
|
||||
array_push($servicios, $servicio_plegado_guardas); // Plegado de guardas
|
||||
}
|
||||
}
|
||||
|
||||
if ($datos_entrada['servicios']['retractilado']) // acabado
|
||||
array_push($servicios, 3);
|
||||
array_push($servicios, $servicio_retractilado);
|
||||
if ($datos_entrada['servicios']['retractilado5']) // acabado
|
||||
array_push($servicios, 98);
|
||||
array_push($servicios, $servicio_retractilado5);
|
||||
if ($datos_entrada['servicios']['prototipo']) // extra
|
||||
array_push($servicios, 9);
|
||||
array_push($servicios, $servicio_prototipo);
|
||||
if ($datos_entrada['servicios']['ferro']) // extra
|
||||
array_push($servicios, 30);
|
||||
array_push($servicios, $servicio_ferro);
|
||||
/*if ($datos_entrada['servicios']['ferroDigital'])
|
||||
array_push($servicios, 29);*/ // Es gratis
|
||||
foreach ($servicios as $servicio) {
|
||||
|
||||
if (intval($servicio) == 3 || intval($servicio) == 98) {
|
||||
if ($servicio->nombre == "retractilado" || $servicio->nombre == "retractilado5") {
|
||||
// Servicios acabado
|
||||
$resultado = PresupuestoCLienteService::getServiciosAcabados([
|
||||
'tarifa_id' => $servicio,
|
||||
'tarifa_id' => intval($servicio->id),
|
||||
'tirada' => $datosPedido->tirada,
|
||||
'POD' => $POD,
|
||||
]);
|
||||
@ -2345,10 +2369,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$totalServicios += floatval($resultado[0]->total);
|
||||
$margenServicios += floatval($resultado[0]->total) * floatval($resultado[0]->margen) / 100.0;
|
||||
}
|
||||
} else if (intval($servicio) == 9 || intval($servicio) == 30 || intval($servicio) == 29) {
|
||||
} else if ($servicio->nombre == "ferro" || $servicio->nombre == "prototipo") {
|
||||
// Extra
|
||||
$resultado = PresupuestoCLienteService::getServiciosExtra([
|
||||
'tarifa_id' => $servicio,
|
||||
'tarifa_id' => intval($servicio->id),
|
||||
]);
|
||||
array_push($serviciosAutomaticos, $resultado[0]);
|
||||
if ($resultado[0]->precio <= 0) {
|
||||
@ -2385,7 +2409,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
|
||||
// Servicios acabado
|
||||
$resultado = PresupuestoCLienteService::getServiciosManipulado([
|
||||
'tarifa_id' => 73,
|
||||
'tarifa_id' => intval($servicio_solapas_grandes->id),
|
||||
'tirada' => $datosPedido->tirada,
|
||||
'POD' => $POD,
|
||||
]);
|
||||
|
||||
@ -115,7 +115,7 @@ class Presupuestomanipulados extends \App\Controllers\BaseResourceController
|
||||
|
||||
if (count($datos_tarifas) > 0) {
|
||||
foreach ($datos_tarifas as $tarifa) {
|
||||
$values = $model->getPrecioTarifa($tarifa['tarifa_id'], $tirada, $POD);
|
||||
$values = $model->getPrecioTarifa($tarifa, $tirada, $POD);
|
||||
$values[0]->cubierta = $tarifa['cubierta'] ?? 0;
|
||||
$values[0]->sobrecubierta = $tarifa['sobrecubierta'] ?? 0;
|
||||
array_push($result, $values[0]);
|
||||
|
||||
Reference in New Issue
Block a user