mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en la preview
This commit is contained in:
@ -662,6 +662,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function obtenerComparadorExteriores()
|
||||
{
|
||||
|
||||
@ -1721,7 +1722,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
$input_data = [];
|
||||
$input_data['presupuesto'] = $presupuestoEntity;
|
||||
|
||||
return PresupuestoService::checkLineasPresupuesto($input_data, $lineas);
|
||||
return [false, $lineas];
|
||||
}
|
||||
|
||||
protected function getLineasServicios($presupuestoEntity)
|
||||
|
||||
@ -308,7 +308,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[0],
|
||||
'merma' => $tirada[0] > $POD ? $this->calcular_merma($tirada[0], $POD) : 0,
|
||||
'merma' => $this->calcular_merma($tirada[0], $POD),
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
@ -1057,6 +1057,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datos_presupuesto['retractilado5'] = $retractilado5;
|
||||
$datos_presupuesto['entrega_taller'] = $reqData['entrega_taller'] ?? 0;
|
||||
|
||||
$resultado_presupuesto['info']['merma'] = $this->calcular_merma($selected_tirada, $POD);
|
||||
|
||||
$id = $model_presupuesto->insertarPresupuestoCliente(
|
||||
$id,
|
||||
$selected_tirada,
|
||||
@ -1074,17 +1076,17 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$this->borrarRelacionesPresupuesto($id);
|
||||
}
|
||||
|
||||
foreach ($resultado_presupuesto['info']['interior'] as $linea) {
|
||||
foreach ($resultado_presupuesto['values']['interior'] as $linea) {
|
||||
|
||||
if (count($linea) > 0)
|
||||
$this->guardarLineaPresupuesto($id, $linea);
|
||||
}
|
||||
if (count($resultado_presupuesto['info']['cubierta']) > 0)
|
||||
$this->guardarLineaPresupuesto($id, $resultado_presupuesto['info']['cubierta']);
|
||||
if (count($resultado_presupuesto['info']['sobrecubierta']) > 0)
|
||||
$this->guardarLineaPresupuesto($id, $resultado_presupuesto['info']['sobrecubierta']);
|
||||
if (count($resultado_presupuesto['info']['guardas']) > 0)
|
||||
$this->guardarLineaPresupuesto($id, $resultado_presupuesto['info']['guardas']);
|
||||
if (count($resultado_presupuesto['values']['cubierta']) > 0)
|
||||
$this->guardarLineaPresupuesto($id, $resultado_presupuesto['values']['cubierta']);
|
||||
if (count($resultado_presupuesto['values']['sobrecubierta']) > 0)
|
||||
$this->guardarLineaPresupuesto($id, $resultado_presupuesto['values']['sobrecubierta']);
|
||||
if (count($resultado_presupuesto['values']['guardas']) > 0)
|
||||
$this->guardarLineaPresupuesto($id, $resultado_presupuesto['values']['guardas']);
|
||||
|
||||
// Servicios
|
||||
if ($sobrecubierta) {
|
||||
@ -1110,13 +1112,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
}
|
||||
|
||||
}
|
||||
foreach ($resultado_presupuesto['info']['serviciosDefecto']['encuadernacion'] as $servicio) {
|
||||
foreach ($resultado_presupuesto['values']['serviciosDefecto']['encuadernacion'] as $servicio) {
|
||||
$this->guardarServicio($id, $servicio, 'encuadernacion');
|
||||
}
|
||||
foreach ($resultado_presupuesto['info']['serviciosDefecto']['manipulado'] as $servicio) {
|
||||
foreach ($resultado_presupuesto['values']['serviciosDefecto']['manipulado'] as $servicio) {
|
||||
$this->guardarServicio($id, $servicio, 'manipulado');
|
||||
}
|
||||
foreach ($resultado_presupuesto['info']['servicios_automaticos'] as $servicio) {
|
||||
foreach ($resultado_presupuesto['values']['servicios_automaticos'] as $servicio) {
|
||||
if ($servicio->tarifa_id == 3 || $servicio->tarifa_id == 5 || $servicio->tarifa_id == 16) {
|
||||
// Servicios acabado
|
||||
$this->guardarServicio($id, $servicio, 'acabado');
|
||||
@ -1638,7 +1640,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$datosPedido = (object) array(
|
||||
'paginas' => $paginas,
|
||||
'tirada' => $tirada[$t],
|
||||
'merma' => $tirada[$t] > $POD ? $this->calcular_merma($tirada[$t], $POD) : 0,
|
||||
'merma' => $this->calcular_merma($tirada[$t], $POD),
|
||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
||||
'isCosido' => $is_cosido,
|
||||
@ -2269,15 +2271,15 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$return_data['info'] = $info;
|
||||
|
||||
|
||||
if ($extra_info) { // && $tirada[$t] == $selected_tirada) {
|
||||
if ($extra_info && ($tirada[$t] == $selected_tirada)) {
|
||||
|
||||
$return_data['info']['interior'] = $interior;
|
||||
$return_data['info']['cubierta'] = $cubierta;
|
||||
$return_data['info']['sobrecubierta'] = $linea_sobrecubierta;
|
||||
$return_data['info']['guardas'] = $guardas;
|
||||
$return_data['info']['serviciosDefecto']['encuadernacion'] = $servDefectoEnc;
|
||||
$return_data['info']['serviciosDefecto']['manipulado'] = $servDefectoMan;
|
||||
$return_data['info']['servicios_automaticos'] = $serviciosAutomaticos;
|
||||
$return_data['values']['interior'] = $interior;
|
||||
$return_data['values']['cubierta'] = $cubierta;
|
||||
$return_data['values']['sobrecubierta'] = $linea_sobrecubierta;
|
||||
$return_data['values']['guardas'] = $guardas;
|
||||
$return_data['values']['serviciosDefecto']['encuadernacion'] = $servDefectoEnc;
|
||||
$return_data['values']['serviciosDefecto']['manipulado'] = $servDefectoMan;
|
||||
$return_data['values']['servicios_automaticos'] = $serviciosAutomaticos;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2392,7 +2394,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$merma = 0;
|
||||
|
||||
if ($tirada > $POD) {
|
||||
$merma = $tirada * 0.1 <= 30 ? $tirada * 0.1 : 30;
|
||||
$merma = $tirada * 0.1;
|
||||
} else {
|
||||
$merma_lineas = [];
|
||||
foreach ($formas_lineas_interior as $formas_linea) {
|
||||
|
||||
@ -196,6 +196,7 @@ return [
|
||||
'totalLinea' => 'TOTAL LÍNEA',
|
||||
'verCalculos' => 'Cálculos',
|
||||
'metrosMinuto' => 'Metros x min.',
|
||||
'clicksMinuto' => 'Clicks x min.',
|
||||
'resolucion' => 'Resolución (dpi)',
|
||||
'areaPaginas' => 'Área páginas (in)',
|
||||
'gotasNegro' => 'Nº gotas negro',
|
||||
|
||||
@ -557,7 +557,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
// -- SOBRECUBIERTA --
|
||||
if ($data['sobrecubierta']) {
|
||||
$values['sobrecubierta'] = array(
|
||||
'papel_id' => intval($data['sobrecubierta']['papel']),
|
||||
'papel_id' => intval($data['sobrecubierta']['papel']['id']),
|
||||
'gramaje' => intval($data['sobrecubierta']['gramaje']),
|
||||
'imprimir' => 1,
|
||||
);
|
||||
|
||||
@ -462,21 +462,21 @@ class PresupuestoService extends BaseService
|
||||
[$data['ancho'], $data['alto']] = PresupuestoService::calculoDimForma($datosPedido, $parametrosRotativa);
|
||||
|
||||
// calculo de papel y clicks
|
||||
$factor_anchura = round($maquina->ancho_impresion / $data['ancho'], 2);
|
||||
$factor_altura = round($maquina->alto_impresion / ($data['alto'] + self::MARGEN_PAGINAS_ROTATIVA), 2);
|
||||
$factor_altura_click = round($maquina->alto_click / ($data['alto'] + self::MARGEN_PAGINAS_ROTATIVA), 2);
|
||||
$factor_anchura = floor($maquina->ancho_impresion / $datosPedido->ancho);
|
||||
$factor_altura = round($maquina->alto_impresion / ($datosPedido->alto + self::MARGEN_PAGINAS_ROTATIVA), 2);
|
||||
$factor_altura_click = round($maquina->alto_click / ($datosPedido->alto + self::MARGEN_PAGINAS_ROTATIVA), 2);
|
||||
|
||||
if (floor($factor_anchura) == 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$multiplicador_pliego = $datosPedido->isCosido ? 4 : 2;
|
||||
$paginas_por_pliego = round(floor($factor_anchura) * $factor_altura * $multiplicador_pliego, 2);
|
||||
//$multiplicador_pliego = $datosPedido->isCosido ? 4 : 2;
|
||||
$paginas_por_pliego = round($factor_anchura * $factor_altura * 2 /** $multiplicador_pliego*/, 2);
|
||||
$pliegos_libro = round($paginas_por_pliego ? $datosPedido->paginas / $paginas_por_pliego : 0, 2);
|
||||
$metros_papel_libro = round($pliegos_libro * ($maquina->alto_impresion / 1000.0), 2);
|
||||
$metros_papel_total = round($metros_papel_libro * ($datosPedido->tirada + $datosPedido->merma), 2);
|
||||
|
||||
$paginas_por_pliego_click = round(floor($factor_anchura) * $factor_altura_click * $multiplicador_pliego, 2);
|
||||
$paginas_por_pliego_click = round($factor_anchura * $factor_altura_click * 2/** $multiplicador_pliego*/, 2);
|
||||
$pliegos_libro_click = round($paginas_por_pliego_click ? $datosPedido->paginas / $paginas_por_pliego_click : 0, 2);
|
||||
$clicks_libro = round(ceil($pliegos_libro_click) * 2, 2);
|
||||
$clicks_pedido = round($clicks_libro * ($datosPedido->tirada + $datosPedido->merma), 2);
|
||||
@ -843,7 +843,7 @@ class PresupuestoService extends BaseService
|
||||
$ancho_total = 0;
|
||||
$sangre_cubierta = self::SANGRE_FORMAS_CUBIERTA;
|
||||
if ($datosPedido->ancho >= 210) {
|
||||
$sangre_cubierta = 15;
|
||||
$sangre_cubierta = 10;
|
||||
}
|
||||
|
||||
if ($datosPedido) {
|
||||
@ -925,7 +925,7 @@ class PresupuestoService extends BaseService
|
||||
$alto_total = floatval($datosPedido->alto);
|
||||
$sangre_cubierta = self::SANGRE_FORMAS_CUBIERTA;
|
||||
if ($datosPedido->alto >= 297) {
|
||||
$sangre_cubierta = 15;
|
||||
$sangre_cubierta = 10;
|
||||
}
|
||||
// Tapa dura (cosido y fresado)
|
||||
if ($tipo_impresion_id == 1 || $tipo_impresion_id == 3) {
|
||||
|
||||
@ -1,370 +0,0 @@
|
||||
/***********************
|
||||
* Funcionamiento general de la página
|
||||
************************/
|
||||
function fill_lp_from_bbdd(){
|
||||
|
||||
window.lineasPresupuestoList.forEach(function(lp) {
|
||||
|
||||
const formas = JSON.parse(lp.formas)
|
||||
lp.dimensiones_maquina = [formas.maquina_ancho, formas.maquina_alto]
|
||||
lp.dimensiones_maquina_impresion = [formas.maquina_impresion_ancho, formas.maquina_impresion_alto]
|
||||
lp.num_formas = {
|
||||
value : formas.formas,
|
||||
num_formas_verticales : formas.formas_v,
|
||||
num_formas_horizontales : formas.formas_h,
|
||||
posicion_formas : formas.formas_orientacion
|
||||
}
|
||||
lp['tipo_maquina'] = lp['maquina_tipo']
|
||||
lp['precio_impresion_horas'] = lp['precio_impresion']
|
||||
lp['margen_impresion_horas'] = lp['margen_impresion']
|
||||
lp['precio_libro'] = lp['libro']
|
||||
lp['precio_pedido'] = lp['total_papel_pedido']
|
||||
lp['total_impresion'] = lp['total_linea']
|
||||
lp['precios_pliegos'] = lp['pliegos_precio']
|
||||
lp['papel_generico_id'] = lp['papel_id']
|
||||
|
||||
dateObj = new Date(lp['tiempo_maquina'] * 1000);
|
||||
hours = dateObj.getUTCHours();
|
||||
minutes = dateObj.getUTCMinutes();
|
||||
seconds = dateObj.getSeconds();
|
||||
lp['tiempo_maquina'] = hours.toString().padStart(2, '0') + ':' +
|
||||
minutes.toString().padStart(2, '0') + ':' +
|
||||
seconds.toString().padStart(2, '0');
|
||||
|
||||
if(lp.maquina_tipo=='inkjet'){
|
||||
|
||||
lp.datosTipologias = {
|
||||
negro: lp.rotativa_negro,
|
||||
cyan: lp.rotativa_cyan,
|
||||
magenta: lp.rotativa_magenta,
|
||||
amarillo: lp.rotativa_amarillo,
|
||||
cg: lp.rotativa_cg,
|
||||
gota_negro: lp.rotativa_gota_negro,
|
||||
gota_color: lp.rotativa_gota_color,
|
||||
}
|
||||
|
||||
lp['paginas_color'] = lp['rotativa_pag_color']
|
||||
|
||||
lp['totalImpresion'] = lp['rotativa_total_impresion']
|
||||
lp['a_favor_fibra'] = lp['rotativa_a_favor_fibra']
|
||||
|
||||
lp['resolucion'] = lp['rotativa_resolucion']
|
||||
lp['superficie'] = lp['rotativa_area_paginas']
|
||||
|
||||
lp['num_gotas_negro'] = lp['rotativa_num_gotas_negro']
|
||||
lp['num_gotas_cyan'] = lp['rotativa_num_gotas_cyan']
|
||||
lp['num_gotas_magenta'] = lp['rotativa_num_gotas_magenta']
|
||||
lp['num_gotas_amarillo'] = lp['rotativa_num_gotas_amarillo']
|
||||
lp['num_gotas_cg'] = lp['rotativa_num_gotas_cg']
|
||||
|
||||
lp['precio_pagina_negro'] = lp['rotativa_precio_pag_negro']
|
||||
lp['precio_pagina_color'] = lp['rotativa_precio_pag_color']
|
||||
lp['factor_altura'] = lp['rotativa_factor_altura']
|
||||
lp['factor_anchura'] = lp['rotativa_factor_anchura']
|
||||
lp['paginas_por_pliego'] = lp['rotativa_pag_por_pliego']
|
||||
|
||||
lp['clicks_libro'] = lp['rotativa_clicks_libro']
|
||||
lp['peso_gotas_negro'] = lp['rotativa_peso_gotas_negro']
|
||||
lp['peso_gotas_cyan'] = lp['rotativa_peso_gotas_cyan']
|
||||
lp['peso_gotas_magenta'] = lp['rotativa_peso_gotas_magenta']
|
||||
lp['peso_gotas_amarillo'] = lp['rotativa_peso_gotas_amarillo']
|
||||
lp['peso_gotas_cg'] = lp['rotativa_peso_gotas_cg']
|
||||
lp['clicks_pedido'] = lp['rotativa_clicks_total']
|
||||
lp['precio_click_pedido'] = lp['precio_click_pedido']
|
||||
lp['margen_click_pedido'] = lp['margen_click_pedido']
|
||||
lp['precio_tinta'] = lp['rotativa_precio_tinta']
|
||||
|
||||
|
||||
lp['peso_gotas_negro_pedido'] = lp['rotativa_peso_gotas_negro_pedido']
|
||||
lp['peso_gotas_cyan_pedido'] = lp['rotativa_peso_gotas_cyan_pedido']
|
||||
lp['peso_gotas_magenta_pedido'] = lp['rotativa_peso_gotas_magenta_pedido']
|
||||
lp['peso_gotas_amarillo_pedido'] = lp['rotativa_peso_gotas_amarillo_pedido']
|
||||
lp['peso_gotas_cg_pedido'] = lp['rotativa_peso_gotas_cg_pedido']
|
||||
|
||||
}
|
||||
if(lp.tipo.includes('rot')){
|
||||
|
||||
lp['maquina_velocidad'] = lp['rotativa_mxm']
|
||||
lp['metros_papel_libro'] = lp['rotativa_metros_libro']
|
||||
lp['metros_papel_total'] = lp['rotativa_metros_total']
|
||||
lp['velocidad_corte'] = lp['rotativa_velocidad_corte']
|
||||
lp['precio_hora_corte'] = lp['rotativa_precio_hora_corte']
|
||||
lp['tiempo_corte'] = lp['rotativa_tiempo_corte']
|
||||
lp['total_corte'] = lp['rotativa_total_corte']
|
||||
}
|
||||
|
||||
lp['areaPaginas'] = lp['rotativa_superficie']
|
||||
|
||||
|
||||
data = processRowData(lp, lp.tipo, lp.tipo.replace(/_/g, '-'));
|
||||
|
||||
var row = tableLineasPresupuesto.row("#" + lp.tipo);
|
||||
|
||||
tableLineasPresupuesto.row.add(data).draw()
|
||||
row = tableLineasPresupuesto.row("#" + lp.tipo);
|
||||
|
||||
row.child(format(row.data())).show();
|
||||
|
||||
switch(lp.tipo){
|
||||
case 'lp_bn':
|
||||
eventos_lp_bn(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_bnhq':
|
||||
eventos_lp_bnhq(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_color':
|
||||
eventos_lp_color(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_colorhq':
|
||||
eventos_lp_colorhq(lp.maquina_tipo=='inkjet'?true:false)
|
||||
break
|
||||
case 'lp_rot_bn':
|
||||
eventos_lp_rot_bn()
|
||||
break
|
||||
case 'lp_rot_color':
|
||||
eventos_lp_rot_color()
|
||||
break
|
||||
case 'lp_cubierta':
|
||||
eventos_lp_cubierta()
|
||||
break
|
||||
case 'lp_sobrecubierta':
|
||||
eventos_lp_sobrecubierta()
|
||||
break
|
||||
case 'lp_guardas':
|
||||
eventos_lp_guardas()
|
||||
lp['paginas_impresion'] = lp.paginas_impresion
|
||||
break
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function fill_bbdd_from_lp(presupuesto_id){
|
||||
|
||||
data=[];
|
||||
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
const formas = {
|
||||
maquina_ancho: rowData.maquina_ancho,
|
||||
maquina_alto: rowData.maquina_alto,
|
||||
maquina_impresion_ancho: rowData.maquina_impresion_ancho,
|
||||
maquina_impresion_alto: rowData.maquina_impresion_alto,
|
||||
formas: rowData.formas,
|
||||
formas_v: rowData.formas_v,
|
||||
formas_h: rowData.formas_h,
|
||||
formas_orientacion: rowData.formas_orientacion,
|
||||
}
|
||||
|
||||
var t_maq_str = rowData.tiempo.split(':'); // split it at the colons
|
||||
var t_maq = 0
|
||||
|
||||
if(t_maq_str.length == 3)
|
||||
t_maq = (+t_maq_str[0]) * 3600 + (+t_maq_str[1]) * 60 + (+t_maq_str[2]);
|
||||
|
||||
linea_data = {
|
||||
presupuesto_id: presupuesto_id,
|
||||
tipo: rowData.row_id,
|
||||
paginas: (rowData.row_id=='lp_guardas')?(($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3)?8:4):rowData.paginas,
|
||||
papel_id: rowData.papel,
|
||||
gramaje: rowData.gramaje,
|
||||
papel_impresion_id: rowData.papel_impresion_id,
|
||||
papel_impresion: rowData.papel_impresion,
|
||||
maquina_id: rowData.maquina_id,
|
||||
maquina: rowData.maquina,
|
||||
maquina_tipo: rowData.maquinaTipo,
|
||||
tiempo_maquina: t_maq,
|
||||
pliegos_libro: rowData.numeroPliegos,
|
||||
pliegos_pedido: rowData.pliegosPedido,
|
||||
pliegos_precio: rowData.precioPliego,
|
||||
libro: rowData.libro,
|
||||
total_papel_pedido: rowData.totalPapelPedido,
|
||||
margen_papel_pedido: rowData.margenPapelPedido,
|
||||
mano: rowData.lomo,
|
||||
peso: rowData.peso,
|
||||
precio_click: rowData.click,
|
||||
precio_click_pedido: rowData.totalClicks,
|
||||
margen_click_pedido: rowData.margenClicks,
|
||||
check_papel_total: $('#' + rowData.row_id + '_checkPapel').is(":checked")?1:0,
|
||||
check_impresion_total: $('#' + rowData.row_id + '_checkClicks').is(":checked")?1:0,
|
||||
tarifa_impresion_id: rowData.tarifa_impresion_id,
|
||||
formas: JSON.stringify(formas),
|
||||
|
||||
horas_maquina: rowData.horasMaquina,
|
||||
precio_hora: rowData.precioHora,
|
||||
precio_impresion: rowData.precioImpresion,
|
||||
margen_impresion: rowData.margenImpresion,
|
||||
total_linea: rowData.total_linea,
|
||||
}
|
||||
|
||||
if(rowData.row_id=='lp_guardas')
|
||||
linea_data.paginas_impresion = rowData.paginas_impresion
|
||||
|
||||
// maquina rotativa o inkjet
|
||||
if(linea_data.maquina_tipo=='inkjet'){
|
||||
|
||||
linea_data.rotativa_pag_color = rowData.numPagColor
|
||||
|
||||
linea_data.rotativa_total_impresion = rowData.totalImpresion
|
||||
linea_data.rotativa_a_favor_fibra = rowData.aFavorFibra,
|
||||
linea_data.rotativa_negro = rowData.cobNegro
|
||||
linea_data.rotativa_cyan = rowData.cobCyan
|
||||
linea_data.rotativa_magenta = rowData.cobMagenta
|
||||
linea_data.rotativa_amarillo = rowData.cobAmarillo
|
||||
linea_data.rotativa_cg = rowData.cobCG
|
||||
linea_data.rotativa_gota_negro = rowData.gotaNegro
|
||||
linea_data.rotativa_gota_color = rowData.gotaColor
|
||||
|
||||
|
||||
linea_data.rotativa_resolucion = rowData.resolucion
|
||||
linea_data.rotativa_area_paginas = rowData.areaPaginas
|
||||
|
||||
linea_data.rotativa_num_gotas_negro = rowData.gotaNegro
|
||||
linea_data.rotativa_num_gotas_cyan = rowData.gotasCyan
|
||||
linea_data.rotativa_num_gotas_magenta = rowData.gotasMagenta
|
||||
linea_data.rotativa_num_gotas_amarillo = rowData.gotasAmarillo
|
||||
linea_data.rotativa_num_gotas_cg = rowData.gotasCG
|
||||
|
||||
linea_data.rotativa_precio_pag_negro = rowData.precioPagNegro
|
||||
linea_data.rotativa_precio_pag_color = rowData.precioPagColor
|
||||
linea_data.rotativa_factor_altura = rowData.factorAltura
|
||||
linea_data.rotativa_factor_anchura = rowData.factorAnchura
|
||||
linea_data.rotativa_pag_por_pliego = rowData.paginasPliego
|
||||
|
||||
linea_data.rotativa_clicks_libro = rowData.clicksLibro
|
||||
linea_data.rotativa_peso_gotas_negro = rowData.gTintaNegro
|
||||
linea_data.rotativa_peso_gotas_cyan = rowData.gTintaCyan
|
||||
linea_data.rotativa_peso_gotas_magenta = rowData.gTintaMagenta
|
||||
linea_data.rotativa_peso_gotas_amarillo = rowData.gTintaAmarillo
|
||||
linea_data.rotativa_peso_gotas_cg = rowData.gTintaCG
|
||||
linea_data.rotativa_clicks_total = rowData.clicksPedido
|
||||
linea_data.precio_click_pedido = rowData.totalClicksPedido
|
||||
linea_data.rotativa_precio_tinta = rowData.totalTinta
|
||||
|
||||
|
||||
linea_data.rotativa_peso_gotas_negro_pedido = rowData.gTintaNegroPed
|
||||
linea_data.rotativa_peso_gotas_cyan_pedido = rowData.gTintaCyanPed
|
||||
linea_data.rotativa_peso_gotas_magenta_pedido = rowData.gTintaMagentaPed
|
||||
linea_data.rotativa_peso_gotas_amarillo_pedido = rowData.gTintaAmarilloPed
|
||||
linea_data.rotativa_peso_gotas_cg_pedido = rowData.gTintaCGPed
|
||||
|
||||
}
|
||||
if(linea_data.tipo.includes('rot')){
|
||||
|
||||
linea_data.rotativa_mxm = rowData.metrosMinuto
|
||||
linea_data.rotativa_metros_libro = rowData.metrosPapelLibro
|
||||
linea_data.rotativa_metros_total = rowData.metrosPapelTotal
|
||||
linea_data.rotativa_velocidad_corte = rowData.velocidadCorte
|
||||
linea_data.rotativa_precio_hora_corte = rowData.precioHoraCorte
|
||||
linea_data.rotativa_tiempo_corte = rowData.tiempoCorte
|
||||
linea_data.rotativa_total_corte = rowData.totalCorte
|
||||
linea_data.rotativa_a_favor_fibra = rowData.aFavorFibra==true?1:0
|
||||
}
|
||||
|
||||
data.push(linea_data)
|
||||
} );
|
||||
|
||||
var datos = {
|
||||
tipo: 'lineasPresupuesto',
|
||||
datos: data,
|
||||
presupuesto_id: presupuesto_id,
|
||||
}
|
||||
datos = Object.assign(datos, window.token_ajax);
|
||||
|
||||
await $.ajax({
|
||||
type: 'post',
|
||||
url: window.routes_lp.updateDataOfPresupuestoAdmin,
|
||||
|
||||
data: datos,
|
||||
dataType: 'json',
|
||||
success:function(response){
|
||||
|
||||
token=response[window.csrf_token];
|
||||
yeniden(token);
|
||||
}
|
||||
}).fail(function (jqXHR, textStatus, error) {
|
||||
// Handle error here
|
||||
console.log(jqXHR)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function checkPaginasPresupuesto(){
|
||||
|
||||
cantidad_total = 0
|
||||
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
if(rowData.row_id != 'lp_cubierta' && rowData.row_id != 'lp_sobrecubierta' && rowData.row_id != 'lp_guardas')
|
||||
cantidad_total += parseInt(rowData.paginas)
|
||||
})
|
||||
htmlString = ''
|
||||
|
||||
if(cantidad_total != parseInt($('#paginas').val())){
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-bell ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2">` +
|
||||
window.Presupuestos.errores.paginasLP +
|
||||
`</h5>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
$('#divAlarmasLineasPresupuesto').html(htmlString)
|
||||
}
|
||||
|
||||
// variable para controlar el foco en los inputs
|
||||
let focused = 0;
|
||||
|
||||
function change_focus(){
|
||||
// se comprueba que el elemento es un input
|
||||
if($('#'+focused).is('input')){
|
||||
if(focused){
|
||||
$('#'+focused).focus();
|
||||
$('#'+focused).select();
|
||||
focused = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tableLineasPresupuesto.on( 'draw.dt', function () {
|
||||
checkPaginasPresupuesto()
|
||||
getVisibleTabs()
|
||||
} );
|
||||
|
||||
|
||||
$(document).on('click', '.btn-delete-lp', function(e) {
|
||||
|
||||
const row = $(this).closest('tr');
|
||||
data = tableLineasPresupuesto.row( row ).data()
|
||||
tableLineasPresupuesto.row( row )
|
||||
.remove()
|
||||
.draw();
|
||||
|
||||
//updateTablaEnvios()
|
||||
updatePresupuesto({
|
||||
update_lineas: false,
|
||||
update_servicios: true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
|
||||
if(data.row_id == 'lp_guardas')
|
||||
servicioGuardas(false)
|
||||
|
||||
// Si existe cubierta, hay que actualizar con el valor del lomo
|
||||
check_update_cubierta()
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -21,8 +21,7 @@
|
||||
value="<?= $tipo_impresion_id ?>"></input>
|
||||
<input type="hidden" name="lomo" id="lomo" class="form-control" value=""></input>
|
||||
<input type="hidden" name="lomo_cubierta" id="lomo_cubierta" class="form-control" value=""></input>
|
||||
<input type="hidden" name="lomo_sobrecubierta" id="lomo_sobrecubierta" class="form-control"
|
||||
value="<?= is_null($presupuestoEntity->lomo_sobrecubierta)?0:$presupuestoEntity->lomo_sobrecubierta ?>"></input>
|
||||
<input type="hidden" name="lomo_sobrecubierta" id="lomo_sobrecubierta" class="form-control" value=""></input>
|
||||
<input type="hidden" name="isCosido" id="isCosido" class="form-control"
|
||||
value="<?= $isCosido ?>"></input>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user