Merge branch 'dev/presupuestos3' of https://git.imnavajas.es/jjimenez/safekat into dev/presupuestos3

This commit is contained in:
Jaime Jiménez Ortega
2023-11-01 19:17:29 +01:00
26 changed files with 166 additions and 637 deletions

View File

@ -1,12 +0,0 @@
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<label for="nombre" class="form-label">
<?=lang('FormasPagoes.nombre') ?>*
</label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $formasPagoEntity->nombre) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div><!-- //.row -->

View File

@ -1,26 +0,0 @@
<?= $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="formaPagoForm" 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/formas-pago/_formaPagoFormItems") ?>
</div><!-- /.card-body -->
<div class="card-footer">
<?= anchor(route_to("formaPagoList2"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
<input type="submit" class="btn btn-primary float-end" name="save" value="<?= lang("Basic.global.Save") ?>">
</div><!-- /.card-footer -->
</form>
</div><!-- //.card -->
</div><!--//.col -->
</div><!--//.row -->
<?= $this->endSection() ?>

View File

@ -1,141 +0,0 @@
<?=$this->include('themes_commonPartialsBs/datatables') ?>
<?=$this->include('themes_commonPartialsBs/sweetalert') ?>
<?=$this->extend('themes'.config('Basics')->theme['name'].'/AdminLayout/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('FormasPagoes.formaPagoList') ?></h3>
</div><!--//.card-header -->
<div class="card-body">
<?= view('themes_commonPartialsBs/_alertBoxes'); ?>
<table id="tableOfFormaspago" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
<thead>
<tr>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<th><?= lang('FormasPagoes.id') ?></th>
<th><?= lang('FormasPagoes.nombre') ?></th>
<th><?= lang('FormasPagoes.createdAt') ?></th>
<th><?= lang('FormasPagoes.updatedAt') ?></th>
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($formaPagoList as $item ) : ?>
<tr>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editFormaPago', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteFormaPago', $item->id)]); ?>
</td>
<td class="align-middle text-center">
<?=$item->id ?>
</td>
<td class="align-middle">
<?= empty($item->nombre) || strlen($item->nombre) < 51 ? esc($item->nombre) : character_limiter(esc($item->nombre), 50) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->created_at) ? '' : date('mm/dd/YYYY H:i', strtotime($item->created_at)) ?>
</td>
<td class="align-middle text-nowrap">
<?= empty($item->updated_at) ? '' : date('mm/dd/YYYY H:i', strtotime($item->updated_at)) ?>
</td>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editFormaPago', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteFormaPago', $item->id)]); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div><!--//.card-body -->
<div class="card-footer">
<?=anchor(route_to('newFormaPago'), lang('Basic.global.addNew').' '.lang('FormasPagoes.formaPago'), ['class'=>'btn btn-primary float-end']); ?>
</div><!--//.card-footer -->
</div><!--//.card -->
</div><!--//.col -->
</div><!--//.row -->
<?=$this->endSection() ?>
<?=$this->section('additionalInlineJs') ?>
const lastColNr2 = $(".using-exportable-data-table").find("tr:first th").length - 1;
theTable = $('.using-exportable-data-table').DataTable({
"responsive": true,
"paging": true,
"lengthMenu": [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
"pageLength": 10,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"dom": 'lfrtipB', // 'lfBrtip', // you can try different layout combinations by uncommenting one or the other
// "dom": '<"top"lf><"clear">rt<"bottom"ipB><"clear">', // remember to comment this line if you uncomment the above
"buttons": [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}
],
"autoWidth": true,
"scrollX": true,
"stateSave": true,
"language": {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
},
"columnDefs": [
{
orderable: false,
searchable: false,
targets: [0,lastColNr2]
}
]
});
$(document).on('click', '.btn-delete', function(e) {
e.preventDefault();
const dataHref = $(this).data('href');
Swal.fire({
title: "<?= lang('Basic.global.sweet.sureToDeleteTitle', [lang('FormasPagoes.forma pago')]) ?>",
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) => {
if (result.value) {
window.location.href = `${dataHref}`;
}
});
});
<?=$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

@ -23,6 +23,12 @@
aria-controls="comentarios-cliente"
aria-selected="true">
<?= lang("Presupuestos.comentariosCliente") ?>
<span
id="mostrar_comentarios_cliente"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
<li class="nav-item">
@ -35,6 +41,12 @@
aria-controls="comentarios-safekat"
aria-selected="false">
<?= lang("Presupuestos.comentariosSafekat") ?>
<span
id="mostrar_comentarios_safekat"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
<li class="nav-item">
@ -47,6 +59,30 @@
aria-controls="comentarios-presupuesto"
aria-selected="false">
<?= lang("Presupuestos.comentariosPresupuesto") ?>
<span
id="mostrar_comentarios_pdf"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
<li class="nav-item">
<button
type="button"
class="nav-link"
role="tab"
data-bs-toggle="tab"
data-bs-target="#comentarios-produccion"
aria-controls="comentarios-produccion"
aria-selected="false">
<?= lang("Presupuestos.comentariosProduccion") ?>
<span
id="mostrar_comentarios_produccion"
style="display: none"
class="badge rounded-pill badge-center h-px-20 w-px-20 bg-warning ms-1">
!
</span>
</button>
</li>
</ul>
@ -99,7 +135,21 @@
</div>
<div class="tab-pane fade" id="comentarios-produccion" role="tabpanel">
<div class="row">
<div class="col-md-12 col-lg-12 px-4">
<div class="mb-3">
<textarea
rows="3"
id="comentariosProduccion"
name="comentarios_produccion"
required
style="height: 10em;"
class="form-control"><?=old('comentarios_pdf', $presupuestoEntity->comentarios_produccion) ?></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- //.accordion-body -->
@ -111,6 +161,14 @@
<!------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?>
$("textarea[name*='comentarios_']").each(function(){
if (!$.trim($(this).val())) {
// textarea is empty or contains only white-space
$("#mostrar_" + $(this).attr('name')).hide();
}else{
$("#mostrar_" + $(this).attr('name')).show();
}
});
<?= $this->endSection() ?>

View File

@ -228,7 +228,7 @@
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
$.ajax({
url: `/presupuestos/presupuestoacabados/delete/${dataId}`,
url: `/serviciosacabados/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');

View File

@ -172,11 +172,11 @@
table : "#tableOfTarifaencuadernacionlineas",
idSrc: 'id',
fields: [ {
name: "paginas_min"
name: "paginas_libro_min"
}, {
name: "precio_max"
}, {
name: "paginas_max"
name: "paginas_libro_max"
}, {
name: "precio_min"
}, {
@ -243,9 +243,9 @@
async: true,
}),
columns: [
{ 'data': 'paginas_min' },
{ 'data': 'paginas_libro_min' },
{ 'data': 'precio_max' },
{ 'data': 'paginas_max' },
{ 'data': 'paginas_libro_max' },
{ 'data': 'precio_min' },
{ 'data': 'margen' },
{

View File

@ -29,7 +29,7 @@
/**
* MENU CLIENTES
*/
if (allowMenuSection($menus, ['Cliente', 'Tarifacliente'], 'index')):
if (allowMenuSection($menus, ['Cliente'], 'index')):
?>
<!-- Clientes -->
<li class="menu-item">
@ -47,15 +47,6 @@
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifacliente')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
<li class="menu-item">
<a href="<?= site_url("clientes/tarifacliente") ?>" class="menu-link">
<div data-i18n="<?= lang("App.menu_tarifacliente") ?>"><?= lang("App.menu_tarifacliente") ?></div>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>

View File

@ -29,7 +29,7 @@
/**
* MENU CLIENTES
*/
if (allowMenuSection($menus, ['Cliente', 'Tarifacliente'], 'index')):
if (allowMenuSection($menus, ['Cliente'], 'index')):
?>
<!-- Clientes -->
<li class="menu-item">
@ -47,15 +47,6 @@
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Tarifacliente')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
<li class="menu-item">
<a href="<?= site_url("clientes/tarifacliente") ?>" class="menu-link">
<div data-i18n="<?= lang("App.menu_tarifacliente") ?>"><?= lang("App.menu_tarifacliente") ?></div>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>

View File

@ -29,7 +29,7 @@
/**
* MENU CLIENTES
*/
if (allowMenuSection($menus, ['Cliente', 'Tarifacliente'], 'index')):
if (allowMenuSection($menus, ['Cliente'], 'index')):
?>
<!-- Clientes -->
<li class="menu-item">
@ -47,15 +47,6 @@
</li>
<?php endif; ?>
<?php endif; ?>
<?php if (count($temp = getArrayItem($menus, 'name', 'Cliente')) > 0): ?>
<?php if (count(getArrayItem($temp, 'methods', 'nuevo', true)) > 0): ?>
<li class="menu-item">
<a href="<?= site_url("clientes/nuevo") ?>" class="menu-link">
<div data-i18n="<?= lang("App.menu_clientes_nuevo") ?>"><?= lang("App.menu_clientes_nuevo") ?></div>
</a>
</li>
<?php endif; ?>
<?php endif; ?>
</ul>
</li>
<?php endif; ?>