mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'dev/presupuestos3' into 'dev/presupuestos_pdf'
# Conflicts: # ci4/app/Config/Routes.php # ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaForm.php
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default"
|
||||
data-bs-dismiss="modal"><?= lang('Basic.global.deleteConfirmationCancel') ?></button>
|
||||
<a href="javascript:void(0);" class="btn btn-danger btn-confirm btn-remove"><?= lang('Basic.global.deleteConfirmationButton') ?></a>
|
||||
<a id="confirmDelete" href="javascript:void(0);" class="btn btn-danger btn-confirm btn-remove"><?= lang('Basic.global.deleteConfirmationButton') ?></a>
|
||||
</div><!--//.modal-footer -->
|
||||
</div><!--//.modal-content -->
|
||||
</div><!--//.modal-dialog -->
|
||||
|
||||
@ -175,6 +175,12 @@
|
||||
$(this).find('.btn-confirm').attr('href', $(e.relatedTarget).data('href'));
|
||||
});
|
||||
|
||||
$('#confirm2delete').keypress(function(e) { // Attach the form handler to the keypress event
|
||||
if (e.keyCode == 13) { // If the the enter key was pressed.
|
||||
$('#confirmDelete').click(); // Trigger the button(elementId) click event.
|
||||
}
|
||||
});
|
||||
|
||||
function toggleAllCheckboxes($cssClass, $io=null) {
|
||||
$('.'+$cssClass).prop('checked', $io);
|
||||
}
|
||||
|
||||
@ -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 -->
|
||||
@ -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() ?>
|
||||
@ -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() ?>
|
||||
|
||||
@ -101,16 +101,16 @@
|
||||
<?= lang('Maquinas.forzarNumFormasHorizontalesPortada') ?>
|
||||
</label>
|
||||
<input type="number" id="forzarNumFormasHorizontalesPortada"
|
||||
name="forzar_num_formas_horizontales_portada" maxLength="11" class="form-control"
|
||||
value="<?= old('forzar_num_formas_horizontales_portada', $maquina->forzar_num_formas_horizontales_portada) ?>">
|
||||
name="forzar_num_formas_horizontales_cubierta" maxLength="11" class="form-control"
|
||||
value="<?= old('forzar_num_formas_horizontales_cubierta', $maquina->forzar_num_formas_horizontales_cubierta) ?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="forzarNumFormasVerticalesPortada" class="form-label">
|
||||
<?= lang('Maquinas.forzarNumFormasVerticalesPortada') ?>
|
||||
</label>
|
||||
<input type="number" id="forzarNumFormasVerticalesPortada"
|
||||
name="forzar_num_formas_verticales_portada" maxLength="11" class="form-control"
|
||||
value="<?= old('forzar_num_formas_verticales_portada', $maquina->forzar_num_formas_verticales_portada) ?>">
|
||||
name="forzar_num_formas_verticales_cubierta" maxLength="11" class="form-control"
|
||||
value="<?= old('forzar_num_formas_verticales_cubierta', $maquina->forzar_num_formas_verticales_cubierta) ?>">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label for="observaciones" class="form-label">
|
||||
|
||||
@ -78,8 +78,7 @@
|
||||
<table id="tableOfCalles" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('MaquinasCalles.formas_min') ?></th>
|
||||
<th><?= lang('MaquinasCalles.formas_max') ?></th>
|
||||
<th><?= lang('MaquinasCalles.formas') ?></th>
|
||||
<th><?= lang('MaquinasCalles.internas') ?></th>
|
||||
<th><?= lang('MaquinasCalles.externas') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
@ -479,13 +478,14 @@
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250],
|
||||
order: [[ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
pageLength: 25,
|
||||
lengthChange: true,
|
||||
searching: true,
|
||||
paging: true,
|
||||
info: true,
|
||||
stateSave: true,
|
||||
dom: "lftp",
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinasPapelesImpresion') ?>',
|
||||
@ -522,8 +522,11 @@
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr2]
|
||||
},
|
||||
{
|
||||
searchable: false,
|
||||
targets: [0,3,4,5,6,7,8,lastColNr2]
|
||||
}
|
||||
],
|
||||
rowCallback: function (row, data) {
|
||||
@ -532,13 +535,7 @@
|
||||
},
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
searchable: false,
|
||||
targets: [0,3,4,5,6,7,8]
|
||||
}
|
||||
],
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
@ -657,9 +654,7 @@
|
||||
table : "#tableOfCalles",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "formas_min"
|
||||
}, {
|
||||
name: "formas_max"
|
||||
name: "formas"
|
||||
}, {
|
||||
name: "internas"
|
||||
}, {
|
||||
@ -728,8 +723,7 @@
|
||||
async: true,
|
||||
}),
|
||||
columns : [
|
||||
{ 'data': 'formas_min' },
|
||||
{ 'data': 'formas_max' },
|
||||
{ 'data': 'formas' },
|
||||
{ 'data': 'internas' },
|
||||
{ 'data': 'externas' },
|
||||
{ data: actionBtns,
|
||||
|
||||
@ -0,0 +1,175 @@
|
||||
<div class="accordion mt-3" id="accordionComentarios">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionComentariosTip" aria-expanded="false"
|
||||
aria-controls="accordionComentariosTip">
|
||||
<h4><?= lang("Presupuestos.comentarios") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionComentariosTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionComentarios">
|
||||
<div class="accordion-body">
|
||||
<div class="nav-align-top mb-4">
|
||||
<ul class="nav nav-pills mb-3" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link active"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-cliente"
|
||||
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">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-safekat"
|
||||
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">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#comentarios-presupuesto"
|
||||
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>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="comentarios-cliente" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
id="comentariosCliente"
|
||||
name="comentarios_cliente"
|
||||
required style="height: 10em;"
|
||||
class="form-control"><?= old('comentarios', $presupuestoEntity->comentarios_cliente) ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-safekat" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
id="comentariosSafekat"
|
||||
name="comentarios_safekat"
|
||||
required
|
||||
style="height: 10em;"
|
||||
class="form-control"><?=old('comentarios_safekat', $presupuestoEntity->comentarios_safekat) ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="comentarios-presupuesto" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<textarea
|
||||
rows="3"
|
||||
id="comentariosPdf"
|
||||
name="comentarios_pdf"
|
||||
required style="height: 10em;"
|
||||
class="form-control"><?=old('comentarios_pdf', $presupuestoEntity->comentarios_pdf) ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</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 -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
<!------------------------------------------------------->
|
||||
<!-- Código JS comportamiento ?????. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $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() ?>
|
||||
|
||||
|
||||
@ -204,26 +204,11 @@
|
||||
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comentarios" class="form-label">
|
||||
<?=lang('Presupuestos.comentarios') ?>*
|
||||
</label>
|
||||
<textarea rows="3" id="comentarios" name="comentarios" required style="height: 10em;" class="form-control"><?=old('comentarios', $presupuestoEntity->comentarios) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comentariosSafekat" class="form-label">
|
||||
<?=lang('Presupuestos.comentariosSafekat') ?>*
|
||||
</label>
|
||||
<textarea rows="3" id="comentariosSafekat" name="comentarios_safekat" required style="height: 10em;" class="form-control"><?=old('comentarios_safekat', $presupuestoEntity->comentarios_safekat) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comentariosPdf" class="form-label">
|
||||
<?=lang('Presupuestos.comentariosPdf') ?>*
|
||||
</label>
|
||||
<textarea rows="3" id="comentariosPdf" name="comentarios_pdf" required style="height: 10em;" class="form-control"><?=old('comentarios_pdf', $presupuestoEntity->comentarios_pdf) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comentariosTarifa" class="form-label">
|
||||
|
||||
@ -95,16 +95,16 @@
|
||||
<label for="merma" class="form-label">
|
||||
<?= lang('Presupuestos.merma') ?>*
|
||||
</label>
|
||||
<input type="number" id="merma" name="merma" maxLength="8" step="0.01" class="form-control" value="<?= old('merma', $presupuestoEntity->merma) ?>">
|
||||
<input type="number" id="merma" name="merma" maxLength="8" step="1" class="form-control" value="<?= old('merma', $presupuestoEntity->merma) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="mermaportada" class="form-label">
|
||||
<?= lang('Presupuestos.mermaportada') ?>*
|
||||
<label for="mermacubierta" class="form-label">
|
||||
<?= lang('Presupuestos.mermacubierta') ?>*
|
||||
</label>
|
||||
<input type="number" id="mermaportada" name="merma_sobrecubierta" placeholder="6.00" maxLength="8" step="0.01" class="form-control" value="<?= old('merma_sobrecubierta', $presupuestoEntity->merma_sobrecubierta) ?>">
|
||||
<input type="number" id="mermacubierta" name="merma_cubierta" placeholder="10" maxLength="8" step="1" class="form-control" value="<?= old('merma_cubierta', $presupuestoEntity->merma_cubierta) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
@ -69,21 +69,21 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.negro') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="number" id="compPaginasNegro" name="comp_paginas_negro" placeholder="0" maxLength="5" class="form-control" value="<?= isset($presupuestoEntity->comparador_json_data->negro) ? (old(0, $presupuestoEntity->comparador_json_data->negro->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasNegro" name="comp_paginas_negro" placeholder="0" maxLength="5" class="form-control comp_negro_items" value="<?= isset($presupuestoEntity->comparador_json_data->negro) ? (old(0, $presupuestoEntity->comparador_json_data->negro->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelNegro" name="comp_papel_negro" class="form-control select2bs2" style="width: 100%;">
|
||||
<?php if (isset($papelGenericoNegroList) && is_array($papelGenericoNegroList) && !empty($papelGenericoNegroList)) :
|
||||
foreach ($papelGenericoNegroList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" /*<?= $k == $presupuestoEntity->tipo_impresion_id ? ' selected' : '' ?>* />
|
||||
<?= $v ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compGramajeNegro" name="comp_gramaje_negro" class="form-control select2bs2" disabled style="width: 100%;">
|
||||
<select id="compGramajeNegro" name="comp_gramaje_negro" class="form-control select2bs2 comp_negro_items" disabled style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
@ -97,21 +97,21 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.negrohq') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="number" id="compPaginasNegrohq" name="comp_paginas_negrohq" placeholder="0" maxLength="5" class="form-control" value="<?= isset($presupuestoEntity->comparador_json_data->negro) ? (old(0, $presupuestoEntity->comparador_json_data->negro->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasNegrohq" name="comp_paginas_negrohq" placeholder="0" maxLength="5" class="form-control comp_negrohq_items" value="<?= isset($presupuestoEntity->comparador_json_data->negro) ? (old(0, $presupuestoEntity->comparador_json_data->negro->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelNegrohq" name="comp_papel_negrohq" class="form-control select2bs2" style="width: 100%;">
|
||||
<select id="compPapelNegrohq" name="comp_papel_negrohq" class="form-control select2bs2 comp_negrohq_items" style="width: 100%;">
|
||||
<?php if (isset($papelGenericoNegroHQList) && is_array($papelGenericoNegroHQList) && !empty($papelGenericoNegroHQList)) :
|
||||
foreach ($papelGenericoNegroHQList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" /*<?= $k == $presupuestoEntity->tipo_impresion_id ? ' selected' : '' ?>* />
|
||||
<?= $v ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compGramajeNegrohq" name="comp_gramaje_negrohq" class="form-control select2bs2" disabled style="width: 100%;">
|
||||
<select id="compGramajeNegrohq" name="comp_gramaje_negrohq" class="form-control select2bs2 comp_negrohq_items" disabled style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
@ -125,21 +125,21 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.color') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="number" id="compPaginasColor" name="comp_paginas_color" placeholder="0" maxLength="5" class="form-control" value="<?= isset($presupuestoEntity->comparador_json_data->color) ? (old(0, $presupuestoEntity->comparador_json_data->color->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasColor" name="comp_paginas_color" placeholder="0" maxLength="5" class="form-control comp_color_items" value="<?= isset($presupuestoEntity->comparador_json_data->color) ? (old(0, $presupuestoEntity->comparador_json_data->color->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelColor" name="comp_papel_color" class="form-control select2bs2" style="width: 100%;">
|
||||
<select id="compPapelColor" name="comp_papel_color" class="form-control select2bs2 comp_color_items" style="width: 100%;">
|
||||
<?php if (isset($papelGenericoColorList) && is_array($papelGenericoColorList) && !empty($papelGenericoColorList)) :
|
||||
foreach ($papelGenericoColorList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" /*<?= $k == $presupuestoEntity->tipo_impresion_id ? ' selected' : '' ?>* />
|
||||
<?= $v ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compGramajeColor" name="comp_gramaje_color" class="form-control select2bs2" disabled style="width: 100%;">
|
||||
<select id="compGramajeColor" name="comp_gramaje_color" class="form-control select2bs2 comp_color_items" disabled style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
@ -153,21 +153,21 @@
|
||||
<p><?= lang('MaquinasTarifasImpresions.colorhq') ?></p>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<input type="number" id="compPaginasColorhq" name="comp_paginas_colorhq" placeholder="0" maxLength="5" class="form-control" value="<?= isset($presupuestoEntity->comparador_json_data->color) ? (old(0, $presupuestoEntity->comparador_json_data->color->paginas)) : '0' ?>">
|
||||
<input type="text" id="compPaginasColorhq" name="comp_paginas_colorhq" placeholder="0" maxLength="5" class="form-control comp_colorhq_items" value="<?= isset($presupuestoEntity->comparador_json_data->color) ? (old(0, $presupuestoEntity->comparador_json_data->color->paginas)) : '0' ?>">
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelColorhq" name="comp_papel_colorhq" class="form-control select2bs2" style="width: 100%;">
|
||||
<select id="compPapelColorhq" name="comp_papel_colorhq" class="form-control select2bs2 comp_colorhq_items" style="width: 100%;">
|
||||
<?php if (isset($papelGenericoColorHQList) && is_array($papelGenericoColorHQList) && !empty($papelGenericoColorHQList)) :
|
||||
foreach ($papelGenericoColorHQList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" /*<?= $k == $presupuestoEntity->tipo_impresion_id ? ' selected' : '' ?>* />
|
||||
<?= $v ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compGramajeColorhq" name="comp_gramaje_colorhq" class="form-control select2bs2" disabled style="width: 100%;">
|
||||
<select id="compGramajeColorhq" name="comp_gramaje_colorhq" class="form-control select2bs2 comp_colorhq_items" disabled style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
@ -179,30 +179,30 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<p><?= lang('PapelImpresion.cubierta') ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compPaginasCubierta" name="comp_paginas_cubierta" class="form-control select2bs2" style="width: 100%;">
|
||||
<option value="1" >
|
||||
<select id="compCarasCubierta" name="comp_paginas_cubierta" class="form-control select2bs2 comp_cubierta_items" style="width: 100%;">
|
||||
<option value="2">
|
||||
<p><?= lang('Presupuestos.1cara') ?></p>
|
||||
</option>
|
||||
<option value="2" >
|
||||
<option value="4">
|
||||
<p><?= lang('Presupuestos.2caras') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<select id="compPapelCubierta" name="comp_papel_cubierta" class="form-control select2bs2" style="width: 100%;">
|
||||
<?php if (isset($papelGenericoSobrecubiertaList) && is_array($papelGenericoSobrecubiertaList) && !empty($papelGenericoSobrecubiertaList)) :
|
||||
foreach ($papelGenericoSobrecubiertaList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" /*<?= $k == $presupuestoEntity->tipo_impresion_id ? ' selected' : '' ?>* />
|
||||
<?= $v ?>
|
||||
<select id="compPapelCubierta" name="comp_papel_cubierta" class="form-control select2bs2 comp_cubierta_items" style="width: 100%;">
|
||||
<?php if (isset($papelGenericoCubiertaList) && is_array($papelGenericoCubiertaList) && !empty($papelGenericoCubiertaList)) :
|
||||
foreach ($papelGenericoCubiertaList as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<select id="compGramajeCubierta" name="comp_gramaje_cubierta" class="form-control select2bs2" disabled style="width: 100%;">
|
||||
<select id="compGramajeCubierta" name="comp_gramaje_cubierta" class="form-control select2bs2 comp_cubierta_items" disabled style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
@ -246,17 +246,15 @@
|
||||
<div class="accordion mt-3" id="accordionCompInteriorPlana">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionCompInteriorPlanaTip" aria-expanded="false" aria-controls="accordionCompInteriorPlanaTip">
|
||||
<h6><?= lang("Presupuestos.compInteriorPlana") ?></h4>
|
||||
<button id="accordion-button-int-plana" type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionCompInteriorPlanaTip" aria-expanded="false" aria-controls="accordionCompInteriorPlanaTip">
|
||||
<h6 id="title_int_plana"><?= lang("Presupuestos.compInteriorPlana") ?></h6>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionCompInteriorPlanaTip" class="accordion-collapse collapse" data-bs-parent="#accordionCompInteriorPlana">
|
||||
<div class="accordion-body">
|
||||
|
||||
|
||||
|
||||
<table id="tableCompIntPlana" class="comparator-table table dt-responsive dataTable">
|
||||
<table id="tableCompIntPlana" class="comparator-table table dt-responsive dataTable" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.tipo') ?></th>
|
||||
@ -274,10 +272,6 @@
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.peso') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.click') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.totalClicks') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.precioPagNegro') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.precioPagColor') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.totalTinta') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.totalCorte') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.total') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -285,12 +279,21 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="dt-result dt-result-text" colspan="18"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compInteriorPlana") ?>:</td>
|
||||
<td class="dt-result dt-result-value" colspan="2"> 0.00 </td>
|
||||
<td class="dt-result dt-result-text" colspan="14"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compInteriorPlana") ?>:</td>
|
||||
<td id="total_comp_plana" class="dt-result dt-result-value" colspan="2"> 0.00 </td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<div >
|
||||
<button type="button" name="insertarPlanaBtn"
|
||||
id="insertarPlanaBtn"
|
||||
class="btn btn-primary float-end me-sm-3 me-1 mb-3 insertarLinea d-none">
|
||||
<?= lang('Presupuestos.insertarLinea').' '.strtoupper(lang('Presupuestos.plana')) ?>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -300,8 +303,8 @@
|
||||
<div class="accordion mt-3" id="accordionCompInteriorRotativa">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingTwo">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionCompInteriorRotativaTip" aria-expanded="false" aria-controls="accordionCompInteriorRotativaTip">
|
||||
<h6><?= lang("Presupuestos.compInteriorRotativa") ?></h4>
|
||||
<button id="accordion-button-int-rotativa" type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionCompInteriorRotativaTip" aria-expanded="false" aria-controls="accordionCompInteriorRotativaTip">
|
||||
<h6 id="title_int_rot"><?= lang("Presupuestos.compInteriorRotativa") ?></h6>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
@ -309,7 +312,7 @@
|
||||
<div class="accordion-body">
|
||||
|
||||
|
||||
<table id="tableCompIntRotativa" class="comparator-table table dt-responsive dataTable">
|
||||
<table id="tableCompIntRotativa" class="comparator-table table dt-responsive dataTable" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.tipo') ?></th>
|
||||
@ -317,6 +320,7 @@
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.papel') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.gramaje') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.marca') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.aFavorFibra') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.maquina') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.numeroPliegos') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.pliegosPedido') ?></th>
|
||||
@ -338,12 +342,20 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="dt-result dt-result-text" colspan="18"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compInteriorRotativa") ?>:</td>
|
||||
<td class="dt-result dt-result-value" colspan="2">0.00</td>
|
||||
<td class="dt-result dt-result-text" colspan="19"><?= 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>
|
||||
</table>
|
||||
|
||||
<div >
|
||||
<button type="button" name="insertarRotativaBtn"
|
||||
id="insertarRotativaBtn"
|
||||
class="btn btn-primary float-end me-sm-3 me-1 mb-3 insertarLinea d-none">
|
||||
<?= lang('Presupuestos.insertarLinea').' '.strtoupper(lang('Presupuestos.rotativa')) ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -352,15 +364,15 @@
|
||||
<div class="accordion mt-3" id="accordionCompCubiertaSobrecubierta">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingThree">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionCompCubiertaSobrecubiertaTip" aria-expanded="false" aria-controls="accordionCompCubiertaSobrecubiertaTip">
|
||||
<h6><?= lang("Presupuestos.cubierta") ?></h4>
|
||||
<button id="accordion-button-cubierta" type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionCompCubiertaSobrecubiertaTip" aria-expanded="false" aria-controls="accordionCompCubiertaSobrecubiertaTip">
|
||||
<h6 id="title_cubierta"><?= lang("Presupuestos.cubierta") ?></h6>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionCompCubiertaSobrecubiertaTip" class="accordion-collapse collapse" data-bs-parent="#accordionCompCubiertaSobrecubierta">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableCompCubierta" class="comparator-table table dt-responsive dataTable">
|
||||
<table id="tableCompCubierta" class="comparator-table table dt-responsive dataTable" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.tipo') ?></th>
|
||||
@ -378,10 +390,6 @@
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.peso') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.click') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.totalClicks') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.precioPagNegro') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.precioPagColor') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.totalTinta') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.totalCorte') ?></th>
|
||||
<th style="padding-right: 0.75em;"><?= lang('Presupuestos.total') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -389,13 +397,20 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td class="dt-result dt-result-text" colspan="18"><?= lang('Presupuestos.total') ?> <?= lang('Presupuestos.cubierta') ?>:</td>
|
||||
<td class="dt-result dt-result-value" colspan="2">0.00</td>
|
||||
<td class="dt-result dt-result-text" colspan="14"><?= lang('Presupuestos.total') ?> <?= lang("Presupuestos.compInteriorPlana") ?>:</td>
|
||||
<td id="total_comp_cubierta" class="dt-result dt-result-value" colspan="2"> 0.00 </td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
|
||||
<div>
|
||||
<button type="button" name="insertarCubiertaBtn"
|
||||
id="insertarCubiertaBtn"
|
||||
class="btn btn-primary float-end me-sm-3 me-1 mb-3 insertarLinea d-none">
|
||||
<?= lang('Presupuestos.insertarLinea').' '.strtoupper(lang('Presupuestos.cubierta')) ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,712 @@
|
||||
<div class="accordion mt-3" id="accordionDatosServicios">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionDatosServiciosTip" aria-expanded="false"
|
||||
aria-controls="accordionDatosServiciosTip">
|
||||
<h4><?= lang("Presupuestos.datosServicios") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionDatosServiciosTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionDatosServicios">
|
||||
<div class="accordion-body">
|
||||
<div class="nav-align-top mb-4">
|
||||
<ul class="nav nav-pills mb-3" role="tablist">
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link active"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#servicios-acabado"
|
||||
aria-controls="servicios-acabado"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.servicioAcabado") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#servicios-preimpresion"
|
||||
aria-controls="servicios-preimpresion"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.servicioPreimpresion") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#servicios-encuadernacion"
|
||||
aria-controls="servicios-encuadernacion"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.servicioEncuadernado") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#servicios-manipulado"
|
||||
aria-controls="servicios-manipulado"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.servicioManipulado") ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="servicios-acabado" role="tabpanel">
|
||||
<table id="tableOfServiciosAcabado" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaacabado.tarifaacabado') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="servicios-preimpresion" role="tabpanel">
|
||||
<table id="tableOfServiciosPreimpresion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifapreimpresion.tarifapreimpresion') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="servicios-encuadernacion" role="tabpanel">
|
||||
<table id="tableOfServiciosEncuadernacion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaencuadernacion.tarifaencuadernacion') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="servicios-manipulado" role="tabpanel">
|
||||
<table id="tableOfServiciosManipulado" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifamanipulado.tarifamanipulado') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!------------------------------------------------------->
|
||||
<!-- Código JS comportamiento tabla servicios acabado. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr = $('#tableOfServiciosAcabado').find("tr:first th").length - 1;
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
else{
|
||||
id = 200000; // id=-1
|
||||
}
|
||||
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<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>
|
||||
`;
|
||||
};
|
||||
|
||||
editor = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfPresupuestoAcabados') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfServiciosAcabado",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
"name": "tarifa_acabado_id",
|
||||
"type": "select"
|
||||
}, {
|
||||
"name": "precio_unidad"
|
||||
}, {
|
||||
"name": "precio_total"
|
||||
}, {
|
||||
"name": "presupuesto_id",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
// Generación de la lista de servicios de acabado (id, nombre)
|
||||
const acabadosList = <?php echo json_encode($serviciosAcabado); ?>;
|
||||
editor.field( 'tarifa_acabado_id' ).update( acabadosList );
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['presupuesto_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['presupuesto_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
editor.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
theTable.clearPipeline();
|
||||
theTable.draw();
|
||||
});
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfServiciosAcabado').on( 'click', 'tbody span.edit', function (e) {
|
||||
editor.inline(
|
||||
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
||||
{
|
||||
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||
cancelTrigger: 'span.cancel',
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||
submitTrigger: 'span.edit',
|
||||
submit: 'allIfChanged'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
// 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: `/serviciosacabados/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)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
var theTable = $('#tableOfServiciosAcabado').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPresupuestoAcabados') ?>',
|
||||
data: {
|
||||
id_presupuesto: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{'data': 'tarifa_acabado_id',
|
||||
render: function(data, type, row, meta) {
|
||||
var value = acabadosList.find(element => element.value === data);
|
||||
return value['label'];
|
||||
},
|
||||
},
|
||||
{ 'data': 'precio_unidad' },
|
||||
{ 'data': 'precio_total' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
},
|
||||
{
|
||||
"orderData": [ 0, 1 ],
|
||||
"targets": 0
|
||||
},
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!-------------------------------------------------------------->
|
||||
<!-- Código JS comportamiento tabla servicios encuadernacion. -->
|
||||
<!-------------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr2 = $('#tableOfServiciosEncuadernacion').find("tr:first th").length - 1;
|
||||
|
||||
editor2 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfPresupuestoEncuadernaciones') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfServiciosEncuadernacion",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
"name": "tarifa_encuadernado_id",
|
||||
"type": "select"
|
||||
}, {
|
||||
"name": "precio_unidad"
|
||||
}, {
|
||||
"name": "precio_total"
|
||||
}, {
|
||||
"name": "presupuesto_id",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
// Generación de la lista de servicios de acabado (id, nombre)
|
||||
const encuadernadosList = <?php echo json_encode($serviciosEncuadernacion); ?>;
|
||||
editor2.field( 'tarifa_encuadernado_id' ).update( encuadernadosList );
|
||||
|
||||
editor2.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['presupuesto_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['presupuesto_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
editor2.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
editor2.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
theTable2.clearPipeline();
|
||||
theTable2.draw();
|
||||
});
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfServiciosEncuadernacion').on( 'click', 'tbody span.edit', function (e) {
|
||||
editor2.inline(
|
||||
theTable2.cells(this.parentNode.parentNode, '*').nodes(),
|
||||
{
|
||||
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||
cancelTrigger: 'span.cancel',
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||
submitTrigger: 'span.edit',
|
||||
submit: 'allIfChanged'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
var theTable2 = $('#tableOfServiciosEncuadernacion').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPresupuestoEncuadernaciones') ?>',
|
||||
data: {
|
||||
id_presupuesto: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{'data': 'tarifa_encuadernado_id',
|
||||
render: function(data, type, row, meta) {
|
||||
var value = encuadernadosList.find(element => element.value === data);
|
||||
return value['label'];
|
||||
},
|
||||
},
|
||||
{ 'data': 'precio_unidad' },
|
||||
{ 'data': 'precio_total' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr2]
|
||||
},
|
||||
{
|
||||
"orderData": [ 0, 1 ],
|
||||
"targets": 0
|
||||
},
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor2,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!-------------------------------------------------------------->
|
||||
<!-- Código JS comportamiento tabla servicios manipulados. -->
|
||||
<!-------------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr3 = $('#tableOfServiciosManipulado').find("tr:first th").length - 1;
|
||||
|
||||
editor3 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfPresupuestoManipulados') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfServiciosManipulado",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
"name": "tarifa_manipulado_id",
|
||||
"type": "select"
|
||||
}, {
|
||||
"name": "precio_unidad"
|
||||
}, {
|
||||
"name": "precio_total"
|
||||
}, {
|
||||
"name": "presupuesto_id",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
// Generación de la lista de servicios de acabado (id, nombre)
|
||||
const manipuladosList = <?php echo json_encode($serviciosManipulado); ?>;
|
||||
editor3.field( 'tarifa_manipulado_id' ).update( manipuladosList );
|
||||
|
||||
editor3.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['presupuesto_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['presupuesto_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
editor3.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
editor3.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
theTable3.clearPipeline();
|
||||
theTable3.draw();
|
||||
});
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfServiciosManipulado').on( 'click', 'tbody span.edit', function (e) {
|
||||
editor3.inline(
|
||||
theTable3.cells(this.parentNode.parentNode, '*').nodes(),
|
||||
{
|
||||
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||
cancelTrigger: 'span.cancel',
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||
submitTrigger: 'span.edit',
|
||||
submit: 'allIfChanged'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
// Delete row
|
||||
|
||||
|
||||
var theTable3 = $('#tableOfServiciosManipulado').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPresupuestoManipulados') ?>',
|
||||
data: {
|
||||
id_presupuesto: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{'data': 'tarifa_manipulado_id',
|
||||
render: function(data, type, row, meta) {
|
||||
var value = manipuladosList.find(element => element.value === data);
|
||||
return value['label'];
|
||||
},
|
||||
},
|
||||
{ 'data': 'precio_unidad' },
|
||||
{ 'data': 'precio_total' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr3]
|
||||
},
|
||||
{
|
||||
"orderData": [ 0, 1 ],
|
||||
"targets": 0
|
||||
},
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor3,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<!-------------------------------------------------------------->
|
||||
<!-- Código JS comportamiento tabla servicios preimpresion. -->
|
||||
<!-------------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr4 = $('#tableOfServiciosPreimpresion').find("tr:first th").length - 1;
|
||||
|
||||
editor4 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfPresupuestoPreimpresiones') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfServiciosPreimpresion",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
"name": "tarifa_preimpresion_id",
|
||||
"type": "select"
|
||||
}, {
|
||||
"name": "precio_unidad"
|
||||
}, {
|
||||
"name": "precio_total"
|
||||
}, {
|
||||
"name": "presupuesto_id",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
// Generación de la lista de servicios de acabado (id, nombre)
|
||||
const preimpresionesList = <?php echo json_encode($serviciosPreimpresion); ?>;
|
||||
editor4.field( 'tarifa_preimpresion_id' ).update( preimpresionesList );
|
||||
|
||||
editor4.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['presupuesto_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['presupuesto_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
editor4.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
editor4.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
theTable4.clearPipeline();
|
||||
theTable4.draw();
|
||||
});
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfServiciosPreimpresion').on( 'click', 'tbody span.edit', function (e) {
|
||||
editor4.inline(
|
||||
theTable4.cells(this.parentNode.parentNode, '*').nodes(),
|
||||
{
|
||||
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||
cancelTrigger: 'span.cancel',
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||
submitTrigger: 'span.edit',
|
||||
submit: 'allIfChanged'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
// Delete row
|
||||
|
||||
|
||||
var theTable4 = $('#tableOfServiciosPreimpresion').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [[ 0, "asc" ], [ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPresupuestoPreimpresiones') ?>',
|
||||
data: {
|
||||
id_presupuesto: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{'data': 'tarifa_preimpresion_id',
|
||||
render: function(data, type, row, meta) {
|
||||
var value = preimpresionesList.find(element => element.value === data);
|
||||
return value['label'];
|
||||
},
|
||||
},
|
||||
{ 'data': 'precio_unidad' },
|
||||
{ 'data': 'precio_total' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr4]
|
||||
},
|
||||
{
|
||||
"orderData": [ 0, 1 ],
|
||||
"targets": 0
|
||||
},
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor4,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,81 @@
|
||||
<div class="accordion mt-3 col-xl-6" id="accordionResumen">
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionResumenTip" aria-expanded="false"
|
||||
aria-controls="accordionResumenTip">
|
||||
<h4><?= lang("Presupuestos.resumen") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionResumenTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionResumen">
|
||||
<div class="accordion-body">
|
||||
|
||||
<div class="col-xl-12">
|
||||
<div class="border rounded p-4 mb-3 pb-3">
|
||||
|
||||
<!-- Price Details -->
|
||||
<h6>Detalles del presupuesto</h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-normal text-end">Coste papel</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 fw-normal text-end">Margen papel</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
|
||||
<dt class="col-6 fw-normal text-end">Coste impresión</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 fw-normal text-end">Margen impresión</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
|
||||
<dt class="col-6 fw-normal text-end">Coste servicios</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 fw-normal text-end">Margen servicios</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
|
||||
<dt class="col-6 fw-normal text-end">Costes</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 fw-normal text-end">Margen</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
|
||||
<dt class="col-6 fw-normal text-end">Descuento</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
|
||||
<dt class="col-6 fw-normal text-end">Precio unidad</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 fw-normal text-end">Coste de envío</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
<hr class="mx-n4">
|
||||
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-normal text-end">Total impresión</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 text-end">Total presupuesto</dt>
|
||||
<dd class="col-6 fw-semibold text-end mb-0">NaN €</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="d-grid float-end mb-4">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="confirmar_presupuesto" name="solapas" value="1" <?= $presupuestoEntity->confirmarPresupuesto == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="papelFormatoPersonalizado"><?= lang('Presupuestos.confirmar') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
<!------------------------------------------------------->
|
||||
<!-- Código JS comportamiento ?????. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
@ -1,6 +1,85 @@
|
||||
/*******************************
|
||||
* Eventos asociados a elementos HTML
|
||||
*******************************/
|
||||
$('#compPaginasNegro').on("change", function () {
|
||||
var negro = parseInt(document.getElementById('compPaginasNegro').value);
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
if (paginas < negro) {
|
||||
document.getElementById('compPaginasNegro').value = paginas;
|
||||
negro = paginas;
|
||||
}
|
||||
var color = parseInt(document.getElementById('compPaginasColor').value);
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
|
||||
var newValue = paginas - negro;
|
||||
if (newValue != color) {
|
||||
document.getElementById('compPaginasColor').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasColor').change();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$('#compPaginasColor').on("change", function () {
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
var color = parseInt(document.getElementById('compPaginasColor').value);
|
||||
var negro = parseInt(document.getElementById('compPaginasNegro').value);
|
||||
|
||||
if (paginas < color) {
|
||||
document.getElementById('compPaginasColor').value = paginas;
|
||||
color = paginas
|
||||
}
|
||||
var newValue = paginas - color;
|
||||
if (newValue != negro) {
|
||||
document.getElementById('compPaginasNegro').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasNegro').change();
|
||||
}
|
||||
});
|
||||
|
||||
$('#compPaginasNegrohq').on("change", function () {
|
||||
if (document.getElementById('paginas').value < document.getElementById('compPaginasNegrohq').value) {
|
||||
document.getElementById('compPaginasNegrohq').value = document.getElementById('paginas').value;
|
||||
}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
if (document.getElementById('compPaginasNegrohq').value + document.getElementById('compPaginasColorhq').value > document.getElementById('paginas').value) {
|
||||
var newValue = document.getElementById('paginas').value - document.getElementById('compPaginasNegrohq').value;
|
||||
document.getElementById('compPaginasColorhq').value = newValue >= 0 ? newValue : 0;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#compPaginasColorhq').on("change", function () {
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
var color = parseInt(document.getElementById('compPaginasColorhq').value);
|
||||
var negro = parseInt(document.getElementById('compPaginasNegrohq').value);
|
||||
|
||||
if (paginas < color) {
|
||||
document.getElementById('compPaginasColorhq').value = paginas;
|
||||
color = paginas
|
||||
}
|
||||
var newValue = paginas - color;
|
||||
if (newValue != negro) {
|
||||
document.getElementById('compPaginasNegrohq').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasNegrohq').change();
|
||||
}
|
||||
});
|
||||
|
||||
$('#paginas').on("change", function () {
|
||||
// Si es negro o color
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
document.getElementById('compPaginasNegro').value = document.getElementById('paginas').value;
|
||||
document.getElementById('compPaginasColor').value = 0;
|
||||
}
|
||||
// Si es negrohq o colorhq
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
document.getElementById('compPaginasNegrohq').value = document.getElementById('paginas').value;
|
||||
document.getElementById('compPaginasColorhq').value = 0;
|
||||
}
|
||||
});
|
||||
|
||||
$("#solapas").on("click", function () {
|
||||
var e = document.getElementById('div_solapas_ancho');
|
||||
if (document.getElementById('solapas').checked) {
|
||||
@ -11,22 +90,18 @@ $("#solapas").on("click", function () {
|
||||
}
|
||||
});
|
||||
|
||||
$('#tipoImpresion').on("change", function () {
|
||||
updatePapelesComparador();
|
||||
});
|
||||
|
||||
$('#tipoImpresion').on("change", function () {
|
||||
updatePapelesComparador();
|
||||
});
|
||||
|
||||
$('#compRetractilado').on("change", function () {
|
||||
checkRetractiladoComparador(this);
|
||||
});
|
||||
|
||||
|
||||
$('#compRetractilado5').on("change", function () {
|
||||
checkRetractiladoComparador(this);
|
||||
});
|
||||
|
||||
|
||||
$('#imagenesBnInterior').on("change", function () {
|
||||
var e = document.getElementById('tipoImpresion');
|
||||
var optionToHide = e.querySelector("option[value='negro']");
|
||||
@ -44,6 +119,7 @@ $('#imagenesBnInterior').on("change", function () {
|
||||
$('#tipoImpresion').select2();
|
||||
});
|
||||
|
||||
|
||||
$('#compPosPaginasColor').on("keyup", function () {
|
||||
computarPaginasColor(this.value);
|
||||
});
|
||||
@ -52,23 +128,152 @@ $('#compPosPaginasColor').on("keyup", function () {
|
||||
// Este evento recoloca los headers de las tablas cuando se pulsa el
|
||||
// boton del acordeon
|
||||
$('.accordion-button').on('click', function (e) {
|
||||
$.fn.dataTable.tables({ visible: true, api: true }).columns.adjust();
|
||||
|
||||
if(e.target.id.includes("plana")){
|
||||
$("#tableCompIntPlana").DataTable().columns.adjust();
|
||||
}
|
||||
else if(e.target.id.includes("rotativa")){
|
||||
$("#tableCompIntRotativa").DataTable().columns.adjust();
|
||||
}
|
||||
else if(e.target.id.includes("cubierta")){
|
||||
$("#tableCompCubierta").DataTable().columns.adjust();
|
||||
}
|
||||
else if(e.target.id.includes("LineasPresupuesto")){
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************
|
||||
* Metodos
|
||||
*******************************/
|
||||
$('.insertarLinea').on("click", function (e) {
|
||||
|
||||
if(e.target.id.includes("Plana")){
|
||||
// Se borran todas las líneas que no sean cubierta y sobrecubierta
|
||||
$('#tableLineasPresupuesto').DataTable()
|
||||
.rows( function ( idx, data, node ) {
|
||||
return data[0] !== 'cubierta' && data[0] !== 'sobrecubierta';
|
||||
} )
|
||||
.remove()
|
||||
.draw();
|
||||
|
||||
var rows = $("#tableCompIntPlana").DataTable().rows( '.selected' ).data().toArray();
|
||||
console.log(rows);
|
||||
for(row of rows){
|
||||
$('#tableLineasPresupuesto').DataTable().row.add({
|
||||
'tipo': row['tipo'],
|
||||
'paginas': row['paginas'],
|
||||
'papel': row['papel'],
|
||||
'gramaje': row['gramaje'],
|
||||
'marca': row['marca'],
|
||||
'maquina': row['maquina'],
|
||||
'tiempo': row['tiempoMaquina'],
|
||||
'numeroPliegos': row['numeroPliegos'],
|
||||
'pliegosPedido': row['pliegosPedido'],
|
||||
'precioPliego': row['precioPliego'],
|
||||
'libro': row['libro'],
|
||||
'totalPapelPedido': row['totalPapelPedido'],
|
||||
'chekPapel': true,
|
||||
'lomo': row['lomo'],
|
||||
'peso': row['peso'],
|
||||
'click': row['click'],
|
||||
'totalClicks': row['totalClicks'],
|
||||
'chekClicks': true,
|
||||
'maquinaId': row['maquinaId'],
|
||||
'maquinaVelocidad': row['maquinaVelocidad'],
|
||||
'papelGenericoId': row['papelGenericoId'],
|
||||
'papelImpresionId': row['papelImpresionId'],
|
||||
}
|
||||
).draw();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function getRowFromLineaInt(tipo, linea) {
|
||||
|
||||
return {
|
||||
'tipo': tipo,
|
||||
'paginas': linea.fields.paginas,
|
||||
'papel': linea.fields.papel_generico,
|
||||
'gramaje': linea.fields.gramaje,
|
||||
'marca': linea.fields.papel_impresion,
|
||||
'maquina': linea.fields.maquina,
|
||||
'numeroPliegos': isNaN(parseFloat(linea.fields.pliegos_libro)) ? "" : parseFloat(linea.fields.pliegos_libro).toFixed(2),
|
||||
'pliegosPedido': isNaN(parseFloat(linea.fields.pliegos_pedido)) ? "" : parseFloat(linea.fields.pliegos_pedido).toFixed(2),
|
||||
'precioPliego': isNaN(parseFloat(linea.fields.precios_pliegos)) ? "" : parseFloat(linea.fields.precios_pliegos).toFixed(6),
|
||||
'libro': isNaN(parseFloat(linea.fields.precio_libro)) ? "" : parseFloat(linea.fields.precio_libro).toFixed(2),
|
||||
'totalPapelPedido': isNaN(parseFloat(linea.fields.precio_pedido)) ? "" : parseFloat(linea.fields.precio_pedido).toFixed(2),
|
||||
'lomo': isNaN(parseFloat(linea.fields.mano)) ? "" : parseFloat(linea.fields.mano).toFixed(2),
|
||||
'peso': isNaN(parseFloat(linea.fields.peso)) ? "" : parseFloat(linea.fields.peso).toFixed(2),
|
||||
'click': isNaN(parseFloat(linea.fields.precio_click)) ? "" : parseFloat(linea.fields.precio_click).toFixed(6),
|
||||
'totalClicks': isNaN(parseFloat(linea.fields.precio_click_pedido)) ? "" : parseFloat(linea.fields.precio_click_pedido).toFixed(2),
|
||||
'total': isNaN(parseFloat(linea.fields.precio_pedido) + parseFloat(linea.fields.precio_click_pedido)) ?
|
||||
"" : (parseFloat(linea.fields.precio_pedido) + parseFloat(linea.fields.precio_click_pedido)).toFixed(2),
|
||||
'maquinaId': linea.fields.maquina_id,
|
||||
'maquinaVelocidad': linea.fields.maquina_velocidad,
|
||||
'tiempoMaquina': linea.fields.tiempo_maquina,
|
||||
'papelGenericoId': linea.fields.papel_generico_id,
|
||||
'papelImpresionId': linea.fields.papel_impresion_id,
|
||||
}
|
||||
}
|
||||
|
||||
function getRowFromLineaRot(linea) {
|
||||
|
||||
return {
|
||||
'tipo': 'rotativa',
|
||||
'paginas': linea.fields.paginas,
|
||||
'papel': linea.fields.papel_generico,
|
||||
'gramaje': linea.fields.gramaje,
|
||||
'marca': linea.fields.papel_impresion,
|
||||
'aFavorFibra':linea.fields.a_favor_fibra==1?'si':'no',
|
||||
'maquina': linea.fields.maquina,
|
||||
'numeroPliegos': isNaN(parseFloat(linea.fields.pliegos_libro)) ? "" : parseFloat(linea.fields.pliegos_libro).toFixed(2),
|
||||
'pliegosPedido': isNaN(parseFloat(linea.fields.pliegos_pedido)) ? "" : parseFloat(linea.fields.pliegos_pedido).toFixed(2),
|
||||
'precioPliego': isNaN(parseFloat(linea.fields.precios_pliegos)) ? "" : parseFloat(linea.fields.precios_pliegos).toFixed(6),
|
||||
'libro': isNaN(parseFloat(linea.fields.precio_libro)) ? "" : parseFloat(linea.fields.precio_libro).toFixed(2),
|
||||
'totalPapelPedido': isNaN(parseFloat(linea.fields.precio_pedido)) ? "" : parseFloat(linea.fields.precio_pedido).toFixed(2),
|
||||
'lomo': isNaN(parseFloat(linea.fields.mano)) ? "" : parseFloat(linea.fields.mano).toFixed(2),
|
||||
'peso': isNaN(parseFloat(linea.fields.peso)) ? "" : parseFloat(linea.fields.peso).toFixed(2),
|
||||
'click': isNaN(parseFloat(linea.fields.precio_click)) ? "" : parseFloat(linea.fields.precio_click).toFixed(6),
|
||||
'totalClicks': isNaN(parseFloat(linea.fields.precio_click_pedido)) ? "" : parseFloat(linea.fields.precio_click_pedido).toFixed(2),
|
||||
'precioPagNegro': isNaN(parseFloat(linea.fields.precio_pagina_negro)) ? "" : parseFloat(linea.fields.precio_pagina_negro).toFixed(6),
|
||||
'precioPagColor': isNaN(parseFloat(linea.fields.precio_pagina_color)) ? "" : parseFloat(linea.fields.precio_pagina_color).toFixed(6),
|
||||
'totalTinta':isNaN(parseFloat(linea.fields.precio_tinta)) ? "" : parseFloat(linea.fields.precio_tinta).toFixed(2),
|
||||
'totalCorte':isNaN(parseFloat(linea.fields.total_corte)) ? "" : parseFloat(linea.fields.total_corte).toFixed(2),
|
||||
'total': isNaN(parseFloat(linea.fields.total_impresion)) ? "" : (parseFloat(linea.fields.total_impresion)).toFixed(2),
|
||||
'maquinaId': linea.fields.maquina_id,
|
||||
'maquinaVelocidad': linea.fields.maquina_velocidad,
|
||||
'tiempoMaquina': linea.fields.tiempo_maquina,
|
||||
'papelGenericoId': linea.fields.papel_generico_id,
|
||||
'papelImpresionId': linea.fields.papel_impresion_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function checkDatosPedidoForComp() {
|
||||
|
||||
if (parseInt($('#paginas').val()) > 0 &&
|
||||
parseInt($('#tirada').val()) > 0 &&
|
||||
($('#papelFormatoId').select2('data').length > 0 ||
|
||||
(parseInt($('#papelFormatoAncho').val()) > 0 && parseInt($('#papelFormatoAlto').val()) > 0)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function init_comparador() {
|
||||
updatePapelesComparador();
|
||||
const paginasColor = document.getElementById('compCalPaginasColor');
|
||||
if (paginasColor.value.length > 0) {
|
||||
computarPaginasColor(paginasColor.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -100,6 +305,7 @@ function computarPaginasColor(string) {
|
||||
autosize.update(calPagesTextarea);
|
||||
}
|
||||
|
||||
|
||||
function checkRetractiladoComparador(element) {
|
||||
|
||||
switch (element.id) {
|
||||
@ -140,11 +346,13 @@ function updatePapelesComparador() {
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
clearNegro();
|
||||
break;
|
||||
|
||||
case "negrohq":
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "none";
|
||||
|
||||
});
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "none";
|
||||
@ -190,8 +398,217 @@ function updatePapelesComparador() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function clearNegro() {
|
||||
document.getElementById('compPaginasNegro').value = 0;
|
||||
$('#compGramajeNegro').val('').change();
|
||||
$('#compGramajeNegro').prop('disabled', true);
|
||||
$('#compPapelNegro').val('data', { id: '0' });
|
||||
}
|
||||
|
||||
|
||||
function clearIntLineas(is_color){
|
||||
$("#tableCompIntPlana").DataTable().rows( '.selected' ).deselect();
|
||||
var tabla = $('#tableCompIntPlana').DataTable();
|
||||
tabla
|
||||
.rows( function ( idx, data, node ) {
|
||||
return data['tipo'].includes(is_color?'color':'bn');
|
||||
} )
|
||||
.remove()
|
||||
.draw();
|
||||
$('#insertarPlanaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
|
||||
function clearCubierta(){
|
||||
|
||||
$('#tableCompCubierta').DataTable().clear().draw();
|
||||
}
|
||||
|
||||
|
||||
function clearIntRot(){
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
}
|
||||
|
||||
|
||||
function selectIntLineas(){
|
||||
var negro_selected = false;
|
||||
var color_selected = false;
|
||||
$("#tableCompIntPlana").DataTable().rows( '.selected' ).deselect();
|
||||
$("#tableCompIntPlana").DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
if( !negro_selected && $('#tableCompIntPlana').DataTable().cell(rowIdx, 0).data().includes('bn') ){
|
||||
$("#tableCompIntPlana").DataTable().row( rowIdx ).nodes().to$().toggleClass( 'selected' );
|
||||
negro_selected = true;
|
||||
}
|
||||
if( !color_selected && $('#tableCompIntPlana').DataTable().cell(rowIdx, 0).data().includes('color') ){
|
||||
$("#tableCompIntPlana").DataTable().row( rowIdx ).nodes().to$().toggleClass( 'selected' );
|
||||
color_selected = true;
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#tableCompIntPlana").DataTable();
|
||||
var rows = table.rows( '.selected' ).indexes();
|
||||
var data = table.rows( rows ).data();
|
||||
|
||||
var value_total = 0.00;
|
||||
|
||||
for (let i = 0; i < data.length ; i++) {
|
||||
|
||||
value_total += parseFloat(data[i]['total'])
|
||||
}
|
||||
|
||||
$('#total_comp_plana').html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
function selectIntRotLineas(){
|
||||
|
||||
$("#tableCompIntRotativa").DataTable().rows( '.selected' ).deselect();
|
||||
|
||||
let value_total = 0.00;
|
||||
|
||||
if($("#tableCompIntRotativa").DataTable().rows().count()>0) {
|
||||
|
||||
$("#tableCompIntRotativa").DataTable().row( 0 ).nodes().to$().toggleClass( 'selected' );
|
||||
value_total = parseFloat($("#tableCompIntRotativa").DataTable().rows( 0 ).data()[0]['total'])
|
||||
};
|
||||
|
||||
|
||||
$('#total_comp_rot').html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
function selectCubiertaLineas(){
|
||||
|
||||
$("#tableCompCubierta").DataTable().rows( '.selected' ).deselect();
|
||||
|
||||
let value_total = 0.00;
|
||||
|
||||
if($("#tableCompCubierta").DataTable().rows().count()>0) {
|
||||
|
||||
$("#tableCompCubierta").DataTable().row( 0 ).nodes().to$().toggleClass( 'selected' );
|
||||
value_total = parseFloat($("#tableCompCubierta").DataTable().rows( 0 ).data()[0]['total'])
|
||||
};
|
||||
|
||||
|
||||
$('#total_comp_cubierta').html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
function getIDsComparador(is_color, is_hq){
|
||||
|
||||
if(!is_color){
|
||||
if(is_hq){
|
||||
var papel = '#compPapelNegrohq';
|
||||
var gramaje = '#compGramajeNegrohq';
|
||||
var paginas = '#compPaginasNegrohq';
|
||||
}
|
||||
else{
|
||||
var papel = '#compPapelNegro';
|
||||
var gramaje = '#compGramajeNegro';
|
||||
var paginas = '#compPaginasNegro';
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(is_hq){
|
||||
var papel = '#compPapelColorhq';
|
||||
var gramaje = '#compGramajeColorhq';
|
||||
var paginas = '#compPaginasColorhq';
|
||||
}
|
||||
else{
|
||||
var papel = '#compPapelColor';
|
||||
var gramaje = '#compGramajeColor';
|
||||
var paginas = '#compPaginasColor';
|
||||
}
|
||||
}
|
||||
return{
|
||||
papel: papel,
|
||||
gramaje: gramaje,
|
||||
paginas: paginas,
|
||||
}
|
||||
}
|
||||
|
||||
function getDimensionLibro(){
|
||||
var ancho = 0;
|
||||
var alto = 0;
|
||||
|
||||
if($('#papelFormatoId').select2('data').length > 0){
|
||||
ancho = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[0]);
|
||||
alto = parseFloat($('#papelFormatoId').select2('data')[0].text.trim().split(" x ")[1]);
|
||||
}
|
||||
else{
|
||||
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
|
||||
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
|
||||
}
|
||||
return {
|
||||
ancho: ancho,
|
||||
alto: alto
|
||||
}
|
||||
}
|
||||
|
||||
function checkInputsForRotativa(){
|
||||
|
||||
// Si es color, el gramaje y el papel tiene que ser el mismo
|
||||
try{
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
if($('#compPapelNegro').select2('data')[0].id == $('#compPapelColor').select2('data')[0].id &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.trim() == $('#compGramajeColor').select2('data')[0].text.trim() ){
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ($('#tipoImpresion').select2('data')[0].id == 'negro') {
|
||||
if($('#compPapelNegro').select2('data')[0].id.length>0 &&
|
||||
$('#compGramajeNegro').select2('data')[0].text.length>0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch(error){
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function fillIntPlana(data, is_color, is_hq){
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) < (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) > (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function(linea) {
|
||||
if(typeof linea.error == "undefined")
|
||||
$('#tableCompIntPlana').DataTable().row
|
||||
.add(getRowFromLineaInt(is_color?(is_hq?'colorhq':'color'):(is_hq?'bnhq':'bn'), linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function fillIntRot(data){
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) < (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) > (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function(linea) {
|
||||
if(typeof linea.error == "undefined"){
|
||||
$('#tableCompIntRotativa').DataTable().row
|
||||
.add(getRowFromLineaRot(linea))
|
||||
.draw()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function fillCubierta(data, is_color, is_hq){
|
||||
|
||||
let sorted = data.lineas.sort(
|
||||
(p1, p2) => ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) < (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ?
|
||||
-1 : ((p1.fields.precio_pedido+p1.fields.precio_click_pedido) > (p2.fields.precio_pedido+p2.fields.precio_click_pedido)) ? 1 : 0);
|
||||
sorted.forEach(function(linea) {
|
||||
if(typeof linea.error == "undefined")
|
||||
$('#tableCompCubierta').DataTable().row
|
||||
.add(getRowFromLineaInt('cubierta', linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("presupuestoToPdf"), lang("Basic.global.Print"), ["class" => "btn btn-dark float-start me-sm-3 me-1",]) ?>
|
||||
<?= anchor(route_to("#"), lang("Basic.global.Print"), ["class" => "btn btn-dark float-start me-sm-3 me-1",]) ?>
|
||||
<?= anchor(route_to("#"), lang("Basic.global.Clone"), ["class" => "btn btn-info float-start me-sm-3 me-1",]) ?>
|
||||
<?= anchor(route_to("cosidotapablandaList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
|
||||
</div>
|
||||
@ -146,7 +146,7 @@
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
autosize($('#compCalPaginasColor'));
|
||||
|
||||
|
||||
$('#papelFormatoPersonalizado').on("click",function(){
|
||||
var checkbox = document.getElementById('papelFormatoPersonalizado');
|
||||
if(checkbox.checked == true){
|
||||
@ -154,7 +154,7 @@
|
||||
document.getElementById("papelFormatoAlto").style.display = "block";
|
||||
$('#papelFormatoId').next(".select2-container").hide();
|
||||
$('#papelFormatoId').val('').change();
|
||||
document.getElementById("label_papelFormatoId").innerHTML =
|
||||
document.getElementById("label_papelFormatoId").innerHTML =
|
||||
"<?=lang('Presupuestos.papelFormatoId') ?> (" +
|
||||
"<?=lang('Presupuestos.papelFormatoAncho') ?> x <?=lang('Presupuestos.papelFormatoAncho') ?>)*";
|
||||
}
|
||||
@ -185,7 +185,7 @@
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
columns: [
|
||||
{ 'data': 'tipo',
|
||||
{ 'data': 'tipo',
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='bn')
|
||||
return '<?= lang('Presupuestos.bn') ?>';
|
||||
@ -240,7 +240,7 @@
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
columns: [
|
||||
{ 'data': 'tipo',
|
||||
{ 'data': 'tipo',
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='rotativa')
|
||||
return '<?= lang('Presupuestos.rotativa') ?>';
|
||||
@ -300,7 +300,7 @@
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
columns: [
|
||||
{ 'data': 'tipo',
|
||||
{ 'data': 'tipo',
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='cubierta')
|
||||
return '<?= lang('Presupuestos.cubierta') ?>';
|
||||
@ -339,7 +339,7 @@
|
||||
});
|
||||
|
||||
const papelGenericoNegroList = <?php echo json_encode($papelGenericoNegroList); ?>;
|
||||
|
||||
|
||||
|
||||
var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||
scrollX: true,
|
||||
@ -352,9 +352,256 @@
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
$('.comp_negro_items').on('change', function (e) {
|
||||
|
||||
checkComparadorInt(false,false);
|
||||
});
|
||||
|
||||
$('.comp_negrohq_items').on('change', function (e) {
|
||||
|
||||
checkComparadorInt(false, true);
|
||||
});
|
||||
|
||||
$('.comp_color_items').on('change', function (e) {
|
||||
|
||||
checkComparadorInt(true, false);
|
||||
});
|
||||
|
||||
$('.comp_colorhq_items').on('change', function (e) {
|
||||
checkComparadorInt(true, true);
|
||||
});
|
||||
|
||||
async function getLineasIntPlana(is_color, is_hq){
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
let datos = {
|
||||
type: 'interior',
|
||||
color: is_color?1:0,
|
||||
hq: is_hq?1:0,
|
||||
paginas: parseInt($(''+ elementos.paginas).val()),
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#merma').val()),
|
||||
ancho: dimension.ancho,
|
||||
alto: dimension.alto,
|
||||
papel_generico_id: $(''+ elementos.papel).select2('data')[0].id,
|
||||
papel_generico: $(''+ elementos.papel).select2('data')[0].text.trim(),
|
||||
gramaje: $(''+ elementos.gramaje).select2('data')[0].text.trim() ,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
data: datos,
|
||||
success: function (data) {
|
||||
|
||||
clearIntLineas(is_color);
|
||||
|
||||
if(data.lineas.length >0){
|
||||
|
||||
fillIntPlana(data, is_color, is_hq);
|
||||
selectIntLineas();
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>' + ' (' + tableCompIntPlana.rows().count() + ')');
|
||||
$('#insertarPlanaBtn').removeClass('d-none')
|
||||
}
|
||||
else{
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
$('#insertarPlanaBtn').addClass('d-none')
|
||||
$('#total_comp_plana').html('0.00');
|
||||
}
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
return true;
|
||||
},
|
||||
error: function(e){
|
||||
return false;
|
||||
}
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
async function getLineasIntRot(is_hq){
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
// Rotativa solo negro o color (no hq)
|
||||
if ( is_hq==false){
|
||||
|
||||
if(checkInputsForRotativa()){
|
||||
|
||||
let datos = {
|
||||
type: 'interior_rot',
|
||||
paginas: parseInt($('#paginas').val()),
|
||||
paginas_negro: parseInt($('#compPaginasNegro').val()),
|
||||
paginas_color: parseInt($('#compPaginasColor').val()),
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#merma').val()),
|
||||
ancho: dimension.ancho,
|
||||
alto: dimension.alto,
|
||||
// el papel y el gramaje se coge del negro (siempre estará)
|
||||
papel_generico_id: $('#compPapelNegro').select2('data')[0].id,
|
||||
papel_generico: $('#compPapelNegro').select2('data')[0].text.trim(),
|
||||
gramaje: $('#compGramajeNegro').select2('data')[0].text.trim() ,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
data: datos,
|
||||
success: function (data) {
|
||||
|
||||
clearIntRot();
|
||||
|
||||
if(data.lineas.length >0){
|
||||
|
||||
fillIntRot(data);
|
||||
selectIntRotLineas();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>' + ' (' + tableCompIntRotativa.rows().count() + ')');
|
||||
$('#insertarRotativaBtn').removeClass('d-none')
|
||||
}
|
||||
else{
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#insertarRotativaBtn').addClass('d-none')
|
||||
$('#total_comp_rot').html('0.00')
|
||||
|
||||
}
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
return true;
|
||||
},
|
||||
error: function(e){
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$('.comp_cubierta_items').on('change', function (){
|
||||
|
||||
if ($('#compCarasCubierta').select2('data').length > 0 &&
|
||||
$('#compPapelCubierta').select2('data').length > 0 &&
|
||||
$('#compGramajeCubierta').select2('data').length > 0 ){
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
let datos = {
|
||||
type: 'cubierta',
|
||||
paginas: parseInt($('#compCarasCubierta').select2('data')[0].id),
|
||||
tirada: parseInt($('#tirada').val()),
|
||||
merma: parseInt($('#mermacubierta').val()),
|
||||
color: 1,
|
||||
ancho: dimension.ancho,
|
||||
alto: dimension.alto,
|
||||
solapas: $('#solapas').is(':checked')?1:0,
|
||||
solapas_ancho: parseInt($('#solapas_ancho').val()),
|
||||
papel_generico_id: $('#compPapelCubierta').select2('data')[0].id,
|
||||
papel_generico: $('#compPapelCubierta').select2('data')[0].text.trim(),
|
||||
gramaje: $('#compGramajeCubierta').select2('data')[0].text.trim() ,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cosidotapablanda/datatable",
|
||||
data: datos,
|
||||
success: function (data) {
|
||||
|
||||
clearCubierta();
|
||||
|
||||
if(data.lineas.length >0){
|
||||
|
||||
fillCubierta(data);
|
||||
selectCubiertaLineas();
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>' + ' (' + tableCompCubierta.rows().count() + ')');
|
||||
$('#insertarCubiertaBtn').removeClass('d-none')
|
||||
|
||||
}
|
||||
else{
|
||||
$('#title_cubierta').html('<?= lang("Presupuestos.cubierta") ?>');
|
||||
$('#insertarCubiertaBtn').addClass('d-none')
|
||||
$('#total_comp_cubierta').html('0.00')
|
||||
|
||||
}
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
return true;
|
||||
},
|
||||
error: function(e){
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
else{
|
||||
clearCubierta();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#tipoImpresion').on("change", function () {
|
||||
updatePapelesComparador();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
$('#paginas').change();
|
||||
|
||||
|
||||
if (($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'color')){
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if( $('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
}
|
||||
|
||||
}
|
||||
else if (($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'colorhq')){
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
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 &&
|
||||
parseInt($(''+ elementos.paginas).val()) > 0 &&
|
||||
checkDatosPedidoForComp()) {
|
||||
|
||||
getLineasIntPlana(is_color, is_hq).then((result) =>{
|
||||
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) {
|
||||
|
||||
@ -641,7 +888,7 @@
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
@ -683,7 +930,7 @@
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
@ -727,7 +974,7 @@
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
@ -771,7 +1018,7 @@
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
@ -811,7 +1058,7 @@
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
@ -826,8 +1073,6 @@
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
|
||||
@ -835,7 +1080,7 @@
|
||||
<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://cdn.datatables.net/select/1.7.0/js/dataTables.select.min.js"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/comparadorCosidoTapaBlanda_js') ?>"></script>
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Presupuestos.presupuestoCosidotapablandaList') ?></h3>
|
||||
<?=anchor(route_to('newCosidotapablanda'), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
<?=anchor(route_to('newCosidotapablanda'), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary ']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
@ -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' },
|
||||
{
|
||||
|
||||
17
ci4/app/Views/themes/backend/vuexy/form/test_js/test_js.js
Normal file
17
ci4/app/Views/themes/backend/vuexy/form/test_js/test_js.js
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
fetch("/presupuestos/cosidotapablanda/datatable", {
|
||||
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
|
||||
})
|
||||
.then(response => console.log(response))
|
||||
//.then(json => console.log(json))
|
||||
.catch(err => console.log(err));
|
||||
|
||||
*/
|
||||
36
ci4/app/Views/themes/backend/vuexy/form/test_js/viewTest.php
Normal file
36
ci4/app/Views/themes/backend/vuexy/form/test_js/viewTest.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
console.log("Hola")
|
||||
|
||||
let datos = {
|
||||
table_type: 'comp_int_bn',
|
||||
paginas: 200,
|
||||
tirada: 100,
|
||||
merma: 10,
|
||||
ancho: 98 ,
|
||||
alto: 148,
|
||||
papel_generico_id: 4,
|
||||
papel_generico: 'AHUESADO OFFSET',
|
||||
gramaje: 80,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"cosidotapablanda/datatable",
|
||||
data:datos, // data recive un objeto con la informacion que se enviara al servidor
|
||||
success:function(data){ //success es una funcion que se utiliza si el servidor retorna informacion
|
||||
console.log(data)
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
},
|
||||
//dataType: dataType // El tipo de datos esperados del servidor. Valor predeterminado: Intelligent Guess (xml, json, script, text, html).
|
||||
})
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
@ -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; ?>
|
||||
|
||||
@ -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; ?>
|
||||
@ -76,7 +67,7 @@
|
||||
<?php if (allowMenuSection(
|
||||
$menus,
|
||||
['Fresadotapadura', 'Fresadotapablanda', 'Cosidotapadura', 'Cosidotapablanda',
|
||||
'Cosidotapablandasolapas', 'Grapados', 'Espiraltapadura', 'Espiraltapablanda',
|
||||
'Grapados', 'Espiraltapadura', 'Espiraltapablanda',
|
||||
'Wireotapadura', 'Wireotapablanda'],
|
||||
'index')):
|
||||
?>
|
||||
@ -125,16 +116,6 @@
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Cosidotapablandasolapas')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("presupuestos/cosidotapablandasolapas") ?>" class="menu-link">
|
||||
<div data-i18n="<?= lang("App.menu_libros_cosido_tapa_blanda_solapas") ?>"><?= lang("App.menu_libros_cosido_tapa_blanda_solapas") ?></div>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (count($temp = getArrayItem($menus, 'name', 'Grapados')) > 0): ?>
|
||||
<?php if (count(getArrayItem($temp, 'methods', 'index', true)) > 0): ?>
|
||||
<li class="menu-item">
|
||||
|
||||
@ -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; ?>
|
||||
|
||||
Reference in New Issue
Block a user