arreglado bug rotativa. Trabajando en bug inkjet

This commit is contained in:
Jaime Jiménez
2024-02-03 20:19:48 +01:00
parent f82228f8be
commit 0813abfb10
4 changed files with 141 additions and 80 deletions

View File

@ -483,7 +483,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
array_push($datosTipolog, $data);
}
$resourceData = $this->getCompIntData($type, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog);
$a_favor_fibra = $reqData['a_favor_fibra'] ?? null;
$resourceData = $this->getCompIntData($type, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog, $a_favor_fibra);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
@ -640,7 +642,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
}
public function getCompIntData($uso, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog = null)
public function getCompIntData($uso, $datosPedido, $papel_generico, $gramaje, $isColor, $isHq, $cliente_id, $datosTipolog = null, $a_favor_fibra = null)
{
$tipo = $isColor? ($isHq?'colorhq':'color'): ($isHq?'negrohq':'negro');
@ -697,7 +699,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
if($maquina->is_inkjet){
$parametrosInkjet = (object)array(
'a_favor_fibra' => 1, // este parametro se cambia para comprobar
'a_favor_fibra' => $a_favor_fibra, // este parametro se cambia para comprobar
// en las dos direcciones (menos en rustica fresada que es siempre 1)
'bnPages' => $isColor?0:$datosPedido->paginas,
'colorPages' => $isColor?$datosPedido->paginas:0,

View File

@ -45,7 +45,7 @@ class PresupuestoService extends BaseService
if ($uso!='rotativa') {
$ancho_calculo = ($uso=='cubierta' || $uso=='sobrecubierta') ? $datosPedido->anchoExteriores : $datosPedido->ancho;
$formas = PresupuestoService::getNumFormasPlana($uso, $maquina, $ancho_calculo, $datosPedido->alto, $datosPedido->isCosido);
$formas = PresupuestoService::getNumFormasPlana($uso, $maquina, $ancho_calculo, $datosPedido->alto, $datosPedido->isCosido,);
$response['fields'] = $formas;
}
@ -387,13 +387,18 @@ class PresupuestoService extends BaseService
$data['alto_click'] = $maquina->alto_click;
$formas = PresupuestoService::getNumFormasRot($maquina, $datosPedido->ancho, $datosPedido->alto, $datosPedido->isCosido);
$formas = PresupuestoService::getNumFormasRot(
$maquina,
$datosPedido->ancho,
$datosPedido->alto,
$datosPedido->isCosido,
$parametrosRotativa->a_favor_fibra);
$data['num_formas'] = $formas;
return $data;
}
public static function getNumFormasRot($maquina, $ancho, $alto, $isCosido)
public static function getNumFormasRot($maquina, $ancho, $alto, $isCosido, $a_favor_fibra = true)
{
// El ancho si es cosido es el doble
$anchoForCalculo = $isCosido ? $ancho * 2 : $ancho;
@ -403,35 +408,38 @@ class PresupuestoService extends BaseService
$h2_temp = floor($maquina->ancho_impresion / $alto);
// horizontales
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp);
// Si son mas de 2 formas
if(count($calles)>0)
$h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h1_temp : $h1_temp - 1;
else
$h1 = $h1_temp;
$v1 = floor($maquina->alto_click / $alto);
$formas_h = $h1 * $v1; //p1
if($a_favor_fibra){
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp);
// Si son mas de 2 formas
if(count($calles)>0)
$h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h1_temp : $h1_temp - 1;
else
$h1 = $h1_temp;
$v1 = floor($maquina->alto_click / $alto);
$formas_h = $h1 * $v1; //p1
}
// verticales
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp);
if(count($calles)>0)
$h2 = ($h2_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h2_temp : $h2_temp - 1;
else
$h2 = $h2_temp;
$v2 = floor($maquina->alto_click / $anchoForCalculo);
$formas_v = $h2 * $v2; //p2
else{
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp);
if(count($calles)>0)
$h2 = ($h2_temp * $alto + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h2_temp : $h2_temp - 1;
else
$h2 = $h2_temp;
$v2 = floor($maquina->alto_click / $anchoForCalculo);
$formas_v = $h2 * $v2; //p2
}
$num_formas = ($formas_h > $formas_v) ? $formas_h : $formas_v;
$num_formas = $a_favor_fibra ? $formas_h : $formas_v;
$num_formas = $isCosido ? $num_formas * 2 : $num_formas;
// si no hay formas se devuelve n/a
if ($num_formas == 0) {
$response['posicion_formas'] = 'n/a'; // not available
} else if ($formas_h > $formas_v) {
} else if ($a_favor_fibra) {
$response['posicion_formas'] = 'h';
$response['num_formas_horizontales'] = $h1;
$response['num_formas_verticales'] = $v1;

View File

@ -90,26 +90,26 @@ function format(d) {
'<td></td>'+
'<td></td>'+
'<td colspan="10">'+
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
'<div class="row flex-grow-1 d-flex align-items-end">' +
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.numeroPliegos") ?>" +
'<input id="' + d.row_id +'_numeroPliegos" name="' + d.row_id +'_numeroPliegos" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.numeroPliegos +'">'+
'<input readonly id="' + d.row_id +'_numeroPliegos" name="' + d.row_id +'_numeroPliegos" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.numeroPliegos +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.pliegosPedido") ?>" +
'<input id="' + d.row_id +'_pliegosPedido" name="' + d.row_id +'_pliegosPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.pliegosPedido +'">'+
'<input readonly id="' + d.row_id +'_pliegosPedido" name="' + d.row_id +'_pliegosPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.pliegosPedido +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.precioPliego") ?>" +
'<input id="' + d.row_id +'_precioPliego" name="' + d.row_id +'_precioPliego" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioPliego +'">'+
'<input readonly id="' + d.row_id +'_precioPliego" name="' + d.row_id +'_precioPliego" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioPliego +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.libro") ?>" +
'<input id="' + d.row_id +'_libro" name="' + d.row_id +'_libro" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.libro +'">'+
'<input readonly id="' + d.row_id +'_libro" name="' + d.row_id +'_libro" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.libro +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.totalPapelPedido") ?>" +
'<input id="' + d.row_id +'_totalPapelPedido" name="' + d.row_id +'_totalPapelPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalPapelPedido +'">'+
'<input readonly id="' + d.row_id +'_totalPapelPedido" name="' + d.row_id +'_totalPapelPedido" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalPapelPedido +'">'+
'</div>'+
'<input id="' + d.row_id +'_margenPapelPedido" name="' + d.row_id +'_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled ' + d.row_class + '-input" type="text" value="' + d.margenPapelPedido +'" style="display: none;">' +
'<div class="d-flex col-md-auto justify-content-center align-items-center">' +
@ -117,23 +117,23 @@ function format(d) {
'</div>'+
'<div class="col-md-1 col-lg-1">' +
"<?= lang("Presupuestos.click") ?>" +
'<input id="' + d.row_id +'_click" name="' + d.row_id +'_click" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.click +'">'+
'<input readonly id="' + d.row_id +'_click" name="' + d.row_id +'_click" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.click +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.totalClicks") ?>" +
'<input id="' + d.row_id +'_totalClicks" name="' + d.row_id +'_totalClicks" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalClicks +'">'+
'<input readonly id="' + d.row_id +'_totalClicks" name="' + d.row_id +'_totalClicks" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.totalClicks +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.horas") ?>" +
'<input id="' + d.row_id +'_horasMaquina" name="' + d.row_id +'_horasMaquina" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.horasMaquina +'">'+
'<input readonly id="' + d.row_id +'_horasMaquina" name="' + d.row_id +'_horasMaquina" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.horasMaquina +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.precioHora") ?>" +
'<input id="' + d.row_id +'_precioHora" name="' + d.row_id +'_precioHora" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioHora +'">'+
'<input readonly id="' + d.row_id +'_precioHora" name="' + d.row_id +'_precioHora" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioHora +'">'+
'</div>'+
'<div class="col-md-12 col-lg-1">' +
"<?= lang("Presupuestos.precioImpresion") ?>" +
'<input id="' + d.row_id +'_precioImpresion" name="' + d.row_id +'_precioImpresion" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioImpresion +'">'+
'<input readonly id="' + d.row_id +'_precioImpresion" name="' + d.row_id +'_precioImpresion" class="lp-input lp-cell lp-cell-disabled ' + d.row_class +'-input" type="text" value="' + d.precioImpresion +'">'+
'</div>'+
'<div class="d-flex col-md-auto justify-content-center align-items-center">' +
'<input id="' + d.row_id + '_checkClicks" name="' + d.row_id +'_checkClicks" class="update-totales" style="bottom:0;width: 15px; padding: 0; margin:0;" type="checkbox" ' + (d.check_impresion_total==true?'checked':'') + '>' +
@ -153,7 +153,7 @@ function format(d) {
'<td></td>'+
'<td></td>'+
'<td colspan="10">'+
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
'<div class="row flex-grow-1 d-flex align-items-end">' +
'<div class="col-md-12 col-lg-1">' +
'<button id="' + d.row_id +'_defecto" name="' + d.row_id +'_defecto" type="button" class="btn btn-label-primary waves-effect lp-button"><?= lang('Presupuestos.porDefecto') ?></button>' +
'</div>'+
@ -163,7 +163,7 @@ function format(d) {
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.saturacion') ?>' +
'<input type="text" id="' + d.row_id +'_saturacion" name="' + d.row_id +'_saturacion" class="lp-cell lp-input lp-cell-disabled" readonly value="100">' +
'<input readonly type="text" id="' + d.row_id +'_saturacion" name="' + d.row_id +'_saturacion" class="lp-cell lp-input lp-cell-disabled" readonly value="100">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.cobNegro') ?>' +
@ -204,54 +204,54 @@ function format(d) {
'<td></td>'+
'<td></td>'+
'<td colspan="10">'+
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
'<div class="row flex-grow-1 d-flex align-items-end">' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
'<?= lang('Presupuestos.metrosMinuto') ?>' +
'<input type="text" id="' + d.row_id +'_metrosMinuto" name="' + d.row_id +'_metrosMinuto" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosMinuto +'">' +
'<input readonly type="text" id="' + d.row_id +'_metrosMinuto" name="' + d.row_id +'_metrosMinuto" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosMinuto +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.resolucion') ?>' +
'<input type="text" id="' + d.row_id +'_resolucion" name="' + d.row_id +'_resolucion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.resolucion +'">' +
'<input readonly type="text" id="' + d.row_id +'_resolucion" name="' + d.row_id +'_resolucion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.resolucion +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.areaPaginas') ?>' +
'<input type="text" id="' + d.row_id +'_areaPaginas" name="' + d.row_id +'_areaPaginas" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.areaPaginas +'">' +
'<input readonly type="text" id="' + d.row_id +'_areaPaginas" name="' + d.row_id +'_areaPaginas" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.areaPaginas +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gotasNegro') ?>' +
'<input type="text" id="' + d.row_id +'_gotasNegro" name="' + d.row_id +'_gotasNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasNegro +'">' +
'<input readonly type="text" id="' + d.row_id +'_gotasNegro" name="' + d.row_id +'_gotasNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasNegro +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gotasCyan') ?>' +
'<input type="text" id="' + d.row_id +'_gotasCyan" name="' + d.row_id +'_gotasCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasCyan +'">' +
'<input readonly type="text" id="' + d.row_id +'_gotasCyan" name="' + d.row_id +'_gotasCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasCyan +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gotasMagenta') ?>' +
'<input type="text" id="' + d.row_id +'_gotasMagenta" name="' + d.row_id +'_gotasMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasMagenta +'">' +
'<input readonly type="text" id="' + d.row_id +'_gotasMagenta" name="' + d.row_id +'_gotasMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasMagenta +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gotasAmarillo') ?>' +
'<input type="text" id="' + d.row_id +'_gotasAmarillo" name="' + d.row_id +'_gotasAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasAmarillo +'">' +
'<input readonly type="text" id="' + d.row_id +'_gotasAmarillo" name="' + d.row_id +'_gotasAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasAmarillo +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.precioPagNegro') ?>' +
'<input type="text" id="' + d.row_id +'_precioPagNegro" name="' + d.row_id +'_precioPagNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagNegro +'">' +
'<input readonly type="text" id="' + d.row_id +'_precioPagNegro" name="' + d.row_id +'_precioPagNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagNegro +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.precioPagColor') ?>' +
'<input type="text" id="' + d.row_id +'_precioPagColor" name="' + d.row_id +'_precioPagColor" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagColor +'">' +
'<input readonly type="text" id="' + d.row_id +'_precioPagColor" name="' + d.row_id +'_precioPagColor" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioPagColor +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.factorAltura') ?>' +
'<input type="text" id="' + d.row_id +'_factorAltura" name="' + d.row_id +'_factorAltura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAltura +'">' +
'<input readonly type="text" id="' + d.row_id +'_factorAltura" name="' + d.row_id +'_factorAltura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAltura +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.factorAnchura') ?>' +
'<input type="text" id="' + d.row_id +'_factorAnchura" name="' + d.row_id +'_factorAnchura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAnchura +'">' +
'<input readonly type="text" id="' + d.row_id +'_factorAnchura" name="' + d.row_id +'_factorAnchura" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.factorAnchura +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.paginasPliego') ?>' +
'<input type="text" id="' + d.row_id +'_paginasPliego" name="' + d.row_id +'_paginasPliego" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.paginasPliego +'">' +
'<input readonly type="text" id="' + d.row_id +'_paginasPliego" name="' + d.row_id +'_paginasPliego" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.paginasPliego +'">' +
'</div>' +
'</div>' +
'</td>' +
@ -260,54 +260,54 @@ function format(d) {
'<td></td>'+
'<td></td>'+
'<td colspan="10">'+
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end">' +
'<div class="row flex-grow-1 d-flex align-items-end">' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
'<?= lang('Presupuestos.metrosPapelLibro') ?>' +
'<input type="text" id="' + d.row_id +'_metrosPapelLibro" name="' + d.row_id +'_metrosPapelLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelLibro +'">' +
'<input readonly type="text" id="' + d.row_id +'_metrosPapelLibro" name="' + d.row_id +'_metrosPapelLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelLibro +'">' +
'</div>' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
'<?= lang('Presupuestos.metrosPapelTotal') ?>' +
'<input type="text" id="' + d.row_id +'_metrosPapelTotal" name="' + d.row_id +'_metrosPapelTotal" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelTotal +'">' +
'<input readonly type="text" id="' + d.row_id +'_metrosPapelTotal" name="' + d.row_id +'_metrosPapelTotal" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.metrosPapelTotal +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.clicksLibro') ?>' +
'<input type="text" id="' + d.row_id +'_clicksLibro" name="' + d.row_id +'_clicksLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksLibro +'">' +
'<input readonly type="text" id="' + d.row_id +'_clicksLibro" name="' + d.row_id +'_clicksLibro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksLibro +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaNegro') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaNegro" name="' + d.row_id +'_gTintaNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegro +'">' +
'<input readonly type="text" id="' + d.row_id +'_gTintaNegro" name="' + d.row_id +'_gTintaNegro" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegro +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaCyan') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaCyan" name="' + d.row_id +'_gTintaCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyan +'">' +
'<input readonly type="text" id="' + d.row_id +'_gTintaCyan" name="' + d.row_id +'_gTintaCyan" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyan +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaMagenta') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaMagenta" name="' + d.row_id +'_gTintaMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagenta +'">' +
'<input readonly type="text" id="' + d.row_id +'_gTintaMagenta" name="' + d.row_id +'_gTintaMagenta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagenta +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaAmarillo') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaAmarillo" name="' + d.row_id +'_gTintaAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarillo +'">' +
'<input readonly type="text" id="' + d.row_id +'_gTintaAmarillo" name="' + d.row_id +'_gTintaAmarillo" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarillo +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.clicksPedido') ?>' +
'<input type="text" id="' + d.row_id +'_clicksPedido" name="' + d.row_id +'_clicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksPedido +'">' +
'<input readonly type="text" id="' + d.row_id +'_clicksPedido" name="' + d.row_id +'_clicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.clicksPedido +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.totalClicks') ?>' +
'<input type="text" id="' + d.row_id +'_totalClicksPedido" name="' + d.row_id +'_totalClicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalClicksPedido +'">' +
'<input readonly type="text" id="' + d.row_id +'_totalClicksPedido" name="' + d.row_id +'_totalClicksPedido" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalClicksPedido +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.totalTinta') ?>' +
'<input type="text" id="' + d.row_id +'_totalTinta" name="' + d.row_id +'_totalTinta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalTinta +'">' +
'<input readonly type="text" id="' + d.row_id +'_totalTinta" name="' + d.row_id +'_totalTinta" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalTinta +'">' +
'</div>' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
'<?= lang('Presupuestos.totalCorte') ?>' +
'<input type="text" id="' + d.row_id +'_totalCorte" name="' + d.row_id +'_totalCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalCorte +'">' +
'<input readonly type="text" id="' + d.row_id +'_totalCorte" name="' + d.row_id +'_totalCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalCorte +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.totalImpresion') ?>' +
'<input type="text" id="' + d.row_id +'_totalImpresion" name="' + d.row_id +'_totalImpresion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalImpresion +'">' +
'<input readonly type="text" id="' + d.row_id +'_totalImpresion" name="' + d.row_id +'_totalImpresion" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.totalImpresion +'">' +
'</div>' +
'</div>' +
'</td>' +
@ -316,34 +316,34 @@ function format(d) {
'<td></td>'+
'<td></td>'+
'<td colspan="10">'+
'<div class="row flex-grow-1 d-flex justify-content-center align-items-end" >' +
'<div class="row flex-grow-1 d-flex align-items-end" >' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
'<?= lang('Presupuestos.velocidadCorte') ?>' +
'<input type="text" id="' + d.row_id +'_velocidadCorte" name="' + d.row_id +'_velocidadCorte" class="lp-cell lp-input lp-cell-disabled" readonly value="' + d.velocidadCorte +'">' +
'<input readonly type="text" id="' + d.row_id +'_velocidadCorte" name="' + d.row_id +'_velocidadCorte" class="lp-cell lp-input lp-cell-disabled" readonly value="' + d.velocidadCorte +'">' +
'</div>' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
'<?= lang('Presupuestos.precioHoraCorte') ?>' +
'<input type="text" id="' + d.row_id +'_precioHoraCorte" name="' + d.row_id +'_precioHoraCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioHoraCorte +'">' +
'<input readonly type="text" id="' + d.row_id +'_precioHoraCorte" name="' + d.row_id +'_precioHoraCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.precioHoraCorte +'">' +
'</div>' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">': '<div class="col-md-12 col-lg-1" style="display:none;">') +
'<?= lang('Presupuestos.tiempoCorte') ?>' +
'<input type="text" id="' + d.row_id +'_tiempoCorte" name="' + d.row_id +'_tiempoCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.tiempoCorte +'">' +
'<input readonly type="text" id="' + d.row_id +'_tiempoCorte" name="' + d.row_id +'_tiempoCorte" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.tiempoCorte +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaNegroPed') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaNegroPed" name="' + d.row_id +'_gTintaNegroPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegroPed +'">' +
'<input readonly type="text" id="' + d.row_id +'_gTintaNegroPed" name="' + d.row_id +'_gTintaNegroPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaNegroPed +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaCyanPed') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaCyanPed" name="' + d.row_id +'_gTintaCyanPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyanPed +'">' +
'<input readonly type="text" id="' + d.row_id +'_gTintaCyanPed" name="' + d.row_id +'_gTintaCyanPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCyanPed +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaMagentaPed') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaMagentaPed" name="' + d.row_id +'_gTintaMagentaPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagentaPed +'">' +
'<input readonly type="text" id="' + d.row_id +'_gTintaMagentaPed" name="' + d.row_id +'_gTintaMagentaPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaMagentaPed +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaAmarilloPed') ?>' +
'<input type="text" id="' + d.row_id +'_gTintaAmarilloPed" name="' + d.row_id +'_gTintaAmarilloPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarilloPed +'">'+
'<input readonly type="text" id="' + d.row_id +'_gTintaAmarilloPed" name="' + d.row_id +'_gTintaAmarilloPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaAmarilloPed +'">'+
'</div>' +
'</div>' +
'</td>' +
@ -1173,7 +1173,6 @@ function change_lp_bn_maquina(){
}
function change_lp_bn_paginas(){
if( parseInt($('#lp_bn_paginas').val())>0 &&
@ -1186,6 +1185,23 @@ function change_lp_bn_paginas(){
}
}
function change_lp_bn_aFavorFibra(){
if( parseInt($('#lp_bn_paginas').val())>0 &&
parseInt($('#lp_bn_papel option:selected').val())>0 &&
$('#lp_bn_gramaje option:selected').text().length>0 &&
parseInt($('#lp_bn_papelImpresion option:selected').val())>0
){
var rowData = tableLineasPresupuesto.row('#lp_bn').data()
rowData.aFavorFibra = $('#lp_bn_aFavorFibra').prop('checked')
tableLineasPresupuesto.row('#lp_bn').data(rowData).draw(false)
calcularPresupuesto_rot_bn(false, true);
}
}
function calcularPresupuesto_bn(input_data={}, updatedTipologias = false){
const dimension = getDimensionLibro();
@ -1219,6 +1235,11 @@ function calcularPresupuesto_bn(input_data={}, updatedTipologias = false){
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
// Si es inkjet, existe este check
if ($('#lp_bn_aFavorFibra').length){
datos.a_favor_fibra = $('#lp_bn_aFavorFibra').prop('checked')
}
if(updatedTipologias){
datos.gota_negro= $('#lp_bn_gotaNegro').val()
datos.gota_color= $('#lp_bn_gotaColor').val()
@ -1243,9 +1264,13 @@ function calcularPresupuesto_bn(input_data={}, updatedTipologias = false){
value.fields.papel_generico_id === input_data.papel_generico_id &&
value.fields.papel_impresion_id === input_data.papel_impresion_id) {
// Si viene del comparador
if(Object.keys(input_data).length == 0){
value.fields.check_papel_total = $('#lp_bn' + '_checkPapel').is(":checked")?1:0
value.fields.check_impresion_total = $('#lp_bn' + '_checkClicks').is(":checked")?1:0
// Por defecto en plana: en contra de fibra
value.fields.a_favor_fibra = false
}
else{
value.fields.check_papel_total = 1
@ -1353,6 +1378,7 @@ function eventos_lp_bn(isInkjet = false){
if(isInkjet){
$('.lp-bn-tipologia').bind("change", change_lp_bn_tipologia);
$('#lp_bn_defecto').bind("click", por_defecto_lp_bn);
$('#lp_bn_aFavorFibra').bind("change", change_lp_bn_aFavorFibra);
}
$('#lp_bn_checkPapel').bind("change", {id_linea: 'lp_bn'}, update_total_linea);
@ -1806,6 +1832,21 @@ function por_defecto_lp_bnhq(){
}
}
function change_lp_bnhq_aFavorFibra(){
if( parseInt($('#lp_bnhq_paginas').val())>0 &&
parseInt($('#lp_bnhq_papel option:selected').val())>0 &&
$('#lp_bnhq_gramaje option:selected').text().length>0 &&
parseInt($('#lp_bnhq_papelImpresion option:selected').val())>0
){
var rowData = tableLineasPresupuesto.row('#lp_bnhq').data()
rowData.aFavorFibra = $('#lp_bnhq_aFavorFibra').prop('checked')
tableLineasPresupuesto.row('#lp_bnhq').data(rowData).draw(false)
calcularPresupuesto_bnhq(false, true);
}
}
function calcularPresupuesto_bnhq(input_data={}, updatedTipologias = false){
@ -1849,6 +1890,11 @@ function calcularPresupuesto_bnhq(input_data={}, updatedTipologias = false){
datos.amarillo= $('#lp_bnhq_cobAmarillo').val()
}
// Si es inkjet, existe este check
if ($('#lp_bnhq_aFavorFibra').length){
datos.a_favor_fibra = $('#lp_bnhq_aFavorFibra').prop('checked')
}
$.ajax({
type: "POST",
url: "/cosidotapablanda/datatable",
@ -1865,6 +1911,8 @@ function calcularPresupuesto_bnhq(input_data={}, updatedTipologias = false){
if(Object.keys(input_data).length == 0){
value.fields.check_papel_total = $('#lp_bnhq' + '_checkPapel').is(":checked")?1:0
value.fields.check_impresion_total = $('#lp_bnhq' + '_checkClicks').is(":checked")?1:0
// Por defecto en plana: en contra de fibra
value.fields.a_favor_fibra = false
}
else{
value.fields.check_papel_total = 1
@ -1946,6 +1994,7 @@ function eventos_lp_bnhq(isInkjet = false){
if(isInkjet){
$('.lp-bnhq-tipologia').bind("change", change_lp_bnhq_tipologia);
$('#lp_bnhq_defecto').bind("click", por_defecto_lp_bnhq);
$('#lp_bnhq_aFavorFibra').bind("change", change_lp_bnhq_aFavorFibra);
}
$('#lp_bnhq_checkPapel').bind("change", {id_linea: 'lp_bnhq'}, update_total_linea);
@ -2792,6 +2841,7 @@ function calcularPresupuesto_rot_color(fromComparador=false, updatedTipologias=f
if(data.lineas.length >0){
// Se cogen los valores de la linea con los datos correspondientes
$.each(data.lineas, function(key, value) {
console.log(value.fields.num_formas)
fibra = $('#lp_rot_color_aFavorFibra').prop('checked')
if(fromComparador){
if(value.fields.maquina_id === input_data.maquina_id &&
@ -3324,16 +3374,16 @@ function fill_lp_from_bbdd(){
switch(lp.tipo){
case 'lp_bn':
eventos_lp_bn()
eventos_lp_bn(lp.maquina_tipo=='inkjet'?true:false)
break
case 'lp_bnhq':
eventos_lp_bnhq()
eventos_lp_bnhq(lp.maquina_tipo=='inkjet'?true:false)
break
case 'lp_color':
eventos_lp_color()
eventos_lp_color(lp.maquina_tipo=='inkjet'?true:false)
break
case 'lp_colorhq':
eventos_lp_colorhq()
eventos_lp_colorhq(lp.maquina_tipo=='inkjet'?true:false)
break
case 'lp_rot_bn':
eventos_lp_rot_bn()

View File

@ -455,10 +455,11 @@ function getObjetoLP(lpName, _isCosido) {
case 'rot_bn':
case 'rot_color':
if ((pvObj.anchoImpresion / pvObj.altoForma) > (pvObj.anchoImpresion / pvObj.anchoForma)) {
let auxReg = pvObj.anchoForma;
pvObj.anchoForma = pvObj.altoForma;
pvObj.altoForma = auxReg;
// Conditional assignements depending on rotation of the printing shape
if (pvObj.orientacionFormas == 'v') {
let auxReg = pvObj.altoForma;
pvObj.altoForma = pvObj.anchoForma;
pvObj.anchoForma = auxReg;
}
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
pvObj.altoClick = isNaN(parseFloat(rowData.alto_click))?305:parseFloat(rowData.alto_click);