Merge branch 'add/guardas_negro_hq' into 'main'

añadida posibilidad de guardas negrohq

See merge request jjimenez/safekat!541
This commit is contained in:
2025-02-11 18:03:40 +00:00
6 changed files with 37 additions and 10 deletions

View File

@ -720,8 +720,7 @@ 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;
// guardas siempre hq
$isHq = true;
// Para el caso de Fresado y Cosido tapa dura, las guardas son un diptico
@ -1096,6 +1095,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
$guardas = false;
if ($uso == 'guardas') {
$guardas = true;
$isColor = $this->request->getGet("isColor") ?? 1;
}
$rotativa = false;
if ($uso == 'rotativa') {

View File

@ -2247,7 +2247,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$input_data['datosPedido']->paginas_impresion = $datos_guardas['caras'] ?? 0;
$input_data['datosPedido']->solapas_ancho = 0;
$input_data['datosPedido']->solapas = 0;
$input_data['isColor'] = 1;
$input_data['isColor'] = $isColor;
$input_data['isHq'] = 1;
$input_data['uso'] = 'guardas';

View File

@ -152,7 +152,7 @@ class PapelGenericoModel extends \App\Models\BaseModel
$POD = false,
$ancho = 0,
$alto = 0,
$tirada = 0
$tirada = 0,
) {
/*
1.-> Tipo impresion

View File

@ -305,7 +305,7 @@ class PresupuestoAdminEdit {
if (self.cargandoPresupuesto == false) {
self.comparador.updateComparador();
//self.comparador.updateComparador();
// Ejecutar los pasos de forma secuencial si están habilitados
if (update_lineas) {

View File

@ -544,7 +544,7 @@ class Comparador {
this.gramajeSobrecubierta.setOption(datos.json_data.sobrecubierta.gramaje, datos.json_data.sobrecubierta.gramaje);
}
if (datos.json_data.guardas) {
this.carasGuardas.val(datos.json_data.guardas.paginas_impresion).trigger('change');
this.carasGuardas.val(datos.json_data.guardas.paginas).trigger('change');
this.papelGuardas.setOption(datos.json_data.guardas.papel_id, datos.json_data.guardas.papel_nombre);
this.gramajeGuardas.setOption(datos.json_data.guardas.gramaje, datos.json_data.guardas.gramaje);
}
@ -1023,8 +1023,10 @@ class Comparador {
}
}
if (!this.cargando)
if (!this.cargando){
$('#paginas').trigger('change');
this.updateComparador();
}
}
getDataForComp(uso = 'interior') {
@ -1891,7 +1893,7 @@ class Comparador {
try {
guardas_obj = {
"guardas": {
'paginas_impresion': $('#compCarasGuardas option:selected').val(),
'paginas': $('#compCarasGuardas option:selected').val(),
'papel_id': $('#compPapelGuardas').select2('data')[0].id,
'gramaje': $('#compGramajeGuardas').select2('data')[0].text.trim(),
},

View File

@ -1507,6 +1507,21 @@ class LineasPresupuesto {
if (linea == 'lp_bn' || linea == 'lp_bnhq' || linea == 'lp_rot_bn') {
color = 0;
}
else if(linea == 'lp_guardas'){
if(fromComparador){
color = $('#tipoImpresion').val().includes('color') ? 1 : 0;
}
else{
for (let i = 0; i < this.table.rows().data().length; i++) {
let row = this.table.row(i).data();
if (row.row_id == 'lp_color' || row.row_id == 'lp_colorhq' || row.row_id == 'lp_rot_color') {
color = 1;
break;
}
}
color = 0;
}
}
let hq = 1;
if (linea == 'lp_bn' || linea == 'lp_color' || linea == 'lp_rot_bn' || linea == 'lp_rot_color') {
hq = 0;
@ -1723,12 +1738,21 @@ class LineasPresupuesto {
tipo = 'color';
break;
case 'lp_colorhq':
case 'lp_guardas':
case 'lp_cubierta':
case 'lp_sobrecubierta':
case 'lp_faja':
tipo = 'colorhq';
break
case 'lp_guardas':
tipo = 'negrohq';
for (let i = 0; i < this.table.rows().data().length; i++) {
let row = this.table.row(i).data();
if (row.row_id == 'lp_color' || row.row_id == 'lp_colorhq' || row.row_id == 'lp_rot_color') {
tipo = 'colorhq';
break;
}
}
break;
default:
break;
}
@ -1789,7 +1813,7 @@ class LineasPresupuesto {
papel_impresion.init();
let merma = uso == 'interior' ? $('#merma').val() : $('#mermacubierta').val();
uso = ((uso == 'guardas') ? 'cubierta' : uso);
uso = ((uso == 'guardas') ? 'interior' : uso);
let maquinas = new ClassSelect($('#' + tipoLinea + '_maquina'),
'/presupuestoadmin/maquinas', 'Seleccione maquina', false,