mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
solucionados bugs (pe, cuando es cubierta o sobrecubierta no se necesita color=1)
This commit is contained in:
@ -345,7 +345,8 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="dt-result dt-result-text" colspan="19"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compInteriorRotativa") ?>:</td>
|
||||
<td id="errorComRot" class="dt-result dt-result-text" colspan="15"></td>
|
||||
<td class="dt-result dt-result-text" colspan="4"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compInteriorRotativa") ?>:</td>
|
||||
<td id="total_comp_rot" class="dt-result dt-result-value" colspan="2">0.00</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
@ -997,52 +997,66 @@ $('.insertarLinea').on("click", function (e) {
|
||||
|
||||
$('#addLineasPresupuesto').on("change", function (e) {
|
||||
switch($('#addLineasPresupuesto').val()){
|
||||
// Se chequean todas las lineas de negro y todas las de color
|
||||
// (solo una de cada en interior)
|
||||
case 'lp_bn':
|
||||
if($('#lp_bn').css('display') == 'none'){
|
||||
$('.lp_bn').css('display', 'flex')
|
||||
if($('#lp_bn').css('display') != 'none' ||
|
||||
$('#lp_bnhq').css('display') != 'none' ||
|
||||
$('#lp_rot_bn').css('display') != 'none'){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
$('.lp_bn').css('display', 'flex')
|
||||
}
|
||||
break
|
||||
case 'lp_bnhq':
|
||||
if($('#lp_bnhq').css('display') == 'none'){
|
||||
$('.lp_bnhq').css('display', 'flex')
|
||||
if($('#lp_bn').css('display') != 'none' ||
|
||||
$('#lp_bnhq').css('display') != 'none' ||
|
||||
$('#lp_rot_bn').css('display') != 'none'){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
$('.lp_bnhq').css('display', 'flex')
|
||||
}
|
||||
break
|
||||
case 'lp_color':
|
||||
if($('#lp_color').css('display') == 'none'){
|
||||
$('.lp_color').css('display', 'flex')
|
||||
if($('#lp_color').css('display') != 'none' ||
|
||||
$('#lp_colorhq').css('display') != 'none' ||
|
||||
$('#lp_rot_color').css('display') != 'none'){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
$('.lp_color').css('display', 'flex')
|
||||
}
|
||||
break
|
||||
case 'lp_colorhq':
|
||||
if($('#lp_colorhq').css('display') == 'none'){
|
||||
$('.lp_colorhq').css('display', 'flex')
|
||||
if($('#lp_color').css('display') != 'none' ||
|
||||
$('#lp_colorhq').css('display') != 'none' ||
|
||||
$('#lp_rot_color').css('display') != 'none'){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
$('.lp_colorhq').css('display', 'flex')
|
||||
}
|
||||
break
|
||||
case 'lp_rot_bn':
|
||||
if($('#lp_rot_bn').css('display') == 'none'){
|
||||
$('.lp_rot_bn').css('display', 'flex')
|
||||
if($('#lp_bn').css('display') != 'none' ||
|
||||
$('#lp_bnhq').css('display') != 'none' ||
|
||||
$('#lp_rot_bn').css('display') != 'none'){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
$('.lp_rot_bn').css('display', 'flex')
|
||||
}
|
||||
break
|
||||
case 'lp_rot_color':
|
||||
if($('#lp_rot_color').css('display') == 'none'){
|
||||
$('.lp_rot_color').css('display', 'flex')
|
||||
if($('#lp_color').css('display') != 'none' ||
|
||||
$('#lp_colorhq').css('display') != 'none' ||
|
||||
$('#lp_rot_color').css('display') != 'none'){
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?=lang('Presupuestos.errores.lineaDuplicada') ?>', 'divAlarmasLineasPresupuesto');
|
||||
$('.lp_rot_color').css('display', 'flex')
|
||||
}
|
||||
break
|
||||
case 'lp_cubierta':
|
||||
|
||||
@ -357,7 +357,7 @@ function clearNegro() {
|
||||
|
||||
|
||||
function clearIntLineas(is_color){
|
||||
$("#tableCompIntPlana").DataTable().rows( '.selected' ).deselect();
|
||||
//$("#tableCompIntPlana").DataTable().rows( '.selected' ).deselect();
|
||||
var tabla = $('#tableCompIntPlana').DataTable();
|
||||
tabla
|
||||
.rows( function ( idx, data, node ) {
|
||||
@ -365,6 +365,7 @@ function clearIntLineas(is_color){
|
||||
} )
|
||||
.remove()
|
||||
.draw();
|
||||
//$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#insertarPlanaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
@ -372,12 +373,15 @@ function clearIntLineas(is_color){
|
||||
function clearCubierta(){
|
||||
|
||||
$('#tableCompCubierta').DataTable().clear().draw();
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
|
||||
function clearIntRot(){
|
||||
|
||||
$('#errorComRot').html('');
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#insertarRotativaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
|
||||
@ -568,3 +572,14 @@ function fillCubierta(data, is_color, is_hq){
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function clearCompTable(clearNegro=true,clearColor=false,clearCubierta=false){
|
||||
if(clearNegro){
|
||||
|
||||
}
|
||||
|
||||
$('#insertarPlanaBtn').addClass('d-none')
|
||||
$('#insertarRotativaBtn').addClass('d-none')
|
||||
$('#total_comp_plana').html('0.00')
|
||||
$('#total_comp_rot').html('0.00')
|
||||
}
|
||||
|
||||
@ -564,33 +564,6 @@
|
||||
});
|
||||
|
||||
|
||||
function checkComparadorInt(is_color, is_hq) {
|
||||
|
||||
elementos = getIDsComparador(is_color, is_hq)
|
||||
|
||||
if ($(''+ elementos.papel).select2('data').length > 0 &&
|
||||
$(''+ elementos.gramaje).select2('data').length > 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
|
||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||
|
||||
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||
if(!is_color || ($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim()))
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
clearIntLineas(is_color);
|
||||
clearIntRot();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$('.comp_negro_items').on('change', function (e) {
|
||||
|
||||
checkComparadorInt(false,false);
|
||||
@ -818,23 +791,38 @@
|
||||
|
||||
function checkComparadorInt(is_color, is_hq) {
|
||||
|
||||
elementos = getIDsComparador(is_color, is_hq)
|
||||
clearIntLineas(is_color);
|
||||
clearIntRot();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
|
||||
elementos = getIDsComparador(is_color, is_hq)
|
||||
|
||||
if ($(''+ elementos.papel).select2('data').length > 0 &&
|
||||
$(''+ elementos.gramaje).select2('data').length > 0 &&
|
||||
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
|
||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||
getLineasIntRot(is_hq);
|
||||
// Para rotativa, si es color el papel y el gramaje tiene que ser igual
|
||||
if(!is_color)
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim()))
|
||||
{
|
||||
getLineasIntRot(is_hq);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#errorComRot').html('<?= lang("Presupuestos.errores.errorRotColor") ?>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else{
|
||||
clearIntLineas(is_color);
|
||||
clearIntRot();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -854,7 +842,7 @@
|
||||
$('#compGramajeNegro').empty().trigger("change");
|
||||
$('#compGramajeNegro').prop('disabled', false);
|
||||
$('#compGramajeNegro').select2({
|
||||
allowClear: true,
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
@ -896,7 +884,7 @@
|
||||
$('#compGramajeNegrohq').empty().trigger("change");
|
||||
$('#compGramajeNegrohq').prop('disabled', false);
|
||||
$('#compGramajeNegrohq').select2({
|
||||
allowClear: true,
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
@ -940,7 +928,7 @@
|
||||
$('#compGramajeColor').prop('disabled', false);
|
||||
$('#compPapelColor').find('option[value="0"]').remove();
|
||||
$('#compGramajeColor').select2({
|
||||
allowClear: true,
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
@ -984,7 +972,7 @@
|
||||
$('#compGramajeColorhq').prop('disabled', false);
|
||||
$('#compPapelColorhq').find('option[value="0"]').remove();
|
||||
$('#compGramajeColorhq').select2({
|
||||
allowClear: true,
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
@ -1024,7 +1012,7 @@
|
||||
$('#compGramajeCubierta').prop('disabled', false);
|
||||
$('#compPapelCubierta').find('option[value="0"]').remove();
|
||||
$('#compGramajeCubierta').select2({
|
||||
allowClear: true,
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
|
||||
Reference in New Issue
Block a user