Merge branch 'dev/tinta_extra_inkjet' into 'main'

Dev/tinta extra inkjet

See merge request jjimenez/safekat!146
This commit is contained in:
2024-02-06 09:10:01 +00:00
16 changed files with 207 additions and 47 deletions

View File

@ -267,6 +267,13 @@ class Papelimpresiontipologias extends \App\Controllers\GoBaseResourceController
->validator( 'Validate::notEmpty',array(
'message' => lang('ImpresionTipologias.validation.amarillo.required') )
),
Field::inst( 'cg' )
->validator( 'Validate::numeric', array(
'message' => lang('ImpresionTipologias.validation.amarillo.decimal') )
)
->validator( 'Validate::notEmpty',array(
'message' => lang('ImpresionTipologias.validation.amarillo.required') )
),
Field::inst( 'gota_negro' )
->validator( 'Validate::numeric', array(
'message' => lang('ImpresionTipologias.validation.gota_negro.decimal') )

View File

@ -728,6 +728,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$parametrosInkjet->rotativa_cyan = $datosTipologias[0]->cyan;
$parametrosInkjet->rotativa_magenta = $datosTipologias[0]->magenta;
$parametrosInkjet->rotativa_amarillo = $datosTipologias[0]->amarillo;
$parametrosInkjet->rotativa_cg = $datosTipologias[0]->cg;
}
$tarifamodel = new MaquinasTarifasImpresionModel();

View File

@ -25,6 +25,7 @@ class Maquina extends \CodeIgniter\Entity\Entity
"precio_tinta_negro" => 0.0,
"is_inkjet" => false,
"precio_tinta_color" => 0.0,
"precio_tinta_cg" => 0.0,
"velocidad_corte" => 0.0,
"precio_hora_corte" => 0.0,
"metrosxminuto" => 0.0,
@ -54,6 +55,7 @@ class Maquina extends \CodeIgniter\Entity\Entity
"precio_tinta_negro" => "float",
"is_inkjet" => "boolean",
"precio_tinta_color" => "float",
"precio_tinta_cg" => "float",
"velocidad_corte" => "float",
"precio_hora_corte" => "float",
"forzar_num_formas_horizontales_cubierta" => "?int",

View File

@ -13,6 +13,7 @@ class PapelImpresionTipologia extends \CodeIgniter\Entity\Entity
"cyan" => 0.0,
"magenta" => 0.0,
"amarillo" => 0.0,
"cg" => 0.0,
"gota_negro" => 0.0,
"gota_color" => 0.0,
];
@ -22,6 +23,7 @@ class PapelImpresionTipologia extends \CodeIgniter\Entity\Entity
"cyan" => "float",
"magenta" => "float",
"amarillo" => "float",
"cg" => "float",
"gota_negro" => "float",
"gota_color" => "float",
];

View File

@ -3,6 +3,7 @@
return [
'cg' => 'CG',
'amarillo' => 'Yellow',
'bicolor' => 'Bicolor',
'color' => 'Color',

View File

@ -140,7 +140,7 @@ return [
'gTintaCyan' => 'G. Cyan Ink',
'gTintaMagenta' => 'G. Magenta Ink',
'gTintaAmarillo' => 'G. Yellow Ink',
'clicksPedido' => 'Clicks Order',
'clicksPedido' => 'Clicks Order',
'totalClicks' => 'Total Clicks',
'totalTinta' => 'Total Ink',
'totalCorte' => 'Total Cut',

View File

@ -3,6 +3,7 @@
return [
'cg' => 'CG',
'amarillo' => 'Amarillo',
'bicolor' => 'Bicolor',
'color' => 'Color',

View File

@ -33,6 +33,7 @@ return [
'ordenPlanning' => 'Orden Planning',
'padreId' => 'Variante',
'precioHoraCorte' => 'Precio Hora Corte',
'precioTintaCG' => 'Precio Tinta CG',
'precioTintaColor' => 'Precio Tinta Color',
'precioTintaNegro' => 'Precio Tinta Negro',
'tipo' => 'Tipo',
@ -130,6 +131,12 @@ return [
],
'precio_tinta_cg' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',
],
'precio_tinta_color' => [
'decimal' => 'El campo {field} debe contener un número decimal.',
'required' => 'El campo {field} es obligatorio.',

View File

@ -116,6 +116,7 @@ return [
'cobCyan' => 'Cob. % Cyan',
'cobMagenta' => 'Cob. % Magenta',
'cobAmarillo' => 'Cob. % Amarillo',
'cobCG' => 'Cob. % CG',
'gotaNegro' => 'Gota negro',
'gotaColor' => 'Gota color',
'totalLinea' => 'TOTAL LÍNEA',
@ -127,6 +128,7 @@ return [
'gotasCyan' => 'Nº gotas cyan',
'gotasMagenta' => 'Nº gotas magenta',
'gotasAmarillo' => 'Nº gotas amarillo',
'gotasCG' => 'Nº gotas CG',
'precioPagNegro' => 'Precio pág. Negro',
'precioPagColor' => 'Precio pág. Color',
'factorAltura' => 'Factor altura',
@ -139,6 +141,7 @@ return [
'gTintaCyan' => 'G. tinta Cyan',
'gTintaMagenta' => 'G. tinta Magenta',
'gTintaAmarillo' => 'G. tinta Amarillo',
'gTintaCG' => 'G. tinta CG',
'clicksPedido' => 'Clicks Pedido',
'totalClicks' => 'Total Clicks',
'totalTinta' => 'Total Tinta',
@ -151,6 +154,7 @@ return [
'gTintaCyanPed' => 'G.T. Cyan Ped.',
'gTintaMagentaPed' => 'G.T. Magenta Ped.',
'gTintaAmarilloPed' => 'G.T. Amarillo Ped.',
'gTintaCGPed' => 'G.T. CG Ped.',
'addLineaPresupuesto' => 'Añadir linea...',

View File

@ -50,6 +50,7 @@ class MaquinaModel extends \App\Models\GoBaseModel
"precio_tinta_negro",
"is_inkjet",
"precio_tinta_color",
"precio_tinta_cg",
"velocidad_corte",
"precio_hora_corte",
"metrosxminuto",
@ -131,6 +132,10 @@ class MaquinaModel extends \App\Models\GoBaseModel
"label" => "Maquinas.precioHoraCorte",
"rules" => "decimal",
],
"precio_tinta_cg" => [
"label" => "Maquinas.precioTintaColor",
"rules" => "decimal",
],
"precio_tinta_color" => [
"label" => "Maquinas.precioTintaColor",
"rules" => "decimal",
@ -297,7 +302,7 @@ class MaquinaModel extends \App\Models\GoBaseModel
->select(
"t1.id AS id, t1.nombre AS nombre, t1.is_padre AS is_padre, t1.tipo AS tipo, t1.velocidad AS velocidad, t1.ancho AS ancho, t1.alto AS alto, t1.ancho_impresion AS ancho_impresion, t1.alto_impresion AS alto_impresion, t1.alto_click AS alto_click, t1.min AS min, t1.max AS max, t1.duracion_jornada AS duracion_jornada,
t1.orden_planning AS orden_planning, t1.is_rotativa AS is_rotativa, t1.precio_tinta_negro AS precio_tinta_negro,
t1.is_inkjet AS is_inkjet, t1.precio_tinta_color AS precio_tinta_color, t1.velocidad_corte AS velocidad_corte,
t1.is_inkjet AS is_inkjet, t1.precio_tinta_color AS precio_tinta_color, t1.precio_tinta_cg AS precio_tinta_cg, t1.velocidad_corte AS velocidad_corte,
t1.precio_hora_corte AS precio_hora_corte, t1.metrosxminuto AS metrosxminuto,
t1.forzar_num_formas_horizontales_cubierta AS forzar_num_formas_horizontales_cubierta,
t1.forzar_num_formas_verticales_cubierta AS forzar_num_formas_verticales_cubierta,
@ -375,7 +380,7 @@ class MaquinaModel extends \App\Models\GoBaseModel
"t1.id AS maquina_id, t1.nombre AS maquina, t1.ancho_impresion AS ancho_impresion,
t1.alto_impresion AS alto_impresion, t1.ancho AS ancho, t1.alto AS alto,
t1.is_rotativa AS is_rotativa, t1.is_inkjet AS is_inkjet, t1.alto_click AS alto_click, t1.velocidad AS velocidad,
t1.precio_tinta_negro AS precio_tinta_negro, t1.precio_tinta_color AS precio_tinta_color,
t1.precio_tinta_negro AS precio_tinta_negro, t1.precio_tinta_color AS precio_tinta_color, t1.precio_tinta_cg AS precio_tinta_cg,
t1.velocidad_corte AS velocidad_corte, t1.precio_hora_corte AS precio_hora_corte,
t1.forzar_num_formas_horizontales_cubierta AS forzar_num_formas_horizontales_cubierta,
t1.forzar_num_formas_verticales_cubierta AS forzar_num_formas_verticales_cubierta"

View File

@ -19,6 +19,7 @@ class PapelImpresionTipologiaModel extends \App\Models\GoBaseModel
"cyan",
"magenta",
"amarillo",
"cg",
"gota_negro",
"gota_color",
];
@ -27,6 +28,11 @@ class PapelImpresionTipologiaModel extends \App\Models\GoBaseModel
public static $labelField = "tipo";
protected $validationRules = [
"cg"=> [
"label" => "ImpresionTipologias.cg",
"rules" => "required|decimal",
],
"amarillo" => [
"label" => "ImpresionTipologias.amarillo",
"rules" => "required|decimal",

View File

@ -284,7 +284,17 @@ class PresupuestoService extends BaseService
round(($data['peso_gotas_cyan_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
round(($data['peso_gotas_magenta_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2) +
round(($data['peso_gotas_amarillo_pedido'] / 1000.0) * $maquina->precio_tinta_color, 2)
, 2);
, 2);
// Esta calculado para color
if($maquina->is_inkjet){
$data['num_gotas_cg'] = round($data['superficie'] * $data['resolucion'] * $data['resolucion'] * ($parametros->rotativa_cg / 100.0), 0);
$data['peso_gotas_cg'] = round((($data['num_gotas_cg'] * $parametros->rotativa_gota_color * $data['pulgada']) / (17.65 / 20.0)) * $pag_color * 1000, 6) +
round((($data['num_gotas_cg'] * $parametros->rotativa_gota_negro * $data['pulgada']) / (17.65 / 20.0)) * $pag_negro * 1000, 6);
$data['peso_gotas_cg_pedido'] = round($data['peso_gotas_cg'], 2) * ($datosPedido->tirada + $datosPedido->merma);
$data['precio_tinta'] += round(($data['peso_gotas_cg_pedido'] / 1000.0) * $maquina->precio_tinta_cg, 2);
}
// precio pagina
$data['precio_pagina_negro'] = round($pag_negro ? $data['precio_tinta'] / ($pag_negro * ($datosPedido->tirada + $datosPedido->merma)) : 0, 6);

View File

@ -174,13 +174,9 @@
</div>
</div>
<?php if ($maquina->is_rotativa == false && $maquina->is_inkjet == false): ?>
<div class="row" id="datosRotativa" style="display:none">
<?php else: ?>
<div class="row" id="datosRotativa">
<?php endif; ?>
<div class="col-md-2">
<div class="row">
<div class="col-md-2 datosRotativa datosInkjet" style="display: none;">
<label for="precioTintaNegro" class="form-label">
<?= lang('Maquinas.precioTintaNegro') ?>
</label>
@ -188,7 +184,7 @@
maxLength="8" step="0.01" class="form-control"
value="<?= old('precio_tinta_negro', $maquina->precio_tinta_negro) ?>">
</div>
<div class="col-md-2">
<div class="col-md-2 datosRotativa datosInkjet" style="display: none;">
<label for="precioTintaColor" class="form-label">
<?= lang('Maquinas.precioTintaColor') ?>
</label>
@ -197,7 +193,16 @@
value="<?= old('precio_tinta_color', $maquina->precio_tinta_color) ?>">
</div>
<div class="col-md-2" <?= ($maquina->is_rotativa == false)?' style="display:none"':""; ?>>
<div class="col-md-2 datosInkjet" style="display: none;">
<label for="precioTintaCG" class="form-label">
<?= lang('Maquinas.precioTintaCG') ?>
</label>
<input type="number" id="precioTintaCG" name="precio_tinta_cg" placeholder="0.00"
maxLength="8" step="0.01" class="form-control"
value="<?= old('precio_tinta_cg', $maquina->precio_tinta_cg) ?>">
</div>
<div class="col-md-2 datosRotativa" style="display: none;">
<label for="velocidadCorte" class="form-label">
<?= lang('Maquinas.velocidadCorte') ?>
</label>
@ -205,7 +210,7 @@
step="0.01" class="form-control"
value="<?= old('velocidad_corte', $maquina->velocidad_corte) ?>">
</div>
<div class="col-md-2" <?= ($maquina->is_rotativa == false)?' style="display:none"':""; ?>>
<div class="col-md-2 datosRotativa" style="display: none;">
<label for="precioHoraCorte" class="form-label">
<?= lang('Maquinas.precioHoraCorte') ?>
</label>
@ -213,7 +218,7 @@
maxLength="8" step="0.01" class="form-control"
value="<?= old('precio_hora_corte', $maquina->precio_hora_corte) ?>">
</div>
<div class="col-md-2" <?= ($maquina->is_rotativa == false)?' style="display:none"':""; ?>>
<div class="col-md-2 datosRotativa" style="display: none;">
<label for="metrosxminuto" class="form-label">
<?= lang('Maquinas.metrosxminuto') ?>
</label>

View File

@ -147,6 +147,20 @@
<?= $this->section("additionalInlineJs") ?>
<?php if($maquina->is_rotativa) { ?>
$(".datosInkjet").css('display', 'none');
$(".datosRotativa").css('display', 'inline');
<?php } ?>
<?php if($maquina->is_inkjet) { ?>
$(".datosRotativa").css('display', 'none');
$(".datosInkjet").css('display', 'inline');
<?php } ?>
<?php if(!$maquina->is_inkjet && !$maquina->is_rotativa){ ?>
$(".datosRotativa").css('display', 'none');
$(".datosInkjet").css('display', 'none');
<?php } ?>
const lastColNr2 = $('#tableOfPapelesImpresion').find("tr:first th").length - 1;
const actionBtns2 = function(data) {
return `
@ -173,13 +187,6 @@
isRotativa = watch(0);
$(document).ready(function () {
if($(this).is(':checked')){
$("#datosRotativa").show();
}
});
$('#isRotativa').on("click",function(el){
asyncConfirmDialog('<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
'<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>', yesCallback, noCallback);
@ -187,20 +194,19 @@
function yesCallback() {
if($('#isRotativa').is(':checked')){
isRotativa.watch = 1;
$("#datosRotativa").show();
$(".datosInkjet").css('display', 'none');
$('#isTinta').prop("checked", 0);
$(".datosRotativa").css('display', 'inline');
}else{
document.getElementById("precioTintaNegro").value = 0;
document.getElementById("precioTintaColor").value = 0;
document.getElementById("velocidadCorte").value = 0;
document.getElementById("precioHoraCorte").value = 0;
document.getElementById("metrosxminuto").value = 0;
$("#datosRotativa").hide();
isRotativa.watch = 0;
$(".datosRotativa").css('display', 'none');
}
theTable2.clearPipeline();
theTable2.draw();
//yeniden(response.<?= csrf_token() ?>); esto da error JJO?
updatePapeles()
}
function noCallback() {
@ -208,16 +214,38 @@
$('#isRotativa').prop("checked", !$('#isRotativa').prop("checked"));
}
$('#isRotativa').on('change', function(){
updatePapeles()
$('#isTinta').on('click', function(){
asyncConfirmDialog('<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
'<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>', yesCallbackInkjet, noCallbackInkjet);
})
$('#isTinta').on('change', function(){
function yesCallbackInkjet() {
if($('#isTinta').is(':checked')){
$(".datosRotativa").css('display', 'none');
$(".datosInkjet").css('display', 'inline');
$('#isRotativa').prop("checked", 0);
}else{
document.getElementById("precioTintaNegro").value = 0;
document.getElementById("precioTintaColor").value = 0;
document.getElementById("velocidadCorte").value = 0;
document.getElementById("precioHoraCorte").value = 0;
document.getElementById("metrosxminuto").value = 0;
$(".datosInkjet").css('display', 'inline');
}
updatePapeles()
})
}
function noCallbackInkjet() {
// Toggle behaviour
$('#isTinta').prop("checked", !$('#isTinta').prop("checked"));
}
function updatePapeles(){
yeniden(json.<?= csrf_token() ?>);
//yeniden(json.<?= csrf_token() ?>);
$.ajax({
url: '<?= route_to('updateMaquinaPapelOnTarifasChange') ?>',

View File

@ -79,6 +79,7 @@
<th><?= lang('ImpresionTipologias.cyan') ?></th>
<th><?= lang('ImpresionTipologias.magenta') ?></th>
<th><?= lang('ImpresionTipologias.amarillo') ?></th>
<th><?= lang('ImpresionTipologias.cg') ?></th>
<th><?= lang('ImpresionTipologias.gotaNegro') ?></th>
<th><?= lang('ImpresionTipologias.gotaColor') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
@ -449,6 +450,12 @@
type: "number"
}
},{
name: "cg",
attr: {
type: "number"
}
},
{
name: "gota_negro",
attr: {
type: "number"
@ -466,7 +473,6 @@
} );
// Definición de la tabla
theTable = $('#tableOfPapelimpresiontipologias').DataTable({
processing: true,
@ -507,11 +513,18 @@
{ 'data': 'cyan' },
{ 'data': 'magenta' },
{ 'data': 'amarillo' },
{ 'data': 'cg' },
{ 'data': 'gota_negro' },
{ 'data': 'gota_color' },
{ data: actionBtns,
className: 'row-edit dt-center'}
],
columnDefs: [
{
visible: false,
targets: [5]
}
],
buttons: [ {
className: 'btn btn-primary float-end me-sm-3 me-1',
extend: "createInline",
@ -520,7 +533,12 @@
submitTrigger: -1,
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
}
} ]
} ],
initComplete: function () {
<?php if($papelImpresion->inkjet) { ?>
theTable.column(5).visible(true)
<?php } ?>
}
});

View File

@ -161,10 +161,10 @@ function format(d) {
'<?= lang('Presupuestos.numPagColor') ?>' +
'<input type="text" id="' + d.row_id +'_numPagColor" name="' + d.row_id +'_numPagColor" class="lp-cell lp-input' + (d.row_id.includes('color')?'" ':' lp-cell-disabled" readonly ') + ' value="' + d.numPagColor +'">' +
'</div>' +
'<div class="col-md-12 col-lg-1">' +
((d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.saturacion') ?>' +
'<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>':'') +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.cobNegro') ?>' +
'<input type="text" id="' + d.row_id +'_cobNegro" name="' + d.row_id +'_cobNegro" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobNegro +'">' +
@ -181,6 +181,11 @@ function format(d) {
'<?= lang('Presupuestos.cobAmarillo') ?>' +
'<input type="text" id="' + d.row_id +'_cobAmarillo" name="' + d.row_id +'_cobAmarillo" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobAmarillo +'">' +
'</div>' +
((!d.row_id.includes('rot'))?
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.cobCG') ?>' +
'<input type="text" id="' + d.row_id +'_cobCG" name="' + d.row_id +'_cobCG" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.cobCG +'">' +
'</div>':'') +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gotaNegro') ?>' +
'<input type="text" id="' + d.row_id +'_gotaNegro" name="' + d.row_id +'_gotaNegro" class="lp-cell lp-input ' + d.row_class +'-input ' + d.row_class +'-tipologia" value="' + d.gotaNegro +'">' +
@ -205,18 +210,28 @@ function format(d) {
'<td></td>'+
'<td colspan="10">'+
'<div class="row flex-grow-1 d-flex align-items-end">' +
((!d.row_id.includes('rot'))?
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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 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>':'') +
(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 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">' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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">' +
'</div>':'') +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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>':'') +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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 +'">' +
@ -233,6 +248,10 @@ function format(d) {
'<?= lang('Presupuestos.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>' +
(!(d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gotasCG') ?>' +
'<input readonly type="text" id="' + d.row_id +'_gotasCG" name="' + d.row_id +'_gotasCG" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gotasCG +'">' +
'</div>':'') +
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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 +'">' +
@ -241,6 +260,7 @@ function format(d) {
'<?= lang('Presupuestos.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>' +
(d.row_id.includes('rot')?
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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 +'">' +
@ -248,11 +268,11 @@ function format(d) {
'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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">' +
'</div>':'') +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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>':'') +
'</div>' +
'</td>' +
'</tr>' +
@ -269,10 +289,18 @@ function format(d) {
'<?= lang('Presupuestos.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">' +
(d.row_id.includes('rot')?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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>':'') +
((!d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.saturacion') ?>' +
'<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>':'') +
((!d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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 class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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 +'">' +
@ -289,6 +317,14 @@ function format(d) {
'<?= lang('Presupuestos.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>' +
(!(d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaCG') ?>' +
'<input readonly type="text" id="' + d.row_id +'_gTintaCG" name="' + d.row_id +'_gTintaCG" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCG +'">' +
'</div>':'') +
((!d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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.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 +'">' +
@ -317,6 +353,14 @@ function format(d) {
'<td></td>'+
'<td colspan="10">'+
'<div class="row flex-grow-1 d-flex align-items-end" >' +
((!d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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>':'') +
((!d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.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>':'') +
(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 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 +'">' +
@ -345,6 +389,10 @@ function format(d) {
'<?= lang('Presupuestos.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>' +
(!(d.row_id.includes('rot'))?'<div class="col-md-12 col-lg-1">' +
'<?= lang('Presupuestos.gTintaCGPed') ?>' +
'<input readonly type="text" id="' + d.row_id +'_gTintaCGPed" name="' + d.row_id +'_gTintaCGPed" class="lp-cell lp-cell-disabled lp-input ' + d.row_class +'-input" readonly value="' + d.gTintaCGPed +'">'+
'</div>':'') +
'</div>' +
'</td>' +
'</tr>'
@ -743,6 +791,13 @@ function processRowData(row, rowId, rowClass){
data.gTintaMagentaPed = isNaN(parseFloat(row.peso_gotas_magenta_pedido)) ? "" : parseFloat(row.peso_gotas_magenta_pedido).toFixed(2)
data.gTintaAmarilloPed = isNaN(parseFloat(row.peso_gotas_amarillo_pedido)) ? "" : parseFloat(row.peso_gotas_amarillo_pedido).toFixed(2)
if(!rowId.includes('rot')){
data.cobCG = isNaN(parseFloat(row.datosTipologias.cg)) ? "" : parseFloat(row.datosTipologias.cg).toFixed(0)
data.gotasCG = isNaN(parseFloat(row.num_gotas_cg)) ? "" : parseFloat(row.num_gotas_cg).toFixed(0)
data.gTintaCG = isNaN(parseFloat(row.peso_gotas_cg)) ? "" : parseFloat(row.peso_gotas_cg).toFixed(2)
data.gTintaCGPed = isNaN(parseFloat(row.peso_gotas_cg_pedido)) ? "" : parseFloat(row.peso_gotas_cg_pedido).toFixed(2)
}
data.alto_click = row.alto_click
}
@ -3352,6 +3407,7 @@ function fill_lp_from_bbdd(){
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,
}
@ -3368,6 +3424,7 @@ function fill_lp_from_bbdd(){
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']
@ -3380,6 +3437,7 @@ function fill_lp_from_bbdd(){
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['precio_tinta'] = lp['rotativa_precio_tinta']
@ -3389,6 +3447,7 @@ function fill_lp_from_bbdd(){
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')){
@ -3509,6 +3568,7 @@ async function fill_bbdd_from_lp(presupuesto_id){
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
@ -3520,6 +3580,7 @@ async function fill_bbdd_from_lp(presupuesto_id){
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
@ -3532,6 +3593,7 @@ async function fill_bbdd_from_lp(presupuesto_id){
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
@ -3541,6 +3603,7 @@ async function fill_bbdd_from_lp(presupuesto_id){
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')){