Merge branch 'main' into 'dev/ui-ajustes'

# Conflicts:
#   ci4/app/Entities/Tarifas/TarifapreimpresionEntity.php
#   ci4/app/Language/es/Tarifaacabado.php
#   ci4/app/Language/es/Tarifamanipulado.php
#   ci4/app/Language/es/Tarifapreimpresion.php
#   ci4/app/Views/themes/backend/vuexy/form/tarifas/preimpresion/_tarifapreimpresionFormItems.php
This commit is contained in:
Ignacio Martinez Navajas
2023-07-13 20:00:25 +00:00
25 changed files with 1164 additions and 31 deletions

View File

@ -0,0 +1,84 @@
<div class="row">
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<label for="tipo" class="form-label">
<?=lang('MaquinasPorDefecto.tipo') ?>*
</label>
<select tabindex="1" id="tipo" name="tipo" class="form-control select2bs" style="width: 100%;" >
<option value="" selected="selected"><?=lang('Basic.global.pleaseSelectOne') ?></option>
<option value="bn"<?=$maquinasDefectoEntity->tipo == 'bn' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bn') ?></option>
<option value="bnhq"<?=$maquinasDefectoEntity->tipo == 'bnhq' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bnhq') ?></option>
<option value="color"<?=$maquinasDefectoEntity->tipo == 'color' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.color') ?></option>
<option value="portada"<?=$maquinasDefectoEntity->tipo == 'portada' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.portada') ?></option>
<option value="cubierta"<?=$maquinasDefectoEntity->tipo == 'cubierta' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.cubierta') ?></option>
<option value="rotativa"<?=$maquinasDefectoEntity->tipo == 'rotativa' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.rotativa') ?></option>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="anchoMin" class="form-label">
<?=lang('MaquinasPorDefecto.anchoMin') ?>*
</label>
<input tabindex="3" type="number" id="anchoMin" name="ancho_min" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_min', $maquinasDefectoEntity->ancho_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="altoMin" class="form-label">
<?=lang('MaquinasPorDefecto.altoMin') ?>*
</label>
<input tabindex="5" type="number" id="altoMin" name="alto_min" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_min', $maquinasDefectoEntity->alto_min) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="tiradaMin" class="form-label">
<?=lang('MaquinasPorDefecto.tiradaMin') ?>*
</label>
<input tabindex="7" type="number" id="tiradaMin" name="tirada_min" placeholder="1" maxLength="11" class="form-control" value="<?=old('tirada_min', $maquinasDefectoEntity->tirada_min) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="col-md-12 col-lg-6 px-4">
<div class="mb-3">
<label for="maquinaId" class="form-label">
<?=lang('MaquinasPorDefecto.maquinaId') ?>*
</label>
<select tabindex="2" id="maquinaId" name="maquina_id" class="form-control select2 form-select" style="width: 100%;" >
<?php if ( isset($maquinaList) && is_array($maquinaList) && !empty($maquinaList) ) :
foreach ($maquinaList as $k => $v) : ?>
<option value="<?=$k ?>"<?=$k==$maquinasDefectoEntity->maquina_id ? ' selected':'' ?>>
<?=$v ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="anchoMax" class="form-label">
<?=lang('MaquinasPorDefecto.anchoMax') ?>*
</label>
<input tabindex="4" type="number" id="anchoMax" name="ancho_max" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_max', $maquinasDefectoEntity->ancho_max) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="altoMax" class="form-label">
<?=lang('MaquinasPorDefecto.altoMax') ?>*
</label>
<input tabindex="6" type="number" id="altoMax" name="alto_max" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_max', $maquinasDefectoEntity->alto_max) ?>">
</div><!--//.mb-3 -->
<div class="mb-3">
<label for="tiradaMax" class="form-label">
<?=lang('MaquinasPorDefecto.tiradaMax') ?>*
</label>
<input tabindex="8" type="number" id="tiradaMax" name="tirada_max" placeholder="10000" maxLength="11" class="form-control" value="<?=old('tirada_max', $maquinasDefectoEntity->tirada_max) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -286,9 +286,6 @@
yeniden(json.<?= csrf_token() ?>);
setTimeout(() => {
console.log("1 Segundo esperado")
}, 1000);
$.ajax({
url: '<?= route_to('updateMaquinaPapelOnTarifasChange') ?>',
data: {

View File

@ -0,0 +1,67 @@
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?= $this->section("content") ?>
<div class="row">
<div class="col-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
</div><!--//.card-header -->
<form id="maquinaPorDefectoForm" method="post" action="<?= $formAction ?>">
<?= csrf_field() ?>
<div class="card-body">
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
<?= view("themes/backend/vuexy/form/configuracion/maquinas/_maquinaPorDefectoFormItems") ?>
</div><!-- /.card-body -->
<div class="pt-4">
<input
type="submit"
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
/>
<?= anchor(route_to("maquinaPorDefectoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>
<?= $this->section("additionalInlineJs") ?>
$('#maquinaId').select2({
allowClear: false,
ajax: {
url: '<?= route_to("menuItemsOfMaquinas") ?>',
type: 'post',
dataType: 'json',
data: function (params) {
return {
id: 'id',
text: 'nombre',
searchTerm: params.term,
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
};
},
delay: 60,
processResults: function (response) {
yeniden(response.<?= csrf_token() ?>);
return {
results: response.menu
};
},
cache: true
}
});
<?= $this->endSection() ?>

View File

@ -0,0 +1,185 @@
<?=$this->include('themes/_commonPartialsBs/select2bs5') ?>
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
<?=$this->section('content'); ?>
<div class="row">
<div class="col-md-12">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title"><?=lang('MaquinasPorDefecto.maquinaPorDefectoList') ?></h3>
<?=anchor(route_to('newMaquinaPorDefecto'), lang('Basic.global.addNew').' '.lang('MaquinasPorDefecto.maquinaPorDefecto'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-header -->
<div class="card-body">
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfMaquinaspordefecto" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('MaquinasPorDefecto.tipo') ?></th>
<th><?= lang('Maquinas.maquina') ?></th>
<th><?= lang('MaquinasPorDefecto.anchoMin') ?></th>
<th><?= lang('MaquinasPorDefecto.anchoMax') ?></th>
<th><?= lang('MaquinasPorDefecto.altoMin') ?></th>
<th><?= lang('MaquinasPorDefecto.altoMax') ?></th>
<th><?= lang('MaquinasPorDefecto.tiradaMin') ?></th>
<th><?= lang('MaquinasPorDefecto.tiradaMax') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr = $('#tableOfMaquinaspordefecto').find("tr:first th").length - 1;
const actionBtns = function(data) {
return `<td class="text-right py-0 align-middle">
<div class="btn-group btn-group-sm">
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
<i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i>
</div>
</td>`;
};
theTable = $('#tableOfMaquinaspordefecto').DataTable({
processing: true,
serverSide: true,
autoWidth: true,
responsive: true,
scrollX: true,
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
pageLength: 10,
lengthChange: true,
"dom": 'lfBrtip',
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
stateSave: true,
order: [[1, 'asc']],
language: {
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
},
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfMaquinasPorDefecto') ?>',
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
async: true,
}),
columnDefs: [
{
orderable: false,
searchable: false,
targets: [lastColNr]
}
],
columns : [
{ 'data': 'tipo', "render": function ( data, type, row, meta ) {
if(data=='bn')
return '<?= lang('MaquinasPorDefecto.bn') ?>';
else if(data=='bnhq')
return '<?= lang('MaquinasPorDefecto.bnhq') ?>';
else if(data=='color')
return '<?= lang('MaquinasPorDefecto.color') ?>';
else if(data=='cubierta')
return '<?= lang('MaquinasPorDefecto.cubierta') ?>';
else if(data=='portada')
return '<?= lang('MaquinasPorDefecto.portada') ?>';
else if(data=='rotativa')
return '<?= lang('MaquinasPorDefecto.rotativa') ?>';
}
},
{ 'data': 'maquina' },
{ 'data': 'ancho_min' },
{ 'data': 'ancho_max' },
{ 'data': 'alto_min' },
{ 'data': 'alto_max' },
{ 'data': 'tirada_min' },
{ 'data': 'tirada_max' },
{ 'data': actionBtns }
]
});
$(document).on('click', '.btn-edit', function(e) {
window.location.href = `configuracion/maquinasdefecto/edit/${$(this).attr('data-id')}`;
});
$(document).on('click', '.btn-delete', function(e) {
Swal.fire({
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('MaquinasPorDefecto.maquinadefecto'))]) ?>',
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) {
$.ajax({
//url: `<?= route_to('maquinaPorDefectoList') ?>/${dataId}`,
//method: 'DELETE',
url: `/configuracion/maquinasdefecto/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
Toast.fire({
icon: 'success',
title: data.msg ?? jqXHR.statusText,
});
theTable.clearPipeline();
theTable.row($(row)).invalidate().draw();
}).fail((jqXHR, textStatus, errorThrown) => {
Toast.fire({
icon: 'error',
title: jqXHR.responseJSON.messages.error,
});
})
}
});
});
<?=$this->endSection() ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<?=$this->endSection() ?>

View File

@ -48,7 +48,7 @@
<?= esc($item->user_created_id) ?>
</td>
<td class="align-middle">
<?= esc($item->user_update_id) ?>
<?= esc($item->user_updated_id) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->created_at) ? '' : date('d/m/Y H:m:s', strtotime($item->created_at)) ?>