Finalizadas las tareas de modificacion

This commit is contained in:
Jaime Jimenez
2023-08-18 13:51:09 +02:00
parent ce070dfcf7
commit 77cb70ede4
34 changed files with 318 additions and 129 deletions

View File

@ -24,6 +24,16 @@
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="mostrar_en_presupuesto" class="form-check-label">
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaacabadoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
<?= lang('Tarifaacabado.mostrar_en_presupuesto') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -1,6 +1,7 @@
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
@ -49,7 +50,7 @@
<th><?= lang('TarifaAcabadoLineas.tiradaMax') ?></th>
<th><?= lang('TarifaAcabadoLineas.precioMin') ?></th>
<th><?= lang('TarifaAcabadoLineas.margen') ?></th>
<th></th>
<th style="min-width:100px"></th>
</tr>
</thead>
<tbody>
@ -79,10 +80,10 @@
const actionBtns = function(data) {
return `
<span class="edit"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></span>
<span class="cancel"></span>
<span class="remove"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i></span>
`;
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
<span class="cancel"></span>
`;
};
@ -96,11 +97,11 @@
table : "#tableOfTarifaacabadolineas",
idSrc: 'id',
fields: [ {
name: "paginas_min"
name: "tirada_min"
}, {
name: "precio_max"
}, {
name: "paginas_max"
name: "tirada_max"
}, {
name: "precio_min"
},{
@ -165,9 +166,9 @@
async: true,
}),
columns: [
{ 'data': 'paginas_min' },
{ 'data': 'tirada_min' },
{ 'data': 'precio_max' },
{ 'data': 'paginas_max' },
{ 'data': 'tirada_max' },
{ 'data': 'precio_min' },
{ 'data': 'margen' },
{
@ -193,7 +194,7 @@
editor: editor,
formOptions: {
submitTrigger: -1,
submitHtml: '<i class="ti ti-device-floppy"/>'
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
}
} ]
} );
@ -205,9 +206,9 @@
editor.inline(
theTable.cells(this.parentNode.parentNode, '*').nodes(),
{
cancelHtml: '<i class="ti ti-x"></i>',
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
cancelTrigger: 'span.cancel',
submitHtml: '<i class="ti ti-device-floppy"></i>',
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
submitTrigger: 'span.edit',
submit: 'allIfChanged'
}
@ -216,32 +217,29 @@
// Delete row
$('#tableOfTarifaacabadolineas').on( 'click', 'tbody span.remove', function (e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
editor
.create( false )
.edit( this.parentNode, false)
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
.set( 'is_deleted', 1 )
.submit();
}
});
$(document).on('click', '.btn-delete', function(e) {
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
});
$(document).on('click', '.btn-remove', function(e) {
const dataId = $(this).attr('data-id');
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
$.ajax({
url: `/tarifas/tarifaacabadolineas/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
popSuccessAlert(data.msg ?? jqXHR.statusText);
}).fail((jqXHR, textStatus, errorThrown) => {
popErrorAlert(jqXHR.responseJSON.messages.error)
})
}
});
<?= $this->endSection() ?>
<?=$this->section('css') ?>

View File

@ -19,6 +19,7 @@
<th><?= lang('Tarifaacabado.nombre') ?></th>
<th><?= lang('Tarifaacabado.precioMin') ?></th>
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
<th><?= lang('Tarifaacabado.mostrar_en_presupuesto') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
@ -89,10 +90,19 @@
{ 'data': 'nombre' },
{ 'data': 'precio_min' },
{ 'data': 'importe_fijo' },
{ 'data': 'mostrar_en_presupuesto' },
{ 'data': actionBtns }
]
});
theTable.on( 'draw.dt', function () {
const boolCols = [3];
for (let coln of boolCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
});
}
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;

View File

@ -1,6 +1,7 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('Tarifaencuadernacion.nombre') ?>*
</label>
@ -21,6 +22,15 @@
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaEncuadernacionEntity->importe_fijo) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="mb-3">
<div class="form-check">
<label for="mostrar_en_presupuesto" class="form-check-label">
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaEncuadernacionEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
<?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -69,6 +69,8 @@
</h2>
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionLineas">
<div class="accordion-body">
<p><?= lang("TarifaEncuadernacionLineas.moduleExplanation") ?></p>
<table id="tableOfTarifaencuadernacionlineas" class="table table-striped table-hover" style="width: 100%;">
<thead>
@ -117,11 +119,36 @@
`;
};
// Delete row
$(document).on('click', '.btn-delete', function(e) {
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
if($(this).closest('table').attr('id').includes('tiradas')){
$(".btn-remove").attr('table', "tiradas");
}
else if($(this).closest('table').attr('id').includes('lineas')){
$(".btn-remove").attr('table', "lineas");
}
else{
$(".btn-remove").attr('table', );
}
});
var selected_tirada_id = -1;
$(document).on('click', '.btn-remove', function(e) {
const dataId = $(this).attr('data-id');
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
if($(this).attr('table').includes('tiradas')){
remove_tiradas(dataId, row);
}
else if ($(this).attr('table').includes('lineas')){
remove_lineas(dataId, row);
}
}
});
<?php endif; ?>
<?= $this->endSection() ?>
@ -278,14 +305,11 @@
);
} );
// Delete row
$(document).on('click', '.btn-remove', function(e) {
const dataId = $(this).attr('data-id');
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
/*$.ajax({
url: `/configuracion/papelimpresiontipologias/delete/${dataId}`,
function remove_lineas(dataId, row){
$.ajax({
url: `/tarifas/tarifaencuadernacionlineas/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');
@ -294,44 +318,11 @@
popSuccessAlert(data.msg ?? jqXHR.statusText);
}).fail((jqXHR, textStatus, errorThrown) => {
popErrorAlert(jqXHR.responseJSON.messages.error)
})*/
/*editor
.create( false )
.edit( this.parentNode, false)
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
.set( 'is_deleted', 1 )
.submit();*/
}
});
/*
$('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.remove', function (e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
cancelButtonColor: '#d33'
})
.then((result) => {
const dataId = $(this).data('id');
const row = $(this).closest('tr');
if (result.value) {
editor
.create( false )
.edit( this.parentNode, false)
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
.set( 'is_deleted', 1 )
.submit();
}
});
});*/
}
<?= $this->endSection() ?>
@ -505,23 +496,22 @@
// Delete row
$(document).on('click', '.btn-remove', function(e) {
const dataId = $(this).attr('data-id');
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
$.ajax({
function remove_tiradas(dataId, row){
$.ajax({
url: `/tarifas/tarifaencuadernaciontiradas/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');
theTable2.clearPipeline();
theTable2.row($(row)).invalidate().draw();
theTable.clearPipeline();
theTable.draw();
popSuccessAlert(data.msg ?? jqXHR.statusText);
}).fail((jqXHR, textStatus, errorThrown) => {
popErrorAlert(jqXHR.responseJSON.messages.error)
})
}
});
popErrorAlert(jqXHR.statusText)
});
}
<?= $this->endSection() ?>

View File

@ -19,6 +19,7 @@
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
<th><?= lang('Tarifaencuadernacion.precioMin') ?></th>
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
<th><?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
@ -89,10 +90,20 @@
{ 'data': 'nombre' },
{ 'data': 'precio_min' },
{ 'data': 'importe_fijo' },
{ 'data': 'mostrar_en_presupuesto' },
{ 'data': actionBtns }
]
});
theTable.on( 'draw.dt', function () {
const boolCols = [3];
for (let coln of boolCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
});
}
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `/tarifas/tarifasencuadernacion/edit/${$(this).attr('data-id')}`;

View File

@ -21,6 +21,16 @@
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaManipuladoEntity->importe_fijo) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<div class="form-check">
<label for="mostrar_en_presupuesto" class="form-check-label">
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaManipuladoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
<?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?>
</label>
</div><!--//.form-check -->
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -52,7 +52,7 @@
<th><?= lang('TarifaManipuladoLineas.tiradaMax') ?></th>
<th><?= lang('TarifaManipuladoLineas.precioMin') ?></th>
<th><?= lang('TarifaManipuladoLineas.margen') ?></th>
<th></th>
<th style="min-width:100px"></th>
</tr>
</thead>
<tbody>
@ -80,10 +80,10 @@
const actionBtns = function(data) {
return `
<span class="edit"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></span>
<span class="cancel"></span>
<span class="remove"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i></span>
`;
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
<span class="cancel"></span>
`;
};
@ -97,11 +97,11 @@
table : "#tableOfTarifamanipuladolineas",
idSrc: 'id',
fields: [ {
name: "paginas_min"
name: "tirada_min"
}, {
name: "precio_max"
}, {
name: "paginas_max"
name: "tirada_max"
}, {
name: "precio_min"
}, {
@ -166,9 +166,9 @@
async: true,
}),
columns: [
{ 'data': 'paginas_min' },
{ 'data': 'tirada_min' },
{ 'data': 'precio_max' },
{ 'data': 'paginas_max' },
{ 'data': 'tirada_max' },
{ 'data': 'precio_min' },
{ 'data': 'margen' },
{
@ -194,7 +194,7 @@
editor: editor,
formOptions: {
submitTrigger: -1,
submitHtml: '<i class="ti ti-device-floppy"/>'
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
}
} ]
} );
@ -206,9 +206,9 @@
editor.inline(
theTable.cells(this.parentNode.parentNode, '*').nodes(),
{
cancelHtml: '<i class="ti ti-x"></i>',
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
cancelTrigger: 'span.cancel',
submitHtml: '<i class="ti ti-device-floppy"></i>',
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
submitTrigger: 'span.edit',
submit: 'allIfChanged'
}
@ -243,6 +243,30 @@
}
});
});
// Delete row
$(document).on('click', '.btn-delete', function(e) {
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
});
$(document).on('click', '.btn-remove', function(e) {
const dataId = $(this).attr('data-id');
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
$.ajax({
url: `/tarifas/tarifamanipuladolineas/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
popSuccessAlert(data.msg ?? jqXHR.statusText);
}).fail((jqXHR, textStatus, errorThrown) => {
popErrorAlert(jqXHR.responseJSON.messages.error)
})
}
});
<?= $this->endSection() ?>
<?=$this->section('css') ?>

View File

@ -19,6 +19,7 @@
<th><?= lang('Tarifamanipulado.nombre') ?></th>
<th><?= lang('Tarifamanipulado.precioMin') ?></th>
<th><?= lang('Tarifamanipulado.importeFijo') ?></th>
<th><?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
@ -88,15 +89,27 @@
{ 'data': 'nombre' },
{ 'data': 'precio_min' },
{ 'data': 'importe_fijo' },
{ 'data': 'mostrar_en_presupuesto' },
{ 'data': actionBtns }
]
});
theTable.on( 'draw.dt', function () {
const boolCols = [3];
for (let coln of boolCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
});
}
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `/tarifas/tarifasmanipulado/edit/${$(this).attr('data-id')}`;
});
$(document).on('click', '.btn-delete', function(e) {
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
});

View File

@ -21,13 +21,13 @@
</label>
<input
type="number"
id="precio"
name="precio"
id="precio_pagina"
name="precio_pagina"
required
maxLength="31"
step="0.01"
class="form-control"
value="<?= old('precio', $tarifapreimpresionEntity->precio) ?>"
value="<?= old('precio', $tarifapreimpresionEntity->precio_pagina) ?>"
>
</div><!--//.mb-3 -->

View File

@ -1,4 +1,5 @@
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
<div class="row">