mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
intentando resolver conflictos
This commit is contained in:
279
ci4/app/Views/themes/vuexy/form/activity/activityList.php
Normal file
279
ci4/app/Views/themes/vuexy/form/activity/activityList.php
Normal file
@ -0,0 +1,279 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="row g-4">
|
||||
<!-- OS cards -->
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['windows']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_windows"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-windows ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['mac']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_mac"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-apple ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['linux']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_linux"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-ubuntu ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=($logs['android']??'0') + ($logs['iphone']??'0')?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_mobile"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-device-mobile ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=($logs['ie']??'0') + ($logs['edge']??'0')?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_edge"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-edge ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['safari']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_safari"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-safari ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['firefox']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_firefox"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-firefox ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xl-3 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div class="card-title mb-0">
|
||||
<h5 class="mb-0 me-2"><?=$logs['chrome']??'0'?></h5>
|
||||
<small><?=strtoupper(lang("App.activity_top_chrome"))?></small>
|
||||
</div>
|
||||
<div class="card-icon">
|
||||
<span class="badge bg-label-primary rounded-pill p-2">
|
||||
<i class="ti ti-brand-chrome ti-xl"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- \OS cards -->
|
||||
<!-- Activity Table -->
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header row">
|
||||
<div class="col-sm-6">
|
||||
<h4 class="card-title"><?= $title['page']??'' ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<div class="table-responsive">
|
||||
<table id='activityTable' class="table table-striped table-hover" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=lang("Actividad.user")?></th>
|
||||
<th><?=lang("Actividad.level")?></th>
|
||||
<th><?=lang("Actividad.event")?></th>
|
||||
<th><?=lang("Actividad.ip")?></th>
|
||||
<th><?=lang("Actividad.os")?></th>
|
||||
<th><?=lang("Actividad.browser")?></th>
|
||||
<th><?=lang("Actividad.createdAt")?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- \Activity Table -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
|
||||
const lastColNr = $('#activityTable').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#activityTable').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendors/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfActividad') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'user' },
|
||||
{ 'data': 'level' },
|
||||
{ 'data': 'event' },
|
||||
{ 'data': 'ip' },
|
||||
{ 'data': 'os' },
|
||||
{ 'data': 'browser' },
|
||||
{ 'data': 'created_at' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [7];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="text-success bi bi-check-lg"></i>' : '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/*$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Paises.pais'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('activityList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
155
ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteDireccionesForm.php
Executable file
155
ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteDireccionesForm.php
Executable file
@ -0,0 +1,155 @@
|
||||
<div id="addressForm" action='create' class="modal fade addModal">
|
||||
<div class="modal-dialog modal-lg modal-simple">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 id="labelTitleConfirmDialog" class="modal-title"><?= lang('ClienteDirecciones.direccionTitle') ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="add_alias" class="form-label">
|
||||
<?= lang('ClienteDirecciones.alias') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_alias" tabindex="1" maxLength="100" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="add_att" class="form-label">
|
||||
<?= lang('ClienteDirecciones.att') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_att" tabindex="1" maxLength="100" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="add_email" class="form-label">
|
||||
<?= lang('ClienteDirecciones.email') ?>
|
||||
</label>
|
||||
<input type="text" id="add_email" tabindex="2" maxLength="100" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="add_direccion" class="form-label">
|
||||
<?= lang('ClienteDirecciones.direccion') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_direccion" tabindex="3" maxLength="255" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class='row'>
|
||||
|
||||
<div id='divPais' class="col-md-12 col-lg-12 pl-4">
|
||||
<div class="mb-3">
|
||||
<label for="add_pais_id" class="form-label">
|
||||
<?=lang('ClienteDirecciones.pais') ?>*
|
||||
</label>
|
||||
<select id="add_pais_id" tabindex="4" class="form-control select2bs" style="width: 100%;" >
|
||||
<option value="" disabled selected><?=lang('ClienteDirecciones.selectPais') ?></option>
|
||||
<?php foreach ($paisList as $item) : ?>
|
||||
<option value="<?=$item->id ?>">
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- //.row -->
|
||||
|
||||
<div class='row'>
|
||||
|
||||
<div id='divMunicipio' class="col-md-12 col-lg-12 pl-4">
|
||||
<div class="mb-3">
|
||||
<label for="add_municipio" class="form-label">
|
||||
<?=lang('ClienteDirecciones.municipio') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_municipio" tabindex="6" maxLength="100" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4 spain-data" style="display: none;">
|
||||
<div class="mb-3">
|
||||
<label for="add_provincia" class="form-label">
|
||||
<?=lang('ClienteDirecciones.provincia') ?>
|
||||
</label>
|
||||
<input type="text" id="add_provincia" tabindex="7" maxLength="100" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
</div> <!-- //.row -->
|
||||
|
||||
<div class='row'>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4">
|
||||
<div class="mb-3">
|
||||
<label for="add_cp" class="form-label">
|
||||
<?=lang('ClienteDirecciones.cp') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_cp" tabindex="8" maxLength="100" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4">
|
||||
<div class="mb-3">
|
||||
<label for="add_telefono" class="form-label">
|
||||
<?=lang('ClienteDirecciones.telefono') ?>
|
||||
</label>
|
||||
<input type="text" id="add_telefono" tabindex="9" maxLength="100" class="form-control"></input>
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
</div> <!-- //.row -->
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="saveAdd"
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
>Guardar</button>
|
||||
<button id="cancelAdd"
|
||||
type="button"
|
||||
class="btn btn-default"
|
||||
>Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
$('#cancelAdd').on('click', function(){
|
||||
$('#addressForm').modal("hide");
|
||||
})
|
||||
|
||||
|
||||
$('#saveAdd').on('click', function(){
|
||||
saveAdd_callback()
|
||||
})
|
||||
|
||||
|
||||
|
||||
$('#add_pais_id').on('change', function(){
|
||||
var nombre_pais = $("#add_pais_id option:selected" ).text().trim();
|
||||
if(nombre_pais.localeCompare('España')==0){
|
||||
$('#divPais').removeClass('col-lg-12').addClass('col-lg-6')
|
||||
$('#divMunicipio').removeClass('col-lg-12').addClass('col-lg-6')
|
||||
$('.spain-data').css('display', 'inline')
|
||||
}
|
||||
else{
|
||||
$('.spain-data').css('display', 'none')
|
||||
$('#divPais').removeClass('col-lg-6').addClass('col-lg-12')
|
||||
$('#divMunicipio').removeClass('col-lg-6').addClass('col-lg-12')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// clear modal items when close
|
||||
$('#addressForm').on('hidden.bs.modal', function () {
|
||||
$('#add_alias').val("")
|
||||
$('#add_att').val("")
|
||||
$('#add_email').val("")
|
||||
$('#add_direccion').val("")
|
||||
$("#add_pais_id").val("").change()
|
||||
$('#add_municipio').val("")
|
||||
$('#add_provincia').val("")
|
||||
$('#add_cp').val("")
|
||||
$('#add_telefono').val("")
|
||||
})
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
1532
ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteFormItems.php
Executable file
1532
ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteFormItems.php
Executable file
File diff suppressed because it is too large
Load Diff
65
ci4/app/Views/themes/vuexy/form/clientes/cliente/convert2templateModal.php
Executable file
65
ci4/app/Views/themes/vuexy/form/clientes/cliente/convert2templateModal.php
Executable file
@ -0,0 +1,65 @@
|
||||
<div id="convert2Template" class="modal fade addModal">
|
||||
<div class="modal-dialog modal-lg modal-simple">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 id="labelTitleConfirmDialog" class="modal-title"><?= lang('ClientePrecios.convertir2plantilla') ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id='error-nombre'></div>
|
||||
|
||||
<div class="mb-3">
|
||||
<p><?= lang('ClientePrecios.convertir2plantillaText') ?></p>
|
||||
<p><?= lang('ClientePrecios.convertir2plantillaText2') ?></p>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre_plantilla" class="form-label">
|
||||
<?= lang('ClientePrecios.nombrePlantilla') ?>
|
||||
</label>
|
||||
<input type="text" id="nombre_plantilla" maxLength="100" class="form-control new-address">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="saveTemplate"
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
><?= lang('App.global_save') ?></button>
|
||||
<button id="cancelTemplate"
|
||||
type="button"
|
||||
class="btn btn-default"
|
||||
><?= lang('App.user_delete_btn_cancel') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
$('#saveTemplate').on('click', function(){
|
||||
if($('#nombre_plantilla').val().length == 0){
|
||||
popErrorAlert('<?= lang('ClientePrecios.errors.error_nombre_template') ?>', 'error-nombre')
|
||||
}
|
||||
else{
|
||||
data = new FormData();
|
||||
data.append('cliente_id', id)
|
||||
data.append('nombre', $('#nombre_plantilla').val())
|
||||
data.append('<?= csrf_token() ?? "token" ?>', <?= csrf_token() ?>v)
|
||||
fetch('<?= route_to("createClienteplantillaprecios");?>' , {
|
||||
method: "POST",
|
||||
body: data,
|
||||
})
|
||||
.then(data => {
|
||||
$('#convert2Template').modal("hide");
|
||||
var newOption = new Option($('#nombre_plantilla').val(), "", false, false);
|
||||
$('#plantillas').append(newOption);
|
||||
$('#nombre_plantilla').val("");
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
$('#cancelTemplate').on('click', function(){
|
||||
$('#convert2Template').modal("hide");
|
||||
})
|
||||
<?=$this->endSection() ?>
|
||||
238
ci4/app/Views/themes/vuexy/form/clientes/cliente/viewClienteForm.php
Executable file
238
ci4/app/Views/themes/vuexy/form/clientes/cliente/viewClienteForm.php
Executable file
@ -0,0 +1,238 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $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="clienteForm" method="post" class="card-body" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/clientes/cliente/_clienteFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="pt-4">
|
||||
<input
|
||||
type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
id="saveForm"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
>
|
||||
<?= anchor(route_to("clienteList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
$(document).keypress(function (e) {
|
||||
var key = e.which;
|
||||
if(key == 13) // the enter key code
|
||||
{ e.preventDefault()
|
||||
if($('#addressForm').hasClass('show')){
|
||||
$("#saveAdd").click();
|
||||
}
|
||||
else if ($('#convert2Template').hasClass('show')){
|
||||
$("#saveTemplate").click();
|
||||
}
|
||||
else{
|
||||
$('#saveForm').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#soporteId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfUsers") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id_user',
|
||||
text: 'first_name',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#formaPagoId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfFormasDePagos") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#paisId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfPaises") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#provinciaId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfProvincias") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#comunidadAutonomaId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfComunidadesAutonomas") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#comercialId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfUsers") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id_user',
|
||||
text: 'first_name',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
147
ci4/app/Views/themes/vuexy/form/clientes/cliente/viewClienteList.php
Executable file
147
ci4/app/Views/themes/vuexy/form/clientes/cliente/viewClienteList.php
Executable file
@ -0,0 +1,147 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Clientes.clienteList') ?></h3>
|
||||
<?=anchor(route_to('clienteAdd'), lang('Basic.global.addNew').' '.lang('Clientes.cliente'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
<table id="tableOfClientes" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Clientes.nombre') ?></th>
|
||||
<th><?= lang('Clientes.alias') ?></th>
|
||||
<th><?= lang('Clientes.cif') ?></th>
|
||||
<th><?= lang('Clientes.email') ?></th>
|
||||
<th><?= lang('Users.comercial') ?></th>
|
||||
<th><?= lang('FormasPagoes.formaDePago') ?></th>
|
||||
<th><?= lang('Clientes.vencimiento') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfClientes').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
theTable = $('#tableOfClientes').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[0, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('clienteDT') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'alias' },
|
||||
{ 'data': 'cif' },
|
||||
{ 'data': 'email' },
|
||||
{ 'data': 'comercial' },
|
||||
{ 'data': 'forma_pago_id' },
|
||||
{ 'data': 'vencimiento' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/clientes/cliente/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(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: `/clientes/cliente/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,58 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="clienteId" class="form-label">
|
||||
<?=lang('ClienteContactos.cliente') ?>*
|
||||
</label>
|
||||
<select id="clienteId" name="cliente_id" required class="form-control select2bs2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($clienteList) && is_array($clienteList) && !empty($clienteList) ) :
|
||||
foreach ($clienteList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$clienteContactoEntity->cliente_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="cargo" class="form-label">
|
||||
<?=lang('ClienteContactos.cargo') ?>
|
||||
</label>
|
||||
<input type="text" id="cargo" name="cargo" maxLength="100" class="form-control" value="<?=old('cargo', $clienteContactoEntity->cargo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('ClienteContactos.nombre') ?>
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" maxLength="100" class="form-control" value="<?=old('nombre', $clienteContactoEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="apellidos" class="form-label">
|
||||
<?=lang('ClienteContactos.apellidos') ?>
|
||||
</label>
|
||||
<textarea rows="3" id="apellidos" name="apellidos" style="height: 10em;" class="form-control"><?=old('apellidos', $clienteContactoEntity->apellidos) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="telefono" class="form-label">
|
||||
<?=lang('ClienteContactos.telefono') ?>
|
||||
</label>
|
||||
<input type="text" id="telefono" name="telefono" maxLength="20" class="form-control" value="<?=old('telefono', $clienteContactoEntity->telefono) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">
|
||||
<?=lang('ClienteContactos.email') ?>
|
||||
</label>
|
||||
<input type="email" id="email" name="email" maxLength="150" class="form-control" value="<?=old('email', $clienteContactoEntity->email) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,65 @@
|
||||
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/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="contactoDeClienteForm" 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/clientes/contactos/_contactoDeClienteFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("contactoDeClienteList"), 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() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#clienteId').select2({
|
||||
theme: 'bootstrap-5',
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfClientes") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
171
ci4/app/Views/themes/vuexy/form/clientes/contactos/viewContactoDeClienteList.php
Executable file
171
ci4/app/Views/themes/vuexy/form/clientes/contactos/viewContactoDeClienteList.php
Executable file
@ -0,0 +1,171 @@
|
||||
<?=$this->include('Themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?=$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('ClienteContactos.contactoDeClienteList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfContactosdecliente" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
<th><?=lang('ClienteContactos.id')?></th>
|
||||
<th><?= lang('Clientes.cliente') ?></th>
|
||||
<th><?= lang('ClienteContactos.cargo') ?></th>
|
||||
<th><?= lang('ClienteContactos.nombre') ?></th>
|
||||
<th><?= lang('ClienteContactos.apellidos') ?></th>
|
||||
<th><?= lang('ClienteContactos.telefono') ?></th>
|
||||
<th><?= lang('ClienteContactos.email') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newContactoDeCliente'), lang('Basic.global.addNew').' '.lang('ClienteContactos.contactoDeCliente'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfContactosdecliente').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfContactosdecliente').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfContactosDeCliente') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'cliente_id' },
|
||||
{ 'data': 'cargo' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'apellidos' },
|
||||
{ 'data': 'telefono' },
|
||||
{ 'data': 'email' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('contactoDeClienteList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('ClienteContactos.contacto de cliente'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('contactoDeClienteList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,125 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $clienteDistribuidorEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="cif" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.cif') ?>
|
||||
</label>
|
||||
<input type="text" id="cif" name="cif" maxLength="50" class="form-control" value="<?=old('cif', $clienteDistribuidorEntity->cif) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="direccion" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.direccion') ?>
|
||||
</label>
|
||||
<textarea rows="3" id="direccion" name="direccion" style="height: 10em;" class="form-control"><?=old('direccion', $clienteDistribuidorEntity->direccion) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="ciudad" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.ciudad') ?>
|
||||
</label>
|
||||
<input type="text" id="ciudad" name="ciudad" maxLength="100" class="form-control" value="<?=old('ciudad', $clienteDistribuidorEntity->ciudad) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="cp" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.cp') ?>
|
||||
</label>
|
||||
<input type="text" id="cp" name="cp" maxLength="10" class="form-control" value="<?=old('cp', $clienteDistribuidorEntity->cp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.email') ?>
|
||||
</label>
|
||||
<input type="email" id="email" name="email" maxLength="150" class="form-control" value="<?=old('email', $clienteDistribuidorEntity->email) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.pais') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" required class="form-control select2bs2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($paisList) && is_array($paisList) && !empty($paisList) ) :
|
||||
foreach ($paisList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$clienteDistribuidorEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="provinciaId" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.provincia') ?>*
|
||||
</label>
|
||||
<select id="provinciaId" name="provincia_id" required class="form-control select2bs2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($provinciaList) && is_array($provinciaList) && !empty($provinciaList) ) :
|
||||
foreach ($provinciaList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$clienteDistribuidorEntity->provincia_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="comunidadAutonomaId" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.comunidadAutonoma') ?>
|
||||
</label>
|
||||
<select id="comunidadAutonomaId" name="comunidad_autonoma_id" class="form-control select2bs2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($comunidadAutonomaList) && is_array($comunidadAutonomaList) && !empty($comunidadAutonomaList) ) :
|
||||
foreach ($comunidadAutonomaList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$clienteDistribuidorEntity->comunidad_autonoma_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="telefono" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.telefono') ?>
|
||||
</label>
|
||||
<input type="text" id="telefono" name="telefono" maxLength="60" class="form-control" value="<?=old('telefono', $clienteDistribuidorEntity->telefono) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="horariosEntrega" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.horariosEntrega') ?>
|
||||
</label>
|
||||
<textarea rows="3" id="horariosEntrega" name="horarios_entrega" style="height: 10em;" class="form-control"><?=old('horarios_entrega', $clienteDistribuidorEntity->horarios_entrega) ?></textarea>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="personaContacto" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.personaContacto') ?>
|
||||
</label>
|
||||
<input type="text" id="personaContacto" name="persona_contacto" maxLength="100" class="form-control" value="<?=old('persona_contacto', $clienteDistribuidorEntity->persona_contacto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="precio" class="form-label">
|
||||
<?=lang('ClienteDistribuidores.precio') ?>
|
||||
</label>
|
||||
<input type="number" id="precio" name="precio" maxLength="31" step="0.01" class="form-control" value="<?=old('precio', $clienteDistribuidorEntity->precio) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,125 @@
|
||||
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/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="distribuidorDeClienteForm" 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/clientes/distribuidores/_distribuidorDeClienteFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("distribuidorDeClienteList"), 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() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#comunidadAutonomaId').select2({
|
||||
theme: 'bootstrap-5',
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfComunidadesAutonomas") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#provinciaId').select2({
|
||||
theme: 'bootstrap-5',
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfProvincias") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#paisId').select2({
|
||||
theme: 'bootstrap-5',
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfPaises") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,185 @@
|
||||
<?=$this->include('Themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?=$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('ClienteDistribuidores.distribuidorDeClienteList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfDistribuidoresdecliente" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
<th><?=lang('ClienteDistribuidores.id')?></th>
|
||||
<th><?= lang('ClienteDistribuidores.nombre') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.cif') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.direccion') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.ciudad') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.cp') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.email') ?></th>
|
||||
<th><?= lang('Paises.pais') ?></th>
|
||||
<th><?= lang('Provincias.provincia') ?></th>
|
||||
<th><?= lang('ComunidadesAutonomas.comunidadAutonoma') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.telefono') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.horariosEntrega') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.personaContacto') ?></th>
|
||||
<th><?= lang('ClienteDistribuidores.precio') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newDistribuidorDeCliente'), lang('Basic.global.addNew').' '.lang('ClienteDistribuidores.distribuidorDeCliente'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfDistribuidoresdecliente').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfDistribuidoresdecliente').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfDistribuidoresDeCliente') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'cif' },
|
||||
{ 'data': 'direccion' },
|
||||
{ 'data': 'ciudad' },
|
||||
{ 'data': 'cp' },
|
||||
{ 'data': 'email' },
|
||||
{ 'data': 'pais' },
|
||||
{ 'data': 'provincia' },
|
||||
{ 'data': 'comunidad_autonoma' },
|
||||
{ 'data': 'telefono' },
|
||||
{ 'data': 'horarios_entrega' },
|
||||
{ 'data': 'persona_contacto' },
|
||||
{ 'data': 'precio' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('distribuidorDeClienteList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('ClienteDistribuidores.distribuidor de cliente'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('distribuidorDeClienteList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('ClientePrecios.nombre') ?>*
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="nombre"
|
||||
name="nombre"
|
||||
required
|
||||
maxLength="255"
|
||||
class="form-control"
|
||||
value="<?= old('nombre', $clienteplantillapreciosEntity->nombre) ?>"
|
||||
>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,350 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $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="clientePlantillaPreciosForm" method="post" class="card-body" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/clientes/plantillaprecios/_ClienteplantillapreciosFormItems") ?>
|
||||
<div class="pt-4">
|
||||
<input
|
||||
type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("clienteplantillapreciosList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
|
||||
<div class="accordion mt-3" id="accordionPreciosLineas">
|
||||
<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="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||
<h3><?= lang("MaquinasTarifasImpresions.moduleTitle") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionPreciosLineas">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfPlantillasPreciosLineas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ClientePrecios.tipo') ?></th>
|
||||
<th><?= lang('ClientePrecios.tipo_maquina') ?></th>
|
||||
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
||||
<th><?= lang('ClientePrecios.tiempo_min') ?></th>
|
||||
<th><?= lang('ClientePrecios.tiempo_max') ?></th>
|
||||
<th><?= lang('ClientePrecios.precio_hora') ?></th>
|
||||
<th><?= lang('ClientePrecios.margen') ?></th>
|
||||
<th><?= lang('ClientePrecios.user_updated_id') ?></th>
|
||||
<th><?= lang('ClientePrecios.updated_at') ?></th>
|
||||
<th class="text-nowrap" style="min-width:100px"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr_lineas = $('#tableOfPlantillasPreciosLineas').find("tr:first th").length - 1;
|
||||
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
|
||||
let id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
|
||||
const actionBtns_lineas = 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>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
const tipo_linea = [
|
||||
{label:'<?= lang('ClientePrecios.interior') ?>', value:'interior'},
|
||||
{label:'<?= lang('ClientePrecios.cubierta') ?>', value: 'cubierta'},
|
||||
{label:'<?= lang('ClientePrecios.sobrecubierta') ?>', value: 'sobrecubierta'}
|
||||
];
|
||||
|
||||
const tipo_maquina = [
|
||||
{label: '<?= lang('ClientePrecios.toner') ?>', value:'toner'},
|
||||
{label: '<?= lang('ClientePrecios.inkjet') ?>', value:'inkjet'},
|
||||
];
|
||||
|
||||
const tipo_impresion = [
|
||||
{label: '<?= lang('ClientePrecios.negro') ?>', value:'negro'},
|
||||
{label: '<?= lang('ClientePrecios.negrohq') ?>', value:'negrohq'},
|
||||
{label: '<?= lang('ClientePrecios.color') ?>', value:'color'},
|
||||
{label: '<?= lang('ClientePrecios.colorhq') ?>', value:'colorhq'},
|
||||
];
|
||||
|
||||
var editor = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfClienteplantillaprecioslineas') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfPlantillasPreciosLineas",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "tipo",
|
||||
type: "select",
|
||||
options: tipo_linea
|
||||
}, {
|
||||
name: "tipo_maquina",
|
||||
type: "select",
|
||||
options: tipo_maquina
|
||||
}, {
|
||||
name: "tipo_impresion",
|
||||
type: "select",
|
||||
options: tipo_impresion
|
||||
}, {
|
||||
name: "tiempo_min"
|
||||
}, {
|
||||
name: "tiempo_max"
|
||||
}, {
|
||||
name: "precio_hora"
|
||||
}, {
|
||||
name: "margen"
|
||||
}, {
|
||||
name: "user_updated_id",
|
||||
type:'hidden',
|
||||
|
||||
}, {
|
||||
name: "updated_at",
|
||||
type:'hidden',
|
||||
|
||||
}, {
|
||||
"name": "plantilla_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "deleted_at",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "is_deleted",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['plantilla_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['plantilla_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
|
||||
const domain = window.location.origin
|
||||
fetch(domain + "/clientes/clienteprecios/update/" + -1 , {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
plantilla_id: id,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}),
|
||||
headers: {
|
||||
"Content-type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
editor.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.draw();
|
||||
});
|
||||
|
||||
|
||||
var theTable = $('#tableOfPlantillasPreciosLineas').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 10, 25, 50, 100],
|
||||
order: [[ 0, "asc" ], [ 1, "asc" ], [ 2, "asc" ], [ 3, "asc" ]],
|
||||
pageLength: 50,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfClientesplantillaprecioslineas') ?>',
|
||||
data: {
|
||||
plantilla_id: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'tipo' ,
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='interior')
|
||||
return '<?= lang('ClientePrecios.interior') ?>';
|
||||
else if(data=='cubierta')
|
||||
return '<?= lang('ClientePrecios.cubierta') ?>';
|
||||
else if(data=='sobrecubierta')
|
||||
return '<?= lang('ClientePrecios.sobrecubierta') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': 'tipo_maquina',
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='toner')
|
||||
return '<?= lang('ClientePrecios.toner') ?>';
|
||||
else if(data=='inkjet')
|
||||
return '<?= lang('ClientePrecios.inkjet') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': 'tipo_impresion',
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='negro')
|
||||
return '<?= lang('ClientePrecios.negro') ?>';
|
||||
else if(data=='negrohq')
|
||||
return '<?= lang('ClientePrecios.negrohq') ?>';
|
||||
else if(data=='color')
|
||||
return '<?= lang('ClientePrecios.color') ?>';
|
||||
else if(data=='colorhq')
|
||||
return '<?= lang('ClientePrecios.colorhq') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': 'tiempo_min' },
|
||||
{ 'data': 'tiempo_max' },
|
||||
{ 'data': 'precio_hora' },
|
||||
{ 'data': 'margen' },
|
||||
{ 'data': 'user_updated_id',
|
||||
'render': function ( data, type, row, meta ) {
|
||||
return row.user_updated
|
||||
}
|
||||
},
|
||||
{ 'data': 'updated_at' },
|
||||
{
|
||||
data: actionBtns_lineas,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr_lineas]
|
||||
},
|
||||
{"orderData": [ 0, 1 ], "targets": 0 },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfPlantillasPreciosLineas').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: `/clientes/clienteplantillaprecioslineas/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,149 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('ClientePrecios.plantillaPrecios_list') ?></h3>
|
||||
<?=anchor(route_to('newClienteplantillaprecios'), lang('Basic.global.addNew').' '.lang('ClientePrecios.plantillaPrecios_name'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfClienteplantillaprecios" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ClientePrecios.nombre') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr2 = $(".using-exportable-data-table").find("tr:first th").length - 1;
|
||||
const actionBtns2 = 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>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/clientes/clienteplantillaprecios/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
|
||||
// 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: `/clientes/clienteplantillaprecios/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
tablePLantillaPrecios.clearPipeline();
|
||||
tablePLantillaPrecios.row($(row)).invalidate().draw();
|
||||
|
||||
// Se borran las lineas asociadas
|
||||
const domain = window.location.origin
|
||||
fetch(domain + "/clientes/clienteplantillaprecios/update/" + dataId , {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}),
|
||||
headers: {
|
||||
"Content-type": "application/json; charset=UTF-8"
|
||||
}
|
||||
})
|
||||
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var tablePLantillaPrecios = $('#tableOfClienteplantillaprecios').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250],
|
||||
order: [[ 0, "asc" ]],
|
||||
pageLength: 25,
|
||||
lengthChange: true,
|
||||
searching: true,
|
||||
paging: true,
|
||||
info: true,
|
||||
stateSave: true,
|
||||
dom: "lftp",
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfClientesplantillaprecios') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ data: 'nombre'},
|
||||
{ data: actionBtns2,
|
||||
className: 'row-edit dt-center'}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
targets: [lastColNr2]
|
||||
},
|
||||
{
|
||||
searchable: false,
|
||||
targets: [lastColNr2]
|
||||
}
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
}
|
||||
} );
|
||||
<?=$this->endSection() ?>
|
||||
141
ci4/app/Views/themes/vuexy/form/compras/proveedores/_proveedorFormItems.php
Executable file
141
ci4/app/Views/themes/vuexy/form/compras/proveedores/_proveedorFormItems.php
Executable file
@ -0,0 +1,141 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Proveedores.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" tabindex="1" maxLength="255" class="form-control" value="<?=old('nombre', $proveedorEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="razonSocial" class="form-label">
|
||||
<?=lang('Proveedores.razonSocial') ?>
|
||||
</label>
|
||||
<input type="text" id="razonSocial" name="razon_social" tabindex="3" maxLength="255" class="form-control" value="<?=old('razon_social', $proveedorEntity->razon_social) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="direccion" class="form-label">
|
||||
<?=lang('Proveedores.direccion') ?>
|
||||
</label>
|
||||
<input type="text" id="direccion" name="direccion" tabindex="5" maxLength="255" class="form-control" value="<?=old('direccion', $proveedorEntity->direccion) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="ciudad" class="form-label">
|
||||
<?=lang('Proveedores.ciudad') ?>
|
||||
</label>
|
||||
<input type="text" id="ciudad" name="ciudad" tabindex="7" maxLength="255" class="form-control" value="<?=old('ciudad', $proveedorEntity->ciudad) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('Proveedores.paisId') ?>
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" tabindex="9" class="form-control select2bs" style="width: 100%;" >
|
||||
<option value=""><?=lang('Basic.global.pleaseSelectA', [lang('Proveedores.paisId')]) ?></option>
|
||||
|
||||
<?php foreach ($paisList as $item) : ?>
|
||||
<option value="<?=$item->id ?>"<?=$item->id==$proveedorEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">
|
||||
<?=lang('Proveedores.email') ?>
|
||||
</label>
|
||||
<input type="email" id="email" name="email" tabindex="11" maxLength="255" class="form-control" value="<?=old('email', $proveedorEntity->email) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="tipoId" class="form-label">
|
||||
<?=lang('Proveedores.tipoId') ?>*
|
||||
</label>
|
||||
<select id="tipoId" name="tipo_id" tabindex="2" class="form-control select2bs2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($proveedorTipoList) && is_array($proveedorTipoList) && !empty($proveedorTipoList) ) :
|
||||
foreach ($proveedorTipoList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$proveedorEntity->tipo_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="cif" class="form-label">
|
||||
<?=lang('Proveedores.cif') ?>
|
||||
</label>
|
||||
<input type="text" id="cif" name="cif" tabindex="4" maxLength="15" class="form-control" value="<?=old('cif', $proveedorEntity->cif) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="cp" class="form-label">
|
||||
<?=lang('Proveedores.cp') ?>
|
||||
</label>
|
||||
<input type="text" id="cp" name="cp" tabindex="6" maxLength="10" class="form-control" value="<?=old('cp', $proveedorEntity->cp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="provinciaId" class="form-label">
|
||||
<?=lang('Proveedores.provinciaId') ?>
|
||||
</label>
|
||||
<select id="provinciaId" name="provincia_id" tabindex="8" class="form-control select2bs2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($provinciaList) && is_array($provinciaList) && !empty($provinciaList) ) :
|
||||
foreach ($provinciaList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$proveedorEntity->provincia_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="personaContacto" class="form-label">
|
||||
<?=lang('Proveedores.personaContacto') ?>
|
||||
</label>
|
||||
<input type="text" id="personaContacto" name="persona_contacto" tabindex="10" maxLength="255" class="form-control" value="<?=old('persona_contacto', $proveedorEntity->persona_contacto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="telefono" class="form-label">
|
||||
<?=lang('Proveedores.telefono') ?>
|
||||
</label>
|
||||
<input type="text" id="telefono" name="telefono" tabindex="12" maxLength="60" class="form-control" value="<?=old('telefono', $proveedorEntity->telefono) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
|
||||
<div class="row" id="row_transporte" style="display:none;">
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="cajas" class="form-check-label">
|
||||
<input type="checkbox" id="cajas" name="cajas" value="1" class="form-check-input" <?= $proveedorEntity->cajas == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Proveedores.cajas') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="palets" class="form-check-label">
|
||||
<input type="checkbox" id="palets" name="palets" value="1" class="form-check-input" <?= $proveedorEntity->palets == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Proveedores.palets') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,12 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('LgProveedoresTipos.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $proveedorTipoEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
125
ci4/app/Views/themes/vuexy/form/compras/proveedores/viewProveedorForm.php
Executable file
125
ci4/app/Views/themes/vuexy/form/compras/proveedores/viewProveedorForm.php
Executable file
@ -0,0 +1,125 @@
|
||||
<?= $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="proveedorForm" 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/compras/proveedores/_proveedorFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
|
||||
<div class="pt-4">
|
||||
<input type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("proveedorList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#tipoId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfProveedoresTipos") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#provinciaId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfProvincias") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const TRANSPORTE_ID = 2; // Añadir consulta para obtener el id del tipo transporte
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
var e = document.getElementById("tipoId");
|
||||
var value = e.value;
|
||||
if(value == TRANSPORTE_ID) {
|
||||
document.getElementById("row_transporte").style.display = "block";
|
||||
}
|
||||
else{
|
||||
document.getElementById("row_transporte").style.display = "none";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#tipoId').on('select2:select', function (e) {
|
||||
|
||||
if(this.value == TRANSPORTE_ID) {
|
||||
document.getElementById("row_transporte").style.display = "block";
|
||||
}
|
||||
else{
|
||||
document.getElementById("row_transporte").style.display = "none";
|
||||
document.getElementById("cajas").checked = 0;
|
||||
document.getElementById("palets").checked = 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
142
ci4/app/Views/themes/vuexy/form/compras/proveedores/viewProveedorList.php
Executable file
142
ci4/app/Views/themes/vuexy/form/compras/proveedores/viewProveedorList.php
Executable file
@ -0,0 +1,142 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Proveedores.proveedorList') ?></h3>
|
||||
<?=anchor(route_to('newProveedor'), lang('Basic.global.addNew').' '.lang('Proveedores.proveedor'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfProveedores" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Proveedores.nombre') ?></th>
|
||||
<th><?= lang('Proveedores.tipoId') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfProveedores').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfProveedores').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 25,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[0, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfProveedores') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'tipo' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/compras/proveedores/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(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: `/compras/proveedores/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/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="proveedorTipoForm" 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/compras/proveedores/_proveedorTipoFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("proveedorTipoList"), 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() ?>
|
||||
185
ci4/app/Views/themes/vuexy/form/compras/proveedores/viewProveedorTipoList.php
Executable file
185
ci4/app/Views/themes/vuexy/form/compras/proveedores/viewProveedorTipoList.php
Executable file
@ -0,0 +1,185 @@
|
||||
<?=$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('LgProveedoresTipos.proveedorTipoList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfProveedorestipos" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
<th><?=lang('LgProveedoresTipos.id')?></th>
|
||||
<th><?= lang('LgProveedoresTipos.nombre') ?></th>
|
||||
<th><?= lang('LgProveedoresTipos.createdAt') ?></th>
|
||||
<th><?= lang('LgProveedoresTipos.updatedAt') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newProveedorTipo'), lang('Basic.global.addNew').' '.lang('LgProveedoresTipos.proveedorTipo'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfProveedorestipos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfProveedorestipos').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfProveedoresTipos') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'created_at' },
|
||||
{ 'data': 'updated_at' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
const dateCols = [3, 4];
|
||||
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
|
||||
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
|
||||
|
||||
for (let coln of dateCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
const datestr = cell.innerHTML;
|
||||
const dateStrLen = datestr.toString().trim().length;
|
||||
if (dateStrLen > 0) {
|
||||
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
|
||||
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
|
||||
const d = new Date(...dateTimeParts); // new Date(datestr);
|
||||
const md = moment(d);
|
||||
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
|
||||
const formattedDateStr = md.format(usingThisFormat);
|
||||
cell.innerHTML = formattedDateStr;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('proveedorTipoList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('LgProveedoresTipos.proveedor tipo'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('proveedorTipoList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('ComunidadesAutonomas.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="100" class="form-control" value="<?=old('nombre', $comunidadAutonomaEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('ComunidadesAutonomas.paisId') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" required class="form-control select2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($paisList) && is_array($paisList) && !empty($paisList) ) :
|
||||
foreach ($paisList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$comunidadAutonomaEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,65 @@
|
||||
<?= $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="comunidadAutonomaForm" 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/comunidades-autonomas/_comunidadAutonomaFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("comunidadAutonomaList"), 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() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#paisId').select2({
|
||||
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfPaises") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'id',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,160 @@
|
||||
<?=$this->include('themes_commonPartialsBs/select2bs5') ?>
|
||||
<?=$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('ComunidadesAutonomas.comunidadAutonomaList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfComunidadesautonomas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
<th><?=lang('ComunidadesAutonomas.id')?></th>
|
||||
<th><?= lang('ComunidadesAutonomas.nombre') ?></th>
|
||||
<th><?= lang('Paises.pais') ?></th>
|
||||
<th><?= lang('ComunidadesAutonomas.createdAt') ?></th>
|
||||
<th><?= lang('ComunidadesAutonomas.updatedAt') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newComunidadAutonoma'), lang('Basic.global.addNew').' '.lang('ComunidadesAutonomas.comunidadAutonoma'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfComunidadesautonomas').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfComunidadesautonomas').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfComunidadesAutonomas') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'pais' },
|
||||
{ 'data': 'created_at' },
|
||||
{ 'data': 'updated_at' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
const dateCols = [4, 5];
|
||||
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
|
||||
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
|
||||
|
||||
for (let coln of dateCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
const datestr = cell.innerHTML;
|
||||
const dateStrLen = datestr.toString().trim().length;
|
||||
if (dateStrLen > 0) {
|
||||
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
|
||||
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
|
||||
const d = new Date(...dateTimeParts); // new Date(datestr);
|
||||
const md = moment(d);
|
||||
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
|
||||
const formattedDateStr = md.format(usingThisFormat);
|
||||
cell.innerHTML = formattedDateStr;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('comunidadAutonomaList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('ComunidadesAutonomas.comunidad autonoma'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('comunidadAutonomaList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -0,0 +1,12 @@
|
||||
<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', $formaPagoEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,26 @@
|
||||
<?= $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="formaDePagoForm" 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/formasPagoViews/_formaDePagoFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("formaDePagoList"), 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() ?>
|
||||
@ -0,0 +1,182 @@
|
||||
<?=$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.formaDePagoList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfFormasdepagos" class="table table-striped table-hover" 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>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newFormaDePago'), lang('Basic.global.addNew').' '.lang('FormasPagoes.formaDePago'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfFormasdepagos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfFormasdepagos').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfFormasDePagos') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'created_at' },
|
||||
{ 'data': 'updated_at' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
const dateCols = [3, 4];
|
||||
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
|
||||
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
|
||||
|
||||
for (let coln of dateCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
const datestr = cell.innerHTML;
|
||||
const dateStrLen = datestr.toString().trim().length;
|
||||
if (dateStrLen > 0) {
|
||||
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
|
||||
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
|
||||
const d = new Date(...dateTimeParts); // new Date(datestr);
|
||||
const md = moment(d);
|
||||
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
|
||||
const formattedDateStr = md.format(usingThisFormat);
|
||||
cell.innerHTML = formattedDateStr;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('formaDePagoList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('FormasPagoes.forma de 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) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('formaDePagoList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,64 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="ancho" class="form-label">
|
||||
<?=lang('Imposiciones.ancho') ?>*
|
||||
</label>
|
||||
<input type="number" id="ancho" name="ancho" required maxLength="11" class="form-control" value="<?=old('ancho', $imposicion->ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="alto" class="form-label">
|
||||
<?=lang('Imposiciones.alto') ?>*
|
||||
</label>
|
||||
<input type="number" id="alto" name="alto" required maxLength="11" class="form-control" value="<?=old('alto', $imposicion->alto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="unidades" class="form-label">
|
||||
<?=lang('Imposiciones.unidades') ?>
|
||||
</label>
|
||||
<input type="number" id="unidades" name="unidades" maxLength="11" class="form-control" value="<?=old('unidades', $imposicion->unidades) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="orientacion" class="form-label">
|
||||
<?=lang('Imposiciones.orientacion') ?>
|
||||
</label>
|
||||
|
||||
<div class="form-check">
|
||||
<label for="h" class="form-check-label">
|
||||
<input type="radio" id="h" name="orientacion" value="H" class="form-check-input" <?= $imposicion->orientacion == 'H' ? 'checked' : '' ?>>
|
||||
<?= lang('Imposiciones.H') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
|
||||
|
||||
<div class="form-check">
|
||||
<label for="v" class="form-check-label">
|
||||
<input type="radio" id="v" name="orientacion" value="V" class="form-check-input" <?= $imposicion->orientacion == 'V' ? 'checked' : '' ?>>
|
||||
<?= lang('Imposiciones.V') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="maquina" class="form-label">
|
||||
<?=lang('Imposiciones.maquina') ?>
|
||||
</label>
|
||||
<input type="text" id="maquina" name="maquina" maxLength="100" class="form-control" value="<?=old('maquina', $imposicion->maquina) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="etiqueta" class="form-label">
|
||||
<?=lang('Imposiciones.etiqueta') ?>
|
||||
</label>
|
||||
<input type="text" id="etiqueta" name="etiqueta" maxLength="100" class="form-control" value="<?=old('etiqueta', $imposicion->etiqueta) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,26 @@
|
||||
<?= $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="imposicionForm" 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/imposiciones/_imposicionFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("imposicionList"), 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() ?>
|
||||
@ -0,0 +1,168 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Imposiciones.imposicionList') ?></h3>
|
||||
<?=anchor(route_to('newImposicion'), lang('Basic.global.addNew').' '.lang('Imposiciones.imposicion'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfImposiciones" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php // <th class="text-nowrap"><?= lang('Basic.global.Action') ?></th> ?>
|
||||
<th><?=lang('Imposiciones.id')?></th>
|
||||
<th><?= lang('Imposiciones.ancho') ?></th>
|
||||
<th><?= lang('Imposiciones.alto') ?></th>
|
||||
<th><?= lang('Imposiciones.unidades') ?></th>
|
||||
<th><?= lang('Imposiciones.orientacion') ?></th>
|
||||
<th><?= lang('Imposiciones.maquina') ?></th>
|
||||
<th><?= lang('Imposiciones.etiqueta') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfImposiciones').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfImposiciones').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip', // '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfImposiciones') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
//{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'ancho' },
|
||||
{ 'data': 'alto' },
|
||||
{ 'data': 'unidades' },
|
||||
{ 'data': 'orientacion' },
|
||||
{ 'data': 'maquina' },
|
||||
{ 'data': 'etiqueta' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('imposicionList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Imposiciones.imposicion'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('imposicionList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
230
ci4/app/Views/themes/vuexy/form/configuracion/maquinas/_maquinaFormItems.php
Executable file
230
ci4/app/Views/themes/vuexy/form/configuracion/maquinas/_maquinaFormItems.php
Executable file
@ -0,0 +1,230 @@
|
||||
<h6>Datos de la Máquina</h6>
|
||||
<div class="row g-3">
|
||||
<div class="col-md-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('Maquinas.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control"
|
||||
value="<?= old('nombre', $maquina->nombre) ?>">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="min" class="form-label">
|
||||
<?= lang('Maquinas.min') ?>*
|
||||
</label>
|
||||
<input type="number" id="min" name="min" required placeholder="1" maxLength="11"
|
||||
class="form-control" value="<?= old('min', $maquina->min) ?>">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="max" class="form-label">
|
||||
<?= lang('Maquinas.max') ?>*
|
||||
</label>
|
||||
<input type="number" id="max" name="max" required placeholder="1000000" maxLength="11"
|
||||
class="form-control" value="<?= old('max', $maquina->max) ?>">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="velocidad" class="form-label">
|
||||
<?= lang('Maquinas.velocidad') ?>*
|
||||
</label>
|
||||
<input type="number" id="velocidad" name="velocidad" required placeholder="0.00" maxLength="8"
|
||||
step="0.01" class="form-control" value="<?= old('velocidad', $maquina->velocidad) ?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="tipo" class="form-label">
|
||||
<?= lang('Maquinas.tipo') ?>*
|
||||
</label>
|
||||
<select id="tipo" name="tipo" required class="form-control select2" style="width: 100%;">
|
||||
<option value="" selected="selected"><?= lang('Basic.global.pleaseSelectOne') ?></option>
|
||||
<option value="impresion"<?= $maquina->tipo == 'impresion' ? ' selected' : '' ?>><?= lang('Maquinas.impresion') ?></option>
|
||||
<option value="manipulado"<?= $maquina->tipo == 'manipulado' ? ' selected' : '' ?>><?= lang('Maquinas.manipulado') ?></option>
|
||||
<option value="acabado"<?= $maquina->tipo == 'acabado' ? ' selected' : '' ?>><?= lang('Maquinas.acabado') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!--Propiedades-->
|
||||
<div class="col-md-2">
|
||||
<label for="ancho" class="form-label">
|
||||
<?= lang('Maquinas.ancho') ?>*
|
||||
</label>
|
||||
<input type="number" id="ancho" name="ancho" maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('ancho', $maquina->ancho) ?>">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="alto" class="form-label">
|
||||
<?= lang('Maquinas.alto') ?>*
|
||||
</label>
|
||||
<input type="number" id="alto" name="alto" maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('alto', $maquina->alto) ?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="anchoImpresion" class="form-label">
|
||||
<?= lang('Maquinas.anchoImpresion') ?>*
|
||||
</label>
|
||||
<input type="number" id="anchoImpresion" name="ancho_impresion" required placeholder="0.00"
|
||||
maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('ancho_impresion', $maquina->ancho_impresion) ?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="altoImpresion" class="form-label">
|
||||
<?= lang('Maquinas.altoImpresion') ?>*
|
||||
</label>
|
||||
<input type="number" id="altoImpresion" name="alto_impresion" required placeholder="0.00"
|
||||
maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('alto_impresion', $maquina->alto_impresion) ?>">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label for="altoClick" class="form-label">
|
||||
<?= lang('Maquinas.altoClick') ?>*
|
||||
</label>
|
||||
<input type="number" id="altoClick" name="alto_click" required placeholder="0.00" maxLength="8"
|
||||
step="0.01" class="form-control" value="<?= old('alto_click', $maquina->alto_click) ?>">
|
||||
</div>
|
||||
|
||||
<!--Produccion-->
|
||||
<div class="col-md-3">
|
||||
<label for="duracionJornada" class="form-label">
|
||||
<?= lang('Maquinas.duracionJornada') ?>*
|
||||
</label>
|
||||
<input type="number" id="duracionJornada" name="duracion_jornada" required placeholder="8"
|
||||
maxLength="11" class="form-control"
|
||||
value="<?= old('duracion_jornada', $maquina->duracion_jornada) ?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="ordenPlanning" class="form-label">
|
||||
<?= lang('Maquinas.ordenPlanning') ?>*
|
||||
</label>
|
||||
<input type="number" id="ordenPlanning" name="orden_planning" required placeholder="1"
|
||||
maxLength="11" class="form-control"
|
||||
value="<?= old('orden_planning', $maquina->orden_planning) ?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="forzarNumFormasHorizontalesPortada" class="form-label">
|
||||
<?= lang('Maquinas.forzarNumFormasHorizontalesPortada') ?>
|
||||
</label>
|
||||
<input type="number" id="forzarNumFormasHorizontalesPortada"
|
||||
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_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">
|
||||
<?= lang('Maquinas.observaciones') ?>
|
||||
</label>
|
||||
<textarea rows="3" id="observaciones" name="observaciones"
|
||||
class="form-control">
|
||||
<?= old('observaciones', $maquina->observaciones) ?>
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 mt-4 mb-4">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox"
|
||||
id="isPadre"
|
||||
name="is_padre"
|
||||
value="1"
|
||||
class="form-check-input"<?= $maquina->is_padre == true ? 'checked' : ''; ?>
|
||||
>
|
||||
<label for="isPadre" class="form-check-label">
|
||||
<?= lang('Maquinas.isPadre') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="selectVariante" class="col-md-3" style="display:none">
|
||||
<select id="padreId" name="padre_id" class="form-control select2" style="width: 100%;">
|
||||
<?php if (isset($maquinaList) && is_array($maquinaList) && !empty($maquinaList)) :
|
||||
foreach ($maquinaList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>"<?= $k == $maquina->padre_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3 mt-4 mb-4">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox"
|
||||
id="isRotativa"
|
||||
name="is_rotativa"
|
||||
value="1"
|
||||
class="form-check-input"<?= $maquina->is_rotativa == true ? 'checked' : ''; ?>
|
||||
>
|
||||
<label for="isPadre" class="form-check-label">
|
||||
<?= lang('Maquinas.isRotativa') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 mt-4 mb-4">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox"
|
||||
id="isTinta"
|
||||
name="is_inkjet"
|
||||
value="1"
|
||||
class="form-check-input"<?= $maquina->is_inkjet == true ? 'checked' : ''; ?>
|
||||
>
|
||||
<label for="isPadre" class="form-check-label">
|
||||
<?= lang('Maquinas.isTinta') ?>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-2 datosRotativa datosInkjet" style="display: none;">
|
||||
<label for="precioTintaNegro" class="form-label">
|
||||
<?= lang('Maquinas.precioTintaNegro') ?>
|
||||
</label>
|
||||
<input type="number" id="precioTintaNegro" name="precio_tinta_negro" placeholder="0.00"
|
||||
maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('precio_tinta_negro', $maquina->precio_tinta_negro) ?>">
|
||||
</div>
|
||||
<div class="col-md-2 datosRotativa datosInkjet" style="display: none;">
|
||||
<label for="precioTintaColor" class="form-label">
|
||||
<?= lang('Maquinas.precioTintaColor') ?>
|
||||
</label>
|
||||
<input type="number" id="precioTintaColor" name="precio_tinta_color" placeholder="0.00"
|
||||
maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('precio_tinta_color', $maquina->precio_tinta_color) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 datosInkjet" style="display: none;">
|
||||
<label for="precioTintaCG" class="form-label">
|
||||
<?= lang('Maquinas.precioTintaCG') ?>
|
||||
</label>
|
||||
<input type="number" id="precioTintaCG" name="precio_tinta_cg" placeholder="0.00"
|
||||
maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('precio_tinta_cg', $maquina->precio_tinta_cg) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 datosRotativa" style="display: none;">
|
||||
<label for="velocidadCorte" class="form-label">
|
||||
<?= lang('Maquinas.velocidadCorte') ?>
|
||||
</label>
|
||||
<input type="number" id="velocidadCorte" name="velocidad_corte" placeholder="0.00" maxLength="8"
|
||||
step="0.01" class="form-control"
|
||||
value="<?= old('velocidad_corte', $maquina->velocidad_corte) ?>">
|
||||
</div>
|
||||
<div class="col-md-2 datosRotativa" style="display: none;">
|
||||
<label for="precioHoraCorte" class="form-label">
|
||||
<?= lang('Maquinas.precioHoraCorte') ?>
|
||||
</label>
|
||||
<input type="number" id="precioHoraCorte" name="precio_hora_corte" placeholder="0.00"
|
||||
maxLength="8" step="0.01" class="form-control"
|
||||
value="<?= old('precio_hora_corte', $maquina->precio_hora_corte) ?>">
|
||||
</div>
|
||||
<div class="col-md-2 datosRotativa" style="display: none;">
|
||||
<label for="metrosxminuto" class="form-label">
|
||||
<?= lang('Maquinas.metrosxminuto') ?>
|
||||
</label>
|
||||
<input type="number" id="metrosxminuto" name="metrosxminuto" placeholder="48" maxLength="31"
|
||||
step="0.01" class="form-control"
|
||||
value="<?= old('metrosxminuto', $maquina->metrosxminuto) ?>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -0,0 +1,84 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="tipo" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.tipo') ?>*
|
||||
</label>
|
||||
<select tabindex="1" id="tipo" name="tipo" class="form-control select2bs" style="width: 100%;" >
|
||||
<option value="" selected="selected"><?=lang('Basic.global.pleaseSelectOne') ?></option>
|
||||
<option value="bn"<?=$maquinasDefectoEntity->tipo == 'bn' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bn') ?></option>
|
||||
<option value="bnhq"<?=$maquinasDefectoEntity->tipo == 'bnhq' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.bnhq') ?></option>
|
||||
<option value="color"<?=$maquinasDefectoEntity->tipo == 'color' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.color') ?></option>
|
||||
<option value="portada"<?=$maquinasDefectoEntity->tipo == 'portada' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.portada') ?></option>
|
||||
<option value="cubierta"<?=$maquinasDefectoEntity->tipo == 'cubierta' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.cubierta') ?></option>
|
||||
<option value="rotativa"<?=$maquinasDefectoEntity->tipo == 'rotativa' ? ' selected':'' ?>><?= lang('MaquinasPorDefecto.rotativa') ?></option>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="anchoMin" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.anchoMin') ?>*
|
||||
</label>
|
||||
<input tabindex="3" type="number" id="anchoMin" name="ancho_min" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_min', $maquinasDefectoEntity->ancho_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="altoMin" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.altoMin') ?>*
|
||||
</label>
|
||||
<input tabindex="5" type="number" id="altoMin" name="alto_min" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_min', $maquinasDefectoEntity->alto_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="tiradaMin" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.tiradaMin') ?>*
|
||||
</label>
|
||||
<input tabindex="7" type="number" id="tiradaMin" name="tirada_min" placeholder="1" maxLength="11" class="form-control" value="<?=old('tirada_min', $maquinasDefectoEntity->tirada_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="maquinaId" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.maquinaId') ?>*
|
||||
</label>
|
||||
<select tabindex="2" id="maquinaId" name="maquina_id" class="form-control select2 form-select" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($maquinaList) && is_array($maquinaList) && !empty($maquinaList) ) :
|
||||
foreach ($maquinaList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$maquinasDefectoEntity->maquina_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="anchoMax" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.anchoMax') ?>*
|
||||
</label>
|
||||
<input tabindex="4" type="number" id="anchoMax" name="ancho_max" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('ancho_max', $maquinasDefectoEntity->ancho_max) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="altoMax" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.altoMax') ?>*
|
||||
</label>
|
||||
<input tabindex="6" type="number" id="altoMax" name="alto_max" placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?=old('alto_max', $maquinasDefectoEntity->alto_max) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="tiradaMax" class="form-label">
|
||||
<?=lang('MaquinasPorDefecto.tiradaMax') ?>*
|
||||
</label>
|
||||
<input tabindex="8" type="number" id="tiradaMax" name="tirada_max" placeholder="10000" maxLength="11" class="form-control" value="<?=old('tirada_max', $maquinasDefectoEntity->tirada_max) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
832
ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaForm.php
Executable file
832
ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaForm.php
Executable file
@ -0,0 +1,832 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $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="maquinaForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/configuracion/maquinas/_maquinaFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="py-4">
|
||||
<input type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("maquinaList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
|
||||
<div class="accordion mt-3" id="accordianTarifasImpresion">
|
||||
<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="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||
<h3><?= lang("MaquinasTarifasImpresions.moduleTitle") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordianTarifasImpresion">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfMaquinastarifasimpresion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('MaquinasTarifasImpresions.uso') ?></th>
|
||||
<th><?= lang('MaquinasTarifasImpresions.tipo') ?></th>
|
||||
<th><?= lang('MaquinasTarifasImpresions.precio') ?></th>
|
||||
<th><?= lang('MaquinasTarifasImpresions.margen') ?></th>
|
||||
<th>is_deleted</th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
|
||||
<div class="accordion mt-3" id="accordianPapelesCalles">
|
||||
<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="#accordionTip3" aria-expanded="false" aria-controls="accordionTip3">
|
||||
<h3><?= lang("MaquinasCalles.moduleTitle") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip3" class="accordion-collapse collapse show" data-bs-parent="#accordianPapelesCalles">
|
||||
<div class="accordion-body">
|
||||
<table id="tableOfCalles" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('MaquinasCalles.formas') ?></th>
|
||||
<th><?= lang('MaquinasCalles.internas') ?></th>
|
||||
<th><?= lang('MaquinasCalles.externas') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
|
||||
<div class="accordion mt-3" id="accordianPapelesImpresion">
|
||||
<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="#accordionTip2" aria-expanded="false" aria-controls="accordionTip2">
|
||||
<h3><?= lang("MaquinasPapelImpresion.papel_impresion_maquinas") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip2" class="accordion-collapse collapse show" data-bs-parent="#accordianPapelesImpresion">
|
||||
<div class="accordion-body">
|
||||
<table id="tableOfPapelesImpresion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('MaquinasPapelImpresion.activo') ?></th>
|
||||
<th><?= lang('PapelGenerico.papelGenerico') ?></th>
|
||||
<th><?= lang('PapelImpresion.nombre') ?></th>
|
||||
<th><?= lang('PapelImpresion.gramaje') ?></th>
|
||||
<th><?= lang('PapelImpresion.bn') ?></th>
|
||||
<th><?= lang('PapelImpresion.color') ?></th>
|
||||
<th><?= lang('PapelImpresion.cubierta') ?></th>
|
||||
<th><?= lang('PapelImpresion.sobrecubierta') ?></th>
|
||||
<th><?= lang('PapelImpresion.rotativa') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
<?php if($maquina->is_rotativa) { ?>
|
||||
$(".datosInkjet").css('display', 'none');
|
||||
$(".datosRotativa").css('display', 'inline');
|
||||
<?php } ?>
|
||||
<?php if($maquina->is_inkjet) { ?>
|
||||
$(".datosRotativa").css('display', 'none');
|
||||
$(".datosInkjet").css('display', 'inline');
|
||||
<?php } ?>
|
||||
<?php if(!$maquina->is_inkjet && !$maquina->is_rotativa){ ?>
|
||||
$(".datosRotativa").css('display', 'none');
|
||||
$(".datosInkjet").css('display', 'none');
|
||||
<?php } ?>
|
||||
|
||||
const lastColNr2 = $('#tableOfPapelesImpresion').find("tr:first th").length - 1;
|
||||
const actionBtns2 = function(data) {
|
||||
return `
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit2 mx-2" data-id="${data.papel_impresion_id}"></i></a>
|
||||
`;
|
||||
};
|
||||
|
||||
$(document).on('click', '.btn-edit2', function(e) {
|
||||
window.open(`/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`);
|
||||
});
|
||||
|
||||
function watch(j) {
|
||||
return new Proxy(JSON.parse ('{"watch":' + j + '}'), {
|
||||
set: function(target, property, value) {
|
||||
target[property] = value;
|
||||
$('#tableOfPapelesImpresion').DataTable().ajax.reload(null,false);
|
||||
theTable2.clearPipeline();
|
||||
theTable2.draw();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
isRotativa = watch(0);
|
||||
|
||||
|
||||
$('#isRotativa').on("click",function(el){
|
||||
asyncConfirmDialog('<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
|
||||
'<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>', yesCallback, noCallback);
|
||||
});
|
||||
|
||||
function yesCallback() {
|
||||
if($('#isRotativa').is(':checked')){
|
||||
$(".datosInkjet").css('display', 'none');
|
||||
$('#isTinta').prop("checked", 0);
|
||||
$(".datosRotativa").css('display', 'inline');
|
||||
}else{
|
||||
document.getElementById("precioTintaNegro").value = 0;
|
||||
document.getElementById("precioTintaColor").value = 0;
|
||||
document.getElementById("velocidadCorte").value = 0;
|
||||
document.getElementById("precioHoraCorte").value = 0;
|
||||
document.getElementById("metrosxminuto").value = 0;
|
||||
$(".datosRotativa").css('display', 'none');
|
||||
}
|
||||
|
||||
updatePapeles()
|
||||
}
|
||||
|
||||
function noCallback() {
|
||||
// Toggle behaviour
|
||||
$('#isRotativa').prop("checked", !$('#isRotativa').prop("checked"));
|
||||
}
|
||||
|
||||
|
||||
$('#isTinta').on('click', function(){
|
||||
asyncConfirmDialog('<?= lang('MaquinasPapelImpresion.sureToChangeRotativaTitle') ?>',
|
||||
'<?= lang('MaquinasPapelImpresion.sureToChangeRotativaText') ?>', yesCallbackInkjet, noCallbackInkjet);
|
||||
|
||||
})
|
||||
|
||||
function yesCallbackInkjet() {
|
||||
if($('#isTinta').is(':checked')){
|
||||
$(".datosRotativa").css('display', 'none');
|
||||
$(".datosInkjet").css('display', 'inline');
|
||||
$('#isRotativa').prop("checked", 0);
|
||||
}else{
|
||||
document.getElementById("precioTintaNegro").value = 0;
|
||||
document.getElementById("precioTintaColor").value = 0;
|
||||
document.getElementById("velocidadCorte").value = 0;
|
||||
document.getElementById("precioHoraCorte").value = 0;
|
||||
document.getElementById("metrosxminuto").value = 0;
|
||||
$(".datosInkjet").css('display', 'inline');
|
||||
}
|
||||
updatePapeles()
|
||||
}
|
||||
|
||||
function noCallbackInkjet() {
|
||||
// Toggle behaviour
|
||||
$('#isTinta').prop("checked", !$('#isTinta').prop("checked"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updatePapeles(){
|
||||
//yeniden(json.<?= csrf_token() ?>);
|
||||
|
||||
$.ajax({
|
||||
url: '<?= route_to('updateMaquinaPapelOnTarifasChange') ?>',
|
||||
data: {
|
||||
maquina_id: id,
|
||||
isRotativa: isRotativa.watch,
|
||||
isInkjet: $('#isTinta').prop('checked'),
|
||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
success:function(response){
|
||||
|
||||
token=JSON.parse(response).<?= csrf_token() ?>;
|
||||
yeniden(token);
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.draw();
|
||||
|
||||
theTable2.clearPipeline();
|
||||
theTable2.draw();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#isPadre').on("click",function(el){
|
||||
if($(this).is(':checked')){
|
||||
$("#selectVariante").show();
|
||||
}else{
|
||||
$("#padreId").select2('val', -1);
|
||||
$("#selectVariante").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#padreId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfMaquinas") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
const lastColNr = $('#tableOfTarifamanipuladolineas').find("tr:first th").length - 1;
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
let id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-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>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
usoTypes = [
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.interior') ?>', value:'interior'},
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.cubierta') ?>', value: 'cubierta'},
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.sobrecubierta') ?>', value: 'sobrecubierta'}
|
||||
];
|
||||
|
||||
tipoTypes = [
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.negro') ?>', value:'negro'},
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.negrohq') ?>', value: 'negrohq'},
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.bicolor') ?>', value: 'bicolor'},
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.color') ?>', value: 'color'},
|
||||
{label:'<?= lang('MaquinasTarifasImpresions.colorhq') ?>', value: 'colorhq'},
|
||||
];
|
||||
|
||||
editor = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfMaquinasTarifaImpresion') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfMaquinastarifasimpresion",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "uso",
|
||||
type: "select",
|
||||
options: usoTypes
|
||||
}, {
|
||||
name: "tipo",
|
||||
type: "select",
|
||||
options: tipoTypes
|
||||
}, {
|
||||
name: "precio",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
}, {
|
||||
name: "margen",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
}, {
|
||||
"name": "maquina_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "deleted_at",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "is_deleted",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['maquina_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['maquina_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
updatePapeles()
|
||||
});
|
||||
|
||||
|
||||
editor2 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfMaquinasPapelImpresion') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfPapelesImpresion",
|
||||
idSrc: 'papel_impresion_id',
|
||||
fields: [
|
||||
{
|
||||
name: "active",
|
||||
type: "checkbox",
|
||||
separator: "|",
|
||||
ipOpts: [
|
||||
{ label: '', value: 1 }
|
||||
]
|
||||
},{
|
||||
"name": "papel_impresion_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "gramaje",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "maquina_id",
|
||||
"type": "hidden"
|
||||
}
|
||||
]
|
||||
} );
|
||||
|
||||
editor2.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
if(json.error){
|
||||
document.getElementById("check_" + json.data.papel_impresion_id).checked = false;
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '<?= lang('Basic.global.sweet.error_tittle') ?>',
|
||||
text: json.error,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var theTable = $('#tableOfMaquinastarifasimpresion').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
order: [[ 1, "asc" ]],
|
||||
pageLength: 5,
|
||||
lengthChange: false,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-end"B><"float-start"l><t>', //"Blt",
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinasTarifasImpresion') ?>',
|
||||
data: {
|
||||
id_maquina: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'uso', "render": function ( data, type, row, meta ) {
|
||||
if(data=='interior')
|
||||
return '<?= lang('MaquinasTarifasImpresions.interior') ?>';
|
||||
else if (data=='cubierta')
|
||||
return '<?= lang('MaquinasTarifasImpresions.cubierta') ?>';
|
||||
else if (data=='sobrecubierta')
|
||||
return '<?= lang('MaquinasTarifasImpresions.sobrecubierta') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': 'tipo', "render": function ( data, type, row, meta ) {
|
||||
if(data=='negro')
|
||||
return '<?= lang('MaquinasTarifasImpresions.negro') ?>';
|
||||
else if (data=='negrohq')
|
||||
return '<?= lang('MaquinasTarifasImpresions.negrohq') ?>';
|
||||
else if (data=='bicolor')
|
||||
return '<?= lang('MaquinasTarifasImpresions.bicolor') ?>';
|
||||
else if (data=='color')
|
||||
return '<?= lang('MaquinasTarifasImpresions.color') ?>';
|
||||
else if (data=='colorhq')
|
||||
return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': 'precio' },
|
||||
{ 'data': 'margen' },
|
||||
{ 'data': 'is_deleted',},
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
target: 4,
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
},
|
||||
{"orderData": [ 0, 1 ], "targets": 0 },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
|
||||
var theTable2 = $('#tableOfPapelesImpresion').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250],
|
||||
order: [[ 1, "asc" ]],
|
||||
pageLength: 25,
|
||||
lengthChange: true,
|
||||
searching: true,
|
||||
paging: true,
|
||||
info: true,
|
||||
stateSave: true,
|
||||
dom: "lftp",
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinasPapelesImpresion') ?>',
|
||||
data: function (d) {
|
||||
d.maquina_id = id;
|
||||
d.isRotativa = isRotativa.watch;
|
||||
d.webguard_token = '<?= csrf_hash() ?>';
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'active',
|
||||
render: function (data, type, row) {
|
||||
if (type === 'display') {
|
||||
return '<input type="checkbox" class="editor-active" id="check_' + row.papel_impresion_id + '">';
|
||||
}
|
||||
return data;
|
||||
},
|
||||
className: 'dt-body-center'
|
||||
},
|
||||
{ 'data': 'papel_generico'},
|
||||
{ 'data': 'papel_impresion'},
|
||||
{ 'data': 'gramaje'},
|
||||
{ 'data': 'bn'},
|
||||
{ 'data': 'color'},
|
||||
{ 'data': 'cubierta'},
|
||||
{ 'data': 'sobrecubierta'},
|
||||
{ 'data': 'rotativa'},
|
||||
{ data: actionBtns2,
|
||||
className: 'row-edit dt-center'}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
targets: [lastColNr2]
|
||||
},
|
||||
{
|
||||
searchable: false,
|
||||
targets: [0,3,4,5,6,7,8,lastColNr2]
|
||||
}
|
||||
],
|
||||
rowCallback: function (row, data) {
|
||||
// Set the checked state of the checkbox in the table
|
||||
$('input.editor-active', row).prop('checked', data.active == 1);
|
||||
},
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
// Cuando se clica en un checkbox hacer submit en el editor
|
||||
theTable2.on( 'change', 'input.editor-active', function () {
|
||||
editor2
|
||||
.edit( $(this).closest('tr'), false )
|
||||
.set( 'active', $(this).prop( 'checked' ) ? 1 : 0 )
|
||||
.submit();
|
||||
} );
|
||||
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfMaquinastarifasimpresion').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'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
theTable2.on( 'draw.dt', function () {
|
||||
const boolCols = [4, 5, 6, 7, 8];
|
||||
for (let coln of boolCols) {
|
||||
theTable2.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Delete row
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||
const row = $(this).closest('tr')[0]._DT_RowIndex;
|
||||
|
||||
if($(this).closest('table').attr('id').includes('tarifas')){
|
||||
$(".btn-remove").attr('table', "tarifas");
|
||||
$(".btn-remove").attr('row_index', row);
|
||||
}
|
||||
else if($(this).closest('table').attr('id').includes('Calles')){
|
||||
$(".btn-remove").attr('table', "calles");
|
||||
$(".btn-remove").attr('row_index', row);
|
||||
}
|
||||
else{
|
||||
$(".btn-remove").attr('table', );
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-remove', function(e) {
|
||||
const dataId = $(this).attr('data-id');
|
||||
const row = $(this).attr('row_index');
|
||||
|
||||
if ($.isNumeric(dataId)) {
|
||||
|
||||
if($(this).attr('table').includes('tarifas')){
|
||||
remove_tarifas(dataId, row);
|
||||
}
|
||||
else if ($(this).attr('table').includes('calles')){
|
||||
remove_calles(dataId, row);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function remove_calles(dataId, row){
|
||||
$.ajax({
|
||||
url: `/maquinascalles/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable3.clearPipeline();
|
||||
theTable3.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
});
|
||||
};
|
||||
|
||||
function remove_tarifas(dataId, row){
|
||||
|
||||
$.ajax({
|
||||
url: `/maquinastarifasimpresion/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para tabla calles -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
var editor3 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfMaquinascalles') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfCalles",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "formas"
|
||||
}, {
|
||||
name: "internas"
|
||||
}, {
|
||||
name: "externas"
|
||||
}, {
|
||||
"name": "maquina_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "deleted_at",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "is_deleted",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
|
||||
editor3.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['maquina_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['maquina_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();
|
||||
});
|
||||
|
||||
theTable3 = $('#tableOfCalles').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5],
|
||||
pageLength: 10,
|
||||
lengthChange: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
"dom": '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
stateSave: true,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinascalles') ?>',
|
||||
data: {
|
||||
maquina_id: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns : [
|
||||
{ 'data': 'formas' },
|
||||
{ 'data': 'internas' },
|
||||
{ 'data': 'externas' },
|
||||
{ data: actionBtns,
|
||||
className: 'row-edit dt-center'}
|
||||
],
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor3,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfCalles').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'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
155
ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaList.php
Executable file
155
ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaList.php
Executable file
@ -0,0 +1,155 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Maquinas.maquinaList') ?></h3>
|
||||
<?=anchor(route_to('newMaquina'), lang('Basic.global.addNew').' '.lang('Maquinas.maquina'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfMaquinas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Maquinas.nombre') ?></th>
|
||||
<th><?= lang('Maquinas.tipo') ?></th>
|
||||
<th><?= lang('Maquinas.anchoImpresion') ?></th>
|
||||
<th><?= lang('Maquinas.altoImpresion') ?></th>
|
||||
<th><?= lang('Maquinas.min') ?></th>
|
||||
<th><?= lang('Maquinas.max') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfMaquinas').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfMaquinas').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[0, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinas') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'tipo' },
|
||||
{ 'data': 'ancho_impresion' },
|
||||
{ 'data': 'alto_impresion' },
|
||||
{ 'data': 'min' },
|
||||
{ 'data': 'max' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="text-success bi bi-check-lg"></i>' : '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/configuracion/maquinas/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(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: `/configuracion/maquinas/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<form id="maquinaPorDefectoForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/configuracion/maquinas/_maquinaPorDefectoFormItems") ?>
|
||||
<div class="pt-4">
|
||||
<input
|
||||
type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("maquinaPorDefectoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#maquinaId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfMaquinas") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,162 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('MaquinasPorDefecto.maquinaPorDefectoList') ?></h3>
|
||||
<?=anchor(route_to('newMaquinaPorDefecto'), lang('Basic.global.addNew').' '.lang('MaquinasPorDefecto.maquinaPorDefecto'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfMaquinaspordefecto" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('MaquinasPorDefecto.tipo') ?></th>
|
||||
<th><?= lang('Maquinas.maquina') ?></th>
|
||||
<th><?= lang('MaquinasPorDefecto.anchoMin') ?></th>
|
||||
<th><?= lang('MaquinasPorDefecto.anchoMax') ?></th>
|
||||
<th><?= lang('MaquinasPorDefecto.altoMin') ?></th>
|
||||
<th><?= lang('MaquinasPorDefecto.altoMax') ?></th>
|
||||
<th><?= lang('MaquinasPorDefecto.tiradaMin') ?></th>
|
||||
<th><?= lang('MaquinasPorDefecto.tiradaMax') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfMaquinaspordefecto').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfMaquinaspordefecto').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfMaquinasPorDefecto') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'tipo', "render": function ( data, type, row, meta ) {
|
||||
if(data=='bn')
|
||||
return '<?= lang('MaquinasPorDefecto.bn') ?>';
|
||||
else if(data=='bnhq')
|
||||
return '<?= lang('MaquinasPorDefecto.bnhq') ?>';
|
||||
else if(data=='color')
|
||||
return '<?= lang('MaquinasPorDefecto.color') ?>';
|
||||
else if(data=='cubierta')
|
||||
return '<?= lang('MaquinasPorDefecto.cubierta') ?>';
|
||||
else if(data=='portada')
|
||||
return '<?= lang('MaquinasPorDefecto.portada') ?>';
|
||||
else if(data=='rotativa')
|
||||
return '<?= lang('MaquinasPorDefecto.rotativa') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': 'maquina' },
|
||||
{ 'data': 'ancho_min' },
|
||||
{ 'data': 'ancho_max' },
|
||||
{ 'data': 'alto_min' },
|
||||
{ 'data': 'alto_max' },
|
||||
{ 'data': 'tirada_min' },
|
||||
{ 'data': 'tirada_max' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/configuracion/maquinasdefecto/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
$(".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: `/configuracion/maquinasdefecto/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
66
ci4/app/Views/themes/vuexy/form/configuracion/paises/_paisFormItems.php
Executable file
66
ci4/app/Views/themes/vuexy/form/configuracion/paises/_paisFormItems.php
Executable file
@ -0,0 +1,66 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Paises.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $paisEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?=lang('Paises.code') ?>*
|
||||
</label>
|
||||
<input type="text" id="code" name="code" required maxLength="2" class="form-control" value="<?=old('code', $paisEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="code3" class="form-label">
|
||||
<?=lang('Paises.code3') ?>
|
||||
</label>
|
||||
<input type="text" id="code3" name="code3" maxLength="3" class="form-control" value="<?=old('code3', $paisEntity->code3) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="moneda" class="form-label">
|
||||
<?=lang('Paises.moneda') ?>*
|
||||
</label>
|
||||
<input type="text" id="moneda" name="moneda" required maxLength="3" class="form-control" value="<?=old('moneda', $paisEntity->moneda) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="urlErp" class="form-label">
|
||||
<?=lang('Paises.urlErp') ?>
|
||||
</label>
|
||||
<input type="url" id="urlErp" name="url_erp" maxLength="255" class="form-control" value="<?=old('url_erp', $paisEntity->url_erp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="userErp" class="form-label">
|
||||
<?=lang('Paises.userErp') ?>
|
||||
</label>
|
||||
<input type="text" id="userErp" name="user_erp" maxLength="255" class="form-control" value="<?=old('user_erp', $paisEntity->user_erp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="keyErp" class="form-label">
|
||||
<?=lang('Paises.keyErp') ?>
|
||||
</label>
|
||||
<input type="text" id="keyErp" name="key_erp" maxLength="255" class="form-control" value="<?=old('key_erp', $paisEntity->key_erp) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="showErp" class="form-check-label">
|
||||
<input type="checkbox" id="showErp" name="show_erp" value="1" class="form-check-input"<?=$paisEntity->show_erp== true ? 'checked' : ''; ?>>
|
||||
<?=lang('Paises.showErp') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
26
ci4/app/Views/themes/vuexy/form/configuracion/paises/viewPaisForm.php
Executable file
26
ci4/app/Views/themes/vuexy/form/configuracion/paises/viewPaisForm.php
Executable file
@ -0,0 +1,26 @@
|
||||
<?= $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="paisForm" 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/paises/_paisFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("paisList"), 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() ?>
|
||||
171
ci4/app/Views/themes/vuexy/form/configuracion/paises/viewPaisList.php
Executable file
171
ci4/app/Views/themes/vuexy/form/configuracion/paises/viewPaisList.php
Executable file
@ -0,0 +1,171 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Paises.paisList') ?></h3>
|
||||
<?=anchor(route_to('newPais'), lang('Basic.global.addNew').' '.lang('Paises.pais'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPaises" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Paises.nombre') ?></th>
|
||||
<th><?= lang('Paises.code') ?></th>
|
||||
<th><?= lang('Paises.code3') ?></th>
|
||||
<th><?= lang('Paises.moneda') ?></th>
|
||||
<th><?= lang('Paises.urlErp') ?></th>
|
||||
<th><?= lang('Paises.userErp') ?></th>
|
||||
<th><?= lang('Paises.keyErp') ?></th>
|
||||
<th><?= lang('Paises.showErp') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfPaises').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfPaises').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPaises') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'code' },
|
||||
{ 'data': 'code3' },
|
||||
{ 'data': 'moneda' },
|
||||
{ 'data': 'url_erp' },
|
||||
{ 'data': 'user_erp' },
|
||||
{ 'data': 'key_erp' },
|
||||
{ 'data': 'show_erp' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [7];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="text-success bi bi-check-lg"></i>' : '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('paisList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Paises.pais'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('paisList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('PapelGenerico.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $papelGenerico->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?=lang('PapelGenerico.code') ?>
|
||||
</label>
|
||||
<input type="text" id="code" name="code" maxLength="5" class="form-control" value="<?=old('code', $papelGenerico->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="codeOt" class="form-label">
|
||||
<?=lang('PapelGenerico.codeOt') ?>
|
||||
</label>
|
||||
<input type="text" id="codeOt" name="code_ot" maxLength="5" class="form-control" value="<?=old('code_ot', $papelGenerico->code_ot) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="showInClient" class="form-check-label">
|
||||
<input type="checkbox" id="showInClient" name="show_in_client" value="1" class="form-check-input"<?=$papelGenerico->show_in_client== true ? 'checked' : ''; ?>>
|
||||
<?=lang('PapelGenerico.showInClient') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
165
ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php
Executable file
165
ci4/app/Views/themes/vuexy/form/configuracion/papel/_papelImpresionFormItems.php
Executable file
@ -0,0 +1,165 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('PapelImpresion.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?= old('nombre', $papelImpresion->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="referencia" class="form-label">
|
||||
<?= lang('PapelImpresion.referencia') ?>
|
||||
</label>
|
||||
<input type="text" id="referencia" name="referencia" maxLength="13" class="form-control" value="<?= old('referencia', $papelImpresion->referencia) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="mano" class="form-label">
|
||||
<?= lang('PapelImpresion.mano') ?>*
|
||||
</label>
|
||||
<input type="number" id="mano" name="mano" required maxLength="8" step="0.01" class="form-control" value="<?= old('mano', $papelImpresion->mano) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="precioTonelada" class="form-label">
|
||||
<?= lang('PapelImpresion.precioTonelada') ?>*
|
||||
</label>
|
||||
<input type="number" id="precioTonelada" name="precio_tonelada" required maxLength="31" step="0.01" class="form-control" value="<?= old('precio_tonelada', $papelImpresion->precio_tonelada) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="papelGenericoId" class="form-label">
|
||||
<?= lang('PapelImpresion.papelGenericoId') ?>*
|
||||
</label>
|
||||
<select id="papelGenericoId" name="papel_generico_id" required class="form-control select2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($papelGenericoList) && is_array($papelGenericoList) && !empty($papelGenericoList)) :
|
||||
foreach ($papelGenericoList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $papelImpresion->papel_generico_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="gramaje" class="form-label">
|
||||
<?= lang('PapelImpresion.gramaje') ?>*
|
||||
</label>
|
||||
<input type="number" id="gramaje" name="gramaje" required maxLength="31" step="0.01" class="form-control" value="<?= old('gramaje', $papelImpresion->gramaje) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="espesor" class="form-label">
|
||||
<?= lang('PapelImpresion.espesor') ?>*
|
||||
</label>
|
||||
<input type="number" id="espesor" name="espesor" required placeholder="0.00" maxLength="8" step="0.01" class="form-control" value="<?= old('espesor', $papelImpresion->espesor) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="bn" class="form-check-label">
|
||||
<input type="checkbox" id="bn" name="bn" value="1" class="form-check-input" <?= $papelImpresion->bn == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.bn') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="cubierta" class="form-check-label">
|
||||
<input type="checkbox" id="cubierta" name="cubierta" value="1" class="form-check-input" <?= $papelImpresion->cubierta == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.cubierta') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="guardas" class="form-check-label">
|
||||
<input type="checkbox" id="guardas" name="guardas" value="1" class="form-check-input" <?= $papelImpresion->guardas == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.guardas') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="rotativa" class="form-check-label">
|
||||
<input type="checkbox" id="rotativa" name="rotativa" value="1" class="form-check-input" <?= $papelImpresion->rotativa == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.rotativa') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="isActivo" class="form-check-label">
|
||||
<input type="checkbox" id="isActivo" name="isActivo" value="1" class="form-check-input" <?= $papelImpresion->isActivo == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.activo') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="color" class="form-check-label">
|
||||
<input type="checkbox" id="color" name="color" value="1" class="form-check-input" <?= $papelImpresion->color == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.color') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="sobrecubierta" class="form-check-label">
|
||||
<input type="checkbox" id="sobrecubierta" name="sobrecubierta" value="1" class="form-check-input" <?= $papelImpresion->sobrecubierta == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.sobrecubierta') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="inkjet" class="form-check-label">
|
||||
<input type="checkbox" id="inkjet" name="inkjet" value="1" class="form-check-input" <?= $papelImpresion->inkjet == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.inkjet') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
|
||||
<label for="defecto" class="form-check-label">
|
||||
<input type="checkbox" id="defecto" name="defecto" value="1" class="form-check-input" <?= $papelImpresion->defecto == true ? 'checked' : ''; ?>>
|
||||
<?= lang('PapelImpresion.defecto') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
</div><!-- //.row -->
|
||||
154
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoForm.php
Executable file
154
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoForm.php
Executable file
@ -0,0 +1,154 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $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="papelGenericoForm" method="post" class="card-body" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/configuracion/papel/_papelGenericoFormItems") ?>
|
||||
<div class="pt-4">
|
||||
<input
|
||||
type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("papelGenericoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
<div class="accordion mt-3" id="accordionExample">
|
||||
<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="#accordionOne" aria-expanded="flase" aria-controls="accordionOne">
|
||||
<?= lang("PapelGenerico.form_acordion_title") ?>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionOne" class="accordion-collapse collapse show" data-bs-parent="#accordionExample">
|
||||
<div class="accordion-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPapelesimpresion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('PapelImpresion.defecto') ?></th>
|
||||
<th><?= lang('PapelImpresion.nombre') ?></th>
|
||||
<th><?= lang('PapelImpresion.gramaje') ?></th>
|
||||
<th class="text-nowrap"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<?php endif; ?>
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
// JJO
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
let id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
const lastColNr = $('#tableOfPapelesimpresion').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
theTable = $('#tableOfPapelesimpresion').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": '<"mt-4">lfrt<"mb-3"ip>', // '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesImpresion') ?>',
|
||||
data: {
|
||||
id_PG: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr] //JJO añadidas bool cols
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'defecto' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'gramaje' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [0];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
//window.location.href = `<?= route_to('papelImpresionList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
window.location.href = `/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
151
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoList.php
Executable file
151
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelGenericoList.php
Executable file
@ -0,0 +1,151 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('PapelGenerico.papelGenericoList') ?></h3>
|
||||
<?=anchor(route_to('newPapelGenerico'), lang('Basic.global.addNew').' '.lang('PapelGenerico.papelGenerico'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPapelesgenericos" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('PapelGenerico.nombre') ?></th>
|
||||
<th><?= lang('PapelGenerico.code') ?></th>
|
||||
<th><?= lang('PapelGenerico.codeOt') ?></th>
|
||||
<th><?= lang('PapelGenerico.showInClient') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
const lastColNr = $('#tableOfPapelesgenericos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
theTable = $('#tableOfPapelesgenericos').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip', // '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesGenericos') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'code' },
|
||||
{ 'data': 'code_ot' },
|
||||
{ 'data': 'show_in_client' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [3];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/configuracion/papelesgenericos/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(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: `/configuracion/papelesgenericos/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
780
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php
Executable file
780
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionForm.php
Executable file
@ -0,0 +1,780 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $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="papelImpresionForm" method="post" class="card-body" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/configuracion/papel/_papelImpresionFormItems") ?>
|
||||
<div class="pt-4">
|
||||
<input type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("papelImpresionList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
<div class="accordion mt-3" id="accordionMargenes">
|
||||
<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="#accordionTip3" aria-expanded="false" aria-controls="accordionTip3">
|
||||
<p><?= lang("PapelImpresionMargenes.accordion") ?></p>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip3" class="accordion-collapse collapse show" data-bs-parent="#accordionMargenes">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfPapelimpresionmargenes" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('PapelImpresionMargenes.paginasMin') ?></th>
|
||||
<th><?= lang('PapelImpresionMargenes.paginasMax') ?></th>
|
||||
<th><?= lang('PapelImpresionMargenes.margen') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(str_contains($formAction,'edit') && ($papelImpresion->rotativa == true || $papelImpresion->inkjet == true)): ?>
|
||||
<div class="accordion mt-3" id="accordionTipologias">
|
||||
|
||||
<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="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||
<p><?= lang("PapelImpresion.consumo_tintas_rotativas") ?></p>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionTipologias">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfPapelimpresiontipologias" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('ImpresionTipologias.tipo') ?></th>
|
||||
<th><?= lang('ImpresionTipologias.negro') ?></th>
|
||||
<th><?= lang('ImpresionTipologias.cyan') ?></th>
|
||||
<th><?= lang('ImpresionTipologias.magenta') ?></th>
|
||||
<th><?= lang('ImpresionTipologias.amarillo') ?></th>
|
||||
<th><?= lang('ImpresionTipologias.cg') ?></th>
|
||||
<th><?= lang('ImpresionTipologias.gotaNegro') ?></th>
|
||||
<th><?= lang('ImpresionTipologias.gotaColor') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
<div class="accordion mt-3" id="accordionMaquinas">
|
||||
|
||||
<div class="card accordion-item">
|
||||
<h2 class="accordion-header" id="headingTwo">
|
||||
<button
|
||||
type="button"
|
||||
class="accordion-button collapsed"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#accordionMaq"
|
||||
aria-expanded="false"
|
||||
aria-controls="accordionMaq"
|
||||
>
|
||||
<p><?= lang("PapelImpresion.maquinas_papel") ?></p>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="accordionMaq" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionMaquinas">
|
||||
<div class="accordion-body">
|
||||
<table id="tableOfMaquinas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('MaquinasPapelImpresion.activo') ?></th>
|
||||
<th><?= lang('Maquinas.nombre') ?></th>
|
||||
<th><?= lang('Maquinas.ancho') ?></th>
|
||||
<th><?= lang('Maquinas.alto') ?></th>
|
||||
<th><?= lang('Maquinas.anchoImpresion') ?></th>
|
||||
<th><?= lang('Maquinas.altoImpresion') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para general -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
var theTable;
|
||||
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
let id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
|
||||
$('#papelGenericoId').select2({
|
||||
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfPapelesGenericos") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Delete row
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||
if($(this).closest('table').attr('id').includes('margenes')){
|
||||
$(".btn-remove").attr('table', "margenes");
|
||||
}
|
||||
else if($(this).closest('table').attr('id').includes('tipologias')){
|
||||
$(".btn-remove").attr('table', "tipologias");
|
||||
}
|
||||
else{
|
||||
$(".btn-remove").attr('table', );
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-remove', function(e) {
|
||||
const dataId = $(this).attr('data-id');
|
||||
const row = $(this).closest('tr');
|
||||
if ($.isNumeric(dataId)) {
|
||||
|
||||
if($(this).attr('table').includes('margenes')){
|
||||
remove_margenes(dataId, row);
|
||||
}
|
||||
else if ($(this).attr('table').includes('tipologias')){
|
||||
remove_tipologias(dataId, row);
|
||||
}
|
||||
}
|
||||
});
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para tabla margenes -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
var theTable3;
|
||||
const lastColNr3 = $('#tableOfPapelimpresionmargenes').find("tr:first th").length - 1;
|
||||
const actionBtns3 = function(data) {
|
||||
return `
|
||||
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit3 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>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
// Definición del editor
|
||||
var editor3 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfPapelImpresionMargenes') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfPapelimpresionmargenes",
|
||||
idSrc: 'id',
|
||||
fields: [
|
||||
{
|
||||
name: "paginas_min",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},{
|
||||
name: "paginas_max",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},{
|
||||
name: "margen",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
}, {
|
||||
"name": "papel_impresion_id",
|
||||
"type": "hidden"
|
||||
}, {
|
||||
"name": "deleted_at",
|
||||
"type": "hidden"
|
||||
}, {
|
||||
"name": "is_deleted",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
|
||||
|
||||
// Definición de la tabla
|
||||
theTable3 = $('#tableOfPapelimpresionmargenes').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5],
|
||||
pageLength: 5,
|
||||
lengthChange: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
"dom": '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
stateSave: true,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelImpresionMargen') ?>',
|
||||
data: {
|
||||
id_PI: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns : [
|
||||
{ 'data': 'paginas_min' },
|
||||
{ 'data': 'paginas_max' },
|
||||
{ 'data': 'margen' },
|
||||
{ data: actionBtns3,
|
||||
className: 'row-edit dt-center'}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr3]
|
||||
}
|
||||
],
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor3,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$(document).on('click', '.btn-edit3', function(e) {
|
||||
editor3.inline(
|
||||
theTable3.cells(this.parentNode.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'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
// Obtención del id para editar
|
||||
editor3.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['papel_impresion_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['papel_impresion_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Refrescar token
|
||||
editor3.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
// Refrescar tabla
|
||||
editor3.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
|
||||
theTable3.clearPipeline();
|
||||
theTable3.draw();
|
||||
});
|
||||
|
||||
|
||||
// Delete row
|
||||
function remove_margenes(dataId, row){
|
||||
|
||||
$.ajax({
|
||||
url: `/configuracion/papelimpresionmargenes/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable3.clearPipeline();
|
||||
theTable3.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para tabla tipologias -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
var theTable;
|
||||
const lastColNr = $('#tableOfPapelimpresiontipologias').find("tr:first th").length - 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>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
// Etiquetas para las tipologias
|
||||
const tipoTypes = [
|
||||
{label:'<?= lang('ImpresionTipologias.negro') ?>', value:'negro'},
|
||||
{label:'<?= lang('ImpresionTipologias.color') ?>', value: 'color'},
|
||||
{label:'<?= lang('ImpresionTipologias.bicolor') ?>', value: 'bicolor'}
|
||||
];
|
||||
|
||||
|
||||
// Definición del editor
|
||||
editor = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfConsumoTintas') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfPapelimpresiontipologias",
|
||||
idSrc: 'id',
|
||||
fields: [
|
||||
{
|
||||
name: "tipo",
|
||||
type: "select",
|
||||
options: tipoTypes
|
||||
}, {
|
||||
name: "negro",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},{
|
||||
name: "cyan",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},{
|
||||
name: "magenta",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},{
|
||||
name: "amarillo",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},{
|
||||
name: "cg",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "gota_negro",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
},{
|
||||
name: "gota_color",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
}, {
|
||||
"name": "papel_impresion_id",
|
||||
"type": "hidden"
|
||||
}
|
||||
]
|
||||
} );
|
||||
|
||||
|
||||
// Definición de la tabla
|
||||
theTable = $('#tableOfPapelimpresiontipologias').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5],
|
||||
pageLength: 5,
|
||||
lengthChange: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
"dom": '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
stateSave: true,
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesImpresion') ?>',
|
||||
data: {
|
||||
id_PI: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns : [
|
||||
{ 'data': 'tipo', "render": function ( data, type, row, meta ) {
|
||||
if(data=='negro')
|
||||
return '<?= lang('ImpresionTipologias.negro') ?>';
|
||||
else if (data=='color')
|
||||
return '<?= lang('ImpresionTipologias.color') ?>';
|
||||
else if (data=='bicolor')
|
||||
return '<?= lang('ImpresionTipologias.bicolor') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': 'negro' },
|
||||
{ 'data': 'cyan' },
|
||||
{ 'data': 'magenta' },
|
||||
{ 'data': 'amarillo' },
|
||||
{ 'data': 'cg' },
|
||||
{ 'data': 'gota_negro' },
|
||||
{ 'data': 'gota_color' },
|
||||
{ data: actionBtns,
|
||||
className: 'row-edit dt-center'}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
visible: false,
|
||||
targets: [5]
|
||||
}
|
||||
],
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary float-end me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||
}
|
||||
} ],
|
||||
initComplete: function () {
|
||||
<?php if($papelImpresion->inkjet) { ?>
|
||||
theTable.column(5).visible(true)
|
||||
<?php } ?>
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Notificar que no se pueden añadir más tipologías
|
||||
editor.on( 'initCreate', function () {
|
||||
if ( $('#tableOfPapelimpresiontipologias').DataTable().data().count() >= 3 ){
|
||||
editor.close();
|
||||
popErrorAlert('<?= lang('Basic.global.sweet.maxRowsReached') ?>');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
editor.inline(
|
||||
theTable.cells(this.parentNode.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'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
// Obtención del id para editar
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['papel_impresion_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['papel_impresion_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Refrescar token
|
||||
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
// Refrescar tabla
|
||||
editor.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.draw();
|
||||
});
|
||||
|
||||
|
||||
// Delete row
|
||||
function remove_tipologias(dataId, row){
|
||||
|
||||
$.ajax({
|
||||
url: `/configuracion/papelimpresiontipologias/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
});
|
||||
}
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para tabla maquinas -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
// Botones última columna
|
||||
const lastColNr2 = $('#tableOfMaquinas').find("tr:first th").length - 1;
|
||||
const actionBtns2 = function(data) {
|
||||
return `
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit2 mx-2" data-id="${data.maquina_id}"></i></a>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
// Definicion de la tabla
|
||||
var theTable2 = $('#tableOfMaquinas').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [[ 1, "asc" ]],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: true,
|
||||
paging: true,
|
||||
info: true,
|
||||
dom: "lftp",
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesImpresionMaquinas') ?>',
|
||||
data: function (d) {
|
||||
d.papel_id = id;
|
||||
d.isRotativa = $('#rotativa').is(':checked')?1:0;
|
||||
d.webguard_token = '<?= csrf_hash() ?>';
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'active',
|
||||
render: function (data, type, row) {
|
||||
if (type === 'display') {
|
||||
return '<input type="checkbox" class="editor-active" id="check_' + row.papel_impresion_id + '">';
|
||||
}
|
||||
return data;
|
||||
},
|
||||
className: 'dt-body-center'
|
||||
},
|
||||
{ 'data': 'maquina'},
|
||||
{ 'data': 'ancho'},
|
||||
{ 'data': 'alto'},
|
||||
{ 'data': 'anchoimpresion'},
|
||||
{ 'data': 'altoimpresion'},
|
||||
{ data: actionBtns2,
|
||||
className: 'row-edit dt-center'}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr2]
|
||||
}
|
||||
],
|
||||
rowCallback: function (row, data) {
|
||||
// Set the checked state of the checkbox in the table
|
||||
$('input.editor-active', row).prop('checked', data.active == 1);
|
||||
},
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
searchable: false,
|
||||
targets: [0,2,3,4,5]
|
||||
}
|
||||
],
|
||||
} );
|
||||
|
||||
|
||||
// Definición del editor
|
||||
editor2 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfMaquinasPapelImpresion') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfMaquinas",
|
||||
idSrc: 'papel_impresion_id',
|
||||
fields: [
|
||||
{
|
||||
name: "active",
|
||||
type: "checkbox",
|
||||
separator: "|",
|
||||
ipOpts: [
|
||||
{ label: '', value: 1 }
|
||||
]
|
||||
},{
|
||||
"name": "papel_impresion_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "gramaje",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "maquina_id",
|
||||
"type": "hidden"
|
||||
}
|
||||
]
|
||||
} );
|
||||
|
||||
|
||||
// Postsubmit del editor
|
||||
editor2.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
if(json.error){
|
||||
document.getElementById("check_" + json.data.papel_impresion_id).checked = false;
|
||||
popErrorAlert(json.error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Click sobre el botón editar máquina
|
||||
$(document).on('click', '.btn-edit2', function(e) {
|
||||
window.open(`/configuracion/maquinas/edit/${$(this).attr('data-id')}`);
|
||||
});
|
||||
|
||||
|
||||
// Cuando se clica en un checkbox hacer submit en el editor
|
||||
theTable2.on( 'change', 'input.editor-active', function () {
|
||||
editor2
|
||||
.edit( $(this).closest('tr'), false )
|
||||
.set( 'active', $(this).prop( 'checked' ) ? 1 : 0 )
|
||||
.submit();
|
||||
} );
|
||||
|
||||
$('#rotativa').on('change', function() {
|
||||
if($('#inkjet').prop('checked')){
|
||||
$('#inkjet').prop('checked', false)
|
||||
}
|
||||
})
|
||||
|
||||
$('#inkjet').on('change', function() {
|
||||
if($('#rotativa').prop('checked')){
|
||||
$('#rotativa').prop('checked', false)
|
||||
}
|
||||
})
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
166
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php
Executable file
166
ci4/app/Views/themes/vuexy/form/configuracion/papel/viewPapelImpresionList.php
Executable file
@ -0,0 +1,166 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('PapelImpresion.papelImpresionList') ?></h3>
|
||||
<?=anchor(route_to('newPapelImpresion'), lang('Basic.global.addNew').' '.lang('PapelImpresion.papelImpresion'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPapelesimpresion" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('PapelImpresion.nombre') ?></th>
|
||||
<th><?= lang('PapelGenerico.papelGenerico') ?></th>
|
||||
<th><?= lang('PapelImpresion.gramaje') ?></th>
|
||||
<th><?= lang('PapelImpresion.bn') ?></th>
|
||||
<th><?= lang('PapelImpresion.color') ?></th>
|
||||
<th><?= lang('PapelImpresion.cubierta') ?></th>
|
||||
<th><?= lang('PapelImpresion.sobrecubierta') ?></th>
|
||||
<th><?= lang('PapelImpresion.guardas') ?></th>
|
||||
<th><?= lang('PapelImpresion.inkjet') ?></th>
|
||||
<th><?= lang('PapelImpresion.rotativa') ?></th>
|
||||
<th><?= lang('PapelImpresion.activo') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfPapelesimpresion').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfPapelesimpresion').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesImpresion') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr] //JJO añadidas bool cols
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'papel_generico_id' },
|
||||
{ 'data': 'gramaje' },
|
||||
{ 'data': 'bn' },
|
||||
{ 'data': 'color' },
|
||||
{ 'data': 'cubierta' },
|
||||
{ 'data': 'sobrecubierta' },
|
||||
{ 'data': 'guardas' },
|
||||
{ 'data': 'inkjet' },
|
||||
{ 'data': 'rotativa' },
|
||||
{ 'data': 'isActivo' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [3, 4, 5, 6, 7, 8, 9, 10];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/configuracion/papelesimpresion/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(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: `/configuracion/papelesimpresion/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="ancho" class="form-label">
|
||||
<?=lang('LgPapelFormatoes.ancho') ?>*
|
||||
</label>
|
||||
<input type="number" id="ancho" name="ancho" required maxLength="8" step="0.01" class="form-control" value="<?=old('ancho', $papelFormatoEntity->ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="alto" class="form-label">
|
||||
<?=lang('LgPapelFormatoes.alto') ?>*
|
||||
</label>
|
||||
<input type="number" id="alto" name="alto" required maxLength="8" step="0.01" class="form-control" value="<?=old('alto', $papelFormatoEntity->alto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,26 @@
|
||||
<?= $this->include("Themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("Themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend("Themes/" . config("Basics")->theme["name"] . "/AdminLayout/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="papelFormatoForm" 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/papelformato/_papelFormatoFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("papelFormatoList"), 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() ?>
|
||||
@ -0,0 +1,187 @@
|
||||
<?=$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('LgPapelFormatoes.papelFormatoList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('Themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPapelesformatos" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
<th><?=lang('LgPapelFormatoes.id')?></th>
|
||||
<th><?= lang('LgPapelFormatoes.ancho') ?></th>
|
||||
<th><?= lang('LgPapelFormatoes.alto') ?></th>
|
||||
<th><?= lang('LgPapelFormatoes.createdAt') ?></th>
|
||||
<th><?= lang('LgPapelFormatoes.updatedAt') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newPapelFormato'), lang('Basic.global.addNew').' '.lang('LgPapelFormatoes.papelFormato'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfPapelesformatos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfPapelesformatos').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/assets/dt/<?= config('Basics')->languages[$currentLocale] ?? config('Basics')->i18n ?>.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfPapelesFormatos') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'ancho' },
|
||||
{ 'data': 'alto' },
|
||||
{ 'data': 'created_at' },
|
||||
{ 'data': 'updated_at' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
const dateCols = [4, 5];
|
||||
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
|
||||
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
|
||||
|
||||
for (let coln of dateCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
const datestr = cell.innerHTML;
|
||||
const dateStrLen = datestr.toString().trim().length;
|
||||
if (dateStrLen > 0) {
|
||||
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
|
||||
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
|
||||
const d = new Date(...dateTimeParts); // new Date(datestr);
|
||||
const md = moment(d);
|
||||
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
|
||||
const formattedDateStr = md.format(usingThisFormat);
|
||||
cell.innerHTML = formattedDateStr;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('papelFormatoList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('LgPapelFormatoes.papel formato'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('papelFormatoList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?=lang('Provincias.code') ?>*
|
||||
</label>
|
||||
<input type="text" id="code" name="code" required maxLength="2" class="form-control" value="<?=old('code', $provinciaEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('Provincias.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $provinciaEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('Provincias.paisId') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" class="form-control select2" style="width: 100%;" >
|
||||
|
||||
<?php if ( isset($paisList) && is_array($paisList) && !empty($paisList) ) :
|
||||
foreach ($paisList as $k => $v) : ?>
|
||||
<option value="<?=$k ?>"<?=$k==$provinciaEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,63 @@
|
||||
<?= $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="provinciaForm" 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/provincias/_provinciaFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("provinciaList"), 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() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#paisId').select2({
|
||||
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfPaises") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
187
ci4/app/Views/themes/vuexy/form/configuracion/provincias/viewProvinciaList.php
Executable file
187
ci4/app/Views/themes/vuexy/form/configuracion/provincias/viewProvinciaList.php
Executable file
@ -0,0 +1,187 @@
|
||||
<?=$this->include('themes_commonPartialsBs/select2bs5') ?>
|
||||
<?=$this->include('themes_commonPartialsBs/datatables') ?>
|
||||
<?=$this->include('themes_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?=lang('Provincias.provinciaList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfProvincias" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
<th><?=lang('Provincias.id')?></th>
|
||||
<th><?= lang('Provincias.code') ?></th>
|
||||
<th><?= lang('Provincias.nombre') ?></th>
|
||||
<th><?= lang('Paises.pais') ?></th>
|
||||
<th><?= lang('Provincias.createdAt') ?></th>
|
||||
<th><?= lang('Provincias.updatedAt') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newProvincia'), lang('Basic.global.addNew').' '.lang('Provincias.provincia'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfProvincias').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<button class="btn btn-sm btn-warning btn-edit me-1" data-id="${data.id}"><?= lang('Basic.global.edit') ?></button>
|
||||
<button class="btn btn-sm btn-danger btn-delete ms-1" data-id="${data.id}"><?= lang('Basic.global.Delete') ?></button>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
theTable = $('#tableOfProvincias').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
"dom": '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'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfProvincias') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': actionBtns },
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'code' },
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'pais' },
|
||||
{ 'data': 'created_at' },
|
||||
{ 'data': 'updated_at' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
const dateCols = [5, 6];
|
||||
const shortDateFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY')?>';
|
||||
const dateTimeFormat = '<?= convertPhpDateToMomentFormat('mm/dd/YYYY h:i a')?>';
|
||||
|
||||
for (let coln of dateCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
const datestr = cell.innerHTML;
|
||||
const dateStrLen = datestr.toString().trim().length;
|
||||
if (dateStrLen > 0) {
|
||||
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
|
||||
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
|
||||
const d = new Date(...dateTimeParts); // new Date(datestr);
|
||||
const md = moment(d);
|
||||
const usingThisFormat = dateStrLen > 11 ? dateTimeFormat : shortDateFormat;
|
||||
const formattedDateStr = md.format(usingThisFormat);
|
||||
cell.innerHTML = formattedDateStr;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `<?= route_to('provinciaList') ?>/${$(this).attr('data-id')}/edit`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Provincias.provincia'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: `<?= route_to('provinciaList') ?>/${dataId}`,
|
||||
method: 'DELETE',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: data.msg ?? jqXHR.statusText,
|
||||
});
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
Toast.fire({
|
||||
icon: 'error',
|
||||
title: jqXHR.responseJSON.messages.error,
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?=lang('TipologiasLibros.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" value="<?=old('nombre', $tipologiasEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="code" class="form-label">
|
||||
<?=lang('TipologiasLibros.code') ?>*
|
||||
</label>
|
||||
<input type="text" id="code" name="code" required maxLength="5" class="form-control" value="<?=old('code', $tipologiasEntity->code) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
@ -0,0 +1,27 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?=$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="tipologiaLibrosForm" 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/tipologias/_tipologiaLibrosFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="card-footer">
|
||||
<?= anchor(route_to("tipologiaLibrosList2"), 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() ?>
|
||||
@ -0,0 +1,106 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$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('TipologiasLibros.tipologiaLibrosList') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfTipologiaslibros" 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('TipologiasLibros.nombre') ?></th>
|
||||
<th><?= lang('TipologiasLibros.code') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tipologiaLibrosList as $item ) : ?>
|
||||
<tr>
|
||||
<td class="align-middle text-center text-nowrap">
|
||||
<?=anchor(route_to('editTipologiaLibros', $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('deleteTipologiaLibros', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
|
||||
</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">
|
||||
<?= esc($item->code) ?>
|
||||
</td>
|
||||
<td class="align-middle text-center text-nowrap">
|
||||
<?=anchor(route_to('editTipologiaLibros', $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('deleteTipologiaLibros', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
<?=anchor(route_to('newTipologiaLibros'), lang('Basic.global.addNew').' '.lang('TipologiasLibros.tipologiaLibros'), ['class'=>'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$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: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
"columnDefs": [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0,lastColNr2]
|
||||
}
|
||||
]
|
||||
});
|
||||
<?=$this->endSection() ?>
|
||||
121
ci4/app/Views/themes/vuexy/form/group/viewUserGroupForm.php
Executable file
121
ci4/app/Views/themes/vuexy/form/group/viewUserGroupForm.php
Executable file
@ -0,0 +1,121 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-info">
|
||||
<h3 class="card-header"><?= lang("RolesPermisos.editRol") ?></h3>
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form id="groupForm" method="post" class="card-body" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
|
||||
<div class="row g-3">
|
||||
<input type="hidden"
|
||||
name="id"
|
||||
value="<?= old('id', $group->id) ?>"
|
||||
>
|
||||
<div class="col-md-4">
|
||||
<label for="title" class="form-label text-dark">
|
||||
<?= lang("RolesPermisos.rolName") ?>
|
||||
</label>
|
||||
<input type="text" name="title" id="title" class="form-control"
|
||||
value="<?= old('title', $group->title) ?>">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<label for="description" class="form-label text-dark">
|
||||
<?= lang("RolesPermisos.rolDescription") ?>
|
||||
</label>
|
||||
<input type="text" name="description" id="description" class="form-control"
|
||||
value="<?= old('description', $group->description) ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-3 mt-3">
|
||||
<div class="col-md-12">
|
||||
<h5><?= lang("RolesPermisos.rolPermissions") ?></h5>
|
||||
<!-- Permission table -->
|
||||
<div class="table-responsive">
|
||||
<table class="table table-flush-spacing">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-nowrap fw-semibold" colspan="1">
|
||||
<?= lang("RolesPermisos.adminRol") ?>
|
||||
<i class="ti ti-info-circle" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
aria-label="<?= lang("RolesPermisos.adminRolTooltip") ?>"
|
||||
data-bs-original-title="<?= lang("RolesPermisos.adminRolTooltip") ?>">
|
||||
</i>
|
||||
</td>
|
||||
<td colspan="3">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="selectAll">
|
||||
<label class="form-check-label" for="selectAll">
|
||||
<?= lang("RolesPermisos.selectAll") ?>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php foreach ($permisos as $permiso): ?>
|
||||
<tr>
|
||||
<td colspan="4" class="text-nowrap fw-semibold">
|
||||
<?= $permiso->name ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php foreach ($permiso->rules as $key => $rules): ?>
|
||||
<tr>
|
||||
<td class="text-nowrap fw-semibold" >
|
||||
  <?= lang("RolesPermisos." . convertToCamelCase($key) . "Section") ?>
|
||||
</td>
|
||||
<?php foreach ($rules as $rule): ?>
|
||||
<td>
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
id="<?= $key . '_' . $rule ?>"
|
||||
name="<?= $key . '_' . $rule ?>"
|
||||
class="form-check-input"
|
||||
<?= ruleIsChecked($group->rules, $key, $rule) ? 'checked' : '' ?>
|
||||
>
|
||||
<label for="<?= $key . '_' . $rule ?>" class="form-check-label">
|
||||
<?= lang("RolesPermisos." . $rule . "Permission") ?>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach;
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-4">
|
||||
<input type="submit" class="btn btn-primary float-start me-sm-3 me-1" name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>">
|
||||
<?= anchor(route_to("groupIndex"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!-- /.card-body -->
|
||||
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
|
||||
$('input[name="selectAll"]').click(function() {
|
||||
var checkedStatus = this.checked;
|
||||
$('input[type="checkbox"]').each(function() {
|
||||
this.checked = checkedStatus;
|
||||
});
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
82
ci4/app/Views/themes/vuexy/form/group/viewUserGroupList.php
Executable file
82
ci4/app/Views/themes/vuexy/form/group/viewUserGroupList.php
Executable file
@ -0,0 +1,82 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('RolesPermisos.pageTitle') ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<!-- Role cards -->
|
||||
<div class="row g-4">
|
||||
<div class="col-xl-4 col-lg-6 col-md-6">
|
||||
<div class="card h-100">
|
||||
<div class="row h-100">
|
||||
<div class="col-sm-5">
|
||||
<div class="d-flex align-items-end h-100 justify-content-center mt-sm-0 mt-3">
|
||||
<img
|
||||
src="<?= site_url('themes/vuexy/img/illustrations/add-new-roles.png') ?>"
|
||||
class="img-fluid mt-sm-4 mt-md-0"
|
||||
alt="add-new-roles"
|
||||
width="83"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="card-body text-sm-end text-center ps-sm-0">
|
||||
<button
|
||||
onclick="window.location='<?= route_to('newGroup') ?>'"
|
||||
class="btn btn-primary mb-2 text-nowrap add-new-role"
|
||||
>
|
||||
<?= lang('Basic.global.addNew') ?>
|
||||
</button>
|
||||
<p class="mb-0 mt-1"><?= lang("RolesPermisos.addRol") ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php foreach ($userGroupList as $item) : ?>
|
||||
<div class="col-xl-4 col-lg-6 col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h6 class="fw-normal mb-2"><?= $model->getUsersWithRol($item->keyword); ?><?= lang("RolesPermisos.totalUsers") ?></h6>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-end mt-1">
|
||||
<div class="role-heading">
|
||||
<h4 class="mb-1"><?= esc($item->title) ?></h4>
|
||||
<a href="<?= route_to('editGroup', $item->id) ?>">
|
||||
<span><?= lang('Basic.global.edit') ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?=
|
||||
anchor('#confirm2delete', "<i class='ti ti-trash ti-md'></i>",
|
||||
[
|
||||
'class' => 'text-muted',
|
||||
'data-href' => route_to('deleteGroup', $item->id),
|
||||
'data-bs-toggle' => 'modal',
|
||||
'data-bs-target' => '#confirm2delete'
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<!--/ Role cards -->
|
||||
</div>
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
106
ci4/app/Views/themes/vuexy/form/my/notification.php
Executable file
106
ci4/app/Views/themes/vuexy/form/my/notification.php
Executable file
@ -0,0 +1,106 @@
|
||||
<!--Content Body-->
|
||||
<div class="content-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row page-titles mx-0">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<div class="welcome-text">
|
||||
<h4><i class="<?= $title['icon']??'' ?>"></i> <?= $title['module']??'' ?></h4>
|
||||
<span class="ml-1"><?= $title['page']??'' ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<ol class="breadcrumb">
|
||||
<?php foreach ($breadcrumb??[] as $item) : ?>
|
||||
<?php if (!$item['active']) : ?>
|
||||
<li class="breadcrumb-item"><a href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
||||
<?php else : ?>
|
||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header row">
|
||||
<div class="col-sm-12">
|
||||
<h4 class="card-title"><?= $title['page']??'' ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<!-- CSRF token -->
|
||||
<input type="hidden" class="txt_csrfname" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" />
|
||||
<!-- Table -->
|
||||
<div class="table-responsive">
|
||||
<table id='table-grid' class="table table-striped nowrap" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=lang("App.notification_grid_sender")?></th>
|
||||
<th><?=lang("App.notification_grid_recipient")?></th>
|
||||
<th><?=lang("App.notification_grid_title")?></th>
|
||||
<th><?=lang("App.notification_grid_created_my")?></th>
|
||||
<th><?=lang("App.notification_grid_view_my")?></th>
|
||||
<th><?=lang("App.user_grid_options")?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Required vendors -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/global/global.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/js/quixnav-init.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/js/custom.min.js")?>"></script>
|
||||
<!-- Datatable -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/jquery.dataTables.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/pickers/daterange/moment.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/dataTables.datetime.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/dataTables.buttons.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/buttons.bootstrap4.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/jszip.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/pdfmake.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/vfs_fonts.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/buttons.html5.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/buttons.print.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/datatables/js/buttons.colVis.min.js")?>"></script>
|
||||
<!-- Alert -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/vendor/toastr/js/toastr.min.js")?>"></script>
|
||||
<!-- Custom -->
|
||||
<script src="<?=site_url("assets/js/main.js")?>"></script>
|
||||
<script src="<?=site_url('themes/focus2/vendor/timeago/jquery.timeago.js'); ?>"></script>
|
||||
<script src="<?=site_url('themes/focus2/vendor/timeago/locales/jquery.timeago.'.langJS().'.js'); ?>"></script>
|
||||
<script>
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
let dataFormat = [
|
||||
{
|
||||
targets: 3,
|
||||
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss','<?=momentDateTimeJS()?>')
|
||||
},
|
||||
{
|
||||
targets: 4,
|
||||
render: function ( data, type, row ) {
|
||||
switch (data) {
|
||||
case '1':
|
||||
return '<span class="badge badge-success"><?=lang("App.notification_grid_yes")?></span>';
|
||||
default:
|
||||
return '<span class="badge badge-dark"><?=lang("App.notification_grid_no")?></span>';
|
||||
}
|
||||
}
|
||||
},
|
||||
];
|
||||
let order = [[3, "desc"]];
|
||||
let translate = '/themes/focus2/vendor/datatables/locales/<?=langJS()?>.json';
|
||||
let button = ["<?=lang("App.global_copy")?>","<?=lang("App.global_print")?>","<?=lang("App.global_excel")?>","<?=lang("App.global_pdf")?>"];
|
||||
let columns = [{ data: 'sender' },{ data: 'recipient' },{ data: 'title' },{ data: 'created_at' },{ data: 'is_read' },{ data: 'options' }];
|
||||
loadDataTableAjax('table-grid', '<?=site_url('ajax/getMyNotification')?>', translate, true, true, order, columns,dataFormat, button);
|
||||
});
|
||||
</script>
|
||||
<?= sweetAlert() ?>
|
||||
46
ci4/app/Views/themes/vuexy/form/my/view.php
Executable file
46
ci4/app/Views/themes/vuexy/form/my/view.php
Executable file
@ -0,0 +1,46 @@
|
||||
<!--Content Body-->
|
||||
<div class="content-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row page-titles mx-0">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<div class="welcome-text">
|
||||
<h4><i class="<?= $title['icon']??'' ?>"></i> <?= $title['module']??'' ?></h4>
|
||||
<span class="ml-1"><?= $title['page']??'' ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<ol class="breadcrumb">
|
||||
<?php foreach ($breadcrumb??[] as $item) : ?>
|
||||
<?php if (!$item['active']) : ?>
|
||||
<li class="breadcrumb-item"><a href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
||||
<?php else : ?>
|
||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= $obj['title']??''?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= html_entity_decode($obj['body']??'');?>
|
||||
<div class="form-actions mt-4">
|
||||
<a href="<?= site_url($btn_return['route']??'#') ?>" class="<?= $btn_return['class']??''?>">
|
||||
<i class="<?= $btn_return['icon']??'' ?>"></i> <?= $btn_return['title']??'' ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Required vendors -->
|
||||
<script src="<?=site_url("themes/focus2/vendor/global/global.min.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/js/quixnav-init.js")?>"></script>
|
||||
<script src="<?=site_url("themes/focus2/js/custom.min.js")?>"></script>
|
||||
|
||||
@ -0,0 +1,340 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $pageTitle ?></h3>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPresupuestos" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=lang('Presupuestos.id')?></th>
|
||||
<th><?= lang('Presupuestos.created_at') ?></th>
|
||||
<th><?= lang('Presupuestos.tipoPresupuesto') ?></th>
|
||||
<th><?= lang('Clientes.cliente') ?></th>
|
||||
<th><?= lang('Presupuestos.comercial') ?></th>
|
||||
<th><?= lang('Presupuestos.titulo') ?></th>
|
||||
<th><?= lang('Paises.pais') ?></th>
|
||||
<th><?= lang('Presupuestos.incRei') ?></th>
|
||||
<th class='noFilter'><?= lang('Presupuestos.paginas') ?></th>
|
||||
<th class='noFilter'><?= lang('Presupuestos.tirada') ?></th>
|
||||
<th class='noFilter'><?= lang('Presupuestos.totalPresupuesto') ?></th>
|
||||
<th><?= lang('Presupuestos.presupuestoEstado') ?></th>
|
||||
<th class="noFilter text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
// Setup - add a text input to each footer cell
|
||||
$('#tableOfPresupuestos thead tr').clone(true).appendTo('#tableOfPresupuestos thead');
|
||||
$('#tableOfPresupuestos thead tr:eq(1) th').each(function (i) {
|
||||
if (!$(this).hasClass("noFilter")) {
|
||||
var title = $(this).text();
|
||||
if(i==1){
|
||||
|
||||
$(this).html('<input id="bs-rangepicker-range" type="text" class="form-control " style="min-width:100px;max-width:120px;font-size:0.8rem !important;" />');
|
||||
var bsRangePickerRange = $('#bs-rangepicker-range')
|
||||
bsRangePickerRange.daterangepicker({
|
||||
ranges: {
|
||||
'<?= lang('datePicker.hoy') ?>': [moment(), moment()],
|
||||
'<?= lang('datePicker.ayer') ?>': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'<?= lang('datePicker.ultimos7') ?>': [moment().subtract(6, 'days'), moment()],
|
||||
'<?= lang('datePicker.ultimos30') ?>': [moment().subtract(29, 'days'), moment()],
|
||||
'<?= lang('datePicker.esteMes') ?>': [moment().startOf('month'), moment().endOf('month')],
|
||||
'<?= lang('datePicker.ultimoMes') ?>': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
},
|
||||
opens: 'right',
|
||||
language: '<?= config('Basics')->i18n ?>',
|
||||
"locale": {
|
||||
"customRangeLabel": "<?= lang('datePicker.personalizar') ?>",
|
||||
"format": "YYYY-MM-DD",
|
||||
"separator": " ",
|
||||
"applyLabel": "<?= lang('datePicker.aplicar') ?>",
|
||||
"cancelLabel": "<?= lang('datePicker.limpiar') ?>",
|
||||
|
||||
},
|
||||
"alwaysShowCalendars": true,
|
||||
autoUpdateInput: false,
|
||||
|
||||
});
|
||||
|
||||
bsRangePickerRange.on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' ' + picker.endDate.format('YYYY-MM-DD'));
|
||||
theTable
|
||||
.column(i)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
});
|
||||
|
||||
bsRangePickerRange.on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
theTable
|
||||
.column(i)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
});
|
||||
|
||||
}
|
||||
else if (i == 2) {
|
||||
// Agregar un selector en la tercera columna
|
||||
$(this).html('<select class="form-control" style="min-width:100px;max-width:120px;font-size:0.8rem !important;"></select>');
|
||||
|
||||
// Agregar opciones al selector
|
||||
var selector = $('select', this);
|
||||
selector.append('<option value="">Todos</option>'); // Opción vacía
|
||||
selector.append('<option value="libroCosidoTapaBlanda"><?= lang('Presupuestos.libroCosidoTapaBlanda') ?></option>');
|
||||
selector.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>');
|
||||
selector.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>');
|
||||
selector.append('<option value="libroFresadoTapaDura"><?= lang('Presupuestos.libroFresadoTapaDura') ?></option>');
|
||||
selector.append('<option value="libroEspiralTapaDura"><?= lang('Presupuestos.libroEspiralTapaDura') ?></option>');
|
||||
selector.append('<option value="libroEspiralTapaBlanda"><?= lang('Presupuestos.libroEspiralTapaBlanda') ?></option>');
|
||||
selector.append('<option value="libroWireoTapaDura"><?= lang('Presupuestos.libroWireoTapaDura') ?></option>');
|
||||
selector.append('<option value="libroWireoTapaBlanda"><?= lang('Presupuestos.libroWireoTapaBlanda') ?></option>');
|
||||
selector.append('<option value="libroGrapado"><?= lang('Presupuestos.libroGrapado') ?></option>');
|
||||
|
||||
selector.on('change', function () {
|
||||
var val = $.fn.dataTable.util.escapeRegex(
|
||||
$(this).val()
|
||||
);
|
||||
theTable.column(i).search(val).draw();
|
||||
});
|
||||
}
|
||||
else{
|
||||
$(this).html('<input type="text" class="form-control " style="min-width:100px;max-width:120px;font-size:0.8rem !important;" />');
|
||||
|
||||
$('input', this).on('change clear', function () {
|
||||
if (theTable.column(i).search() !== this.value) {
|
||||
theTable
|
||||
.column(i)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(this).html('<span></span>');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
theTable = $('#tableOfPresupuestos').DataTable({
|
||||
orderCellsTop: true,
|
||||
fixedHeader: true,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 50,
|
||||
lengthChange: true,
|
||||
"dom": '<"mb-3"l>Brtip',
|
||||
"buttons": [
|
||||
'colvis', 'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: false,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfBuscador') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'fecha' },
|
||||
{ 'data': 'codigo',
|
||||
render: function(data, type, row, meta) {
|
||||
switch(data){
|
||||
case "libroCosidoTapaBlanda":
|
||||
return '<?= lang('Presupuestos.libroCosidoTapaBlanda') ?>';
|
||||
break;
|
||||
|
||||
case "libroCosidoTapaDura":
|
||||
return '<?= lang('Presupuestos.libroCosidoTapaDura') ?>';
|
||||
break;
|
||||
|
||||
case "libroFresadoTapaBlanda":
|
||||
return '<?= lang('Presupuestos.libroFresadoTapaBlanda') ?>';
|
||||
break;
|
||||
|
||||
case "libroFresadoTapaDura":
|
||||
return '<?= lang('Presupuestos.libroFresadoTapaDura') ?>';
|
||||
break;
|
||||
|
||||
|
||||
case "libroEspiralTapaDura":
|
||||
return '<?= lang('Presupuestos.libroEspiralTapaDura') ?>';
|
||||
break;
|
||||
|
||||
case "libroEspiralTapaBlanda":
|
||||
return '<?= lang('Presupuestos.libroEspiralTapaBlanda') ?>';
|
||||
break;
|
||||
|
||||
case "libroWireoTapaDura":
|
||||
return '<?= lang('Presupuestos.libroWireoTapaDura') ?>';
|
||||
break;
|
||||
|
||||
case "libroWireoTapaBlanda":
|
||||
return '<?= lang('Presupuestos.libroWireoTapaBlanda') ?>';
|
||||
break;
|
||||
|
||||
case "libroGrapado":
|
||||
return '<?= lang('Presupuestos.libroGrapado') ?>';
|
||||
break;
|
||||
|
||||
default:
|
||||
return data; // Debug
|
||||
break;
|
||||
|
||||
}
|
||||
},
|
||||
},
|
||||
{ 'data': 'cliente' },
|
||||
{ 'data': 'comercial' },
|
||||
{ 'data': 'titulo' },
|
||||
{ 'data': 'pais' },
|
||||
{ 'data': 'inc_rei' },
|
||||
{ 'data': 'paginas' },
|
||||
{ 'data': 'tirada' },
|
||||
{ 'data': 'total_presupuesto' },
|
||||
{ 'data': 'estado' ,
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='borrador')
|
||||
return '<?= lang('Presupuestos.presupuestoEstadoBorrador') ?>';
|
||||
else if(data=='aceptado')
|
||||
return '<?= lang('Presupuestos.presupuestoEstadoAceptado') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
const dateCols = [1];
|
||||
const priceCols = [9];
|
||||
|
||||
for (let coln of dateCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
const datestr = cell.innerHTML;
|
||||
const dateStrLen = datestr.toString().trim().length;
|
||||
if (dateStrLen > 0) {
|
||||
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
|
||||
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
|
||||
const d = new Date(...dateTimeParts); // new Date(datestr);
|
||||
cell.innerHTML = d.toLocaleDateString();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (let coln of priceCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/presupuestos/cosidotapablanda/edit/${$(this).attr('data-id')}/`;
|
||||
});
|
||||
|
||||
|
||||
$(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: `/presupuestos/cosidotapablanda/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/fixedheader/fixedHeader.dataTables.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.css') ?>" />
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.colVis.min.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/moment/moment.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.js') ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
<div class="col-12 pb-2">
|
||||
|
||||
<input hidden readonly style="background: #E8E8E8;" id="id" name="id" maxLength="12" class="form-control" value="<?= old('id', $presupuestoEntity->id) ?>">
|
||||
|
||||
<div class="row g-2">
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="titulo" class="form-label">
|
||||
<?=lang('Presupuestos.titulo') ?>*
|
||||
</label>
|
||||
<input type="text" id="titulo" name="titulo" maxLength="300" class="form-control" value="<?=old('titulo', $presupuestoEntity->titulo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="autor" class="form-label">
|
||||
<?=lang('Presupuestos.autor') ?>
|
||||
</label>
|
||||
<input type="text" id="autor" name="autor" maxLength="150" class="form-control" value="<?=old('autor', $presupuestoEntity->autor) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="coleccion" class="form-label">
|
||||
<?=lang('Presupuestos.coleccion') ?>
|
||||
</label>
|
||||
<input type="text" id="coleccion" name="coleccion" maxLength="255" class="form-control" value="<?=old('coleccion', $presupuestoEntity->coleccion) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="numeroEdicion" class="form-label">
|
||||
<?=lang('Presupuestos.numeroEdicion') ?>
|
||||
</label>
|
||||
<input type="text" id="numeroEdicion" name="numero_edicion" maxLength="50" class="form-control" value="<?=old('numero_edicion', $presupuestoEntity->numero_edicion) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="numeroEdicion" class="form-label">
|
||||
<?=lang('Presupuestos.numeroEdicion') ?>
|
||||
</label>
|
||||
<input type="text" id="numeroEdicion" name="numero_edicion" maxLength="50" class="form-control" value="<?=old('numero_edicion', $presupuestoEntity->numero_edicion) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="isbn" class="form-label">
|
||||
<?=lang('Presupuestos.isbn') ?>
|
||||
</label>
|
||||
<input type="text" id="isbn" name="isbn" maxLength="50" class="form-control" value="<?=old('isbn', $presupuestoEntity->isbn) ?>">
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('Presupuestos.paisId') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" class="form-control select2bs" style="width: 100%;" >
|
||||
<?php foreach ($datosPresupuesto->paisList as $item) : ?>
|
||||
<option value="<?=$item->id ?>"<?=$item->id==$presupuestoEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<hr> <!-- Separador -->
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="clienteId" class="form-label">
|
||||
<?= lang('Presupuestos.clienteId') ?>*
|
||||
</label>
|
||||
<select id="clienteId" name="clienteId" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($datosPresupuesto->clienteList) && is_array($datosPresupuesto->clienteList) && !empty($datosPresupuesto->clienteList)) :
|
||||
foreach ($datosPresupuesto->clienteList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->cliente_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="referenciaCliente" class="form-label">
|
||||
<?=lang('Presupuestos.referenciaCliente') ?>
|
||||
</label>
|
||||
<input type="text" id="referenciaCliente" name="referencia_cliente" maxLength="100" class="form-control" value="<?=old('referencia_cliente', $presupuestoEntity->referencia_cliente) ?>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
<div class="col-12 pb-2">
|
||||
|
||||
<div id="containerTiradasEnvios" class="row mb-3">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row mb-3">
|
||||
|
||||
<div class="col-sm-4 mb-3">
|
||||
<label for="direcciones" class="form-label">Mis direcciones</label>
|
||||
<select id="direcciones" name="direcciones" class="form-control select2bs2" style="width: 100%;"></select>
|
||||
</div>
|
||||
<div class="col-sm-2 mb-3">
|
||||
<label for="unidadesEnvio" class="form-label">
|
||||
Unidades
|
||||
</label>
|
||||
<input type="number" class="form-control" id="unidadesEnvio" name="unidadesEnvio" maxLength="8" step="1" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="col-sm-2 mb-3 mt-auto mb-0">
|
||||
<button id="insertarDireccion" type="button" class="btn btn-secondary waves-effect waves-light">Insertar</button>
|
||||
</div>
|
||||
<div id="errorDirecciones" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="divDirecciones" class="col-12 pb-2">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.routes_direcciones = {
|
||||
direcciones: "<?= route_to('getDirecciones') ?>",
|
||||
getDatos: "<?= route_to('getDatosDireccion') ?>",
|
||||
nuevaDireccion: "<?= route_to('nuevaDireccion') ?>",
|
||||
}
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,579 @@
|
||||
<div class="col-12 pb-2">
|
||||
|
||||
<input hidden readonly style="background: #E8E8E8;" id="id" name="id" maxLength="12" class="form-control" value="<?= old('id', $presupuestoEntity->id) ?>">
|
||||
|
||||
<div class="row g-2">
|
||||
|
||||
<h3 id="tituloDisenioLibro">Fresado</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mb-3">
|
||||
<label for="titulo" class="form-label">
|
||||
<?= lang('Presupuestos.titulo') ?>*
|
||||
</label>
|
||||
<input type="text" id="titulo" name="titulo" maxLength="300" class="form-control" value="<?= old('titulo', $presupuestoEntity->titulo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="clienteId" class="form-label">
|
||||
<?= lang('Presupuestos.clienteId') ?>*
|
||||
</label>
|
||||
<select id="clienteId" name="clienteId" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($datosPresupuesto->clienteList) && is_array($datosPresupuesto->clienteList) && !empty($datosPresupuesto->clienteList)) :
|
||||
foreach ($datosPresupuesto->clienteList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->cliente_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-sm-6 mb-3">
|
||||
<label for="referenciaCliente" class="form-label">
|
||||
<?= lang('Presupuestos.referenciaCliente') ?>
|
||||
</label>
|
||||
<input type="text" id="referenciaCliente" name="referencia_cliente" maxLength="100" class="form-control" value="<?= old('referencia_cliente', $presupuestoEntity->referencia_cliente) ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tapaDiv" class="row mt-3">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2" id="tapaBlandaDiv">
|
||||
<div id="tapaBlandaInnerDiv" class="form-check custom-option custom-option-tapa custom-option-basic checked">
|
||||
<label class="form-check-label custom-option-content" for="tapaBlanda">
|
||||
<input name="tapaBlanda" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="" id="tapaBlanda" checked="">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Tapa blanda</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tapaDuraDiv" class="col-sm-3 mb-md-0 mb-2">
|
||||
<div class="form-check custom-option custom-option-tapa custom-option-basic">
|
||||
<label class="form-check-label custom-option-content" for="tapaDura">
|
||||
<input name="tapaDura" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="" id="tapaDura">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Tapa Dura</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Datos presupuesto</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div id="errorTiradas" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No puede mezclar tiradas mayores de 30 unidades con tiradas menores de 30 unidades</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 1
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada" name="tirada" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada2" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 2
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada2" name="tirada2" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada2) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada3" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 3
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada3" name="tirada3" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada3) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="tirada4" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?> 4
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="tirada4" name="tirada4" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->tirada4) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="paginas" class="form-label">
|
||||
<?= lang('Presupuestos.paginas') ?>
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="paginas" name="paginas" maxLength="8" step="1" class="form-control" value="<?= old(0, $presupuestoEntity->paginas) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div id="tamanioLibroDiv" class="col-sm-3 mb-3" <?= $presupuestoEntity->papel_formato_personalizado == false ? '' : 'style="display: none"'; ?>>
|
||||
<label id="label_papelFormatoId" for="papelFormatoId" class="form-label">
|
||||
Tamaño Libro*
|
||||
</label>
|
||||
|
||||
<select id="papelFormatoId" name="papel_formato_id" tabindex="3" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
|
||||
<?php if (isset($datosPresupuesto->papelFormatoList) && is_array($datosPresupuesto->papelFormatoList) && !empty($datosPresupuesto->papelFormatoList)) :
|
||||
foreach ($datosPresupuesto->papelFormatoList as $formato) : ?>
|
||||
<option value="<?= $formato->id ?>" <?= $formato->id == $presupuestoEntity->papel_formato_id ? ' selected' : '' ?>>
|
||||
<?= $formato->tamanio ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="anchoLibroDiv" class="col-sm-3 mb-3" <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?>>
|
||||
<div class="mb-1">
|
||||
<label class="form-label" for="papelFormatoAncho">Ancho Libro</label>
|
||||
<input type="number" id="papelFormatoAncho" name="papel_formato_ancho" maxLength="8" step="1" class="form-control formato_libro calcular-presupuesto" value="<?= old('papel_formato_ancho', $presupuestoEntity->papel_formato_ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div id="altoLibroDiv" class="col-sm-3 mb-3" <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?>>
|
||||
<div class="mb-1">
|
||||
<label class="form-label" for="papelFormatoAlto">Alto Libro</label>
|
||||
<input type="number" id="papelFormatoAlto" name="papel_formato_alto" maxLength="8" step="1" class="form-control formato_libro calcular-presupuesto" value="<?= old('papel_formato_alto', $presupuestoEntity->papel_formato_alto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-sm-3 mb-3 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="papelFormatoPersonalizado" name="papel_formato_personalizado" value="1" <?= $presupuestoEntity->papel_formato_personalizado == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="papelFormatoPersonalizado"><?= lang('Presupuestos.papelFormatoPersonalizado') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Interior</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorInterior" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<h6> Color del interior </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col col-sm-2 d-flex justify-content-center">
|
||||
<div id="colorNegroDiv" class="form-check change-tipo-impresion custom-option-color custom-option custom-option-image custom-option-image-radio">
|
||||
<label class="form-check-label custom-option-content" for="colorNegro">
|
||||
<span class="custom-option-body">
|
||||
<img style="height:120px;width:120px" src="<?= site_url("assets/img/grises.png") ?>" alt="">
|
||||
</span>
|
||||
</label>
|
||||
<input name="colorNegro" class="form-check-input calcular-presupuesto" type="radio" value="colorNegro" id="colorNegro" checked="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col col-sm-2 d-flex justify-content-center">
|
||||
<div id="colorColorDiv" class="form-check change-tipo-impresion custom-option-color custom-option custom-option-image custom-option-image-radio">
|
||||
<label class="form-check-label custom-option-content" for="colorColor">
|
||||
<span class="custom-option-body">
|
||||
<img style="height:120px;width:120px" src="<?= site_url("assets/img//gamacolor.png") ?>" alt="">
|
||||
</span>
|
||||
</label>
|
||||
<input name="colorColor" class="form-check-input calcular-presupuesto" type="radio" value="colorColor" id="colorColor">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<div id="pagColorDiv" class="row">
|
||||
<div class="col-sm-3 mb-3">
|
||||
<label for="paginasColor" class="form-label">
|
||||
Páginas a color
|
||||
</label>
|
||||
<input type="number" class="calcular-presupuesto" id="paginasColor" name="paginasColor" maxLength="8" step="1" class="form-control" value="">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<h6> Calidad </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2">
|
||||
<div id="calidadEstandarDiv" class="form-check change-tipo-impresion custom-option custom-option-calidad custom-option-basic checked">
|
||||
<label class="form-check-label custom-option-content" for="calidadEstandar">
|
||||
<input name="calidadEstandar" class="form-check-input calcular-presupuesto" type="radio" value="" id="calidadEstandar" checked="">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Estándar</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div id="calidadPremiumDiv" class="form-check change-tipo-impresion custom-option custom-option-calidad custom-option-basic">
|
||||
<label class="form-check-label custom-option-content" for="calidadPremium">
|
||||
<input name="calidadPremium" class="form-check-input calcular-presupuesto" type="radio" value="" id="calidadPremium">
|
||||
<span class="custom-option-header">
|
||||
<span class="h6 mb-0">Premium</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
<h6> Papel </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelInterior" class="form-label">Tipo de papel</label>
|
||||
<select id="papelInterior" name="papelInterior" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;"></select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="gramajeInterior" class="form-label">Gramaje (g/m2)</label>
|
||||
<select id="gramajeInterior" name="gramajeInterior" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h6> Opciones extra </h6>
|
||||
<div class="row">
|
||||
<div class="col-sm-3 mb-3 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input calcular-presupuesto" type="checkbox" id="excluirRotativa" name="excluir_rotativa" value="0" <?= $presupuestoEntity->excluir_rotativa == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="excluirRotativa">Excluir rotativa</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--SECCION DE CUBIERTA -->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Cubierta</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorCubierta" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<h6> Papel </h6>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelCubierta" class="form-label">Tipo de papel</label>
|
||||
<select id="papelCubierta" name="papelCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->papelCubierta) && is_array($datosPresupuesto->papelCubierta) && !empty($datosPresupuesto->papelCubierta)) :
|
||||
foreach ($datosPresupuesto->papelCubierta as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="gramajeCubierta" class="form-label">Gramaje (g/m2)</label>
|
||||
<select id="gramajeCubierta" name="gramajeCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="carasCubierta" class="form-label">Caras impresas cubierta</label>
|
||||
<select id="carasCubierta" name="carasCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<option value="2">
|
||||
<p><?= lang('Presupuestos.unaCara') ?></p>
|
||||
</option>
|
||||
<option value="4">
|
||||
<p><?= lang('Presupuestos.dosCaras') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h6 class='solapas-cubierta'> Opciones extra </h6>
|
||||
|
||||
<div class="row solapas-cubierta">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input calcular-presupuesto" type="checkbox" id="solapasCubierta" name="solapasCubierta" value="0">
|
||||
<label class="form-check-label" for="solapasCubierta">Solapas cubierta</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tamanioSolapasCubierta" class="col-sm-3 mb-md-0 mb-2" style="display: none;">
|
||||
<label for="anchoSolapasCubierta" class="form-label">Tamaño</label>
|
||||
<input type="number" id="anchoSolapasCubierta" name="anchoSolapasCubierta" maxLength="8" step="1" class="form-control calcular-presupuesto" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="acabadosCubierta" class="form-label">Acabados cubierta</label>
|
||||
<select id="acabadosCubierta" name="acabadosCubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->acabadosCubierta) && is_array($datosPresupuesto->acabadosCubierta) && !empty($datosPresupuesto->acabadosCubierta)) :
|
||||
foreach ($datosPresupuesto->acabadosCubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_cubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--SECCION DE SOBRECUBIERTA -->
|
||||
<div class="divider divider-dark text-start mb-1 sobrecubierta">
|
||||
<div class="divider-text">
|
||||
<h5>Sobrecubierta</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorSobrecubierta" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<div class="row sobrecubierta">
|
||||
<div class="col-sm-3 mb-md-0 mb-2 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="enableSobrecubierta" name="enableSobrecubierta" value="0">
|
||||
<label class="form-check-label" for="enableSobrecubierta">Añadir sobrecubierta</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 class="sobrecubierta enable-sobrecubierta" style="display: none;"> Papel </h6>
|
||||
<div class="row sobrecubierta enable-sobrecubierta">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelSobrecubierta" class="form-label">Tipo de papel</label>
|
||||
<select id="papelSobrecubierta" name="papelSobrecubierta" class="form-control select2bs2 calcular-presupuesto input-sobrecubierta" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->papelSobrecubierta) && is_array($datosPresupuesto->papelSobrecubierta) && !empty($datosPresupuesto->papelSobrecubierta)) :
|
||||
foreach ($datosPresupuesto->papelSobrecubierta as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="gramajeSobrecubierta" class="form-label">Gramaje (g/m2)</label>
|
||||
<select id="gramajeSobrecubierta" name="gramajeSobrecubierta" class="form-control select2bs2 calcular-presupuesto input-sobrecubierta" style="width: 100%;">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<h6 class="sobrecubierta enable-sobrecubierta" style="display: none;"> Opciones extra </h6>
|
||||
|
||||
<div class="row sobrecubierta enable-sobrecubierta" style="display: none;">
|
||||
|
||||
<div class="col-sm-3 mb-md-0 mb-2 d-flex align-items-end">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input calcular-presupuesto input-sobrecubierta" type="checkbox" id="solapasSobrecubierta" name="solapasSobrecubierta" value="0">
|
||||
<label class="form-check-label" for="solapasSobrecubierta">Solapas sobrecubierta</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tamanioSolapasSobrecubierta" class="col-sm-3 mb-md-0 mb-2" style="display: none;">
|
||||
<label for="anchoSolapasSobrecubierta" class="form-label">Tamaño</label>
|
||||
<input type="number" id="anchoSolapasSobrecubierta" name="anchoSolapasSobrecubierta" maxLength="8" step="1" class="form-control input-sobrecubierta calcular-presupuesto" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row sobrecubierta enable-sobrecubierta" style="display: none;">
|
||||
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="acabadosSobrecubierta" class="form-label">Acabados sobrecubierta</label>
|
||||
<select id="acabadosSobrecubierta" name="acabadosSobrecubierta" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->acabadosSobrecubierta) && is_array($datosPresupuesto->acabadosSobrecubierta) && !empty($datosPresupuesto->acabadosSobrecubierta)) :
|
||||
foreach ($datosPresupuesto->acabadosSobrecubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_sobrecubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--SECCION DE GUARDAS -->
|
||||
<div class="divider divider-dark text-start mb-1 guardas">
|
||||
<div class="divider-text">
|
||||
<h5>Guardas</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorGuardas" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<div>No existe combinación con las opciones seleccionadas. Pruebe con otro papel/gramaje</div>
|
||||
</div>
|
||||
|
||||
<div class="row guardas">
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="impresionGuardas" class="form-label">Impresión de guardas</label>
|
||||
<select id="impresionGuardas" name="impresionGuardas" class="form-control select2bs2 comp_guardas_items calcular-presupuesto" style="width: 100%;">
|
||||
<option value="0">
|
||||
<p><?= lang('Presupuestos.sinImpresion') ?></p>
|
||||
</option>
|
||||
<option value="4">
|
||||
<p><?= lang('Presupuestos.unaCara') ?></p>
|
||||
</option>
|
||||
<option value="8">
|
||||
<p><?= lang('Presupuestos.dosCaras') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row guardas">
|
||||
<div class="col-sm-4 mb-md-0 mb-2">
|
||||
<label for="papelGuardas" class="form-label">Tipo de papel</label>
|
||||
<select id="papelGuardas" name="papelGuardas" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<?php if (isset($datosPresupuesto->papelGuardas) && is_array($datosPresupuesto->papelGuardas) && !empty($datosPresupuesto->papelGuardas)) :
|
||||
foreach ($datosPresupuesto->papelGuardas as $k => $v) : ?>
|
||||
<option value="<?= $v->id ?>">
|
||||
<?= $v->nombre ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--SECCION DE SERVICIOS EXTRA -->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Servicios Extra</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="retractilado" class="form-check-label">
|
||||
<input type="checkbox" id="retractilado" name="retractilado" serv_id="3" value="1" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->retractilado == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.retractilado') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="retractilado5" class="form-check-label">
|
||||
<input type="checkbox" id="retractilado5" name="retractilado_5" serv_id="5" value="1" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->retractilado5 == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.retractilado5') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="fajaColor" class="form-check-label">
|
||||
<input type="checkbox" id="fajaColor" name="faja_color" value="1" serv_id="16" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->faja_color == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.fajaColor') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="prototipo" class="form-check-label">
|
||||
<input type="checkbox" id="prototipo" name="prototipo" value="1" serv_id="9" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->prototipo == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.prototipo') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="ferro" class="form-check-label">
|
||||
<input type="checkbox" id="ferro" name="ferro" value="1" serv_id="24" class="form-check-input servicio-extra calcular-presupuesto" <?= $presupuestoEntity->ferro == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.ferro') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<!--SECCION DE OTRAS OPCIONES -->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5>Otras opciones</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2 mb-md-0 mb-2">
|
||||
<label for="ivaReducido" class="form-label">I.V.A. reducido</label>
|
||||
<select id="ivaReducido" name="ivaReducido" class="form-control select2bs2 calcular-presupuesto" style="width: 100%;">
|
||||
<option value="1">
|
||||
<p><?= lang('SI') ?></p>
|
||||
</option>
|
||||
<option value="0">
|
||||
<p><?= lang('NO') ?></p>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<p class="mt-2">Se verificará que el pedido cumpla con los requisitos establecidos en el Artículo 91 de la Ley 37/1992, sobre inserción de publicidad, antes de proceder con su producción, lo que garantiza la aplicación del IVA reducido del 4%.</p>
|
||||
</div>
|
||||
|
||||
</div><!--//.col -->
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.routes_disenio_libro = {
|
||||
obtenerGramaje: "<?= route_to('obtenerGramaje') ?>",
|
||||
presupuestoCliente: "<?= route_to('presupuestoCliente') ?>",
|
||||
}
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,100 @@
|
||||
<div class="col-12 pb-2">
|
||||
<div class="tipo_libro">
|
||||
<div class="row row-cols-3 mb-6 d-flex justify-content-center d-flex justify-content-center">
|
||||
|
||||
<div class="container col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="cosidoDiv"
|
||||
class="form-check checked custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoCosido">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_cosido.png") ?>" alt="radioImg">
|
||||
</span>
|
||||
</label>
|
||||
<input name="cosido" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoCosido"
|
||||
id="tipoCosido" checked="">
|
||||
</div>
|
||||
<h4 class="text-center">Rústica cosido</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="fresadoDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoFresado">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_fresado.png") ?>" alt="radioImg2">
|
||||
</span>
|
||||
</label>
|
||||
<input name="fresado" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoFresado"
|
||||
id="tipoFresado">
|
||||
</div>
|
||||
<h4 class="text-center">Rústica fresado</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="grapadoDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoGrapado">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_grapado.png") ?>" alt="radioImg3">
|
||||
</span>
|
||||
</label>
|
||||
<input name="grapado" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoGrapado"
|
||||
id="tipoGrapado">
|
||||
</div>
|
||||
<h4 class="text-center">Cosido con grapas</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-cols-3 d-flex justify-content-center d-flex justify-content-center"
|
||||
style="margin-bottom: 40px;">
|
||||
<div class="col-md-4 mb-6 d-flex justify-content-center">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="espiralDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoEspiral">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_espiral.png") ?>" alt="radioImg4">
|
||||
</span>
|
||||
</label>
|
||||
<input name="espiral" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoEspiral"
|
||||
id="tipoEspiral">
|
||||
</div>
|
||||
<h4 class="text-center">Espiral</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 mb-6 d-flex justify-content-center" style="margin-bottom: 40px;">
|
||||
<div>
|
||||
<div style="max-width:200px;max-height:200px;padding-right:0px" id="wireoDiv"
|
||||
class="form-check custom-option-tipo custom-option custom-option-image custom-option-image-radio">
|
||||
<label style="max-width:200px;max-height:200px;" class="form-check-label custom-option-content"
|
||||
for="tipoWireO">
|
||||
<span class="custom-option-body">
|
||||
<img style="max-width:200px;max-height:200px;"
|
||||
src="<?= site_url("assets/img/libro_wire-o.png") ?>" alt="radioImg5">
|
||||
</span>
|
||||
</label>
|
||||
<input name="wireo" class="form-check-input elementos-libro calcular-presupuesto" type="radio" value="tipoWireO"
|
||||
id="tipoWireO">
|
||||
</div>
|
||||
<h4 class="text-center">Wire-o</h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,262 @@
|
||||
function initDirecciones() {
|
||||
data = {
|
||||
id: $('#clienteId').val()
|
||||
},
|
||||
data = Object.assign(data, window.token_ajax)
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_direcciones.direcciones,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function(response) {
|
||||
$("#direcciones").empty();
|
||||
$.each(response.menu, function(index, value) {
|
||||
$("#direcciones").append('<option value="' + value.id + '">' + value.text + '</option>');
|
||||
});
|
||||
$("#direcciones").val('');
|
||||
},
|
||||
error: function() {
|
||||
$("#direcciones").empty();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function initTiradasDirecciones() {
|
||||
const _this = this
|
||||
|
||||
$('#containerTiradasEnvios').empty();
|
||||
|
||||
for (i = 1; i <= 4; i++) {
|
||||
let id = "tiradaPrecio" + i;
|
||||
if ($('#' + id).length > 0) {
|
||||
|
||||
let tirada_id = "ud_tiradaPrecio" + i;
|
||||
let total_id = "tot_tiradaPrecio" + i;
|
||||
let precio_u_id = "pu_tiradaPrecio" + i;
|
||||
|
||||
let html = '';
|
||||
html += '<div class="col-sm-3">';
|
||||
html += '<div class="form-check custom-option custom-option-basic custom-option-tiradasDirecciones' + (i==1?' checked':'')+ ' ">';
|
||||
html += '<label class="form-check-label custom-option-content" for="tiradaEnvios' + i + '">';
|
||||
html += '<input name="' + id + '" class="form-check-input" type="radio" value="" id="' + id + '">';
|
||||
html += '<span class="custom-option-header">';
|
||||
html += '<span id="tiradaDireccionesValue' + i + '" class="h6 mb-0">' + $('#' + tirada_id).text().split(' ')[0] + '</span>';
|
||||
html += '<span class="text-muted">' + $('#' + total_id).text() + '</span>';
|
||||
html += '</span>';
|
||||
html += '<span class="custom-option-body">';
|
||||
html += '<small>' + $('#' + precio_u_id).text() + '</small>';
|
||||
html += '</span>';
|
||||
html += '</label>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
$('#containerTiradasEnvios').append(html);
|
||||
|
||||
$('#' + id).hide();
|
||||
}
|
||||
}
|
||||
|
||||
const tiradasDireccionesList = [].slice.call(document.querySelectorAll('.custom-option-tiradasDirecciones .form-check-input'))
|
||||
tiradasDireccionesList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateTiradasDireccionesCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateTiradasDireccionesCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateTiradasDireccionesCheck(el) {
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.row').querySelectorAll('.custom-option-tiradasDirecciones'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-tiradasDirecciones').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-tiradasDirecciones').classList.add('checked')
|
||||
|
||||
} else {
|
||||
el.closest('.custom-option-tiradasDirecciones').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('#insertarDireccion').on('click', function() {
|
||||
|
||||
if( $('#direcciones').val() > 0 ) {
|
||||
|
||||
let unidades = $('#unidadesEnvio').val();
|
||||
if(unidades == '' || isNaN(unidades) || parseInt(unidades) <= 0){
|
||||
return false;
|
||||
}
|
||||
unidades = parseInt(unidades);
|
||||
|
||||
const seleccion = $('.custom-option-tiradasDirecciones.checked');
|
||||
if(seleccion.length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const element_tirada =($(seleccion[0]).find('label input')[0]);
|
||||
const number = element_tirada.id.match(/\d+$/);
|
||||
if (number.length == 0) {
|
||||
return false;
|
||||
}
|
||||
let tirada = parseInt($('#tiradaDireccionesValue' + number[0]).text());
|
||||
|
||||
const elements = $('#divDirecciones').find('.row.mb-3');
|
||||
|
||||
let total = 0;
|
||||
if(elements.length > 0) {
|
||||
for (let index=0; index<elements.length; index++){
|
||||
let unidades_direcciones = parseInt($(elements[index]).find('div label span span').text().split(' ')[0]);
|
||||
total += unidades_direcciones;
|
||||
};
|
||||
}
|
||||
|
||||
if($('#prototipo').is(':checked')) {
|
||||
tirada += 1;
|
||||
}
|
||||
|
||||
if(total + unidades <= tirada) {
|
||||
|
||||
data = {
|
||||
id: $('#direcciones').val()
|
||||
},
|
||||
data = Object.assign(data, window.token_ajax)
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_direcciones.getDatos,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function(response) {
|
||||
if(response.data.length > 0) {
|
||||
let html = '';
|
||||
html += '<div id="envioId' + response.data[0].id + '" class="row mb-3">';
|
||||
html += '<div class="col-sm-5 form-check custom-option custom-option-basic checked">';
|
||||
html += '<label class="form-check-label custom-option-content" for="customRadioAddress1">';
|
||||
html += '<span class="custom-option-header mb-2">';
|
||||
html += '<h6 class="fw-semibold mb-0">' + response.data[0].att + '</h6>';
|
||||
html += '<span class="badge bg-label-primary">' + unidades + ' unidades</span>';
|
||||
html += '</span>';
|
||||
html += '<span class="custom-option-body">';
|
||||
html += '<small>' + response.data[0].direccion + '</small><br>';
|
||||
html += '<small>' + response.data[0].cp + '</small><br>';
|
||||
html += '<small>' + response.data[0].municipio +', ' + response.data[0].pais + '</small><br>';
|
||||
html += '<small>' + response.data[0].telefono + '</small><br>';
|
||||
html += '<small>' + response.data[0].email + '</small><br>';
|
||||
html += '<hr class="my-2">';
|
||||
html += '<span class="d-flex">';
|
||||
html += '<a class="eliminar-direccion" href="javascript:void(0)">Eliminar</a>';
|
||||
html += '</span>';
|
||||
html += '</span>';
|
||||
html += '</label>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
$('#divDirecciones').append(html);
|
||||
$('#errorDirecciones').hide();
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$("#direcciones").empty();
|
||||
},
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('#errorDirecciones').text('El número de unidades supera la tirada seleccionada.');
|
||||
$('#errorDirecciones').show();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
})
|
||||
|
||||
|
||||
|
||||
$(document).on('click', '.eliminar-direccion', function(e) {
|
||||
|
||||
$(this).closest('.row.mb-3').remove();
|
||||
|
||||
const seleccion = $('.custom-option-tiradasDirecciones.checked');
|
||||
if(seleccion.length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const element_tirada =($(seleccion[0]).find('label input')[0]);
|
||||
const number = element_tirada.id.match(/\d+$/);
|
||||
if (number.length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let tirada = parseInt($('#tiradaDireccionesValue' + number[0]).text());
|
||||
|
||||
const elements = $('#divDirecciones').find('.row.mb-3');
|
||||
|
||||
let total = 0;
|
||||
if(elements.length > 0) {
|
||||
for (let index=0; index<elements.length; index++){
|
||||
let unidades_direcciones = parseInt($(elements[index]).find('div label span span').text().split(' ')[0]);
|
||||
total += unidades_direcciones;
|
||||
};
|
||||
}
|
||||
|
||||
if(total <= tirada) {
|
||||
$('#errorDirecciones').hide();
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$('#direcciones').on('change', function() {
|
||||
if( $('#direcciones').val() == 0 ) {
|
||||
$("#addressForm").attr('action','create')
|
||||
|
||||
var $newAddDialog = $("#addressForm")
|
||||
$newAddDialog.modal('show')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function saveAdd_callback(){
|
||||
if($('#addressForm').attr('action')=='create'){
|
||||
let data = {
|
||||
cliente_id: $('#clienteId').val(),
|
||||
alias: $('#add_alias').val(),
|
||||
att: $('#add_att').val(),
|
||||
email: $('#add_email').val(),
|
||||
direccion: $('#add_direccion').val(),
|
||||
pais_id: $("#add_pais_id option:selected").val(),
|
||||
municipio: $('#add_municipio').val(),
|
||||
provincia: $('#add_provincia').val(),
|
||||
cp: $('#add_cp').val(),
|
||||
telefono: $('#add_telefono').val(),
|
||||
}
|
||||
console.log(data);
|
||||
data = Object.assign(data, window.token_ajax)
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_direcciones.nuevaDireccion,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function(response) {
|
||||
$("#direcciones").empty();
|
||||
$.each(response.data, function(index, value) {
|
||||
$("#direcciones").append('<option value="' + value.id + '">' + value.text + '</option>');
|
||||
});
|
||||
$("#direcciones").val('');
|
||||
$('#addressForm').modal('hide');
|
||||
},
|
||||
error: function() {
|
||||
$('#addressForm').modal('hide');
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,756 @@
|
||||
$('#papelFormatoPersonalizado').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('#tamanioLibroDiv').hide();
|
||||
$('#anchoLibroDiv').show();
|
||||
$('#altoLibroDiv').show();
|
||||
$('#papelFormatoId').val('');
|
||||
} else {
|
||||
$('#tamanioLibroDiv').show();
|
||||
$('#anchoLibroDiv').hide();
|
||||
$('#altoLibroDiv').hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Init custom option check
|
||||
function initTapaCheck() {
|
||||
const _this = this
|
||||
|
||||
const tapaOptionList = [].slice.call(document.querySelectorAll('.custom-option-tapa .form-check-input'))
|
||||
tapaOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateTapaCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateTapaCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateTapaCheck(el) {
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.row').querySelectorAll('.custom-option-tapa'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-tapa').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-tapa').classList.add('checked')
|
||||
if (el.closest('.custom-option-tapa').id == 'tapaBlandaInnerDiv') {
|
||||
$('#tapaBlanda').prop('checked', true);
|
||||
$('#tapaDura').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('#tapaBlanda').prop('checked', false);
|
||||
$('#tapaDura').prop('checked', true);
|
||||
}
|
||||
} else {
|
||||
el.closest('.custom-option-tapa').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function initColorCheck() {
|
||||
const _this = this
|
||||
|
||||
const custopOptionList = [].slice.call(document.querySelectorAll('.custom-option-color .form-check-input'))
|
||||
custopOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateColorCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateColorCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateColorCheck(el) {
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.row').querySelectorAll('.custom-option-color'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-color').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-color').classList.add('checked')
|
||||
if (el.closest('.custom-option-color').id == 'colorNegroDiv') {
|
||||
$('#colorNegro').prop('checked', true);
|
||||
$('#colorColor').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('#colorNegro').prop('checked', false);
|
||||
$('#colorColor').prop('checked', true);
|
||||
}
|
||||
|
||||
} else {
|
||||
el.closest('.custom-option-color').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function initCalidadCheck() {
|
||||
const _this = this
|
||||
|
||||
const calidadOptionList = [].slice.call(document.querySelectorAll('.custom-option-calidad .form-check-input'))
|
||||
calidadOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateCalidadCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateCalidadCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateCalidadCheck(el) {
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.row').querySelectorAll('.custom-option-calidad'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-calidad').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-calidad').classList.add('checked')
|
||||
if (el.closest('.custom-option-calidad').id == 'calidadEstandarDiv') {
|
||||
$('#calidadEstandar').prop('checked', true);
|
||||
$('#calidadPremium').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
$('#calidadEstandar').prop('checked', false);
|
||||
$('#calidadPremium').prop('checked', true);
|
||||
}
|
||||
} else {
|
||||
el.closest('.custom-option-calidad').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
$('#enableSobrecubierta').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('.enable-sobrecubierta').show();
|
||||
} else {
|
||||
$('#gramajeSobrecubierta').val('').trigger('change');
|
||||
$('#paperSobrecubierta').val('').trigger('change');
|
||||
$('#acabadosSobrecubierta').val('').trigger('change');
|
||||
$('#solapasSobrecubierta').prop('checked', false).trigger('change');
|
||||
$('#tamanioSolapasSobrecubierta').val();
|
||||
$('.enable-sobrecubierta').hide();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function initDisenioLibro() {
|
||||
initTapaCheck();
|
||||
initColorCheck();
|
||||
initCalidadCheck();
|
||||
|
||||
$('.elementos-libro').trigger('change');
|
||||
$('.change-tipo-impresion').trigger('change');
|
||||
|
||||
$('#papelInterior').trigger('change');
|
||||
$('#papelCubierta').val('').trigger('change');
|
||||
$('#papelSobrecubierta').val('').trigger('change');
|
||||
|
||||
|
||||
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
|
||||
$('.change-tipo-impresion').on('change', function () {
|
||||
|
||||
isColor = $('#colorNegroDiv').hasClass('checked') ? false : true;
|
||||
isHq = $('#calidadEstandarDiv').hasClass('checked') ? false : true;
|
||||
|
||||
//si es color hay que mostrar el numero de paginas a color
|
||||
if (isColor) {
|
||||
$('#pagColorDiv').show();
|
||||
if($('#paginasColor').val() == '')
|
||||
$('#paginasColor').val('0');
|
||||
}
|
||||
else {
|
||||
$('#pagColorDiv').hide();
|
||||
$('#paginasColor').val('0');
|
||||
}
|
||||
|
||||
var data = [];
|
||||
|
||||
if (!isColor && !isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorNegro;
|
||||
}
|
||||
else if (!isColor && isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorNegroHq;
|
||||
}
|
||||
else if (isColor && !isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorColor;
|
||||
}
|
||||
else if (isColor && isHq) {
|
||||
data = window.datosPresupuesto.papelInteriorColorHq;
|
||||
}
|
||||
|
||||
var dropdown = $("#papelInterior");
|
||||
dropdown.empty();
|
||||
$.each(data, function () {
|
||||
dropdown.append($("<option />").val(this.id).text(this.nombre));
|
||||
});
|
||||
//Se quita la seleccion del dropdown
|
||||
dropdown.val('').trigger('change');
|
||||
$('#gramajeInterior').val('').trigger('change');
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#tirada').on('change', function () {
|
||||
|
||||
const valInterior = $('#gramajeInterior option:selected').val();
|
||||
const valCubierta = $('#gramajeCubierta option:selected').val();
|
||||
const valSobrecubierta = $('#gramajeSobrecubierta option:selected').val();
|
||||
|
||||
|
||||
$('#papelInterior').trigger('change');
|
||||
$('#papelCubierta').trigger('change');
|
||||
$('#papelSobrecubierta').trigger('change');
|
||||
});
|
||||
|
||||
|
||||
$('#papelInterior').on('change', function () {
|
||||
isColor = $('#colorNegroDiv').hasClass('checked') ? false : true;
|
||||
isHq = $('#calidadEstandarDiv').hasClass('checked') ? false : true;
|
||||
|
||||
if ($('#papelInterior option:selected').val() != undefined) {
|
||||
var uso = 'bn';
|
||||
|
||||
if (!isColor && !isHq) {
|
||||
uso = 'bn';
|
||||
}
|
||||
else if (!isColor && isHq) {
|
||||
uso = 'bnhq';
|
||||
}
|
||||
else if (isColor && !isHq) {
|
||||
uso = 'color';
|
||||
}
|
||||
else if (isColor && isHq) {
|
||||
uso = 'colorhq';
|
||||
}
|
||||
datos = {
|
||||
tirada: $('#tirada').val(),
|
||||
merma: 0,
|
||||
uso: uso,
|
||||
papel: $('#papelInterior option:selected').text()
|
||||
};
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
const valInterior = $('#gramajeInterior option:selected').val();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.obtenerGramaje,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
|
||||
$('#gramajeInterior').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeInterior').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
|
||||
if (valInterior != undefined)
|
||||
$('#gramajeInterior option[value=' + valInterior + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeInterior').val('').trigger('change');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#papelCubierta').on('change', function () {
|
||||
isColor = true;
|
||||
isHq = true;
|
||||
|
||||
if ($('#papelCubierta option:selected').val() != undefined) {
|
||||
var uso = 'cubierta';
|
||||
|
||||
datos = {
|
||||
tirada: $('#tirada').val(),
|
||||
merma: 0,
|
||||
uso: uso,
|
||||
papel: $('#papelCubierta option:selected').text().trim()
|
||||
};
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
const valCubierta = $('#gramajeCubierta option:selected').val();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.obtenerGramaje,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
|
||||
$('#gramajeCubierta').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeCubierta').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
|
||||
if (valCubierta != undefined)
|
||||
$('#gramajeCubierta option[value=' + valCubierta + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeCubierta').val('').trigger('change');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#papelSobrecubierta').on('change', function () {
|
||||
isColor = true;
|
||||
isHq = true;
|
||||
|
||||
if ($('#papelSobrecubierta option:selected').val() != undefined) {
|
||||
var uso = 'sobrecubierta';
|
||||
|
||||
datos = {
|
||||
tirada: $('#tirada').val(),
|
||||
merma: 0,
|
||||
uso: uso,
|
||||
papel: $('#papelSobrecubierta option:selected').text().trim()
|
||||
};
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
const valSobrecubierta = $('#gramajeSobrecubierta option:selected').val();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.obtenerGramaje,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
|
||||
$('#gramajeSobrecubierta').empty();
|
||||
$(response.menu).each(function (index, element) {
|
||||
$('#gramajeSobrecubierta').append($("<option />").val(element.id).text(element.text));
|
||||
});
|
||||
|
||||
if (valSobrecubierta != undefined)
|
||||
$('#gramajeSobrecubierta option[value=' + valSobrecubierta + ']').prop('selected', true).trigger('change');
|
||||
else
|
||||
$('#gramajeSobrecubierta').val('').trigger('change');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#solapasCubierta').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('#tamanioSolapasCubierta').show();
|
||||
} else {
|
||||
$('#tamanioSolapasCubierta').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#solapasSobrecubierta').on('change', function () {
|
||||
if ($(this).is(":checked")) {
|
||||
$('#tamanioSolapasSobrecubierta').show();
|
||||
} else {
|
||||
$('#tamanioSolapasSobrecubierta').hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Funcion que comprueba que están rellenos todos los datos necesarios para calcular el presupuesto
|
||||
function checkValues() {
|
||||
|
||||
const tirada = $('#tirada').val();
|
||||
const paginas = $('#paginas').val();
|
||||
const papelInterior = $('#papelInterior option:selected').val();
|
||||
const gramajeInterior = $('#gramajeInterior option:selected').text();
|
||||
const papelCubierta = $('#papelCubierta option:selected').val();
|
||||
const gramajeCubierta = $('#gramajeCubierta option:selected').text();
|
||||
const papelFormatoAlto = $('#altoLibro').val();
|
||||
const papelFormatoAncho = $('#anchoLibro').val();
|
||||
const clienteId = $('#clienteId').val();
|
||||
|
||||
if (paginas == '' || isNaN(paginas) || parseInt(paginas) <= 0) {
|
||||
return false;
|
||||
}
|
||||
if(parseInt(paginas)%2!=0){
|
||||
$('#paginas').val(parseInt(paginas)+1).trigger('change');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(clienteId == '' || isNaN(clienteId) || parseInt(clienteId) <= 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tirada == '' || isNaN(tirada) || parseInt(tirada) <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (papelInterior == '' || gramajeInterior == '') {
|
||||
return false;
|
||||
}
|
||||
if (papelCubierta == '' || gramajeCubierta == '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($('#papelFormatoId').val() == '' ||
|
||||
($('#papelFormatoPersonalizado').is(':checked') &&
|
||||
((papelFormatoAncho == '' || isNaN(papelFormatoAncho) || parseInt(papelFormatoAncho) <= 0) ||
|
||||
(papelFormatoAlto == '' || isNaN(papelFormatoAlto) || parseInt(papelFormatoAlto) <= 0))
|
||||
)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function getTiradas() {
|
||||
let tiradas = [];
|
||||
tiradas.push(parseInt($('#tirada').val()));
|
||||
if ($('#tirada2').val().length > 0 && parseInt($('#tirada2').val()) > 0)
|
||||
tiradas.push(parseInt($('#tirada2').val()));
|
||||
if ($('#tirada3').val().length > 0 && parseInt($('#tirada3').val()) > 0)
|
||||
tiradas.push(parseInt($('#tirada3').val()));
|
||||
if ($('#tirada4').val().length > 0 && parseInt($('#tirada4').val()) > 0)
|
||||
tiradas.push(parseInt($('#tirada4').val()));
|
||||
return tiradas;
|
||||
}
|
||||
|
||||
|
||||
function getDimensionLibro() {
|
||||
|
||||
var ancho = 0;
|
||||
var alto = 0;
|
||||
|
||||
if ($('#papelFormatoId option:selected').length > 0) {
|
||||
var selectedText = $('#papelFormatoId option:selected').text();
|
||||
if (selectedText.length > 0) {
|
||||
ancho = parseFloat(selectedText.trim().split(" x ")[0]);
|
||||
alto = parseFloat(selectedText.trim().split(" x ")[1]);
|
||||
}
|
||||
else if (document.getElementById('papelFormatoPersonalizado').checked) {
|
||||
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
|
||||
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
|
||||
}
|
||||
}
|
||||
|
||||
else if (document.getElementById('papelFormatoPersonalizado').checked) {
|
||||
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
|
||||
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
|
||||
}
|
||||
return {
|
||||
ancho: ancho,
|
||||
alto: alto
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('#retractilado').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
if ($('#retractilado5').is(':checked'))
|
||||
$('#retractilado5').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#retractilado5').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
if ($('#retractilado').is(':checked'))
|
||||
$('#retractilado').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('.elementos-libro').on('change', function () {
|
||||
// Libro cosido
|
||||
if ($('#cosidoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Rústica cosido");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// Cosido tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
else {
|
||||
// Cosido tapa dura
|
||||
$('.guardas').show();
|
||||
numCarasGuardas(2);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
}
|
||||
// Libro fresado
|
||||
else if ($('#fresadoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Rústica fresado");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// fresado tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
else {
|
||||
// fresado tapa dura
|
||||
$('.guardas').show();
|
||||
numCarasGuardas(2);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').show();
|
||||
$('#enableSobrecubierta').trigger('change');
|
||||
}
|
||||
}
|
||||
// Libro grapado
|
||||
else if ($('#grapadoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Cosido con grapas");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// grapado tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
}
|
||||
// Libro wire-o
|
||||
else if ($('#wireoDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Wire-O");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// wire-o tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
// wire-o tapa dura
|
||||
$('.guardas').show();
|
||||
numCarasGuardas(1);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
}
|
||||
// Libro espiral
|
||||
else if ($('#espiralDiv').hasClass('checked')) {
|
||||
$('#tituloDisenioLibro').text("Espiral");
|
||||
if ($('#tapaBlandaInnerDiv').hasClass('checked')) {
|
||||
// espiral tapa blanda
|
||||
$('.guardas').hide();
|
||||
$('.solapas-cubierta').show();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
else {
|
||||
// espiral tapa dura
|
||||
$('.espiral').show();
|
||||
numCarasGuardas(1);
|
||||
$('.solapas-cubierta').hide();
|
||||
$('.sobrecubierta').hide();
|
||||
$('#enableSobrecubierta').prop('checked', false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function numCarasGuardas(numCaras) {
|
||||
if (numCaras == 1) {
|
||||
$("#impresionGuardas option[value='8']").remove();
|
||||
}
|
||||
else {
|
||||
if ($("#impresionGuardas option[value='8']").length == 0)
|
||||
$("#impresionGuardas").append('<option value="8">' + window.Presupuestos.dosCaras + '</option>');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('.calcular-presupuesto').on('change', function () {
|
||||
|
||||
// se obtiene el id del elemento que ha disparado el evento
|
||||
if($(this).hasClass('input-sobrecubierta')){
|
||||
if($('#papelSobrecubierta option:selected').val() == '' || $('#gramajeSobrecubierta option:selected').val() == ''){
|
||||
return;
|
||||
}
|
||||
}
|
||||
calcularPresupuesto();
|
||||
});
|
||||
|
||||
function comprobarTiradasPOD(){
|
||||
const tiradas = getTiradas();
|
||||
|
||||
//Comprobar que todos los elementos del array tiradas estan por encima de 30 o por debajo
|
||||
const tiradasPOD = tiradas.every(tirada => tirada <= 30);
|
||||
const tiradasNoPOD = tiradas.every(tirada => tirada > 30);
|
||||
if (tiradasPOD == !tiradasNoPOD) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#clienteId').on('select2:change', function () {
|
||||
calcularPresupuesto();
|
||||
});
|
||||
|
||||
|
||||
async function calcularPresupuesto() {
|
||||
|
||||
if(!comprobarTiradasPOD()){
|
||||
$('#errorTiradas').show();
|
||||
return;
|
||||
}
|
||||
$('#errorTiradas').hide();
|
||||
|
||||
// se obtiene la propiedad serv_id de los checkboxes seleccionados de la clase .servicio-extra
|
||||
if (!checkValues()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let servicios = [];
|
||||
$('.servicio-extra:checked').each(function () {
|
||||
servicios.push($(this).attr('serv_id'));
|
||||
})
|
||||
|
||||
let datos = {
|
||||
tamanio: getDimensionLibro(),
|
||||
tirada: getTiradas(),
|
||||
paginas: $('#paginas').val(),
|
||||
paginasColor: $('#paginasColor').val(),
|
||||
tipo: $('.custom-option-tipo.checked').attr('id').replace('Div', ''),
|
||||
tapa: $('#tapaDura').is(':checked') ? 'dura' : 'blanda',
|
||||
isColor: $('#colorNegroDiv').hasClass('checked') ? 0 : 1,
|
||||
isHq: $('#calidadEstandarDiv').hasClass('checked') ? 0 : 1,
|
||||
papelInterior: $('#papelInterior option:selected').val(),
|
||||
papelInteriorNombre: $('#papelInterior option:selected').text().trim(),
|
||||
gramajeInterior: $('#gramajeInterior option:selected').text(),
|
||||
excluirRotativa: $('#excluirRotativa').is(':checked')? 1 : 0,
|
||||
papelCubierta: $('#papelCubierta option:selected').val(),
|
||||
papelCubiertaNombre: $('#papelCubierta option:selected').text().trim(),
|
||||
gramajeCubierta: $('#gramajeCubierta option:selected').text(),
|
||||
carasCubierta: $('#carasCubierta').val(),
|
||||
acabadoCubierta: $('#acabadosCubierta').val(),
|
||||
clienteId: $('#clienteId').val(),
|
||||
servicios: servicios,
|
||||
}
|
||||
// Si hay solapas de cubierta
|
||||
if ($('#solapasCubierta').is(':checked')) {
|
||||
datos.solapasCubierta = $('#anchoSolapasCubierta').val()
|
||||
}
|
||||
|
||||
// Si hay sobrecubierta
|
||||
if ($('.enable-sobrecubierta').is(':visible')) {
|
||||
if($('#papelSobrecubierta option:selected').val()>0 && $('#gramajeSobrecubierta option:selected').val()>0){
|
||||
|
||||
datos.sobrecubierta = {
|
||||
papel: $('#papelSobrecubierta option:selected').val(),
|
||||
papel_nombre: $('#papelSobrecubierta option:selected').text().trim(),
|
||||
gramaje: $('#gramajeSobrecubierta option:selected').text(),
|
||||
acabado: $('#acabadosSobrecubierta').val()
|
||||
}
|
||||
if ($('#solapasSobrecubierta').is(':checked')) {
|
||||
datos.sobrecubierta.solapas = $('#anchoSolapasSobrecubierta').val()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($('.guardas').is(':visible')) {
|
||||
datos.guardas = {
|
||||
papel: $('#papelGuardas option:selected').val(),
|
||||
papel_nombre: $('#papelGuardas option:selected').text().trim(),
|
||||
gramaje: 170,
|
||||
caras: $('#impresionGuardas option:selected').val()
|
||||
}
|
||||
}
|
||||
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
|
||||
$('#loader').show();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_disenio_libro.presupuestoCliente,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function (response) {
|
||||
error = false;
|
||||
if(response.errors.interior.length > 0){
|
||||
$('#errorInterior').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorInterior').hide();
|
||||
if(response.errors.cubierta.length > 0){
|
||||
$('#errorCubierta').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorCubierta').hide();
|
||||
|
||||
if(response.errors.sobrecubierta.length > 0){
|
||||
$('#errorSobrecubierta').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorSobrecubierta').hide();
|
||||
|
||||
|
||||
if(response.errors.guardas.length > 0){
|
||||
$('#errorGuardas').show();
|
||||
error = true;
|
||||
}
|
||||
else
|
||||
$('#errorGuardas').hide();
|
||||
|
||||
if(response.errors.servicios.length > 0 || response.errors.serviciosDefecto.length > 0){
|
||||
error = true;
|
||||
$('#errorGeneral').show();
|
||||
}
|
||||
else{
|
||||
$('#errorGeneral').hide();
|
||||
}
|
||||
|
||||
console.log(response);
|
||||
$('#loader').hide();
|
||||
if(error){
|
||||
$('#divTiradasPrecio').empty();
|
||||
|
||||
}
|
||||
else{
|
||||
$('#precios').show();
|
||||
|
||||
for (i = 0; i < response.tiradas.length; i++) {
|
||||
const total = (parseFloat(response.precio_u[i]) * parseInt(response.tiradas[i])).toFixed(2) ;
|
||||
const label = "tiradaPrecio" + parseInt(i+1);
|
||||
|
||||
let html = '';
|
||||
|
||||
|
||||
html += '<div id="' + label + '" class="list-group" >';
|
||||
html += '<a href="javascript:void(0);" class="list-group-item list-group-item-action">';
|
||||
html += '<div class="li-wrapper d-flex justify-content-start align-items-center" >';
|
||||
html += '<div class="list-content">';
|
||||
html += '<h7 id="ud_' + label + '" class="mb-1">' + (response.tiradas[i] + ' ud.') + '</h7>';
|
||||
html += '<h6 id="tot_' + label + '" class="mb-1">' + ('Total: ' + total + '€') + '</h6>';
|
||||
html += '<h7 id="pu_' + label + '" class="mb-1">' + (response.precio_u[i] + '€/ud') + '</h7>';
|
||||
html += '</div>';
|
||||
html += '</div>'
|
||||
html += '</a>';
|
||||
html += '</div>';
|
||||
|
||||
$('#divTiradasPrecio').append(html);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (error) {
|
||||
$('#loader').hide();
|
||||
$('#divTiradasPrecio').empty();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<div id="loader" style="display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999;">
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
||||
<img src="<?= site_url("assets/img/loader.gif") ?>" alt="Loading..."/>
|
||||
</div>
|
||||
</div>
|
||||
@ -0,0 +1,328 @@
|
||||
/**
|
||||
* Cliente presupuesto Wizard
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
(function () {
|
||||
|
||||
|
||||
// Init custom option check
|
||||
//window.Helpers.initCustomOptionCheck();
|
||||
// Vertical Wizard
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
const clientePresupuestoWizard = document.querySelector('#wizard-presupuesto-cliente');
|
||||
if (typeof clientePresupuestoWizard !== undefined && clientePresupuestoWizard !== null) {
|
||||
// Wizard form
|
||||
const clientePresupuestoWizardForm = clientePresupuestoWizard.querySelector('#presupuesto-cliente-form');
|
||||
// Wizard steps
|
||||
const clientePresupuestoWizardFormStep2 = clientePresupuestoWizardForm.querySelector('#tipo-libro');
|
||||
const clientePresupuestoWizardFormStep3 = clientePresupuestoWizardForm.querySelector('#disenio-libro');
|
||||
const clientePresupuestoWizardFormStep4 = clientePresupuestoWizardForm.querySelector('#direcciones-libro');
|
||||
const clientePresupuestoWizardFormStep5 = clientePresupuestoWizardForm.querySelector('#resumen-libro');
|
||||
// Wizard next prev button
|
||||
const clientePresupuestoWizardNext = [].slice.call(clientePresupuestoWizardForm.querySelectorAll('.btn-next'));
|
||||
const clientePresupuestoWizardPrev = [].slice.call(clientePresupuestoWizardForm.querySelectorAll('.btn-prev'));
|
||||
|
||||
let validationStepper = new Stepper(clientePresupuestoWizard, {
|
||||
linear: true
|
||||
});
|
||||
|
||||
// select2 (clienteId)
|
||||
const clienteId = $('#clienteId');
|
||||
|
||||
clienteId.on('change.select2', function () {
|
||||
// Revalidate the clienteId field when an option is chosen
|
||||
FormValidation2.revalidateField('clienteId');
|
||||
});
|
||||
|
||||
// Deal Details
|
||||
const FormValidation2 = FormValidation.formValidation(clientePresupuestoWizardFormStep2, {
|
||||
fields: {
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: '.col-sm-3'
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
// Jump to the next step when all fields in the current step are valid
|
||||
validationStepper.next();
|
||||
});
|
||||
|
||||
// Deal Usage
|
||||
const FormValidation3 = FormValidation.formValidation(clientePresupuestoWizardFormStep3, {
|
||||
fields: {
|
||||
titulo: {
|
||||
validators: {
|
||||
notEmpty: {
|
||||
message: window.Presupuestos.validation.requerido_short
|
||||
},
|
||||
}
|
||||
},
|
||||
clienteId: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.cliente,
|
||||
callback: function (input) {
|
||||
// Get the selected options
|
||||
const options = $("#clienteId").select2('data');
|
||||
const hasValidOption = options.some(option => parseInt(option.id) > 0);
|
||||
return options !== null && options.length > 0 && hasValidOption;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
tirada: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
paginas: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
const value = $("#paginas").val();
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
paginasColor: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||
callback: function (input) {
|
||||
if ($('#pagColorDiv').is(':hidden'))
|
||||
return true;
|
||||
else {
|
||||
const value = $("#paginasColor").val();
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
gramajeInterior: {
|
||||
validators: {
|
||||
callback: {
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
if ($('#gramajeInterior option:selected').text().length == 0) {
|
||||
if(value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0){
|
||||
return {
|
||||
valid: false,
|
||||
message: window.Presupuestos.validation.sin_gramaje,
|
||||
}
|
||||
}
|
||||
return {
|
||||
valid: value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0,
|
||||
message: window.Presupuestos.validation.tirada_no_valida,
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
gramajeCubierta: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.tirada_no_valida,
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
},
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.sin_gramaje,
|
||||
callback: function (input) {
|
||||
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
gramajeSobrecubierta: {
|
||||
validators: {
|
||||
callback: {
|
||||
message: window.Presupuestos.validation.tirada_no_valida,
|
||||
callback: function (input) {
|
||||
const value = $("#tirada").val();
|
||||
if ($('#gramajeSobrecubierta option:selected').text().length == 0) {
|
||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: function (field, ele) {
|
||||
// field is the field name
|
||||
// ele is the field element
|
||||
switch (field) {
|
||||
case 'gramajeInterior':
|
||||
case 'gramajeCubierta':
|
||||
case 'gramajeSobrecubierta':
|
||||
return '.col-sm-2';
|
||||
|
||||
case 'titulo':
|
||||
return '.col-sm-12';
|
||||
|
||||
case 'clienteId':
|
||||
return '.col-sm-6';
|
||||
|
||||
default:
|
||||
return '.col-sm-3';
|
||||
}
|
||||
}
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
validationStepper.next();
|
||||
initDirecciones();
|
||||
initTiradasDirecciones();
|
||||
});
|
||||
|
||||
const tirada = $('#tirada');
|
||||
tirada.on('change', function () {
|
||||
// Revalidate the clienteId field when an option is chosen
|
||||
FormValidation2.revalidateField('gramajeInterior');
|
||||
FormValidation2.revalidateField('gramajeCubierta');
|
||||
FormValidation2.revalidateField('gramajeSobrecubierta');
|
||||
});
|
||||
|
||||
// Direcciones
|
||||
const FormValidation4 = FormValidation.formValidation(clientePresupuestoWizardFormStep4, {
|
||||
fields: {
|
||||
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: '.col-md-12'
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
validationStepper.next();
|
||||
});
|
||||
|
||||
// Deal Usage
|
||||
const FormValidation5 = FormValidation.formValidation(clientePresupuestoWizardFormStep5, {
|
||||
fields: {
|
||||
// * Validate the fields here based on your requirements
|
||||
},
|
||||
plugins: {
|
||||
trigger: new FormValidation.plugins.Trigger(),
|
||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||
// Use this for enabling/changing valid/invalid class
|
||||
// eleInvalidClass: '',
|
||||
eleValidClass: '',
|
||||
rowSelector: '.col-md-12'
|
||||
}),
|
||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||
submitButton: new FormValidation.plugins.SubmitButton()
|
||||
}
|
||||
}).on('core.form.valid', function () {
|
||||
// You can submit the form
|
||||
// clientePresupuestoWizardForm.submit()
|
||||
// or send the form data to server via an Ajax request
|
||||
// To make the demo simple, I just placed an alert
|
||||
alert('Submitted..!!');
|
||||
});
|
||||
|
||||
clientePresupuestoWizardNext.forEach(item => {
|
||||
item.addEventListener('click', event => {
|
||||
// When click the Next button, we will validate the current step
|
||||
switch (validationStepper._currentIndex) {
|
||||
case 0:
|
||||
FormValidation2.validate();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
FormValidation3.validate();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
FormValidation4.validate();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
FormValidation5.validate();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
clientePresupuestoWizardPrev.forEach(item => {
|
||||
item.addEventListener('click', event => {
|
||||
switch (validationStepper._currentIndex) {
|
||||
case 4:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
for (let i = 0; i < 4; i++) {
|
||||
let id = "tiradaPrecio" + i;
|
||||
if ($('#' + id).length > 0) {
|
||||
$('#' + id).show();
|
||||
}
|
||||
}
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
validationStepper.previous();
|
||||
break;
|
||||
|
||||
case 0:
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
@ -0,0 +1,52 @@
|
||||
// Init custom option check
|
||||
function initTipoLibroCheck()
|
||||
{
|
||||
const _this = this
|
||||
|
||||
const custopOptionList = [].slice.call(document.querySelectorAll('.custom-option-tipo .form-check-input'))
|
||||
custopOptionList.map(function (customOptionEL) {
|
||||
// Update custom options check on page load
|
||||
_this.updateTipoLibroCheck(customOptionEL)
|
||||
|
||||
// Update custom options check on click
|
||||
customOptionEL.addEventListener('click', e => {
|
||||
_this.updateTipoLibroCheck(customOptionEL)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateTipoLibroCheck(el)
|
||||
{
|
||||
if (el.checked) {
|
||||
// If custom option element is radio, remove checked from the siblings (closest `.row`)
|
||||
if (el.type === 'radio') {
|
||||
const customRadioOptionList = [].slice.call(el.closest('.tipo_libro').querySelectorAll('.custom-option-tipo'))
|
||||
customRadioOptionList.map(function (customRadioOptionEL) {
|
||||
customRadioOptionEL.closest('.custom-option-tipo').classList.remove('checked')
|
||||
})
|
||||
}
|
||||
el.closest('.custom-option-tipo').classList.add('checked')
|
||||
if(el.closest('.custom-option-tipo').id == 'grapadoDiv') {
|
||||
$('#tapaDuraDiv').hide();
|
||||
$('#tapaBlanda').prop('checked', true);
|
||||
}
|
||||
else {
|
||||
$('#tapaDuraDiv').show();
|
||||
}
|
||||
} else {
|
||||
el.closest('.custom-option-tipo').classList.remove('checked')
|
||||
}
|
||||
}
|
||||
|
||||
initTipoLibroCheck();
|
||||
|
||||
|
||||
function getUpdatePapelInterior() {
|
||||
var impresionInterior = $('input[name="impresionInterior"]:checked').val();
|
||||
if(impresionInterior == 'color') {
|
||||
$('#colorInteriorDiv').show();
|
||||
}
|
||||
else {
|
||||
$('#colorInteriorDiv').hide();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,240 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="col-12">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/loader") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
|
||||
|
||||
<!-- Create Deal Wizard -->
|
||||
<div id="wizard-presupuesto-cliente" class="bs-stepper vertical mt-2 linear">
|
||||
<div class="bs-stepper-header">
|
||||
|
||||
<div class="step active" data-target="#tipo-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Tipo de libro</span>
|
||||
<span class="bs-stepper-subtitle">Cosido, Fresado, ...</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#disenio-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Diseño del libro</span>
|
||||
<span class="bs-stepper-subtitle">Detalles técnicos del libro</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#direcciones-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-map-pins ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Direcciones</span>
|
||||
<span class="bs-stepper-subtitle">Dirección envío, facturación</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
|
||||
<div class="step" data-target="#resumen-libro">
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-checkbox ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
<span class="bs-stepper-title">Resumen del presupuesto</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="errorGeneral" class="fv-plugins-message-container invalid-feedback" style="display: none;">
|
||||
<p>Se ha producido un error al calcular el presupuesto. Póngase en contacto con el administrador</p>
|
||||
</div>
|
||||
|
||||
<table id="precios" class="table table-sm" style="display: none;">
|
||||
<caption>Precio/Unidad por tirada</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="bs-stepper-content">
|
||||
<form id="presupuesto-cliente-form" onsubmit="return false">
|
||||
|
||||
|
||||
<!-- Tipo Libro -->
|
||||
<div id="tipo-libro" class="content active dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_tipoLibroItems") ?>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Diseño Libro -->
|
||||
<div id="disenio-libro" class="content dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_disenioLibroItems") ?>
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Deal Usage -->
|
||||
<div id="direcciones-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
|
||||
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Siguiente</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Review & Complete -->
|
||||
<div id="resumen-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<div class="row g-3">
|
||||
|
||||
</div>
|
||||
<div class="col-12 d-flex justify-content-between mt-4">
|
||||
<button class="btn btn-label-secondary btn-prev waves-effect">
|
||||
<i class="ti ti-arrow-left ti-xs me-sm-1 me-0"></i>
|
||||
<span class="align-middle d-sm-inline-block d-none">Anterior</span>
|
||||
</button>
|
||||
<button class="btn btn-success btn-submit btn-next waves-effect waves-light">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Submit</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!--//.col -->
|
||||
<div class="pt-4">
|
||||
<input type="submit" class="btn btn-primary float-start me-sm-3 me-1" name="save" id="saveForm" value="<?= lang("Basic.global.Save") ?>" />
|
||||
</div>
|
||||
</div><!--//.row -->
|
||||
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
|
||||
<?= view("themes/_commonPartialsBs/_modalMessageDialog") ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.datosPresupuesto = <?= json_encode($datosPresupuesto) ?>;
|
||||
window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||
|
||||
$('#clienteId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfClientes") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function(params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function(response) {
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
initDisenioLibro();
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bs-stepper/bs-stepper.css') ?>" />
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/bs-stepper/bs-stepper.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/select/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/vendor/libs/autosize/autosize.js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/translate_js/Presupuestos') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoCliente_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteTipoLibro_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestoClienteDisenioLibro_js') ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,173 @@
|
||||
<div class="accordion accordion-bordered 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 border border-container">
|
||||
<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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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() ?>
|
||||
|
||||
|
||||
@ -0,0 +1,423 @@
|
||||
const actionBtns_direcciones = function(data) {
|
||||
return `
|
||||
<span class="edit-add"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit-add mx-2" data-id="${data.id}"></i></a></span>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm tiradas-alternativas delete-add-row mx-2"></i></a>
|
||||
`;
|
||||
};
|
||||
|
||||
// Funcion para obtener el peso total del libro
|
||||
function get_peso_libro(){
|
||||
|
||||
var peso_total_libro = 0.0
|
||||
$('#tableLineasPresupuesto').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
peso_total_libro += parseFloat(rowData.peso)
|
||||
})
|
||||
return peso_total_libro;
|
||||
}
|
||||
|
||||
|
||||
async function get_precio_envio(peso, paisId, cp, tipo_envio){
|
||||
|
||||
data = {
|
||||
tipo: 'get_tarifa',
|
||||
peso: peso,
|
||||
paisId: paisId,
|
||||
cp: cp,
|
||||
tipo_envio: tipo_envio,
|
||||
}
|
||||
data = Object.assign(data, window.token_ajax);
|
||||
|
||||
const response = await fetch(window.location.origin + window.url_get_precio_envio , {
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
headers: {
|
||||
"Content-type": "application/json; charset=UTF-8",
|
||||
}
|
||||
});
|
||||
|
||||
const values = await response.json();
|
||||
yeniden(values[window.csrf_token]);
|
||||
return values.data;
|
||||
}
|
||||
|
||||
|
||||
async function get_coste_envio_tiradasAlternativas(tirada){
|
||||
|
||||
var peso_libro = get_peso_libro();
|
||||
var tirada_inicial = parseInt($('#tirada').val());
|
||||
var coste = 0.0;
|
||||
var margen = 0.0;
|
||||
|
||||
const table = $('#tableOfDireccionesEnvio').DataTable();
|
||||
const rows = table.rows().nodes();
|
||||
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
const rowData = table.row(rows[i]).data();
|
||||
const porcentaje = parseInt(rowData.cantidad)/tirada_inicial*100.0;
|
||||
const cantidad = Math.floor(tirada*porcentaje/100.0);
|
||||
const peso_envio = cantidad*peso_libro/1000.0;
|
||||
const datos_tarifa = await get_precio_envio(peso_envio, rowData.paisId, rowData.cp, parseInt(rowData.entregaPieCalle)==1?'palets':'cajas');
|
||||
|
||||
if(datos_tarifa.id!=null){
|
||||
|
||||
if(peso_envio>parseFloat(datos_tarifa.peso_max)){
|
||||
coste += parseFloat(datos_tarifa.peso_min) + (peso_envio-parseFloat(datos_tarifa.peso_min))*parseFloat(datos_tarifa.precio_adicional);
|
||||
}
|
||||
// si no se calcula linealmente
|
||||
else{
|
||||
m=((parseFloat(datos_tarifa.precio_max)-parseFloat(datos_tarifa.precio_min))/(parseFloat(datos_tarifa.peso_max)-parseFloat(datos_tarifa.peso_min)));
|
||||
b=parseFloat(datos_tarifa.precio_max)-m*parseFloat(datos_tarifa.peso_max);
|
||||
coste += parseFloat(m*peso_envio+b);
|
||||
}
|
||||
}
|
||||
margen += coste*datos_tarifa.margen/100.0;
|
||||
}
|
||||
|
||||
return {coste, margen};
|
||||
}
|
||||
|
||||
|
||||
function checkInsertar(){
|
||||
|
||||
var cantidad_total = 0
|
||||
$('#tableOfDireccionesEnvio').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var data = this.data();
|
||||
cantidad_total += parseInt(data.cantidad )
|
||||
} );
|
||||
var htmlString = ''
|
||||
if(cantidad_total < parseInt($('#tirada').val())){
|
||||
$('#rowInsertar').css('display', 'flex')
|
||||
}
|
||||
else{
|
||||
$('#rowInsertar').css('display', 'none')
|
||||
}
|
||||
|
||||
if(cantidad_total != parseInt($('#tirada').val())){
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-bell ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2">` +
|
||||
window.Presupuestos.validation.ejemplares_envio +
|
||||
`</h5>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
$('#alert-envios').html(htmlString)
|
||||
}
|
||||
|
||||
|
||||
async function updateTablaEnvios(tirada_inicial = null, tirada = null){
|
||||
|
||||
var peso_total_libro = get_peso_libro();
|
||||
|
||||
$('#tableOfDireccionesEnvio').DataTable().rows().every(async function ( rowIdx, tableLoop, rowLoop ) {
|
||||
|
||||
var rowData = this.data();
|
||||
|
||||
if(tirada_inicial!=null && tirada!=null){
|
||||
const porcentaje = parseInt(rowData.cantidad)/tirada_inicial*100.0;
|
||||
const cantidad = Math.floor(tirada*porcentaje/100.0);
|
||||
rowData.cantidad = cantidad
|
||||
}
|
||||
const peso_envio = peso_total_libro*parseInt(rowData.cantidad)/1000.0;
|
||||
|
||||
var datos_tarifa = await get_precio_envio(peso_envio, rowData.paisId, rowData.cp, parseInt(rowData.entregaPieCalle)==1?'palets':'cajas');
|
||||
|
||||
|
||||
if(datos_tarifa.id!=null){
|
||||
|
||||
if(peso_envio>parseFloat(datos_tarifa.peso_max)){
|
||||
datos_tarifa.precio = parseFloat(datos_tarifa.peso_min) + (peso_envio-parseFloat(datos_tarifa.peso_min))*parseFloat(datos_tarifa.precio_adicional);
|
||||
}
|
||||
// si no se calcula linealmente
|
||||
else{
|
||||
m=((parseFloat(datos_tarifa.precio_max)-parseFloat(datos_tarifa.precio_min))/(parseFloat(datos_tarifa.peso_max)-parseFloat(datos_tarifa.peso_min)));
|
||||
b=parseFloat(datos_tarifa.precio_max)-m*parseFloat(datos_tarifa.peso_max);
|
||||
datos_tarifa.precio = parseFloat(m*peso_envio+b);
|
||||
}
|
||||
|
||||
|
||||
datos_tarifa.cantidad = parseInt($('#add_cantidad').val());
|
||||
datos_tarifa.peso = peso_envio;
|
||||
|
||||
$('#tableOfDireccionesEnvio').DataTable().row(rowIdx)
|
||||
.data({
|
||||
'tarifa_id': datos_tarifa.id,
|
||||
'cantidad': rowData.cantidad,
|
||||
'peso': datos_tarifa.peso.toFixed(3),
|
||||
'att': rowData.att,
|
||||
'email': rowData.email,
|
||||
'direccion': rowData.direccion,
|
||||
'cp': rowData.cp,
|
||||
'municipio': rowData.municipio,
|
||||
'provincia': rowData.provincia,
|
||||
'paisId': rowData.paisId,
|
||||
'telefono': rowData.telefono,
|
||||
'proveedor': datos_tarifa.proveedor,
|
||||
'proveedor_id': datos_tarifa.proveedor_id,
|
||||
'precio': datos_tarifa.precio.toFixed(2),
|
||||
'margen': datos_tarifa.margen,
|
||||
'entregaPieCalle': rowData.entregaPieCalle,
|
||||
'actionBtns_direcciones': actionBtns_direcciones,
|
||||
})
|
||||
.draw();
|
||||
|
||||
checkInsertar()
|
||||
//updateTotales(false, false, true)
|
||||
updatePresupuesto({
|
||||
update_lineas: false,
|
||||
update_servicios: false,
|
||||
update_envios: false,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
}
|
||||
else{
|
||||
popErrorAlert(window.error_no_tarifa_envio, 'error-tarifa')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$('#insertar_direccion').on('click', function(){
|
||||
|
||||
$("#addressForm").attr('action','create')
|
||||
var $newAddDialog = $("#addressForm")
|
||||
var maximaCantidad = parseInt($('#tirada').val())
|
||||
$("#add_cantidad").attr("max" , maximaCantidad);
|
||||
$("#add_cantidad").val( maximaCantidad);
|
||||
$("#add_cantidad").on('change', function(){
|
||||
$("#add_cantidad").val(parseInt($("#add_cantidad").val())>maximaCantidad ? maximaCantidad : $("#add_cantidad").val())
|
||||
})
|
||||
|
||||
cantidad_total = 0
|
||||
tableEnvios.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var data = this.data();
|
||||
cantidad_total += parseInt(data.cantidad)
|
||||
} );
|
||||
$('#add_cantidad').attr('max-value', parseInt($('#tirada').val())-cantidad_total)
|
||||
$('#add_cantidad').val(parseInt($('#tirada').val())-cantidad_total)
|
||||
$newAddDialog.modal('show')
|
||||
})
|
||||
|
||||
const lastColNr_direcciones = $('#tableOfDireccionesEnvio').find("tr:first th").length - 1;
|
||||
|
||||
|
||||
$(document).on('click', '.delete-add-row', function(e) {
|
||||
const row = $(this).closest('tr');
|
||||
tableEnvios.row( row )
|
||||
.remove()
|
||||
.draw();
|
||||
checkInsertar()
|
||||
//updateTotales(false, false, true)
|
||||
updatePresupuesto({
|
||||
update_lineas: false,
|
||||
update_servicios: false,
|
||||
update_envios: false,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
showBreadCrumbSaveButton(true);
|
||||
|
||||
})
|
||||
|
||||
$(document).on('click', '.btn-edit-add', function(e) {
|
||||
const row = $(this).closest('tr');
|
||||
var data = tableEnvios.row( row ).data()
|
||||
|
||||
$("#addressForm").attr('action','edit')
|
||||
$("#addressForm").attr('row', row[0]._DT_RowIndex)
|
||||
$("#addressForm").attr('presupuestodireccion_id', $(this).attr('data-id'))
|
||||
var $newAddDialog = $("#addressForm")
|
||||
var maximaCantidad = parseInt($('#tirada').val())
|
||||
$("#add_cantidad").attr("max" , maximaCantidad);
|
||||
$("#add_cantidad").val( maximaCantidad);
|
||||
$("#add_cantidad").on('change', function(){
|
||||
$("#add_cantidad").val(parseInt($("#add_cantidad").val())>maximaCantidad ? maximaCantidad : $("#add_cantidad").val())
|
||||
})
|
||||
|
||||
cantidad_total = 0
|
||||
tableEnvios.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var data2 = this.data();
|
||||
cantidad_total += parseInt(data2.cantidad)
|
||||
} );
|
||||
cantidad_total -= parseInt(data.cantidad) // Si es editar tienes que restar los de la linea actual
|
||||
$('#add_cantidad').attr('max-value', parseInt($('#tirada').val())-cantidad_total)
|
||||
$('#add_cantidad').val(parseInt($('#tirada').val())-cantidad_total)
|
||||
|
||||
$('#add_att').val(data.att)
|
||||
$('#add_direccion').val(data.direccion)
|
||||
$('#add_email').val(data.email)
|
||||
$('#add_cp').val(data.cp)
|
||||
$('#add_municipio').val(data.municipio)
|
||||
$('#add_provincia').val(data.provincia)
|
||||
$('#add_pais_id').val(data.paisId)
|
||||
$('#add_telefono').val(data.telefono)
|
||||
$('#add_cantidad').val(data.cantidad)
|
||||
$('#add_entregaPieCalle').prop('checked', data.entregaPieCalle==1?true:false)
|
||||
|
||||
$newAddDialog.modal('show')
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$('#recoger_en_taller').change(function(){
|
||||
if(this.checked) {
|
||||
$('#rowTable').css('display', 'none')
|
||||
$('#rowInsertar').css('display', 'none')
|
||||
tableEnvios.clear().draw()
|
||||
}
|
||||
else{
|
||||
$('#rowTable').css('display', 'flex')
|
||||
$('#rowInsertar').css('display', 'flex')
|
||||
tableEnvios.columns.adjust();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
let tableEnvios = $('#tableOfDireccionesEnvio').DataTable( {
|
||||
draw:5,
|
||||
serverSide: false,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
order: [[ 0, "asc" ]],
|
||||
pageLength: 20,
|
||||
lengthChange: false,
|
||||
searching: false,
|
||||
paging: false,
|
||||
info: false,
|
||||
scrollX: true,
|
||||
|
||||
columns: [
|
||||
{ 'data': 'tarifa_id' },
|
||||
{ 'data': 'cantidad' },
|
||||
{ 'data': 'peso' },
|
||||
{ 'data': 'att' },
|
||||
{ 'data': 'email' },
|
||||
{ 'data': 'direccion' },
|
||||
{ 'data': 'cp' },
|
||||
{ 'data': 'municipio' },
|
||||
{ 'data': 'paisId' ,
|
||||
render: function(data, type, row, meta) {
|
||||
var pais = window.paisList.find(element => element.id == data);
|
||||
return pais['nombre'];
|
||||
},
|
||||
},
|
||||
{ 'data': 'telefono' },
|
||||
{ 'data': 'proveedor'},
|
||||
{ 'data': 'proveedor_id'},
|
||||
{ 'data': 'precio' },
|
||||
{ 'data': 'margen' },
|
||||
{ 'data': 'entregaPieCalle' },
|
||||
{
|
||||
data: actionBtns_direcciones,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr_direcciones]
|
||||
},
|
||||
{"orderData": [ 0], "targets": 0 },
|
||||
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
target: [0,11,13,14],
|
||||
visible: false,
|
||||
searchable: false
|
||||
},
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
|
||||
} );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function save_datos_envios(){
|
||||
|
||||
var id = $('#presupuesto_id').val()
|
||||
|
||||
$.post( window.routes_envios.dataTableOfPresupuestoDirecciones,
|
||||
Object.assign({tipo: "clear_lineas", presupuesto_id: id}, window.token_ajax))
|
||||
.done(function( data ) {
|
||||
|
||||
$('#tableOfDireccionesEnvio').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var data = this.data();
|
||||
$.post( '/presupuestos/presupuestodirecciones/add',
|
||||
Object.assign({
|
||||
presupuesto_id : id,
|
||||
tarifa_id : data.tarifa_id,
|
||||
cantidad : data.cantidad,
|
||||
peso : data.peso,
|
||||
att : data.att,
|
||||
email : data.email,
|
||||
direccion : data.direccion,
|
||||
paisId : data.paisId,
|
||||
provincia : data.provincia,
|
||||
municipio : data.municipio,
|
||||
cp : data.cp,
|
||||
telefono : data.telefono,
|
||||
precio : data.precio,
|
||||
margen : data.margen,
|
||||
proveedor : data.proveedor,
|
||||
proveedor_id : data.proveedor_id,
|
||||
entregaPieCalle : data.entregaPieCalle}, window.token_ajax))
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
function load_datos_envios(){
|
||||
|
||||
window.direccionesList.forEach((linea) => {
|
||||
tableEnvios.row
|
||||
.add({
|
||||
'tarifa_id': linea.tarifa_id,
|
||||
'cantidad': linea.cantidad,
|
||||
'peso': linea.peso,
|
||||
'att': linea.att,
|
||||
'email': linea.email,
|
||||
'direccion': linea.direccion,
|
||||
'cp': linea.cp,
|
||||
'municipio': linea.municipio,
|
||||
'provincia': linea.provincia,
|
||||
'paisId': linea.pais_id,
|
||||
'telefono': linea.telefono,
|
||||
'proveedor': linea.proveedor,
|
||||
'proveedor_id': linea.proveedor_id,
|
||||
'precio': linea.precio,
|
||||
'margen': linea.margen,
|
||||
'entregaPieCalle': linea.entregaPieCalle,
|
||||
'actionBtns_direcciones': actionBtns_direcciones,
|
||||
})
|
||||
.draw();
|
||||
checkInsertar()
|
||||
|
||||
|
||||
});
|
||||
|
||||
updatePresupuesto({
|
||||
update_lineas: false,
|
||||
update_servicios: false,
|
||||
update_envios: false,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: false
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionEnvios">
|
||||
<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="#accordionEnviosTip" aria-expanded="false" aria-controls="accordionEnviosTip">
|
||||
<h4><?= lang("Presupuestos.envios") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionEnviosTip" class="accordion-collapse collapse show" data-bs-parent="#accordionEnvios">
|
||||
<div class="accordion-body">
|
||||
<div id='alert-envios'></div>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_presupuestoDireccionesForm") ?>
|
||||
<div id='rowTable' class='row'>
|
||||
<table id="tableOfDireccionesEnvio" class="table dt-responsive dataTable px-2 update-resumen-presupuesto" style="width: 95%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="lp-header">Tarifa_id</th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.cantidad') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.peso') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.att') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.email') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.direccion') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.cp') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.municipio') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.pais') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.telefono') ?></th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.proveedor') ?></th>
|
||||
<th>Proveedor_id</th>
|
||||
<th class="lp-header"><?= lang('PresupuestosDirecciones.precio') ?></th>
|
||||
<th>Margen</th>
|
||||
<th>Entrega a pie</th>
|
||||
<th style="min-width:120px !important;" class="lp-header"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-4 px-4 py-2">
|
||||
<input class="form-check-input" type="checkbox" id="recoger_en_taller" name="recoger_en_taller" value="1" <?= $presupuestoEntity->recoger_en_taller == true ? 'checked' : ''; ?> >
|
||||
<label class="form-check-label" for="recoger_en_taller"><?= lang('Presupuestos.recogerEnTaller') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="rowInsertar" class="row">
|
||||
<div class="col-md-12 col-lg-4 px-4 py-2">
|
||||
<button id="insertar_direccion" type="button" class="btn btn-secondary waves-effect waves-light float-start"><?= lang("Presupuestos.insertar")?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS comportamiento general pag. -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.paisList = <?php echo json_encode($paisList); ?>;
|
||||
window.direccionesList = <?php echo json_encode($direccionesList); ?>;
|
||||
|
||||
window.routes_envios = {
|
||||
dataTableOfPresupuestoDirecciones: '<?= route_to('dataTableOfPresupuestoDirecciones') ?>'
|
||||
}
|
||||
|
||||
window.url_get_precio_envio = '<?= route_to('processDataDirecciones') ?>';
|
||||
window.error_no_tarifa_envio = '<?= lang('PresupuestosDirecciones.validation.no_tarifa') ?>'
|
||||
window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||
|
||||
$( document ).ready(function() {
|
||||
load_datos_envios();
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,144 @@
|
||||
$('#paginas').on("change", function () {
|
||||
|
||||
const url2 = window.location.href;
|
||||
const url_parts2 = url2.split('/');
|
||||
|
||||
if($('#tipo_impresion_id').val() == 21){
|
||||
if(parseInt($('#paginas').val()) > 80){
|
||||
$('#paginas').val(80)
|
||||
}
|
||||
}
|
||||
|
||||
if(url_parts2[url_parts2.length-2] == 'edit'){
|
||||
|
||||
checkPaginasPresupuesto()
|
||||
|
||||
// Si es negro o color
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
$('#compPaginasNegro').val(parseInt($('#paginas').val())-parseInt($('#compPaginasColor').val()));
|
||||
$('#compPaginasNegro').trigger('change')
|
||||
}
|
||||
// Si es negrohq o colorhq
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
$('#compPaginasNegrohq').val(parseInt($('#paginas').val())-parseInt($('#compPaginasColorhq').val()));
|
||||
$('#compPaginasNegrohq').trigger('change');
|
||||
}
|
||||
|
||||
//update_servicios(false)
|
||||
//updateLineasPresupuesto()
|
||||
updatePresupuesto({
|
||||
update_lineas: true,
|
||||
update_servicios: true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#tirada').on("change", function (update_tiradas_alternativas = true) {
|
||||
|
||||
calcular_mermas()
|
||||
|
||||
const url2 = window.location.href;
|
||||
const url_parts2 = url2.split('/');
|
||||
|
||||
if(url_parts2[url_parts2.length-2] == 'edit'){
|
||||
//update_servicios(false)
|
||||
//updateLineasPresupuesto()
|
||||
if(update_tiradas_alternativas)
|
||||
updatePresupuesto({
|
||||
update_lineas: true,
|
||||
update_servicios: false,
|
||||
update_envios: false,
|
||||
update_resumen: false,
|
||||
update_tiradas_alternativas: false
|
||||
})
|
||||
else
|
||||
updatePresupuesto({
|
||||
update_lineas: true,
|
||||
update_servicios: false,
|
||||
update_envios: false,
|
||||
update_resumen: false,
|
||||
update_tiradas_alternativas: false
|
||||
})
|
||||
checkInsertar()
|
||||
}
|
||||
})
|
||||
|
||||
function calcular_mermas(){
|
||||
|
||||
const tirada = parseInt($('#tirada').val())
|
||||
var merma = 0
|
||||
htmlString = ''
|
||||
|
||||
if(tirada> parseInt($('#POD').val())){
|
||||
merma = tirada*0.1<=30 ? tirada*0.1 : 30
|
||||
}
|
||||
else{
|
||||
merma_lineas = []
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
if(rowData.row_id != 'lp_guardas' && rowData.row_id != 'lp_cubierta' && rowData.row_id != 'lp_sobrecubierta'){
|
||||
const formas_linea = parseInt($('#isCosido').val())==0?parseInt(rowData.formas):parseInt(rowData.formas)/2
|
||||
if(formas_linea > tirada)
|
||||
merma_lineas.push(formas_linea-tirada)
|
||||
else
|
||||
merma_lineas.push(tirada%formas_linea)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
if(merma_lineas.length>0)
|
||||
merma = Math.max(...merma_lineas)
|
||||
else{
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-bell ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2">` +
|
||||
window.Presupuestos.validation.no_lp_for_merma +
|
||||
`</h5>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
|
||||
merma = 0
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$('#mermacubierta').val(parseInt(merma))
|
||||
$('#merma').val(parseInt(merma))
|
||||
$('#alert-datosLibro').html(htmlString)
|
||||
}
|
||||
|
||||
|
||||
$('#papelFormatoPersonalizado').on("click",function(){
|
||||
var checkbox = document.getElementById('papelFormatoPersonalizado');
|
||||
if(checkbox.checked == true){
|
||||
document.getElementById("papelFormatoAncho").style.display = "block";
|
||||
document.getElementById("papelFormatoAlto").style.display = "block";
|
||||
$('#papelFormatoId').next(".select2-container").hide();
|
||||
$('#papelFormatoId').val(0).change();
|
||||
document.getElementById("label_papelFormatoId").innerHTML =
|
||||
window.Presupuestos.papelFormatoId + " (" +
|
||||
window.Presupuestos.papelFormatoAncho + " x " + window.Presupuestos.papelFormatoAncho + ")*";
|
||||
}
|
||||
else{
|
||||
document.getElementById("papelFormatoAncho").value= "";
|
||||
document.getElementById("papelFormatoAlto").value= "";
|
||||
document.getElementById("papelFormatoAncho").style.display = "none";
|
||||
document.getElementById("papelFormatoAlto").style.display = "none";
|
||||
$('#papelFormatoId').next(".select2-container").show();
|
||||
document.getElementById("label_papelFormatoId").innerHTML =
|
||||
window.Presupuestos.papelFormatoId + '*';
|
||||
}
|
||||
});
|
||||
|
||||
@ -0,0 +1,443 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionDatosLibro">
|
||||
<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="#accordionDatosLibroTip" aria-expanded="false" aria-controls="accordionDatosLibroTip">
|
||||
<h4><?= lang("Presupuestos.datosLibro") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionDatosLibroTip" class="accordion-collapse collapse show" data-bs-parent="#accordionDatosLibro">
|
||||
<div class="accordion-body">
|
||||
|
||||
<div id='alert-datosLibro'></div>
|
||||
<!-- Fila 1 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<label for="paginas" class="form-label">
|
||||
<?= lang('Presupuestos.paginas') ?>*
|
||||
</label>
|
||||
<input type="number" id="paginas" name="paginas" tabindex="1" maxLength="11" class="form-control" value="<?= old('paginas', $presupuestoEntity->paginas) ?>" <?php echo ($tipo_impresion_id == 21)?' max=80':'' ?>>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="tirada" class="form-label">
|
||||
<?= lang('Presupuestos.tirada') ?>*
|
||||
</label>
|
||||
<input type="number" id="tirada" name="tirada" tabindex="2" maxLength="11" class="form-control" value="<?= old('tirada', $presupuestoEntity->tirada) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-4 px-4">
|
||||
<div class="mb-1">
|
||||
<label id="label_papelFormatoId" for="papelFormatoId" class="form-label">
|
||||
<?= lang('Presupuestos.papelFormatoId') ?>*
|
||||
</label>
|
||||
|
||||
<select id="papelFormatoId" name="papel_formato_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($papelFormatoList) && is_array($papelFormatoList) && !empty($papelFormatoList)) :
|
||||
foreach ($papelFormatoList as $formato) : ?>
|
||||
<option value="<?= $formato->id ?>" <?= $formato->id == $presupuestoEntity->papel_formato_id ? ' selected' : '' ?>>
|
||||
<?= $formato->tamanio ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="mb-1">
|
||||
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAncho" name="papel_formato_ancho" maxLength="8" step="0.01" class="form-control formato_libro" value="<?= old('papel_formato_ancho', $presupuestoEntity->papel_formato_ancho) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="mb-1">
|
||||
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAlto" name="papel_formato_alto" maxLength="8" step="0.01" class="form-control formato_libro" value="<?= old('papel_formato_alto', $presupuestoEntity->papel_formato_alto) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
</div>
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="merma" class="form-label">
|
||||
<?= lang('Presupuestos.merma') ?>*
|
||||
</label>
|
||||
<input readonly style="background: #E8E8E8;" id="merma" name="merma" maxLength="8" tabindex="4" step="1" placeholder="10" 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-1">
|
||||
<label for="mermacubierta" class="form-label">
|
||||
<?= lang('Presupuestos.mermacubierta') ?>*
|
||||
</label>
|
||||
<input readonly style="background: #E8E8E8;" id="mermacubierta" name="merma_cubierta" tabindex="5" placeholder="10" maxLength="8" step="1" class="form-control" value="<?= old('merma_cubierta', $presupuestoEntity->merma_cubierta) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
|
||||
|
||||
<!-- Fila 2 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input solapas_cubierta" type="checkbox" id="solapas" name="solapas" tabindex="6" value="1" <?= $presupuestoEntity->solapas == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="solapas"><?= lang('Presupuestos.solapasCubierta') ?></label>
|
||||
</div>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8 && $tipo_impresion_id != 21) : ?>
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input solapas_sobrecubierta" type="checkbox" id="solapas_sobrecubierta" name="solapas_sobrecubierta" tabindex="6" value="1" <?= $presupuestoEntity->solapas_sobrecubierta == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="solapas_sobrecubierta"><?= lang('Presupuestos.solapasSobrecubierta') ?></label>
|
||||
</div>
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="papelFormatoPersonalizado" name="papel_formato_personalizado" value="1" <?= $presupuestoEntity->papel_formato_personalizado == true ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="papelFormatoPersonalizado"><?= lang('Presupuestos.papelFormatoPersonalizado') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Fila 3 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
<?php if($presupuestoEntity->solapas == true): ?>
|
||||
<div class="mb-1" id="div_solapas_ancho">
|
||||
<?php else: ?>
|
||||
<div class="mb-1" id="div_solapas_ancho" style="display:none;">
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="solapas_ancho" class="form-label">
|
||||
<?= lang('Presupuestos.solapasAnchoCubierta') ?>*
|
||||
</label>
|
||||
<input type="number" id="solapas_ancho" name="solapas_ancho" placeholder="0" maxLength="8" step="1" class="form-control solapas_cubierta" value="<?= old('solapas_ancho', $presupuestoEntity->solapas_ancho) ?>">
|
||||
</div><!--//.mb-1 -->
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8 && $tipo_impresion_id != 21) : ?>
|
||||
<?php if($presupuestoEntity->solapas_sobrecubierta == true): ?>
|
||||
<div class="mb-1" id="div_solapas_ancho_sobrecubierta">
|
||||
<?php else: ?>
|
||||
<div class="mb-1" id="div_solapas_ancho_sobrecubierta" style="display:none;">
|
||||
<?php endif; ?>
|
||||
<label for="solapas_ancho_sobrecubierta" class="form-label">
|
||||
<?= lang('Presupuestos.solapasAnchoSobrecubierta') ?>*
|
||||
</label>
|
||||
<input type="number" id="solapas_ancho_sobrecubierta" name="solapas_ancho_sobrecubierta" placeholder="0" maxLength="8" step="1" class="form-control solapas_sobrecubierta" value="<?= old('solapas_ancho', $presupuestoEntity->solapas_ancho_sobrecubierta) ?>">
|
||||
</div><!--//.mb-1 -->
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5><?= lang("Presupuestos.acabadosExteriores") ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<label id="label_acabado_cubierta_id" for="acabado_cubierta_id" class="form-label">
|
||||
<?= lang('Presupuestos.acabadoCubierta') ?>*
|
||||
</label>
|
||||
<select id="acabado_cubierta_id" name="acabado_cubierta_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
<?php if (isset($acabadosCubierta) && is_array($acabadosCubierta) && !empty($acabadosCubierta)) :
|
||||
foreach ($acabadosCubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_cubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8 && $tipo_impresion_id != 21) : ?>
|
||||
<div class="row">
|
||||
<div class="mb-1">
|
||||
<label id="label_acabado_cubierta_id" for="acabado_sobrecubierta_id" class="form-label">
|
||||
<?= lang('Presupuestos.acabadoSobrecubierta') ?>*
|
||||
</label>
|
||||
<select id="acabado_sobrecubierta_id" name="acabado_sobrecubierta_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
|
||||
<?php if (isset($acabadosSobrecubierta) && is_array($acabadosSobrecubierta) && !empty($acabadosSobrecubierta)) :
|
||||
foreach ($acabadosSobrecubierta as $acabado) : ?>
|
||||
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_sobrecubierta_id ? ' selected' : '' ?>>
|
||||
<?= $acabado->label ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
<div class="divider divider-dark text-start mb-1">
|
||||
<div class="divider-text">
|
||||
<h5><?= lang("Presupuestos.opcionesPresupuesto") ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="retractilado" class="form-check-label">
|
||||
<input type="checkbox" id="retractilado" name="retractilado" value="1" class="form-check-input" <?= $presupuestoEntity->retractilado == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.retractilado') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="retractilado5" class="form-check-label">
|
||||
<input type="checkbox" id="retractilado5" name="retractilado_5" value="1" class="form-check-input" <?= $presupuestoEntity->retractilado5 == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.retractilado5') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="fajaColor" class="form-check-label">
|
||||
<input type="checkbox" id="fajaColor" name="faja_color" value="1" class="form-check-input" <?= $presupuestoEntity->faja_color == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.fajaColor') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="prototipo" class="form-check-label">
|
||||
<input type="checkbox" id="prototipo" name="prototipo" value="1" class="form-check-input" <?= $presupuestoEntity->prototipo == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.prototipo') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="ferro" class="form-check-label">
|
||||
<input type="checkbox" id="ferro" name="ferro" value="1" class="form-check-input" <?= $presupuestoEntity->ferro == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.ferro') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="ferroDigital" class="form-check-label">
|
||||
<input type="checkbox" id="ferroDigital" name="ferro_digital" value="1" class="form-check-input" <?= $presupuestoEntity->ferro_digital == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.ferroDigital') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="marcapaginas" class="form-check-label">
|
||||
<input type="checkbox" id="marcapaginas" name="marcapaginas" value="1" class="form-check-input" <?= $presupuestoEntity->marcapaginas == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Presupuestos.marcapaginas') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS comportamiento general pag. -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
$('#papelFormatoId').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
var ancho_libro = getDimensionLibro().ancho;
|
||||
var alto_libro = getDimensionLibro().alto;
|
||||
|
||||
$('#retractilado').on("change", function () {
|
||||
checkRetractiladoComparador(this);
|
||||
servicioRetractilado()
|
||||
});
|
||||
|
||||
|
||||
$('#retractilado5').on("change", function () {
|
||||
checkRetractiladoComparador(this);
|
||||
servicioRetractilado5()
|
||||
});
|
||||
|
||||
$('#fajaColor').on("change", function () {
|
||||
servicioFajaColor()
|
||||
});
|
||||
|
||||
$('#ferro').on("change", function () {
|
||||
servicioFerro()
|
||||
});
|
||||
|
||||
$('#prototipo').on("change", function () {
|
||||
servicioPrototipo()
|
||||
servicioFerro()
|
||||
});
|
||||
|
||||
|
||||
$('#papelFormatoId').on('select2:select', event_change_formato)
|
||||
$('.formato_libro').on('change', event_change_formato)
|
||||
|
||||
function event_change_formato(){
|
||||
ancho_libro = getDimensionLibro().ancho;
|
||||
alto_libro = getDimensionLibro().alto;
|
||||
|
||||
|
||||
// Si es negro o color
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
$('#compPaginasNegro').trigger('change')
|
||||
}
|
||||
// Si es negrohq o colorhq
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
$('#compPaginasNegrohq').trigger('change');
|
||||
}
|
||||
|
||||
$('.solapas_cubierta').trigger('change')
|
||||
$('.solapas_sobrecubierta').trigger('change')
|
||||
|
||||
checkPaginasPresupuesto()
|
||||
|
||||
updatePresupuesto({
|
||||
update_lineas: true,
|
||||
update_servicios: true,
|
||||
update_envios: true,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
//updateLineasPresupuesto()
|
||||
//update_servicios(false)
|
||||
}
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
|
||||
$("#solapas").on("click", function () {
|
||||
var e = document.getElementById('div_solapas_ancho');
|
||||
if (document.getElementById('solapas').checked) {
|
||||
e.style.display = "block";
|
||||
}
|
||||
else {
|
||||
e.style.display = "none";
|
||||
$('#solapas_ancho').val(0)
|
||||
}
|
||||
|
||||
$('#serv_default').click()
|
||||
});
|
||||
<?php endif; ?>
|
||||
|
||||
$("#solapas_sobrecubierta").on("click", function () {
|
||||
var e = document.getElementById('div_solapas_ancho_sobrecubierta');
|
||||
if (document.getElementById('solapas_sobrecubierta').checked) {
|
||||
e.style.display = "block";
|
||||
}
|
||||
else {
|
||||
e.style.display = "none";
|
||||
$('#solapas_ancho_sobrecubierta').val(0)
|
||||
}
|
||||
|
||||
$('#serv_default').click()
|
||||
});
|
||||
|
||||
let initTamanioPersonalizado = <?php echo ($presupuestoEntity->papel_formato_personalizado==true?1:0); ?>;
|
||||
if(initTamanioPersonalizado != null){
|
||||
if ( initTamanioPersonalizado){
|
||||
$('#papelFormatoId').next(".select2-container").hide();
|
||||
}
|
||||
}
|
||||
<?= $this->endSection() ?>
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,176 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionDatosPresupuesto">
|
||||
<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="#accordionDatosPresupuestoTip" aria-expanded="false" aria-controls="accordionDatosPresupuestoTip">
|
||||
<h4><?= lang("Presupuestos.datosPresupuesto") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionDatosPresupuestoTip" class="accordion-collapse collapse show" data-bs-parent="#accordionDatosPresupuesto">
|
||||
<div class="accordion-body">
|
||||
|
||||
<!-- Fila 1 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="id" class="form-label">
|
||||
<?= lang('Presupuestos.id') ?>
|
||||
</label>
|
||||
<input readonly style="background: #E8E8E8;" id="id" name="id" maxLength="12" class="form-control" value="<?= old('id', $presupuestoEntity->id) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="created_at" class="form-label">
|
||||
<?= lang('Presupuestos.created_at') ?>
|
||||
</label>
|
||||
<?php if(str_contains($formAction,'edit')): ?>
|
||||
<input readonly style="background: #E8E8E8;" id="updated_at" name="updated_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->updated_at)) ? date ('d/m/Y', strtotime($presupuestoEntity->updated_at)) : "") ?>">
|
||||
<?php else: ?>
|
||||
<input readonly style="background: #E8E8E8;" id="created_at" name="created_at" maxLength="12" class="form-control" value="<?= old('created_at', (isset($presupuestoEntity->created_at)) ? date ('d/m/Y', strtotime($presupuestoEntity->created_at)) : "") ?>">
|
||||
<?php endif; ?>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="estadoId" class="form-label">
|
||||
<?= lang('Presupuestos.presupuestoEstado') ?>
|
||||
</label>
|
||||
<select disabled id="estadoId" name="estado_id" maxLength="11" style="background-color: #E8E8E8;" class="form-control" value="<?= old(1, $presupuestoEntity->estado_id) ?>">
|
||||
<option value=1><?=lang('Presupuestos.presupuestoEstadoBorrador') ?></option>
|
||||
<option value=2><?=lang('Presupuestos.presupuestoEstadoAceptado') ?></option>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="incRei" class="form-label">
|
||||
<?= lang('Presupuestos.incRei') ?>
|
||||
</label>
|
||||
<select id="incRei" name="inc_rei" maxLength="11" class="form-control" value="<?= old('inc_rei', $presupuestoEntity->inc_rei) ?>">
|
||||
<?php if (isset($incReiList) && is_array($incReiList) && !empty($incReiList)) : ?>
|
||||
<option> </option>
|
||||
<?php foreach ($incReiList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->inc_rei ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
</div> <!--//.row -->
|
||||
|
||||
<!-- Fila 2 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="titulo" class="form-label">
|
||||
<?=lang('Presupuestos.titulo') ?>*
|
||||
</label>
|
||||
<input type="text" id="titulo" name="titulo" maxLength="300" class="form-control" value="<?=old('titulo', $presupuestoEntity->titulo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="autor" class="form-label">
|
||||
<?=lang('Presupuestos.autor') ?>
|
||||
</label>
|
||||
<input type="text" id="autor" name="autor" maxLength="150" class="form-control" value="<?=old('autor', $presupuestoEntity->autor) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
|
||||
<!-- Fila 3 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="coleccion" class="form-label">
|
||||
<?=lang('Presupuestos.coleccion') ?>
|
||||
</label>
|
||||
<input type="text" id="coleccion" name="coleccion" maxLength="255" class="form-control" value="<?=old('coleccion', $presupuestoEntity->coleccion) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="numeroEdicion" class="form-label">
|
||||
<?=lang('Presupuestos.numeroEdicion') ?>
|
||||
</label>
|
||||
<input type="text" id="numeroEdicion" name="numero_edicion" maxLength="50" class="form-control" value="<?=old('numero_edicion', $presupuestoEntity->numero_edicion) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="isbn" class="form-label">
|
||||
<?=lang('Presupuestos.isbn') ?>
|
||||
</label>
|
||||
<input type="text" id="isbn" name="isbn" maxLength="50" class="form-control" value="<?=old('isbn', $presupuestoEntity->isbn) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="paisId" class="form-label">
|
||||
<?=lang('Presupuestos.paisId') ?>*
|
||||
</label>
|
||||
<select id="paisId" name="pais_id" class="form-control select2bs" style="width: 100%;" >
|
||||
<option value=""><?=lang('Basic.global.pleaseSelectA', [lang('Presupuestos.paisId')]) ?></option>
|
||||
<?php foreach ($paisList as $item) : ?>
|
||||
<option value="<?=$item->id ?>"<?=$item->id==$presupuestoEntity->pais_id ? ' selected':'' ?>>
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
|
||||
<!-- Fila 3 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="clienteId" class="form-label">
|
||||
<?= lang('Presupuestos.clienteId') ?>*
|
||||
</label>
|
||||
<select id="clienteId" name="cliente_id" class="form-control select2bs2" style="width: 100%;">
|
||||
|
||||
<?php if (isset($clienteList) && is_array($clienteList) && !empty($clienteList)) :
|
||||
foreach ($clienteList as $k => $v) : ?>
|
||||
<option value="<?= $k ?>" <?= $k == $presupuestoEntity->cliente_id ? ' selected' : '' ?>>
|
||||
<?= $v ?>
|
||||
</option>
|
||||
<?php endforeach;
|
||||
endif; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="referenciaCliente" class="form-label">
|
||||
<?=lang('Presupuestos.referenciaCliente') ?>
|
||||
</label>
|
||||
<input type="text" id="referenciaCliente" name="referencia_cliente" maxLength="100" class="form-control" value="<?=old('referencia_cliente', $presupuestoEntity->referencia_cliente) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
</div> <!--//.row -->
|
||||
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,359 @@
|
||||
<div class="accordion accordion-bordered 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="row">
|
||||
<div class="col-md-12 col-lg-4 py-4">
|
||||
<button id="serv_default" type="button" class="btn btn-secondary waves-effect waves-light float-start"><?= lang("Presupuestos.serviciosDefault")?></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-align-top mb-4">
|
||||
<ul class="nav nav-pills mb-3 nav-servicios" 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>
|
||||
<li class="nav-item">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#servicios-extra"
|
||||
aria-controls="servicios-extra"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.servicioExtra") ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content border border-container">
|
||||
<div class="tab-pane fade show active" id="servicios-acabado" role="tabpanel">
|
||||
<div id="serv-acabado-alert">
|
||||
</div>
|
||||
<div id="serv-acabado-error">
|
||||
</div>
|
||||
<table id="tableOfServiciosAcabado" class="table table-striped table-hover tiradas-alternativas update-resumen-presupuesto" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Presupuestos.id') ?></th>
|
||||
<th><?= lang('Tarifaacabado.tarifaacabado') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row mb-3 px-4">
|
||||
<div class="col-md-12 col-lg-4 py-4">
|
||||
<select id="add_servicio_acabado_list" class="select2bs2" style="width: 100%;">
|
||||
<option></option>
|
||||
<?php foreach ($serviciosAcabado as $item) : ?>
|
||||
<option value="<?= $item->value ?>" >
|
||||
<?= $item->label ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4 px-2 py-4">
|
||||
<button id="insertar_serv_acabado" type="button" class="btn btn-secondary waves-effect waves-light float-start tiradas-alternativas"><?= lang("Presupuestos.insertar")?></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="servicios-preimpresion" role="tabpanel">
|
||||
<div id="serv-preimpresion-alert">
|
||||
</div>
|
||||
<div id="serv-preimpresion-error">
|
||||
</div>
|
||||
<table id="tableOfServiciosPreimpresion" class="table table-striped table-hover tiradas-alternativas update-resumen-presupuesto" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Presupuestos.id') ?></th>
|
||||
<th><?= lang('Tarifapreimpresion.tarifapreimpresion') ?></th>
|
||||
<th><?= lang('Presupuestos.precio') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row mb-3 px-4">
|
||||
<div class="col-md-12 col-lg-4 py-4">
|
||||
<select id="add_servicio_preimpresion_list" class="select2bs2" style="width: 100%;">
|
||||
<option></option>
|
||||
<?php foreach ($serviciosPreimpresion as $item) : ?>
|
||||
<option value="<?= $item->value ?>" >
|
||||
<?= $item->label ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4 px-2 py-4">
|
||||
<button id="insertar_serv_preimpresion" type="button" class="btn btn-secondary waves-effect waves-light float-start tiradas-alternativas"><?= lang("Presupuestos.insertar")?></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="servicios-encuadernacion" role="tabpanel">
|
||||
<div id="serv-enc-alert">
|
||||
</div>
|
||||
<div id="serv-enc-error">
|
||||
</div>
|
||||
|
||||
<table id="tableOfServiciosEncuadernacion" class="table dt-responsive dataTable tiradas-alternativas update-resumen-presupuesto" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Presupuestos.id') ?></th>
|
||||
<th><?= lang('Presupuestos.tarifa') ?></th>
|
||||
<th><?= lang('Proveedores.proveedor') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.tiempo') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row mb-3 px-4">
|
||||
<div class="col-md-12 col-lg-4 py-4">
|
||||
<select id="add_servicio_enc_list" class="select2bs2" style="width: 100%;">
|
||||
<option></option>
|
||||
<?php foreach ($serviciosEncuadernacion as $item) : ?>
|
||||
<option value="<?= $item->value ?>" >
|
||||
<?= $item->label ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4 px-2 py-4">
|
||||
<button id="insertar_serv_enc" type="button" class="btn btn-secondary waves-effect waves-light float-start tiradas-alternativas"><?= lang("Presupuestos.insertar")?></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="servicios-manipulado" role="tabpanel">
|
||||
<div id="serv-manipulado-alert">
|
||||
</div>
|
||||
<div id="serv-manipulado-error">
|
||||
</div>
|
||||
<table id="tableOfServiciosManipulado" class="table table-striped table-hover tiradas-alternativas update-resumen-presupuesto" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Presupuestos.id') ?></th>
|
||||
<th><?= lang('Tarifamanipulado.tarifamanipulado') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row mb-3 px-4">
|
||||
<div class="col-md-12 col-lg-4 py-4">
|
||||
<select id="add_servicio_manipulado_list" class="select2bs2" style="width: 100%;">
|
||||
<option></option>
|
||||
<?php foreach ($serviciosManipulado as $item) : ?>
|
||||
<option value="<?= $item->value ?>" >
|
||||
<?= $item->label ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4 px-2 py-4">
|
||||
<button id="insertar_serv_manipulado" type="button" class="btn btn-secondary waves-effect waves-light float-start tiradas-alternativas"><?= lang("Presupuestos.insertar")?></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="servicios-extra" role="tabpanel">
|
||||
<div id="serv-extra-alert">
|
||||
</div>
|
||||
<div id="serv-extra-error">
|
||||
</div>
|
||||
<table id="tableOfServiciosExtra" class="table table-striped table-hover tiradas-alternativas update-resumen-presupuesto" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Presupuestos.id') ?></th>
|
||||
<th><?= lang('Tarifaextra.tarifaextra') ?></th>
|
||||
<th><?= lang('Presupuestos.precio') ?></th>
|
||||
<th></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row mb-3 px-4">
|
||||
<div class="col-md-12 col-lg-4 py-4">
|
||||
<select id="add_servicio_extra_list" class="select2bs2" style="width: 100%;">
|
||||
<option></option>
|
||||
<?php foreach ($serviciosExtra as $item) : ?>
|
||||
<option value="<?= $item->value ?>" >
|
||||
<?= $item->label ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-4 px-2 py-4">
|
||||
<button id="insertar_serv_extra" type="button" class="btn btn-secondary waves-effect waves-light float-start tiradas-alternativas"><?= lang("Presupuestos.insertar")?></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
// Generación de la lista de servicios de acabado (id, nombre)
|
||||
window.acabadosList = <?php echo json_encode($serviciosAcabado); ?>;
|
||||
window.serviciosacabadosList = <?php echo json_encode($serviciosAcabadosList); ?>;
|
||||
window.serviciosAutomaticos = <?php echo json_encode($serviciosAutomaticos); ?>;
|
||||
|
||||
window.serviciosencuadernadosList = <?php echo json_encode($serviciosEncuadernacionList); ?>;
|
||||
|
||||
window.serviciosmanipuladoList = <?php echo json_encode($serviciosManipuladoList); ?>;
|
||||
|
||||
window.serviciospreimpresionList = <?php echo json_encode($serviciosPreimpresionList); ?>;
|
||||
|
||||
window.serviciosextraList = <?php echo json_encode($serviciosExtraList); ?>;
|
||||
|
||||
window.routes_servicios = {
|
||||
dataTableOfPresupuestoAcabados: "<?=route_to('dataTableOfPresupuestoAcabados') ?>",
|
||||
dataTableOfPresupuestoPreimpresion: "<?=route_to('dataTableOfPresupuestoPreimpresiones') ?>",
|
||||
dataTableOfPresupuestoEncuadernaciones: "<?=route_to('dataTableOfPresupuestoEncuadernaciones') ?>",
|
||||
dataTableOfPresupuestoManipulados: "<?=route_to('dataTableOfPresupuestoManipulados') ?>",
|
||||
menuItemsOfPresupuestoEncuadernaciones: '<?= route_to("menuItemsOfPresupuestoEncuadernaciones") ?>',
|
||||
dataTableOfPresupuestoServiciosExtra: "<?=route_to('dataTableOfPresupuestoServiciosExtra') ?>",
|
||||
}
|
||||
|
||||
init_servicio_acabado()
|
||||
|
||||
init_servicio_encuadernado()
|
||||
|
||||
init_servicio_manipulado()
|
||||
|
||||
init_servicio_preimpresion()
|
||||
|
||||
init_servicio_extra()
|
||||
|
||||
$('.solapas_cubierta').on('change', function(){
|
||||
|
||||
const ancho_libro = getDimensionLibro().ancho;
|
||||
|
||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||
// solapas <= ancho_libro - 10
|
||||
const limite_2 = ancho_libro - 10;
|
||||
const limite = Math.min(limite_1, limite_2);
|
||||
|
||||
if(parseInt($('#solapas_ancho').val()) > limite){
|
||||
$('#solapas_ancho').val(limite)
|
||||
asyncMessageDialog(
|
||||
window.Presupuestos.advertencia,
|
||||
window.Presupuestos.actualizacionSolapasCubierta,
|
||||
function(){});
|
||||
}
|
||||
|
||||
$('#compGramajeCubierta').trigger('change')
|
||||
})
|
||||
|
||||
|
||||
$('.solapas_sobrecubierta').on('change', function(){
|
||||
|
||||
const ancho_libro = getDimensionLibro().ancho;
|
||||
|
||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||
// solapas <= ancho_libro - 10
|
||||
const limite_2 = ancho_libro - 10;
|
||||
const limite = Math.min(limite_1, limite_2);
|
||||
|
||||
if(parseInt($('#solapas_ancho_sobrecubierta').val()) > limite){
|
||||
$('#solapas_ancho_sobrecubierta').val(limite)
|
||||
asyncMessageDialog(
|
||||
window.Presupuestos.advertencia,
|
||||
window.Presupuestos.actualizacionSolapasSobrecubierta,
|
||||
function(){});
|
||||
}
|
||||
|
||||
$('#compGramajeSobrecubierta').trigger('change')
|
||||
})
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,102 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionLineasPresupuesto">
|
||||
<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="#accordionLineasPresupuestoTip" aria-expanded="false" aria-controls="accordionLineasPresupuestoTip">
|
||||
<h4><?= lang("Presupuestos.lineasPresupuesto") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionLineasPresupuestoTip" class="accordion-collapse collapse show" data-bs-parent="#accordionLineasPresupuesto">
|
||||
<div class="accordion-body">
|
||||
|
||||
<!----------------------------------------------------------------------------->
|
||||
<div id="divAlarmasLineasPresupuesto"></div>
|
||||
<!----------------------------------------------------------------------------->
|
||||
|
||||
<table id="tableLineasPresupuesto" class="comparator-table table dt-responsive dataTable tiradas-alternativas update-resumen-presupuesto" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10px"></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th class="lp-header" width="33px"></th>
|
||||
<th class="lp-header" style="max-width:80px;"><?= lang('Presupuestos.paginas') ?></th>
|
||||
<th class="lp-header"><?= lang('Presupuestos.papel') ?></th>
|
||||
<th class="lp-header" width="100px"><?= lang('Presupuestos.gramaje') ?></th>
|
||||
<th class="lp-header"><?= lang('Presupuestos.marca') ?></th>
|
||||
<th class="lp-header"><?= lang('Presupuestos.maquina') ?></th>
|
||||
<th class="lp-header" width="100px"><?= lang('Presupuestos.tiempo') ?></th>
|
||||
<th class="lp-header" width="100px"><?= lang('Presupuestos.lomo') ?></th>
|
||||
<th class="lp-header" width="100px"><?= lang('Presupuestos.peso') ?></th>
|
||||
<th class="lp-header" width="100px"><?= lang('Presupuestos.totalLinea') ?></th>
|
||||
<th style="max-width:40px;"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-12 col-lg-9 px-4'></div>
|
||||
<div class='col-md-12 col-lg-3 px-4'>
|
||||
<div class="input-group">
|
||||
<label id="btn_addLinea" class="btn btn-outline-primary waves-effect" ><?= lang('Presupuestos.addLineaPresupuesto') ?></label>
|
||||
<select class="form-select" id="addLineasPresupuesto" data-native-menu="false">
|
||||
<option value="lp_bn"><?= lang('Presupuestos.bn') ?></option>
|
||||
<option value="lp_bnhq"><?= lang('Presupuestos.bnhq') ?></option>
|
||||
<option value="lp_color"><?= lang('Presupuestos.color') ?></option>
|
||||
<option value="lp_colorhq"><?= lang('Presupuestos.colorhq') ?></option>
|
||||
<option value="lp_rot_bn"><?= lang('Presupuestos.rotativa_bn') ?></option>
|
||||
<option value="lp_rot_color"><?= lang('Presupuestos.rotativa_color') ?></option>
|
||||
<option value="lp_cubierta"><?= lang('Presupuestos.cubierta') ?></option>
|
||||
<option value="lp_sobrecubierta"><?= lang('Presupuestos.sobrecubierta') ?></option>
|
||||
<option value="lp_guardas"><?= lang('Presupuestos.Guardas') ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS de las lineas de presupuesto. -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
window.papelGenericoNegroList = <?php echo json_encode($papelGenericoNegroList); ?>;
|
||||
window.papelGenericoNegroHQList = <?php echo json_encode($papelGenericoNegroHQList); ?>;
|
||||
window.papelGenericoColorList = <?php echo json_encode($papelGenericoColorList); ?>;
|
||||
window.papelGenericoColorHQList = <?php echo json_encode($papelGenericoColorHQList); ?>;
|
||||
window.papelGenericoCubiertaList = <?php echo json_encode($papelGenericoCubiertaList); ?>;
|
||||
window.papelGenericoSobrecubiertaList = <?php echo json_encode($papelGenericoSobrecubiertaList); ?>;
|
||||
window.papelGenericoRotativaNegroList = <?php echo json_encode($papelGenericoRotativaNegroList); ?>;
|
||||
window.papelGenericoRotativaColorList = <?php echo json_encode($papelGenericoRotativaColorList); ?>;
|
||||
|
||||
<?php if($tipo_impresion_id == 1 || $tipo_impresion_id == 3 || $tipo_impresion_id == 5 || $tipo_impresion_id == 7): ?>
|
||||
window.papelGenericoGuardasList = <?php echo json_encode($papelGenericoGuardasList); ?>;
|
||||
<?php endif; ?>
|
||||
|
||||
window.lineasPresupuestoList = <?php echo json_encode($lineasPresupuesto); ?>;
|
||||
|
||||
window.routes_lp = {
|
||||
menuItemsOfCosidotapablanda: '<?= route_to("menuItemsOfCosidotapablanda") ?>',
|
||||
updateDataOfCosidotapablanda: '<?= route_to("updateDataOfCosidotapablanda") ?>',
|
||||
|
||||
}
|
||||
|
||||
fill_lp_from_bbdd()
|
||||
|
||||
checkPaginasPresupuesto()
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,398 @@
|
||||
<div id="addressForm" action='create' class="modal fade addModal">
|
||||
<div class="modal-dialog modal-lg modal-simple">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 id="labelTitleConfirmDialog" class="modal-title"><?= lang('PresupuestosDirecciones.direccionTitle') ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div id='error-tarifa'></div>
|
||||
<div class="mb-3">
|
||||
<label for="add_clientedAdd" class="form-label">
|
||||
<?=lang('PresupuestosDirecciones.clientedAdd') ?>*
|
||||
</label>
|
||||
<select id="add_clientedAdd" class="form-control select2bs" style="width: 100%;" >
|
||||
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="add_cantidad" class="form-label">
|
||||
<?= lang('PresupuestosDirecciones.cantidad') ?>*
|
||||
</label>
|
||||
<input type="number" id="add_cantidad" class="form-control">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="add_att" class="form-label">
|
||||
<?= lang('PresupuestosDirecciones.att') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_att" maxLength="100" class="form-control new-address">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="add_email" class="form-label">
|
||||
<?= lang('PresupuestosDirecciones.email') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_email" maxLength="100" class="form-control new-address">
|
||||
</div><!--//.mb-3 -->
|
||||
<div class="mb-3">
|
||||
<label for="add_direccion" class="form-label">
|
||||
<?= lang('PresupuestosDirecciones.direccion') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_direccion" maxLength="255" class="form-control new-address">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="add_pais_id" class="form-label">
|
||||
<?=lang('PresupuestosDirecciones.pais') ?>*
|
||||
</label>
|
||||
<select id="add_pais_id" class="form-control select2bs new-address" style="width: 100%;" >
|
||||
<option value="" disabled selected><?=lang('PresupuestosDirecciones.selectPais') ?></option>
|
||||
<?php foreach ($paisList as $item) : ?>
|
||||
<option value="<?=$item->id ?>"<?=$item->id==1 ? ' selected':'' ?>>
|
||||
<?=$item->nombre ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
|
||||
<div class='row'>
|
||||
|
||||
<div id='divMunicipio' class="col-md-12 col-lg-12 pl-4">
|
||||
<div class="mb-3">
|
||||
<label for="add_municipio" class="form-label">
|
||||
<?=lang('PresupuestosDirecciones.municipio') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_municipio" maxLength="100" class="form-control new-address">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4 spain-data" style="display: none;">
|
||||
<div class="mb-3">
|
||||
<label for="add_provincia" class="form-label">
|
||||
<?=lang('PresupuestosDirecciones.provincia') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_provincia" maxLength="100" class="form-control new-address">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
</div> <!-- //.row -->
|
||||
|
||||
<div class='row'>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4">
|
||||
<div class="mb-3">
|
||||
<label for="add_cp" class="form-label">
|
||||
<?=lang('PresupuestosDirecciones.cp') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_cp" maxLength="100" class="form-control new-address">
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4">
|
||||
<div class="mb-3">
|
||||
<label for="add_telefono" class="form-label">
|
||||
<?=lang('PresupuestosDirecciones.telefono') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_telefono" maxLength="100" class="form-control new-address"></input>
|
||||
</div><!--//.mb-3 -->
|
||||
</div>
|
||||
|
||||
</div> <!-- //.row -->
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="add_entregaPieCalle" name="add_entregaPieCalle" value="1" >
|
||||
<label class="form-check-label" for="add_entregaPieCalle"><?= lang('PresupuestosDirecciones.entregaPieCalle') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-6 pl-4">
|
||||
<div class="form-check form-switch mb-2">
|
||||
<input class="form-check-input" type="checkbox" id="add_saveDirection" name="add_saveDirection" value="1" >
|
||||
<label class="form-check-label" for="add_saveDirection"><?= lang('PresupuestosDirecciones.saveDirection') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label style="display:none" for="add_alias" class="form-label save-alias">
|
||||
<?= lang('PresupuestosDirecciones.alias') ?>*
|
||||
</label>
|
||||
<input type="text" id="add_alias" maxLength="100" class="form-control new-address save-alias" style='display: none;'>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button id="saveDireccionEnvio"
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
>Guardar</button>
|
||||
<button id="cancelAdd"
|
||||
type="button"
|
||||
class="btn btn-default"
|
||||
>Cancelar</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
$('#cancelAdd').on('click', function(){
|
||||
$('#addressForm').modal("hide");
|
||||
})
|
||||
|
||||
|
||||
$('#add_cantidad').on('change', function(){
|
||||
if(parseInt($('#add_cantidad').val()) > $('#add_cantidad').attr('max-value'))
|
||||
$('#add_cantidad').val($('#add_cantidad').attr('max-value'))
|
||||
})
|
||||
|
||||
|
||||
$('#saveDireccionEnvio').on('click', function(){
|
||||
|
||||
if(validate_fields()){
|
||||
|
||||
if($('#addressForm').attr('action')=='edit'){
|
||||
tableEnvios.row( $("#addressForm").attr('row') )
|
||||
.remove()
|
||||
.draw();
|
||||
}
|
||||
var peso_total_libro = 0
|
||||
|
||||
tableLineasPresupuesto.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
peso_total_libro += parseFloat(rowData.peso)
|
||||
|
||||
})
|
||||
|
||||
const peso_envio = peso_total_libro*parseInt($('#add_cantidad').val())/1000.0
|
||||
|
||||
|
||||
$.post( '<?= route_to('dataTableOfPresupuestoDirecciones') ?>',
|
||||
{
|
||||
tipo: "get_tarifa",
|
||||
peso: peso_envio,
|
||||
paisId: $("#add_pais_id").val(),
|
||||
cp: $('#add_cp').val(),
|
||||
tipo_envio: $('#add_entregaPieCalle').is(":checked")?'palets':'cajas',
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
})
|
||||
.done(function( data ) {
|
||||
if(data.length >0){
|
||||
|
||||
var precios = []
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if(peso_envio>data[i].peso_max){
|
||||
data[i].precio = (data[i].peso_min + (peso_envio-data[i].peso_min)*data[i].precio_adicional).toFixed(2);
|
||||
}
|
||||
// si no se calcula linealmente
|
||||
else{
|
||||
m=((data[i].precio_max-data[i].precio_min)/(data[i].peso_max-data[i].peso_min))
|
||||
b=data[i].precio_max-m*data[i].peso_max
|
||||
data[i].precio = (m*peso_envio+b).toFixed(2);
|
||||
}
|
||||
data[i].margen = data[i].margen
|
||||
}
|
||||
|
||||
const tarifa_final = data.reduce((previous, current) => {
|
||||
return current.precio < previous.precio ? current : previous;
|
||||
});
|
||||
tarifa_final.cantidad=parseInt($('#add_cantidad').val())
|
||||
tarifa_final.peso=peso_envio
|
||||
|
||||
|
||||
tableEnvios.row
|
||||
.add({
|
||||
'tarifa_id': tarifa_final.id,
|
||||
'cantidad': tarifa_final.cantidad,
|
||||
'peso': tarifa_final.peso.toFixed(3),
|
||||
'att': $('#add_att').val(),
|
||||
'email': $('#add_email').val(),
|
||||
'direccion': $('#add_direccion').val(),
|
||||
'cp': $('#add_cp').val(),
|
||||
'municipio': $('#add_municipio').val(),
|
||||
'provincia': $('#add_provincia').val(),
|
||||
'paisId': $('#add_pais_id').val(),
|
||||
'telefono': $('#add_telefono').val(),
|
||||
'proveedor': tarifa_final.proveedor,
|
||||
'proveedor_id': tarifa_final.proveedor_id,
|
||||
'precio': tarifa_final.precio,
|
||||
'margen': tarifa_final.margen,
|
||||
'entregaPieCalle': $('#add_entregaPieCalle').is(":checked")?1:0,
|
||||
'actionBtns_direcciones': actionBtns_direcciones,
|
||||
})
|
||||
.draw();
|
||||
|
||||
|
||||
// Se guarda la dirección
|
||||
if($('#add_saveDirection').is(":checked") &&
|
||||
$('#add_alias').val().length>0){
|
||||
$.post( '/clientes/clientedirecciones/add',
|
||||
{
|
||||
cliente_id: $('#clienteId').val(),
|
||||
'att': $('#add_att').val(),
|
||||
'email': $('#add_email').val(),
|
||||
'direccion': $('#add_direccion').val(),
|
||||
'cp': $('#add_cp').val(),
|
||||
'municipio': $('#add_municipio').val(),
|
||||
'provincia': $('#add_provincia').val(),
|
||||
'paisId': $('#add_pais_id').val(),
|
||||
'telefono': $('#add_telefono').val(),
|
||||
'alias': $('#add_alias').val(),
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
})
|
||||
.done(function( data ) {
|
||||
|
||||
})
|
||||
}
|
||||
checkInsertar()
|
||||
//updateTotales(false, false, true)
|
||||
updatePresupuesto({
|
||||
update_lineas: false,
|
||||
update_servicios: true,
|
||||
update_envios: false,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: true
|
||||
})
|
||||
$('#addressForm').modal("hide");
|
||||
|
||||
}
|
||||
else{
|
||||
popErrorAlert('<?= lang('PresupuestosDirecciones.validation.no_tarifa') ?>', 'error-tarifa')
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
function validate_fields(){
|
||||
|
||||
$( ".error-text-form" ).remove();
|
||||
|
||||
var returnValue = false
|
||||
|
||||
$("input.new-address").each( function() {
|
||||
if($('#' + this.id).val().length == 0 && $('#' + this.id).css('display') != 'none'){
|
||||
$('#' + this.id).after(
|
||||
"<p style='font-size: 11px !important;" +
|
||||
"padding: 0 !important; " +
|
||||
"color: #b11f1f !important;' " +
|
||||
"class='error-text-form'>" +'<?= lang('PresupuestosDirecciones.validation.required'); ?>' + '</p>')
|
||||
}
|
||||
returnValue = true
|
||||
})
|
||||
return returnValue
|
||||
}
|
||||
|
||||
|
||||
$('#add_saveDirection').change(function() {
|
||||
if(this.checked) {
|
||||
$('.save-alias').css('display', 'inline')
|
||||
}
|
||||
else{
|
||||
$('.save-alias').css('display', 'none')
|
||||
}
|
||||
$('#add_saveDirection').val(this.checked);
|
||||
});
|
||||
|
||||
$('#add_clientedAdd').select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: Infinity,
|
||||
dropdownParent: $('#addressForm'),
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfClienteDirecciones") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function (params) {
|
||||
return {
|
||||
cliente_id: $('#clienteId').val(),
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function (response) {
|
||||
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
|
||||
cache: true
|
||||
}
|
||||
})
|
||||
|
||||
$('#add_clientedAdd').on('select2:select', function (e) {
|
||||
|
||||
$('.save-alias').css('display', 'none')
|
||||
$('#add_alias').val('')
|
||||
$('#add_saveDirection').attr("disabled", true)
|
||||
|
||||
var data = e.params.data;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '<?=route_to('dataTableOfClienteDirecciones') ?>',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
tipo: 'direccion',
|
||||
id: data.id,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
|
||||
},
|
||||
success: function (data) {
|
||||
if(data.length>0){
|
||||
$('#add_att').val(data[0].att)
|
||||
$('#add_direccion').val(data[0].direccion)
|
||||
$('#add_cp').val(data[0].cp)
|
||||
$('#add_municipio').val(data[0].municipio)
|
||||
$('#add_provincia').val(data[0].provincia)
|
||||
$('#add_telefono').val(data[0].telefono)
|
||||
$('#add_email').val(data[0].email)
|
||||
$('#add_pais_id').val(data[0].pais_id).change();
|
||||
}
|
||||
yeniden(data.<?= csrf_token() ?>);
|
||||
|
||||
return true;
|
||||
},
|
||||
error: function(e){
|
||||
return false;
|
||||
}
|
||||
})
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.new-address').on('change', function(e){
|
||||
if (e.originalEvent) {
|
||||
// user-triggered event
|
||||
$('#add_clientedAdd').val(null).trigger('change');
|
||||
$('#add_saveDirection').removeAttr("disabled");
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
// clear modal items when close
|
||||
$('#addressForm').on('hidden.bs.modal', function () {
|
||||
$('#add_alias').val("")
|
||||
$('#add_att').val("")
|
||||
$('#add_email').val("")
|
||||
$('#add_direccion').val("")
|
||||
$("#add_pais_id").val(1).change()
|
||||
$("#add_clientedAdd").val("").change()
|
||||
$('#add_municipio').val("")
|
||||
$('#add_provincia').val("")
|
||||
$('#add_cp').val("")
|
||||
$('#add_telefono').val("")
|
||||
$('#add_saveDirection').prop('checked', false)
|
||||
$('#add_entregaPieCalle').prop('checked', false)
|
||||
})
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -0,0 +1,91 @@
|
||||
async function updatePresupuesto(
|
||||
{
|
||||
update_lineas = false,
|
||||
update_servicios = false,
|
||||
update_envios = false,
|
||||
update_resumen = false,
|
||||
update_tiradas_alternativas = false
|
||||
}) {
|
||||
|
||||
new Promise(
|
||||
async function(resolve, reject){
|
||||
if(update_lineas){
|
||||
await updateLineasPresupuesto()
|
||||
}
|
||||
else
|
||||
resolve()
|
||||
}
|
||||
).then(function(){
|
||||
new Promise(
|
||||
async function(resolve, reject){
|
||||
if(update_servicios){
|
||||
await actualizar_servicios()
|
||||
}
|
||||
else
|
||||
resolve()
|
||||
}
|
||||
)
|
||||
}).then(function(){
|
||||
new Promise(
|
||||
function(resolve, reject){
|
||||
if(update_envios){
|
||||
updateTablaEnvios()
|
||||
}
|
||||
else
|
||||
resolve()
|
||||
}
|
||||
)
|
||||
}).then(function(){
|
||||
new Promise(
|
||||
function(resolve, reject){
|
||||
if(update_resumen){
|
||||
updateTotales()
|
||||
}
|
||||
else
|
||||
resolve()
|
||||
}
|
||||
)
|
||||
}).then(function(){
|
||||
new Promise(
|
||||
async function(resolve, reject){
|
||||
if(update_tiradas_alternativas){
|
||||
await actualizar_tiradas_alternativas()
|
||||
}
|
||||
else
|
||||
resolve()
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
async function updateLineasPresupuesto(){
|
||||
|
||||
$('#tableLineasPresupuesto tbody tr:visible ').each(async function(){
|
||||
|
||||
if(this.id.endsWith('lp_bn')){
|
||||
await calcularPresupuesto_bn({}, true);
|
||||
}
|
||||
else if(this.id.endsWith('lp_bnhq')){
|
||||
await calcularPresupuesto_bnhq({}, true);
|
||||
}
|
||||
else if(this.id.endsWith('lp_color')){
|
||||
await calcularPresupuesto_color({}, true);
|
||||
}
|
||||
else if(this.id.endsWith('lp_colorhq')){
|
||||
await calcularPresupuesto_colorhq({}, true);
|
||||
}
|
||||
else if(this.id.endsWith('lp_rot_bn')){
|
||||
await calcularPresupuesto_rot_bn(false, true, {})
|
||||
}
|
||||
else if(this.id.endsWith('lp_rot_color')){
|
||||
await calcularPresupuesto_rot_color(false, true, {})
|
||||
}
|
||||
else if(this.id.endsWith('_cubierta')){
|
||||
await calcularPresupuesto_cubierta(false, {})
|
||||
}
|
||||
else if(this.id.endsWith('_guardas')){
|
||||
await calcularPresupuesto_guardas(false, {})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
986
ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_previewItems.php
Executable file
986
ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_previewItems.php
Executable file
@ -0,0 +1,986 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordionPreview">
|
||||
<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="#accordionPreviewTip" aria-expanded="false"
|
||||
aria-controls="accordionPreviewTip">
|
||||
<h4><?= lang("Presupuestos.preview") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionPreviewTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionPreview">
|
||||
<div class="accordion-body">
|
||||
<div class="nav-align-top mb-4">
|
||||
<ul class="nav nav-pills mb-3" role="tablist">
|
||||
<li id="tab-pv-bn" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_bn"
|
||||
aria-controls="pv_bn"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.preview-conf-bn") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-bnhq" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_bnhq"
|
||||
aria-controls="pv_bnhq"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.preview-conf-bn-hq") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-color" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_color"
|
||||
aria-controls="pv_color"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.preview-conf-color") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-colorhq" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_colorhq"
|
||||
aria-controls="pv_colorhq"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.preview-conf-color-hq") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-rot-bn" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_rot_bn"
|
||||
aria-controls="pv_rot_bn"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.preview-conf-rot-bn") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-rot-color" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_rot_color"
|
||||
aria-controls="pv_rot_color"
|
||||
aria-selected="true">
|
||||
<?= lang("Presupuestos.preview-conf-rot-color") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-guardas" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_guardas"
|
||||
aria-controls="pv_guardas"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.previewConfiguracionGuardas") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-cubierta" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_cubierta"
|
||||
aria-controls="pv_cubierta"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.previewConfiguracionCubierta") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-esquema-cubierta" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_esquema_cubierta"
|
||||
aria-controls="pv_esquema_cubierta"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.previewEsquemaCubierta") ?>
|
||||
</button>
|
||||
</li>
|
||||
<li id="tab-pv-sobrecubierta" class="nav-item" style="display: none">
|
||||
<button
|
||||
type="button"
|
||||
class="nav-link"
|
||||
role="tab"
|
||||
data-bs-toggle="tab"
|
||||
data-bs-target="#pv_sobrecubierta"
|
||||
aria-controls="pv_sobrecubierta"
|
||||
aria-selected="false">
|
||||
<?= lang("Presupuestos.previewConfiguracionSobrecubierta") ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content border border-container">
|
||||
<div class="tab-pane fade" id="pv_bn" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_bn_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_bn_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_bn_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_bn_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_bn_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_bn_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_bn_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_bn_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_bn_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_bn_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_bn_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_bnhq" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_bnhq_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_bnhq_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_bnhq_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_bnhq_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_bnhq_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_bnhq_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_bnhq_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_bnhq_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_bnhq_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_bnhq_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_bnhq_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_color" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_color_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_color_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_color_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_color_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_color_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_color_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_color_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_color_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_color_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_color_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_color_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_colorhq" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_colorhq_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_colorhq_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_colorhq_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_colorhq_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_colorhq_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_colorhq_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_colorhq_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_colorhq_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_colorhq_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_colorhq_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_colorhq_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_rot_bn" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_bn_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_bn_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_bn_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_rot_bn_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_rot_bn_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_rot_bn_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_rot_bn_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_rot_bn_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_rot_bn_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaRotativa") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_rot_bn_shape" class="draw-rot-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_rot_color" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_color_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_color_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_color_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button"
|
||||
class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_rot_color_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_rot_color_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_rot_color_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_rot_color_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_rot_color_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_rot_color_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaRotativa") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_rot_color_shape" class="draw-rot-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_guardas" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_guardas_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_guardas_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_guardas_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_guardas_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_guardas_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_guardas_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_guardas_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_guardas_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_guardas_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_guardas_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_guardas_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_cubierta" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_cubierta_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_cubierta_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_cubierta_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_cubierta_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_cubierta_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold pv-solapas"><?= lang("Presupuestos.previewSolapas") ?></dt>
|
||||
<dd id="pv_cubierta_solapas" class="col-sm-6 text-left pv-solapas">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_cubierta_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_cubierta_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_cubierta_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_cubierta_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_cubierta_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewCubierta") ?></h6>
|
||||
|
||||
<div id="pv-cubierta-container">
|
||||
<div id="pv_cubierta_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_esquema_cubierta" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_ec_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_ec_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_ec_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id='pv_ec_libro' class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLomo") ?></dt>
|
||||
<dd id='pv_ec_lomo' class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold pv-solapas"><?= lang("Presupuestos.previewSolapas") ?></dt>
|
||||
<dd id='pv_ec_solapas' class="col-6 text-left pv-solapas">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewConfiguracionEsquemaCubierta") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_ec_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="pv_sobrecubierta" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_sobrecubierta_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelGenerico") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_sobrecubierta_pi" href="#" sk-url="<?= site_url('configuracion/papelesimpresion/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewPapelCompra") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<a id="pv_sobrecubierta_mi" href="#" sk-url="<?= site_url('configuracion/maquinas/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
<button type="button" class="btn btn-label-primary">
|
||||
<?= lang("Presupuestos.previewAreaImpresion") ?>
|
||||
</button>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="mx-n4"/>
|
||||
|
||||
<!-- Detalles del presupuesto -->
|
||||
<h6><?= lang("Presupuestos.previewDetalles") ?></h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewGramaje") ?></dt>
|
||||
<dd id="pv_sobrecubierta_gramaje" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_sobrecubierta_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold pv-solapas"><?= lang("Presupuestos.previewSolapas") ?></dt>
|
||||
<dd id="pv_sobrecubierta_solapas" class="col-sm-6 text-left pv-solapas">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_sobrecubierta_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewAreaImpresion") ?></dt>
|
||||
<dd id="pv_sobrecubierta_maquina_impresion" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_sobrecubierta_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_sobrecubierta_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_sobrecubierta_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewSobrecubierta") ?></h6>
|
||||
|
||||
<div id="pv-cubierta-container">
|
||||
<div id="pv_sobrecubierta_shape" class="draw-shapes"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
<!------------------------------------------------------->
|
||||
<!-- Código JS comportamiento ?????. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
$('#tab-pv-bn').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('bn', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-bnhq').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('bnhq', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-color').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('color', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-colorhq').on( "click", function() {
|
||||
|
||||
|
||||
previewInteriorPlana('colorhq', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-rot-bn').on( "click", function() {
|
||||
|
||||
previewRotativa('rot_bn', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-rot-color').on( "click", function() {
|
||||
|
||||
previewRotativa('rot_color', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-guardas').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('guardas', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-cubierta').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('cubierta', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-esquema-cubierta').on( "click", function() {
|
||||
|
||||
previewEsquemaCubierta('ec', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-sobrecubierta').on( "click", function() {
|
||||
|
||||
previewInteriorPlana('sobrecubierta', <?php echo $isCosido; ?>, <?php echo $isTapaDura; ?>);
|
||||
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
<div class="accordion accordion-bordered mt-3 col-xl-4" 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 -->
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-5 py-1 fw-normal text-end">Coste papel</dt>
|
||||
<dd id="totalCostePapel" class="py-1 col-6 text-end"><?= old('0', $presupuestoEntity->total_coste_papel) ?>€</dd>
|
||||
<dt class="col-5 py-1 fw-normal text-end">Margen papel</dt>
|
||||
<dd id="porcentajeMargenPapel" class="col-3 text-end py-1"><?= old('0', $presupuestoEntity->total_margenPercent_papel) ?>%</dd>
|
||||
<dd id="margenPapel" class="col-3 text-end py-1"><?= old('0', $presupuestoEntity->total_margen_papel) ?>€</dd>
|
||||
|
||||
<dt class="col-5 fw-normal text-end">Coste impresión</dt>
|
||||
<dd id="totalCosteImpresion" class="col-6 text-end"><?= old('0', $presupuestoEntity->total_coste_impresion) ?>€</dd>
|
||||
<dt class="col-5 py-1 fw-normal text-end">Margen impresión</dt>
|
||||
<dd id="porcentajeMargenImpresion" class="col-3 text-end py-1"><?= old('0', $presupuestoEntity->total_margenPercent_impresion) ?>%</dd>
|
||||
<dd id="margenImpresion" class="col-3 py-1 text-end"><?= old('0', $presupuestoEntity->total_margen_impresion) ?>€</dd>
|
||||
|
||||
<dt class="col-5 fw-normal text-end">Coste servicios</dt>
|
||||
<dd id="totalServicios" class="col-6 text-end py-1"><?= old('0', $presupuestoEntity->total_coste_servicios) ?>€</dd>
|
||||
<dt class="col-5 fw-normal text-end">Margen servicios</dt>
|
||||
<dd id="porcentajeMargenServicios" class="col-3 text-end py-1"><?= old('0', $presupuestoEntity->total_margenPercent_servicios) ?>%</dd>
|
||||
<dd id="margenServicios" class="col-3 text-end py-1"><?= old('0', $presupuestoEntity->total_margen_servicios) ?>€</dd>
|
||||
|
||||
<dt class="col-5 fw-normal text-end">Coste de envío</dt>
|
||||
<dd id="totalEnvios"class="col-6 text-end py-1"><?= old('0', $presupuestoEntity->total_coste_envios) ?>€</dd>
|
||||
<dt class="col-5 fw-normal text-end">Margen envío</dt>
|
||||
<dd id="margenEnvios" class="col-6 text-end py-1"><?= old('0', $presupuestoEntity->total_margen_envios) ?>€</dd>
|
||||
</dl>
|
||||
|
||||
<hr class="mx-n4">
|
||||
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-5 fw-normal text-end">Total Costes</dt>
|
||||
<dd id="totalCostes" class="col-6 text-end"><?= old('0', $presupuestoEntity->total_costes) ?>€</dd>
|
||||
<dt class="col-5 fw-normal text-end">Total Margen</dt>
|
||||
<dd id="totalMargenes" class="col-6 text-end"><?= old('0', $presupuestoEntity->total_margenes) ?>€</dd>
|
||||
</dl>
|
||||
|
||||
<hr class="mx-n4">
|
||||
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-5 fw-normal text-end">Total</dt>
|
||||
<dd id="totalAntesDescuento" class="col-6 text-end"><?= old('0', $presupuestoEntity->total_antes_descuento) ?>€</dd>
|
||||
<dt class="col-5 py-1 fw-normal text-end">Descuento</dt>
|
||||
<dd id="dd" class="col-3 text-end py-1"><input id="total_descuentoPercent" type="number" value="<?= old('0', $presupuestoEntity->total_descuentoPercent) ?>" class="update-totales form-control" style="width:100% !important;"></dd>
|
||||
<dd id="descuentoTotal" class="col-3 py-1 text-end"><?= old('0', $presupuestoEntity->total_descuento) ?>€</dd>
|
||||
<dt class="col-5 text-end">Total presupuesto</dt>
|
||||
<dd id="totalDespuesDecuento" class="col-6 fw-semibold text-end"><?= old('0', $presupuestoEntity->total_presupuesto) ?>€</dd>
|
||||
<dt class="col-5 fw-normal text-end">Precio unidad</dt>
|
||||
<dd id="precioUnidadPresupuesto" class="col-6 text-end mb-2"><?= old('0', $presupuestoEntity->total_precio_unidad) ?>€</dd>
|
||||
<dt class="col-5 fw-normal text-end" style="font-size: smaller !important;">Factor</dt>
|
||||
<dd id="factor" class="col-6 text-end mb-2" style="font-size: smaller !important;"><?= old('0', $presupuestoEntity->total_factor) ?></dd>
|
||||
<dt class="col-5 fw-normal text-end" style="font-size: smaller !important;">Factor Ponderado</dt>
|
||||
<dd id="factor_ponderado" class="col-6 text-end mb-0" style="font-size: smaller !important;"><?= old('0', $presupuestoEntity->total_factor_ponderado) ?></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 -->
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,271 @@
|
||||
function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
|
||||
|
||||
var totalPapel = 0
|
||||
var margenPapel = 0
|
||||
|
||||
var totalImpresion = 0
|
||||
var totalImpresionforMargen = 0
|
||||
var margenImpresion = 0
|
||||
|
||||
var totalServicios = 0
|
||||
var margenServicios = 0
|
||||
|
||||
var totalEnvios = 0
|
||||
var margenEnvios = 0
|
||||
|
||||
var sumForFactor = 0.0
|
||||
var sumForFactorPonderado = 0.0
|
||||
|
||||
if(updateLP){
|
||||
if(typeof $("#tableLineasPresupuesto").DataTable() !== 'undefined'){
|
||||
$("#tableLineasPresupuesto").DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
|
||||
if(rowData.check_papel_total){
|
||||
totalPapel += parseFloat($('#' + rowData.row_id + '_totalPapelPedido').val())
|
||||
margenPapel += parseFloat($('#' + rowData.row_id + '_margenPapelPedido').val())
|
||||
|
||||
sumForFactor += parseFloat($('#' + rowData.row_id + '_totalPapelPedido').val())
|
||||
sumForFactor -= parseFloat($('#' + rowData.row_id + '_margenPapelPedido').val())
|
||||
|
||||
}
|
||||
if(rowData.check_impresion_total){
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + '_precioImpresion').val())
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + '_totalClicks').val())
|
||||
|
||||
sumForFactor += parseFloat($('#' + rowData.row_id + '_totalClicks').val())
|
||||
|
||||
if(rowData.maquinaTipo=='inkjet'){
|
||||
totalImpresion += parseFloat(rowData.totalTinta)
|
||||
totalImpresion += parseFloat(rowData.totalCorte)
|
||||
|
||||
sumForFactor += (parseFloat(rowData.totalTinta) + parseFloat(rowData.totalCorte))
|
||||
}
|
||||
margenImpresion += parseFloat($('#' + rowData.row_id + '_margenImpresion').val())
|
||||
margenImpresion += parseFloat($('#' + rowData.row_id + '_margenClicks').val())
|
||||
|
||||
sumForFactor -= parseFloat($('#' + rowData.row_id + '_margenClicks').val())
|
||||
|
||||
if(!isNaN(parseFloat($('#' + rowData.row_id + 'lp_bn_totalTinta').val()))){
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + 'lp_bn_totalTinta').val())
|
||||
sumForFactor += parseFloat($('#' + rowData.row_id + 'lp_bn_totalTinta').val())
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
totalImpresion -= margenImpresion
|
||||
totalPapel -= margenPapel
|
||||
|
||||
var porcentajeMargenPapel = isNaN(margenPapel/(totalPapel)*100.0)?0:margenPapel/(totalPapel)*100.0
|
||||
$('#porcentajeMargenPapel').text(porcentajeMargenPapel.toFixed(0) + '%')
|
||||
$('#totalCostePapel').text((addSeparatorsNF(totalPapel.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#margenPapel').text((addSeparatorsNF(margenPapel.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#totalCostePapel').attr('val',totalPapel.toFixed(2))
|
||||
$('#margenPapel').attr('val',margenPapel.toFixed(2))
|
||||
|
||||
var porcentajeMargenImpresion = isNaN(margenImpresion/(totalImpresion)*100.0)?0:margenImpresion/(totalImpresion)*100.0
|
||||
$('#porcentajeMargenImpresion').text(porcentajeMargenImpresion.toFixed(0) + '%')
|
||||
$('#totalCosteImpresion').text((addSeparatorsNF(totalImpresion.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#margenImpresion').text((addSeparatorsNF(margenImpresion.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#totalCosteImpresion').attr('val',totalImpresion.toFixed(2))
|
||||
$('#margenImpresion').attr('val',margenImpresion.toFixed(2))
|
||||
|
||||
}
|
||||
else{
|
||||
totalPapel = parseFloat($('#totalCostePapel').attr('val'))
|
||||
margenPapel = parseFloat($('#margenPapel').attr('val'))
|
||||
totalImpresion = parseFloat($('#totalCosteImpresion').attr('val'))
|
||||
margenImpresion = parseFloat($('#margenImpresion').attr('val'))
|
||||
}
|
||||
|
||||
sumForFactorPonderado = sumForFactor;
|
||||
|
||||
if(updateServicios){
|
||||
|
||||
if ( typeof $("#tableOfServiciosEncuadernacion").DataTable() !== 'undefined' && $("#tableOfServiciosEncuadernacion").DataTable().rows().count() > 0){
|
||||
$('#tableOfServiciosEncuadernacion tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosEncuadernacion').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_total_encuadernado_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#enc_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
if ( typeof $("#tableOfServiciosAcabado").DataTable() !== 'undefined' && $("#tableOfServiciosAcabado").DataTable().rows().count() > 0){
|
||||
$('#tableOfServiciosAcabado tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosAcabado').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_total_acabado_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#acabado_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
if ( typeof $("#tableOfServiciosPreimpresion").DataTable() !== 'undefined' && $("#tableOfServiciosPreimpresion").DataTable().rows().count() > 0){
|
||||
|
||||
$('#tableOfServiciosPreimpresion tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosPreimpresion').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_preimpresion_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#preimpresion_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
if ( typeof $("#tableOfServiciosExtra").DataTable() !== 'undefined' && $("#tableOfServiciosExtra").DataTable().rows().count() > 0){
|
||||
|
||||
$('#tableOfServiciosExtra tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosExtra').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_servicioextra_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#servicioextra_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
if ( typeof $("#tableOfServiciosManipulado").DataTable() !== 'undefined' && $("#tableOfServiciosManipulado").DataTable().rows().count() > 0){
|
||||
|
||||
$('#tableOfServiciosManipulado tbody tr').each(function(){
|
||||
var currentRow = $(this).closest("tr");
|
||||
var subId = $('#tableOfServiciosManipulado').DataTable().cell(currentRow,0).node().innerHTML;
|
||||
var total = parseFloat($('#precio_total_manipulado_' + subId)[0].value)
|
||||
totalServicios += total
|
||||
margenServicios += (total*parseFloat($('#manipulado_margen_' + subId)[0].innerHTML)/100.0)
|
||||
})
|
||||
}
|
||||
|
||||
totalServicios -= margenServicios;
|
||||
|
||||
sumForFactorPonderado += totalServicios;
|
||||
|
||||
var porcentajeMargenServicios = margenServicios/(margenServicios+totalServicios)*100
|
||||
$('#porcentajeMargenServicios').text(isNaN(porcentajeMargenServicios.toFixed(0))?0:porcentajeMargenServicios.toFixed(0) + '%')
|
||||
$('#totalServicios').text((addSeparatorsNF(totalServicios.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#margenServicios').text((addSeparatorsNF(margenServicios.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#totalServicios').attr('val',totalServicios.toFixed(2) + '€')
|
||||
$('#margenServicios').attr('val',margenServicios.toFixed(2) + '€')
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
totalServicios = parseFloat($('#totalServicios').attr('val'))
|
||||
margenServicios = parseFloat($('#margenServicios').attr('val'))
|
||||
|
||||
sumForFactorPonderado += totalServicios;
|
||||
}
|
||||
|
||||
if(updateEnvio){
|
||||
|
||||
if ( typeof $('#tableOfDireccionesEnvio').DataTable() !== 'undefined' && $('#tableOfDireccionesEnvio').DataTable().rows().count() > 0){
|
||||
$('#tableOfDireccionesEnvio').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var data = this.data()
|
||||
totalEnvios += parseFloat(data.precio)
|
||||
margenEnvios += parseFloat((data.precio)*data.margen/100)
|
||||
} );
|
||||
}
|
||||
|
||||
totalEnvios -= margenEnvios
|
||||
$('#totalEnvios').text((addSeparatorsNF(totalEnvios.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#margenEnvios').text((addSeparatorsNF(margenEnvios.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#totalEnvios').attr('val',totalEnvios.toFixed(2) + '€')
|
||||
$('#margenEnvios').attr('val',margenEnvios.toFixed(2) + '€')
|
||||
}
|
||||
else{
|
||||
totalEnvios = parseFloat($('#totalEnvios').attr('val'))
|
||||
margenEnvios = parseFloat($('#margenEnvios').attr('val'))
|
||||
}
|
||||
|
||||
var totalCostes = totalPapel + totalImpresion + totalServicios + totalEnvios
|
||||
var totalMargenes = margenPapel + margenImpresion + margenServicios + margenEnvios
|
||||
$('#totalCostes').text((addSeparatorsNF(totalCostes.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#totalMargenes').text((addSeparatorsNF(totalMargenes.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#totalCostes').attr('val',(totalCostes).toFixed(2) + '€')
|
||||
$('#totalMargenes').attr('val',(totalMargenes).toFixed(2) + '€')
|
||||
|
||||
if($('#total_descuentoPercent').val()<0){
|
||||
$('#total_descuentoPercent').val(0)
|
||||
}
|
||||
var totalAntesDescuento = totalCostes + totalMargenes
|
||||
var totalDescuento = totalAntesDescuento * parseInt($('#total_descuentoPercent').val())/100
|
||||
var totalPresupuesto = totalAntesDescuento - totalDescuento
|
||||
var precioUnidad = totalPresupuesto/parseInt($('#tirada').val())
|
||||
|
||||
$('#totalAntesDescuento').text((addSeparatorsNF(totalAntesDescuento.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#descuentoTotal').text((addSeparatorsNF(totalDescuento.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#totalDespuesDecuento').text((addSeparatorsNF(totalPresupuesto.toFixed(2), ".", ",", ".")) + "€")
|
||||
$('#precioUnidadPresupuesto').text((addSeparatorsNF(precioUnidad.toFixed(4), ".", ",", ".")) + "€")
|
||||
$('#totalAntesDescuento').attr('val',(totalAntesDescuento).toFixed(2))
|
||||
$('#descuentoTotal').attr('val',(totalDescuento).toFixed(2))
|
||||
$('#totalDespuesDecuento').attr('val',(totalPresupuesto).toFixed(2))
|
||||
$('#precioUnidadPresupuesto').attr('val',(precioUnidad).toFixed(4))
|
||||
|
||||
|
||||
$('#factor').text(addSeparatorsNF(((totalPresupuesto-totalEnvios-margenEnvios)/sumForFactor).toFixed(2), ".", ",", "."))
|
||||
$('#factor').attr('val', ((totalPresupuesto-totalEnvios-margenEnvios)/sumForFactor).toFixed(2))
|
||||
$('#factor_ponderado').text(addSeparatorsNF(((totalPresupuesto-totalEnvios-margenEnvios)/sumForFactorPonderado).toFixed(2), ".", ",", "."))
|
||||
$('#factor_ponderado').attr('val',((totalPresupuesto-totalEnvios-margenEnvios)/sumForFactorPonderado).toFixed(2))
|
||||
}
|
||||
|
||||
|
||||
function addSeparatorsNF(nStr, inD, outD, sep)
|
||||
{
|
||||
nStr += '';
|
||||
var dpos = nStr.indexOf(inD);
|
||||
var nStrEnd = '';
|
||||
if (dpos != -1) {
|
||||
nStrEnd = outD + nStr.substring(dpos + 1, nStr.length);
|
||||
nStr = nStr.substring(0, dpos);
|
||||
}
|
||||
var rgx = /(\d+)(\d{3})/;
|
||||
while (rgx.test(nStr)) {
|
||||
nStr = nStr.replace(rgx, '$1' + sep + '$2');
|
||||
}
|
||||
return nStr + nStrEnd;
|
||||
}
|
||||
|
||||
function getValuesResumenForm(){
|
||||
var formResumen = ""
|
||||
formResumen += '&total_coste_papel=' + $('#totalCostePapel').attr('val')
|
||||
formResumen += '&total_margen_papel=' + $('#margenPapel').attr('val')
|
||||
formResumen += '&total_margenPercent_papel=' + $('#porcentajeMargenPapel').text().replace('%', '')
|
||||
|
||||
formResumen += '&total_coste_impresion=' + $('#totalCosteImpresion').attr('val')
|
||||
formResumen += '&total_margen_impresion=' + $('#margenImpresion').attr('val')
|
||||
formResumen += '&total_margenPercent_impresion=' + $('#porcentajeMargenImpresion').text().replace('%', '')
|
||||
|
||||
formResumen += '&total_coste_servicios=' + $('#totalServicios').attr('val')
|
||||
formResumen += '&total_margen_servicios=' + $('#margenServicios').attr('val')
|
||||
formResumen += '&total_margenPercent_servicios=' + $('#porcentajeMargenServicios').text().replace('%', '')
|
||||
|
||||
formResumen += '&total_coste_envios=' + $('#totalEnvios').attr('val')
|
||||
formResumen += '&total_margen_envios=' + $('#margenEnvios').attr('val')
|
||||
|
||||
formResumen += '&total_costes=' + $('#totalCostes').attr('val')
|
||||
formResumen += '&total_margenes=' + $('#totalMargenes').attr('val')
|
||||
|
||||
formResumen += '&total_antes_descuento=' + $('#totalAntesDescuento').attr('val')
|
||||
formResumen += '&total_descuento=' + $('#descuentoTotal').attr('val')
|
||||
formResumen += '&total_descuentoPercent=' + $('#total_descuentoPercent').val()
|
||||
formResumen += '&total_presupuesto=' + $('#totalDespuesDecuento').attr('val')
|
||||
formResumen += '&total_precio_unidad=' + $('#precioUnidadPresupuesto').attr('val')
|
||||
|
||||
formResumen += '&total_factor=' + $('#total_factor').text()
|
||||
formResumen += '&total_factor_ponderado=' + $('#total_factor_ponderado').text()
|
||||
|
||||
return formResumen
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$(".update-totales").on("change", function(){
|
||||
updatePresupuesto({
|
||||
update_lineas: false,
|
||||
update_servicios: false,
|
||||
update_envios: false,
|
||||
update_resumen: true,
|
||||
update_tiradas_alternativas: false
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,397 @@
|
||||
// Selección de la última columna de la tabla de tiradas
|
||||
const lastColNr_tiradasAlt = $('#tableTiradas').find("tr:first th").length - 1;
|
||||
|
||||
|
||||
// Función para generar los botones de acción de la tabla de tiradas
|
||||
const actionBtns_tiradasAlt = function (data) {
|
||||
return `
|
||||
<a href="javascript:void(0);"><i class="ti ti-check ti-sm comfirm-tirada-alt mx-2" data-id="${data.row_id}"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-tirada mx-2" data-id="${data.row_id}"></i></a>
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
// Inicializaciones de la tabla de tiradas
|
||||
var tableTiradas;
|
||||
|
||||
|
||||
// Espera a que todas las variables necesarias estén definidas
|
||||
(async () => {
|
||||
|
||||
while (!window.hasOwnProperty("datatable_lang_url") && !window.hasOwnProperty("datatable_TA_url"))
|
||||
await new Promise(resolve => setTimeout(resolve, 200));
|
||||
initTableTiradas();
|
||||
fill_tiradas_alternativas();
|
||||
|
||||
/*$('.tiradas-alternativas').each(function() {
|
||||
if ($(this).is('input')) {
|
||||
$(this).bind('change', update_tiradas_alternativas);
|
||||
} else if ($(this).is('button')) {
|
||||
$(this).bind('click', update_tiradas_alternativas);
|
||||
} else if ($(this).is('table')) {
|
||||
$(this).bind('draw.dt', update_tiradas_alternativas);
|
||||
}
|
||||
else{
|
||||
// para los botones de borrar
|
||||
$(this).bind('click', update_tiradas_alternativas);
|
||||
}
|
||||
});*/
|
||||
|
||||
})();
|
||||
|
||||
|
||||
async function actualizar_tiradas_alternativas(){
|
||||
if(tableTiradas !== undefined && tableTiradas.rows().count() > 0){
|
||||
// se obtiene la primera columna de la tabla de tiradas
|
||||
const data = tableTiradas.rows().data().toArray();
|
||||
// se borra la tabla de tiradas
|
||||
tableTiradas.clear().draw();
|
||||
const tiradas = data.map(row => row.tirada);
|
||||
// por cada tirada, se añade una fila a la tabla de tiradas
|
||||
await tiradas.forEach(async function(tirada){
|
||||
await add_tirada_alternativa(tirada);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Evento de añadir una tirada alternativa
|
||||
$('#add_tirada_alt').on('click', function () {
|
||||
|
||||
const tirada_alt = parseInt($('#tirada_alt').val());
|
||||
add_tirada_alternativa(tirada_alt);
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
|
||||
// Funcion para añadir una tirada alternativa
|
||||
async function add_tirada_alternativa(tirada_alt) {
|
||||
|
||||
// se comprueba que la tirada no existe ya en la tabla
|
||||
const exists = tableTiradas.rows().data().toArray().some(row => row.tirada == tirada_alt);
|
||||
const isPOD = parseInt($('#tirada').val())<= parseInt($('#POD').val());
|
||||
|
||||
const typeIsOk = tirada_alt <= parseInt($('#POD').val()) && isPOD || tirada_alt > parseInt($('#POD').val()) && !isPOD;
|
||||
|
||||
if (!exists && typeIsOk) {
|
||||
|
||||
const dimension = getDimensionLibro();
|
||||
|
||||
let datos = {
|
||||
tirada: tirada_alt,
|
||||
merma: get_merma_tirada_alternativa(tirada_alt),
|
||||
tipo_impresion_id: $('#tipo_impresion_id').val(),
|
||||
json_tiradas: generate_json_tiradas(),
|
||||
ancho: dimension.ancho,
|
||||
alto: dimension.alto,
|
||||
cliente_id: $('#clienteId').find(":selected").val(),
|
||||
solapas_cubierta: $('#solapas').is(':checked')?1:0,
|
||||
solapas_cubierta_ancho: $('#solapas').is(':checked')?parseInt($('#solapas_ancho').val()):0,
|
||||
solapas_sobrecubierta: $('#solapas_sobrecubierta').is(':checked')?1:0,
|
||||
solapas_sobrecubierta_ancho: $('#solapas_sobrecubierta').is(':checked')?parseInt($('#solapas_ancho_sobrecubierta').val()):0,
|
||||
lomo: getLomoExterior(),
|
||||
};
|
||||
|
||||
datos = Object.assign(datos, window.token_ajax);
|
||||
|
||||
// Se realiza la petición AJAX
|
||||
await $.ajax({
|
||||
type: "POST",
|
||||
url: window.get_tirada_url,
|
||||
data: datos,
|
||||
success: async function (data) {
|
||||
|
||||
var coste_total = 0.0;
|
||||
var margen_total = 0.0;
|
||||
|
||||
var costes_servicios = 0.0;
|
||||
var margen_servicios = 0.0;
|
||||
|
||||
var coste_envio = 0.0;
|
||||
var margen_envio = 0.0;
|
||||
|
||||
if(data.lineas.length >0){
|
||||
// Se cogen los valores de la linea con los datos correspondientes
|
||||
data.lineas.forEach(function(value) {
|
||||
coste_total += value.total_coste;
|
||||
margen_total += value.total_margen;
|
||||
});
|
||||
|
||||
//console.log(datos.tirada);
|
||||
|
||||
// Se obtiene el precio de los servicios
|
||||
const valueAcabados = await get_servAcabados_tiradasAlternativas(parseInt(datos.tirada));
|
||||
costes_servicios += parseFloat(valueAcabados.coste);
|
||||
margen_servicios += parseFloat(valueAcabados.margen);
|
||||
|
||||
//console.log('coste acabados ('+ datos.tirada +'): ' + valueAcabados.coste);
|
||||
|
||||
const valueEncuadernacion = await get_servEncuadernacion_tiradasAlternativas(
|
||||
parseInt(datos.tirada), parseInt( $('#paginas').val()), parseInt(dimension.ancho), parseInt(dimension.alto));
|
||||
costes_servicios += parseFloat(valueEncuadernacion.coste);
|
||||
margen_servicios += parseFloat(valueEncuadernacion.margen);
|
||||
|
||||
//console.log('coste encuadernacion ('+ datos.tirada +'): ' + valueEncuadernacion.coste);
|
||||
|
||||
const valueManipulado = await get_servManipulado_tiradasAlternativas(parseInt(datos.tirada));
|
||||
costes_servicios += parseFloat(valueManipulado.coste);
|
||||
margen_servicios += parseFloat(valueManipulado.margen);
|
||||
|
||||
//console.log('coste manipulado ('+ datos.tirada +'): ' + valueManipulado.coste);
|
||||
|
||||
const valuePreimpresion = await get_servPreimpresion_tiradasAlternativas(parseInt(datos.tirada));
|
||||
costes_servicios += parseFloat(valuePreimpresion.coste);
|
||||
margen_servicios += parseFloat(valuePreimpresion.margen);
|
||||
|
||||
const valueServiciosExtra = await get_servExtra_tiradasAlternativas(parseInt(datos.tirada));
|
||||
costes_servicios += parseFloat(valueServiciosExtra.coste);
|
||||
margen_servicios += parseFloat(valueServiciosExtra.margen);
|
||||
|
||||
//console.log('coste preimpresion ('+ datos.tirada +'): ' + valuePreimpresion.coste);
|
||||
|
||||
const valueTransporte = await get_coste_envio_tiradasAlternativas(parseInt(datos.tirada));
|
||||
coste_envio = valueTransporte.coste;
|
||||
margen_envio = valueTransporte.margen;
|
||||
|
||||
|
||||
// Se añade la fila a la tabla de tiradas
|
||||
tableTiradas.row.add({
|
||||
tirada: datos.tirada,
|
||||
coste_impresion: coste_total.toFixed(2),
|
||||
coste_envio: coste_envio.toFixed(2),
|
||||
margen: ((margen_total + margen_servicios + margen_envio)/(coste_total+coste_envio)*100.0).toFixed(2),
|
||||
total_pedido: (coste_total + costes_servicios + coste_envio).toFixed(2),
|
||||
precio_unidad: ((coste_total + costes_servicios + coste_envio) / datos.tirada).toFixed(4),
|
||||
|
||||
}).draw(false);
|
||||
}
|
||||
|
||||
yeniden(data[window.csrf_token]);
|
||||
|
||||
},
|
||||
error: function(e){}
|
||||
});
|
||||
}
|
||||
else {
|
||||
var htmlString = '';
|
||||
if(typeIsOk){
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-bell ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2">` +
|
||||
window.Presupuestos.errores.tirada_alt_duplicada +
|
||||
`</h5>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
else{
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-bell ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2">` +
|
||||
window.Presupuestos.errores.tirada_alt_tipo +
|
||||
`</h5>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
$('#alert-tiradas_alt').hide().empty().html(htmlString).fadeIn("slow", function(){
|
||||
setTimeout(function(){
|
||||
$('#alert-tiradas_alt').fadeOut("slow");
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Función para obtener el lomo exterior
|
||||
function getLomoExterior(){
|
||||
let lomoTotal = 0
|
||||
try{
|
||||
$('#tableLineasPresupuesto').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
if(rowData.row_id != 'lp_cubierta' && rowData.tipo != 'lp_sobrecubierta')
|
||||
lomoTotal += parseFloat(rowData.lomo)
|
||||
})
|
||||
}
|
||||
catch(error){
|
||||
lomoTotal = 0
|
||||
}
|
||||
return lomoTotal
|
||||
}
|
||||
|
||||
|
||||
// Inicialización de la tabla de tiradas
|
||||
function initTableTiradas() {
|
||||
tableTiradas = $('#tableTiradas').DataTable({
|
||||
"language": {
|
||||
"url": window.datatable_lang_url
|
||||
},
|
||||
"paging": false,
|
||||
"info": false,
|
||||
"searching": false,
|
||||
"ordering": true,
|
||||
"autoWidth": false,
|
||||
"responsive": true,
|
||||
"columnDefs": [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr_tiradasAlt]
|
||||
},
|
||||
],
|
||||
"columns": [
|
||||
{ data: "tirada" },
|
||||
{ data: 'coste_impresion' },
|
||||
{ data: 'coste_envio' },
|
||||
{ data: 'margen' ,
|
||||
render: function ( data, type, row ) {
|
||||
return data + '%';
|
||||
}
|
||||
},
|
||||
{ data: 'total_pedido' },
|
||||
{ data: 'precio_unidad' },
|
||||
{
|
||||
data: actionBtns_tiradasAlt,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
order: [[0, 'asc']]
|
||||
});
|
||||
}
|
||||
|
||||
// Evento de borrado de una fila de la tabla de tiradas
|
||||
$(document).on('click', '.btn-delete-tirada', function (e) {
|
||||
|
||||
const row = $(this).closest('tr');
|
||||
tableTiradas.row(row)
|
||||
.remove()
|
||||
.draw();
|
||||
showBreadCrumbSaveButton(true);
|
||||
})
|
||||
|
||||
|
||||
// Función para usar la tirada alternativa como tirada principal
|
||||
$(document).on('click', '.comfirm-tirada-alt', function (e) {
|
||||
|
||||
const row = $(this).closest('tr');
|
||||
const data = tableTiradas.row(row).data();
|
||||
|
||||
updateTablaEnvios($('#tirada').val(), data.tirada).then(function(){
|
||||
$('#tirada').val(data.tirada);
|
||||
$('#tirada').trigger('change', [false]);
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// Función para generar el JSON de las lineas de presupuesto para calcular las tiradas
|
||||
function generate_json_tiradas() {
|
||||
|
||||
const data = $('#tableLineasPresupuesto').DataTable().data().toArray();
|
||||
|
||||
//return data; // For debugging purposes
|
||||
json = filterData(data,
|
||||
['paginas',
|
||||
'numPagColor',
|
||||
'paginas_impresion',
|
||||
'papel', // papel generico
|
||||
'papel_impresion_id',
|
||||
'gramaje',
|
||||
'maquina_id',
|
||||
'aFavorFibra',
|
||||
'row_id',
|
||||
'check_papel_total',
|
||||
'check_impresion_total',
|
||||
'cobAmarillo', // tipologia de papel
|
||||
'cobCyan',
|
||||
'cobMagenta',
|
||||
'cobNegro',
|
||||
'cobCG',
|
||||
'gotaColor',
|
||||
'gotaNegro']);
|
||||
|
||||
json.forEach(element => {
|
||||
element['check_papel_total'] = $('#' + element['row_id'] + '_checkPapel').is(':checked') ? 1 : 0;
|
||||
element['check_impresion_total'] = $('#' + element['row_id'] + '_checkClicks').is(':checked') ? 1 : 0;
|
||||
});
|
||||
return JSON.stringify(json);
|
||||
}
|
||||
|
||||
|
||||
// Función para filtrar las columnas de la tabla de tiradas
|
||||
function filterData(data, keys) {
|
||||
return data.map(obj => {
|
||||
const newObj = {};
|
||||
keys.forEach(key => {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
});
|
||||
return newObj;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Función para obtener la merma de la tirada alternativa
|
||||
function get_merma_tirada_alternativa(tirada){
|
||||
|
||||
var merma = 0
|
||||
|
||||
if(tirada>parseInt($('#POD').val())){
|
||||
|
||||
merma = tirada*0.1<=30 ? tirada*0.1 : 30
|
||||
}
|
||||
else{
|
||||
merma_lineas = []
|
||||
$('#tableLineasPresupuesto').DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
if(rowData.row_id != 'lp_guardas' && rowData.row_id != 'lp_cubierta' && rowData.row_id != 'lp_sobrecubierta'){
|
||||
const formas_linea = $('#isCosido').val()==0?parseInt(rowData.formas):parseInt(rowData.formas)/2
|
||||
if(formas_linea > tirada)
|
||||
merma_lineas.push(formas_linea-tirada)
|
||||
else
|
||||
merma_lineas.push(tirada%formas_linea)
|
||||
}
|
||||
})
|
||||
|
||||
if(merma_lineas.length>0)
|
||||
merma = Math.max(...merma_lineas)
|
||||
else
|
||||
merma = 0
|
||||
}
|
||||
return merma;
|
||||
}
|
||||
|
||||
|
||||
function fill_tiradas_alternativas(){
|
||||
tableTiradas.clear().draw();
|
||||
const text = $('#tirada_alternativa_json_data').val()
|
||||
if(text.length>0){
|
||||
|
||||
const data = JSON.parse(text);
|
||||
if(data.length>0){
|
||||
$.each(data, function(key, value) {
|
||||
tableTiradas.row.add({
|
||||
tirada: value.tirada,
|
||||
coste_impresion: value.coste_impresion,
|
||||
coste_envio: value.coste_envio,
|
||||
margen: value.margen,
|
||||
total_pedido: value.total_pedido,
|
||||
precio_unidad: value.precio_unidad,
|
||||
}).draw(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,70 @@
|
||||
<div class="accordion accordion-bordered mt-3 col-xl-8" id="accordionTiradas">
|
||||
<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="#accordionTiradasTip" aria-expanded="false"
|
||||
aria-controls="accordionTiradasTip">
|
||||
<h4><?= lang("Presupuestos.tiradasAlternativas") ?></h4>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTiradasTip" class="accordion-collapse collapse show"
|
||||
data-bs-parent="#accordionTiradas">
|
||||
<div class="accordion-body">
|
||||
<div id='alert-tiradas_alt'></div>
|
||||
|
||||
<div class="col-xl-12">
|
||||
<div class="border rounded p-4 mb-3 pb-3">
|
||||
<p><?= lang('Presupuestos.tiradasInfoIVA') ?></p>
|
||||
<input type="hidden" name="tirada_alternativa_json_data" id="tirada_alternativa_json_data" class="form-control" value='<?= isset($presupuestoEntity->tirada_alternativa_json_data)?$presupuestoEntity->tirada_alternativa_json_data:'' ?>'></input>
|
||||
<div class='d-flex justify-content-end '>
|
||||
<input id="tirada_alt" type="number" style="width: 120px !important; display: inline-flex !important" class="form-control" value="1" min="1" step="1">
|
||||
<button id="add_tirada_alt" type="button" class="btn btn-secondary waves-effect waves-light"><i class="ti ti-circle-plus"></i></button>
|
||||
</div>
|
||||
<table id="tableTiradas" class="comparator-table table dt-responsive dataTable" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Presupuestos.tirada') ?></th>
|
||||
<th><?= lang('Presupuestos.tiradaImpresion') ?></th>
|
||||
<th><?= lang('Presupuestos.tiradaEnvio') ?></th>
|
||||
<th><?= lang('Presupuestos.tiradaMargen') ?></th>
|
||||
<th><?= lang('Presupuestos.totalPedido') ?></th>
|
||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||
<th></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- //.accordion-body -->
|
||||
</div> <!-- //.accordion-collapse -->
|
||||
</div> <!-- //.accordion-item -->
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
<!------------------------------------------------------->
|
||||
<!-- Código JS comportamiento ?????. -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
window.datatable_lang_url = "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json";
|
||||
|
||||
window.datatable_TA_url = "<?= route_to('dataTableOfPresupuestoTiradasAlternativas') ?>";
|
||||
window.get_tirada_url = "<?= route_to('getTiradaData') ?>";
|
||||
|
||||
window.error_lang_tirada_alt_duplicada = "<?= lang('Presupuestos.errores.tirada_alt_duplicada') ?>";
|
||||
window.error_lang_tirada_alt_tipo = "<?= lang('Presupuestos.errores.tirada_alt_tipo') ?>";
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
747
ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/comparador.js
Executable file
747
ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/comparador.js
Executable file
@ -0,0 +1,747 @@
|
||||
/*******************************
|
||||
* 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 () {
|
||||
|
||||
var negro = parseInt(document.getElementById('compPaginasNegrohq').value);
|
||||
const paginas = parseInt(document.getElementById('paginas').value);
|
||||
if (paginas < negro) {
|
||||
document.getElementById('compPaginasNegrogq').value = paginas;
|
||||
negro = paginas;
|
||||
}
|
||||
var color = parseInt(document.getElementById('compPaginasColorhq').value);
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
|
||||
var newValue = paginas - negro;
|
||||
if (newValue != color) {
|
||||
document.getElementById('compPaginasColorhq').value = newValue >= 0 ? newValue : 0;
|
||||
$('#compPaginasColorhq').change();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#prototipo').on("change", function () {
|
||||
$('#ferro').prop('checked', true)
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('#compPosPaginasColor').on("keyup", function () {
|
||||
computarPaginasColor(this.value);
|
||||
});
|
||||
|
||||
|
||||
// Este evento recoloca los headers de las tablas cuando se pulsa el
|
||||
// boton del acordeon
|
||||
$('.accordion-button').on('click', function (e) {
|
||||
|
||||
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("guardas")) {
|
||||
$("#tableCompGuardas").DataTable().columns.adjust();
|
||||
}
|
||||
else if (e.target.id.includes("LineasPresupuesto")) {
|
||||
$("#tableLineasPresupuesto").DataTable().columns.adjust();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************
|
||||
* Metodos
|
||||
*******************************/
|
||||
function getRowFromLineaInt(tipo, linea) {
|
||||
|
||||
$precio_impresion = isNaN(parseFloat(linea.fields.precio_impresion_horas + linea.fields.margen_impresion_horas + linea.fields.precio_click_pedido)) ? "" :
|
||||
parseFloat(linea.fields.precio_impresion_horas + linea.fields.margen_impresion_horas + linea.fields.precio_click_pedido).toFixed(2);
|
||||
|
||||
|
||||
data = {
|
||||
'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),
|
||||
'horasMaquina': isNaN(parseFloat(linea.fields.horas_maquina)) ? "" : parseFloat(linea.fields.horas_maquina).toFixed(2),
|
||||
'precioImpresion': $precio_impresion,
|
||||
'total': isNaN(parseFloat(linea.fields.total_impresion).toFixed(2)) ? "" : 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,
|
||||
'tarifa_impresion_id': linea.fields.tarifa_impresion_id,
|
||||
}
|
||||
if(data['tipo']=='guardas')
|
||||
data['paginas_impresion'] = linea.fields.paginas_impresion;
|
||||
return data;
|
||||
}
|
||||
|
||||
function getRowFromLineaRot(linea) {
|
||||
|
||||
$precio_impresion = isNaN(parseFloat(linea.fields.precio_impresion_horas + linea.fields.precio_click_pedido)) ? "" :
|
||||
parseFloat(linea.fields.precio_impresion_horas + linea.fields.precio_click_pedido).toFixed(2);
|
||||
|
||||
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),
|
||||
'horasMaquina': isNaN(parseFloat(linea.fields.horas_maquina)) ? "" : parseFloat(linea.fields.horas_maquina).toFixed(2),
|
||||
'precioImpresion': $precio_impresion,
|
||||
'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,
|
||||
'paginasColor': linea.fields.paginas_color,
|
||||
'tarifa_impresion_id': linea.fields.tarifa_impresion_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function computarPaginasColor(string) {
|
||||
|
||||
var numbers = [];
|
||||
for (const [, beginStr, endStr] of string.matchAll(/(\d+)(?:-(\d+))?/g)) {
|
||||
const [begin, end] = [beginStr, endStr].map(Number);
|
||||
numbers.push(begin);
|
||||
if (endStr !== undefined) {
|
||||
for (let num = begin + 1; num <= end; num++) {
|
||||
numbers.push(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
var numbers2 = [];
|
||||
numbers.forEach(function (value, i) {
|
||||
// Si es impar y no está el siguiente par hay que añadirlo
|
||||
if (value % 2 != 0 && numbers[i + 1] != value + 1) {
|
||||
numbers2.push(value + 1);
|
||||
}
|
||||
});
|
||||
numbers = numbers.concat(numbers2);
|
||||
numbers.sort(function (a, b) {
|
||||
return a - b;
|
||||
});
|
||||
calPagesTextarea = document.getElementById('compCalPaginasColor');
|
||||
calPagesTextarea.value = numbers;
|
||||
autosize.update(calPagesTextarea);
|
||||
}
|
||||
|
||||
|
||||
function checkRetractiladoComparador(element) {
|
||||
|
||||
switch (element.id) {
|
||||
case 'retractilado':
|
||||
if ($('#' + element.id).prop('checked')) {
|
||||
$('#retractilado5').prop('checked', false);
|
||||
}
|
||||
break;
|
||||
case 'retractilado5':
|
||||
if ($('#' + element.id).prop('checked')) {
|
||||
$('#retractilado').prop('checked', false);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updatePapelesComparador() {
|
||||
|
||||
var e = document.getElementById("tipoImpresion");
|
||||
elements_negro = document.getElementsByClassName('comp-negro-selected');
|
||||
elements_negrohq = document.getElementsByClassName('comp-negrohq-selected');
|
||||
elements_color = document.getElementsByClassName('comp-color-selected');
|
||||
elements_colorhq = document.getElementsByClassName('comp-colorhq-selected');
|
||||
switch (e.value) {
|
||||
case "negro":
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
break;
|
||||
|
||||
case "negrohq":
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "none";
|
||||
|
||||
});
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
break;
|
||||
|
||||
case "color":
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
break;
|
||||
|
||||
case "colorhq":
|
||||
Array.from(elements_negro).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_negrohq).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
Array.from(elements_color).forEach(element => {
|
||||
element.style.display = "none";
|
||||
});
|
||||
Array.from(elements_colorhq).forEach(element => {
|
||||
element.style.display = "flex";
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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();
|
||||
//$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#insertarPlanaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
|
||||
function clearCubierta() {
|
||||
|
||||
var tabla = $('#tableCompCubierta').DataTable();
|
||||
tabla
|
||||
.rows(function (idx, data, node) {
|
||||
return data['tipo'] === 'cubierta';
|
||||
})
|
||||
.remove()
|
||||
.draw();
|
||||
if(tabla.rows().count()==0)
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearSobrecubierta() {
|
||||
|
||||
|
||||
var tabla = $('#tableCompCubierta').DataTable();
|
||||
tabla
|
||||
.rows(function (idx, data, node) {
|
||||
return data['tipo'] === 'sobrecubierta';
|
||||
})
|
||||
.remove()
|
||||
.draw();
|
||||
if(tabla.rows().count()==0)
|
||||
$('#insertarCubiertaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearGuardas() {
|
||||
|
||||
$('#tableCompGuardas').DataTable().clear().draw();
|
||||
$('#insertarGuardasBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
function clearIntRot() {
|
||||
|
||||
$('#errorComRot').html('');
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#insertarRotativaBtn').css('display', 'none');
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
|
||||
cubierta_selected = false;
|
||||
sobrecubierta_selected = false;
|
||||
|
||||
if ($("#tableCompCubierta").DataTable().rows().count() > 0) {
|
||||
|
||||
$("#tableCompCubierta").DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||
if (!cubierta_selected && $('#tableCompCubierta').DataTable().cell(rowIdx, 0).data() === 'cubierta') {
|
||||
$("#tableCompCubierta").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
cubierta_selected = true;
|
||||
}
|
||||
if (!sobrecubierta_selected && $('#tableCompCubierta').DataTable().cell(rowIdx, 0).data() === 'sobrecubierta') {
|
||||
$("#tableCompCubierta").DataTable().row(rowIdx).nodes().to$().toggleClass('selected');
|
||||
sobrecubierta_selected = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var table = $("#tableCompCubierta").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_cubierta').html(value_total.toFixed(2));
|
||||
}
|
||||
|
||||
function selectGuardasLineas() {
|
||||
|
||||
$("#tableCompGuardas").DataTable().rows('.selected').deselect();
|
||||
|
||||
let value_total = 0.00;
|
||||
|
||||
if ($("#tableCompGuardas").DataTable().rows().count() > 0) {
|
||||
|
||||
$("#tableCompGuardas").DataTable().row(0).nodes().to$().toggleClass('selected');
|
||||
value_total = parseFloat($("#tableCompGuardas").DataTable().rows(0).data()[0]['total'])
|
||||
};
|
||||
|
||||
|
||||
$('#total_comp_guardas').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) {
|
||||
if ($('#papelFormatoId').select2('data')[0].id.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 if (document.getElementById('papelFormatoPersonalizado').checked) {
|
||||
ancho = parseFloat(document.getElementById('papelFormatoAncho').value);
|
||||
alto = parseFloat(document.getElementById('papelFormatoAlto').value);
|
||||
}
|
||||
}
|
||||
|
||||
else if (document.getElementById('papelFormatoPersonalizado').checked) {
|
||||
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) {
|
||||
|
||||
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()
|
||||
})
|
||||
}
|
||||
|
||||
function fillSobrecubierta(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")
|
||||
$('#tableCompCubierta').DataTable().row
|
||||
.add(getRowFromLineaInt('sobrecubierta', linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function fillGuardas(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")
|
||||
$('#tableCompGuardas').DataTable().row
|
||||
.add(getRowFromLineaInt('guardas', linea))
|
||||
.draw()
|
||||
})
|
||||
}
|
||||
|
||||
function clearCompTable() {
|
||||
|
||||
$('#insertarPlanaBtn').addClass('d-none')
|
||||
$('#insertarRotativaBtn').addClass('d-none')
|
||||
$('#total_comp_plana').html('0.00')
|
||||
$('#total_comp_rot').html('0.00')
|
||||
}
|
||||
|
||||
function generateCompJSON() {
|
||||
|
||||
data = {}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
try {
|
||||
bn_obj = {
|
||||
"bn": {
|
||||
'paginas': $('#compPaginasNegro').val(),
|
||||
'papel_id': $('#compPapelNegro').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegro').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
bn_obj = {}
|
||||
}
|
||||
$.extend(data, bn_obj);
|
||||
}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
try {
|
||||
bnhq_obj = {
|
||||
"bnhq": {
|
||||
'paginas': $('#compPaginasNegrohq').val(),
|
||||
'papel_id': $('#compPapelNegrohq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeNegrohq').select2('data')[0].text.trim(),
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
bnhq_obj = {}
|
||||
}
|
||||
$.extend(data, bnhq_obj);
|
||||
}
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'color') {
|
||||
try {
|
||||
color_obj = {
|
||||
"color": {
|
||||
'paginas': $('#compPaginasColor').val(),
|
||||
'papel_id': $('#compPapelColor').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColor').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
color_obj = {}
|
||||
}
|
||||
$.extend(data, color_obj);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($('#tipoImpresion').select2('data')[0].id == 'colorhq') {
|
||||
try {
|
||||
colorhq_obj = {
|
||||
"colorhq": {
|
||||
'paginas': $('#compPaginasColorhq').val(),
|
||||
'papel_id': $('#compPapelColorhq').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeColorhq').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
colorhq_obj = {}
|
||||
}
|
||||
$.extend(data, colorhq_obj);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
cubierta_obj = {
|
||||
"cubierta": {
|
||||
'paginas': $('#compCarasCubierta option:selected').val(),
|
||||
'papel_id': $('#compPapelCubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeCubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
cubierta_obj = {}
|
||||
}
|
||||
$.extend(data, cubierta_obj);
|
||||
|
||||
try {
|
||||
sobrecubierta_obj = {
|
||||
"sobrecubierta": {
|
||||
'imprimir': $('#compSobrecubierta option:selected').val(),
|
||||
'papel_id': $('#compPapelSobrecubierta').select2('data')[0].id,
|
||||
'gramaje': $('#compGramajeSobrecubierta').select2('data')[0].text.trim(),
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
sobrecubierta_obj = {}
|
||||
}
|
||||
$.extend(data, sobrecubierta_obj);
|
||||
|
||||
if($('#compCarasGuardas').length>0){
|
||||
try {
|
||||
guardas_obj = {
|
||||
"guardas": {
|
||||
'paginas_impresion': $('#compCarasGuardas option:selected').val(),
|
||||
'papel_id': $('#compPapelGuardas').select2('data')[0].id,
|
||||
},
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
guardas_obj = {}
|
||||
}
|
||||
$.extend(data, guardas_obj);
|
||||
|
||||
}
|
||||
|
||||
data_str = JSON.stringify(data)
|
||||
$('#comparador_json_data').val(data_str)
|
||||
}
|
||||
|
||||
1111
ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/previews.js
Executable file
1111
ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/previews.js
Executable file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,388 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $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">
|
||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||
<form id="presupuestoForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<input type="hidden" name="presupuesto_id" id="presupuesto_id" class="form-control"
|
||||
value="<?= $presupuestoEntity->id ?>"></input>
|
||||
<input type="hidden" name="tipo_impresion_id" id="tipo_impresion_id" class="form-control"
|
||||
value="<?= $tipo_impresion_id ?>"></input>
|
||||
<input type="hidden" name="lomo_cubierta" id="lomo_cubierta" class="form-control"
|
||||
value="<?= is_null($presupuestoEntity->lomo_cubierta)?0:$presupuestoEntity->lomo_cubierta ?>"></input>
|
||||
<input type="hidden" name="lomo_sobrecubierta" id="lomo_sobrecubierta" class="form-control"
|
||||
value="<?= is_null($presupuestoEntity->lomo_sobrecubierta)?0:$presupuestoEntity->lomo_sobrecubierta ?>"></input>
|
||||
<input type="hidden" name="isCosido" id="isCosido" class="form-control"
|
||||
value="<?= $isCosido ?>"></input>
|
||||
<input type="hidden" name="POD" id="POD" class="form-control"
|
||||
value="<?= $POD ?>"></input>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoItems") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosLibroItems") ?>
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_previewItems") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_comentariosItems") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_resumenPresupuestoItems") ?>
|
||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_tiradasAlternativasItems") ?>
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="total_presupuesto" id="total_presupuesto" class="form-control"
|
||||
value="0.0"></input>
|
||||
<?php endif; ?>
|
||||
<div class="pt-4">
|
||||
<input type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
id="saveForm"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<?= anchor(route_to("presupuestoToPdf", $presupuestoId), lang("Basic.global.Print"), ["class" => "btn btn-dark float-start me-sm-3 me-1",'target' => '_blank']) ?>
|
||||
<input type="button"
|
||||
class="btn btn-info float-start me-sm-3 me-1"
|
||||
name="clone"
|
||||
id="cloneForm"
|
||||
value="<?= lang("Basic.global.Clone") ?>"
|
||||
/>
|
||||
<?php endif; ?>
|
||||
<?= anchor(route_to("cosidotapablandaList", $tipo_impresion_id), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
|
||||
<?= view("themes/_commonPartialsBs/_modalMessageDialog") ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para el boton de duplicar -->
|
||||
<!------------------------------------------->
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
$('#cloneForm').on('click', async function(e) {
|
||||
|
||||
// se comprueba que no haya lineas de presupuesto en el que exista la variable gotaNegro
|
||||
var gotaNegro = false
|
||||
$("#tableLineasPresupuesto").DataTable().rows().every( function ( rowIdx, tableLoop, rowLoop ) {
|
||||
var rowData = this.data();
|
||||
if(rowData.hasOwnProperty('gotaNegro')){
|
||||
gotaNegro = true
|
||||
return;
|
||||
}
|
||||
})
|
||||
|
||||
const domain = window.location.origin
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
var id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
|
||||
if(gotaNegro){
|
||||
|
||||
asyncMessageDialog('<?= lang("Basic.global.Warning") ?>', '<?= lang("Presupuestos.duplicarConTipologias") ?>', function() {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
|
||||
|
||||
data: {
|
||||
tipo: 'duplicar',
|
||||
presupuesto_id: id,
|
||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
||||
},
|
||||
dataType: 'json',
|
||||
success:function(response){
|
||||
|
||||
token=response.<?= csrf_token() ?>;
|
||||
yeniden(token);
|
||||
// redirect
|
||||
new_location = '<?= site_url("presupuestos/cosidotapablanda/edit/") ?>' + response.id
|
||||
window.location.href = new_location;
|
||||
}
|
||||
}).fail(function (jqXHR, textStatus, error) {
|
||||
// Handle error here
|
||||
console.log(jqXHR)
|
||||
});
|
||||
})
|
||||
}
|
||||
else{
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
|
||||
|
||||
data: {
|
||||
tipo: 'duplicar',
|
||||
presupuesto_id: id,
|
||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
||||
},
|
||||
dataType: 'json',
|
||||
success:function(response){
|
||||
|
||||
token=response.<?= csrf_token() ?>;
|
||||
yeniden(token);
|
||||
// redirect
|
||||
new_location = '<?= site_url("presupuestos/cosidotapablanda/edit/") ?>' + response.id
|
||||
window.location.href = new_location;
|
||||
}
|
||||
}).fail(function (jqXHR, textStatus, error) {
|
||||
// Handle error here
|
||||
console.log(jqXHR)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para los selects -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
$(document).keypress(function(e) {
|
||||
var key = e.which;
|
||||
if (key == 13) // the enter key code
|
||||
{
|
||||
e.preventDefault()
|
||||
if ($('#addressForm').hasClass('show')) {
|
||||
$("#saveDireccionEnvio").click();
|
||||
|
||||
} else {
|
||||
$('#saveForm').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#clienteId').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfClientes") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function(params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'nombre',
|
||||
searchTerm: params.term,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
};
|
||||
},
|
||||
delay: 60,
|
||||
processResults: function(response) {
|
||||
yeniden(response.<?= csrf_token() ?>);
|
||||
return {
|
||||
results: response.menu
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
/*******************************
|
||||
* Inicialización de los Select2
|
||||
*******************************/
|
||||
$('#incRei').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
$('#paisId').select2({
|
||||
allowClear: false,
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<!------------------------------------------------------->
|
||||
<!-- Código JS para detectar cambios en el presupuesto -->
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
$(window).on('load', function() {
|
||||
|
||||
// Detectar cambios en inputs de texto
|
||||
$('input[type="text"]').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en inputs de texto
|
||||
$('input[type="number"]').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en select
|
||||
$('select').change(function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en checkboxes
|
||||
$('input[type="checkbox"]').change(function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en textareas
|
||||
$('textarea').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en otros tipos de input
|
||||
$('input[type="radio"]').change(function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en otros tipos de input
|
||||
$('input:not([type])').on('input', function() {
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#bc-save').on( "click", function() {
|
||||
showBreadCrumbSaveButton(false);
|
||||
$('#saveForm').click()
|
||||
} );
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Acciones antes de submit... -->
|
||||
<!------------------------------------------->
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
// funcion que genera un JSON con la tabla de tiradas alternativas
|
||||
function generate_json_tiradas() {
|
||||
const data = tableTiradas.rows().data().toArray();
|
||||
$('#tirada_alternativa_json_data').val(JSON.stringify(data));
|
||||
}
|
||||
|
||||
$('#presupuestoForm').on("submit", function(event) {
|
||||
event.preventDefault();
|
||||
save_servicios();
|
||||
save_datos_envios();
|
||||
|
||||
var presupuesto_id = $('#presupuesto_id').val()
|
||||
|
||||
$.when(fill_bbdd_from_lp(presupuesto_id).then(function(data, textStatus, jqXHR) {
|
||||
generateCompJSON()
|
||||
generate_json_tiradas()
|
||||
form = $('#presupuestoForm').serialize()
|
||||
form += getValuesResumenForm()
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<?php echo $formAction; ?>",
|
||||
data: form,
|
||||
success: function (data) {
|
||||
yeniden(data.<?= csrf_token() ?>)
|
||||
if('errorMensaje' in data)
|
||||
popErrorAlert(data.errorMensaje)
|
||||
else{
|
||||
showBreadCrumbSaveButton(false)
|
||||
popSuccessAlert(data.mensaje)
|
||||
}
|
||||
|
||||
}
|
||||
}).fail(function (jqXHR, textStatus, error) {
|
||||
// Handle error here
|
||||
console.log(jqXHR)
|
||||
});;
|
||||
}))
|
||||
|
||||
return false; //stop the actual form post !important!
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
if(<?php echo $presupuestoEntity->is_duplicado?'true':'false'; ?>){
|
||||
asyncMessageDialog(
|
||||
'<?= lang("Basic.global.Warning") ?>',
|
||||
'<?= lang("Presupuestos.presupuestoDuplicadoActualizacion") ?>',
|
||||
function(){});
|
||||
}
|
||||
else if(<?php echo ($presupuestoEntity->cambios_lineas? 'true':'false'); ?> ||
|
||||
<?php echo ($presupuestoEntity->cambios_servicios? 'true':'false'); ?> ||
|
||||
<?php echo ($presupuestoEntity->cambios_envios ? 'true':'false'); ?>){
|
||||
|
||||
let text = '<?= lang("Presupuestos.actualizacionPrecios") ?>';
|
||||
if(<?php echo ($presupuestoEntity->cambios_lineas ? 'true':'false'); ?>){
|
||||
text += '<?= lang("Presupuestos.actualizacionPreciosLP") ?>';
|
||||
}
|
||||
else if (<?php echo ($presupuestoEntity->cambios_servicios ? 'true':'false'); ?>){
|
||||
text += '<?= lang("Presupuestos.actualizacionPreciosServicios") ?>';
|
||||
}
|
||||
else if (<?php echo ($presupuestoEntity->cambios_envios ? 'true':'false'); ?>){
|
||||
text += '<?= lang("Presupuestos.actualizacionPreciosEnvios") ?>';
|
||||
}
|
||||
asyncMessageDialog(
|
||||
'<?= lang("Basic.global.Warning") ?>',
|
||||
text,
|
||||
function(){});
|
||||
|
||||
}
|
||||
<?= $this->endSection() ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Variables generales usadas en los ficheros js -->
|
||||
<!------------------------------------------->
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||
window.csrf_token = '<?= csrf_token() ?>';
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("themes/vuexy/vendor/libs/datatables-sk/plugins/select/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/vendor/libs/autosize/autosize.js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/translate_js/Presupuestos') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/datosLibro_js') ?>"></script>
|
||||
<?php if (str_contains($formAction, 'edit')): ?>
|
||||
<script src="<?= site_url('js_loader/datosEnvios_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/resumenPresupuestos_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/presupuestos_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/comparadorCosidoTapaBlanda_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/previsualizador_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/lineasPresupuesto_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/tiradasAlternativas_js') ?>"></script>
|
||||
<script src="<?= site_url('js_loader/datosServicios_js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script>
|
||||
<?php endif; ?>
|
||||
<?= $this->endSection() ?>
|
||||
@ -0,0 +1,272 @@
|
||||
<?=$this->include('themes/_commonPartialsBs/select2bs5') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?=$this->include('themes/_commonPartialsBs/sweetalert') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?=$this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= $pageTitle ?></h3>
|
||||
<?=anchor(route_to('newCosidotapablanda', $tipo_impresion_id), lang('Basic.global.addNew').' '.lang('Presupuestos.presupuesto'), ['class'=>'btn btn-primary ']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfPresupuestos" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=lang('Presupuestos.id')?></th>
|
||||
<th><?= lang('Presupuestos.created_at') ?></th>
|
||||
<th><?= lang('Clientes.cliente') ?></th>
|
||||
<th><?= lang('Presupuestos.comercial') ?></th>
|
||||
<th><?= lang('Presupuestos.titulo') ?></th>
|
||||
<th><?= lang('Paises.pais') ?></th>
|
||||
<th><?= lang('Presupuestos.incRei') ?></th>
|
||||
<th class='noFilter'><?= lang('Presupuestos.paginas') ?></th>
|
||||
<th class='noFilter'><?= lang('Presupuestos.tirada') ?></th>
|
||||
<th class='noFilter'><?= lang('Presupuestos.totalPresupuesto') ?></th>
|
||||
<th><?= lang('Presupuestos.presupuestoEstado') ?></th>
|
||||
<th class="noFilter text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
// Setup - add a text input to each footer cell
|
||||
$('#tableOfPresupuestos thead tr').clone(true).appendTo('#tableOfPresupuestos thead');
|
||||
$('#tableOfPresupuestos thead tr:eq(1) th').each(function (i) {
|
||||
if (!$(this).hasClass("noFilter")) {
|
||||
var title = $(this).text();
|
||||
if(i==1){
|
||||
|
||||
$(this).html('<input id="bs-rangepicker-range" type="text" class="form-control " style="min-width:100px;max-width:120px;font-size:0.8rem !important;" />');
|
||||
var bsRangePickerRange = $('#bs-rangepicker-range')
|
||||
bsRangePickerRange.daterangepicker({
|
||||
ranges: {
|
||||
'<?= lang('datePicker.hoy') ?>': [moment(), moment()],
|
||||
'<?= lang('datePicker.ayer') ?>': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||
'<?= lang('datePicker.ultimos7') ?>': [moment().subtract(6, 'days'), moment()],
|
||||
'<?= lang('datePicker.ultimos30') ?>': [moment().subtract(29, 'days'), moment()],
|
||||
'<?= lang('datePicker.esteMes') ?>': [moment().startOf('month'), moment().endOf('month')],
|
||||
'<?= lang('datePicker.ultimoMes') ?>': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||
},
|
||||
opens: 'right',
|
||||
language: '<?= config('Basics')->i18n ?>',
|
||||
"locale": {
|
||||
"customRangeLabel": "<?= lang('datePicker.personalizar') ?>",
|
||||
"format": "YYYY-MM-DD",
|
||||
"separator": " ",
|
||||
"applyLabel": "<?= lang('datePicker.aplicar') ?>",
|
||||
"cancelLabel": "<?= lang('datePicker.limpiar') ?>",
|
||||
|
||||
},
|
||||
"alwaysShowCalendars": true,
|
||||
autoUpdateInput: false,
|
||||
|
||||
});
|
||||
|
||||
bsRangePickerRange.on('apply.daterangepicker', function(ev, picker) {
|
||||
$(this).val(picker.startDate.format('YYYY-MM-DD') + ' ' + picker.endDate.format('YYYY-MM-DD'));
|
||||
theTable
|
||||
.column(i)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
});
|
||||
|
||||
bsRangePickerRange.on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
theTable
|
||||
.column(i)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
});
|
||||
|
||||
}
|
||||
else{
|
||||
$(this).html('<input type="text" class="form-control " style="min-width:100px;max-width:120px;font-size:0.8rem !important;" />');
|
||||
|
||||
$('input', this).on('change clear', function () {
|
||||
if (theTable.column(i).search() !== this.value) {
|
||||
theTable
|
||||
.column(i)
|
||||
.search(this.value)
|
||||
.draw();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
$(this).html('<span></span>');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
theTable = $('#tableOfPresupuestos').DataTable({
|
||||
orderCellsTop: true,
|
||||
fixedHeader: true,
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 50,
|
||||
lengthChange: true,
|
||||
"dom": '<"mb-3"l>Brtip',
|
||||
"buttons": [
|
||||
'colvis', 'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: false,
|
||||
order: [[1, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfCosidotapablanda') ?>',
|
||||
data: function (d) {
|
||||
d.tipo_impresion_id = '<?php echo $tipo_impresion_id; ?>';
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'id' },
|
||||
{ 'data': 'fecha' },
|
||||
{ 'data': 'cliente' },
|
||||
{ 'data': 'comercial' },
|
||||
{ 'data': 'titulo' },
|
||||
{ 'data': 'pais' },
|
||||
{ 'data': 'inc_rei' },
|
||||
{ 'data': 'paginas' },
|
||||
{ 'data': 'tirada' },
|
||||
{ 'data': 'total_presupuesto' },
|
||||
{ 'data': 'estado' ,
|
||||
'render': function ( data, type, row, meta ) {
|
||||
if(data=='borrador')
|
||||
return '<?= lang('Presupuestos.presupuestoEstadoBorrador') ?>';
|
||||
else if(data=='aceptado')
|
||||
return '<?= lang('Presupuestos.presupuestoEstadoAceptado') ?>';
|
||||
}
|
||||
},
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
|
||||
const dateCols = [1];
|
||||
const priceCols = [9];
|
||||
|
||||
for (let coln of dateCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
const datestr = cell.innerHTML;
|
||||
const dateStrLen = datestr.toString().trim().length;
|
||||
if (dateStrLen > 0) {
|
||||
let dateTimeParts= datestr.split(/[- :]/); // regular expression split that creates array with: year, month, day, hour, minutes, seconds values
|
||||
dateTimeParts[1]--; // monthIndex begins with 0 for January and ends with 11 for December so we need to decrement by one
|
||||
const d = new Date(...dateTimeParts); // new Date(datestr);
|
||||
cell.innerHTML = d.toLocaleDateString();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
for (let coln of priceCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/presupuestos/cosidotapablanda/edit/${$(this).attr('data-id')}/`;
|
||||
});
|
||||
|
||||
|
||||
$(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: `/presupuestos/cosidotapablanda/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<link rel="stylesheet" type="text/css" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/fixedheader/fixedHeader.dataTables.min.css") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.css') ?>" />
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.colVis.min.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/moment/moment.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.js') ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
490
ci4/app/Views/themes/vuexy/form/presupuestos/index.php
Executable file
490
ci4/app/Views/themes/vuexy/form/presupuestos/index.php
Executable file
@ -0,0 +1,490 @@
|
||||
<?= $this->extend('themes/backend/vuexy/main/presupuestos_layout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="faq-header d-flex flex-column justify-content-center align-items-center rounded">
|
||||
<h3 class="text-center">Presupuestos SAFEKAT</h3>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<!-- Navigation -->
|
||||
<div class="col-lg-3 col-md-4 col-12 mb-md-0 mb-3">
|
||||
<div class="d-flex justify-content-between flex-column mb-2 mb-md-0">
|
||||
<ul class="nav nav-align-left nav-pills flex-column">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#payment">
|
||||
<i class="ti ti-credit-card me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Libros</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#delivery">
|
||||
<i class="ti ti-briefcase me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Publicidad</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#cancellation">
|
||||
<i class="ti ti-rotate-clockwise-2 me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Folletos a grapa</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#orders">
|
||||
<i class="ti ti-box me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Espiral/Wire-o</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
|
||||
<i class="ti ti-settings me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">POD</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
|
||||
<i class="ti ti-settings me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Externos</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
|
||||
<i class="ti ti-settings me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Incidencia</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
|
||||
<i class="ti ti-settings me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Mixto</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Navigation -->
|
||||
|
||||
<!-- Presupuestos -->
|
||||
<div class="col-lg-9 col-md-8 col-12">
|
||||
<div class="tab-content py-0">
|
||||
<div class="tab-pane fade show active" id="payment" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-credit-card ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Libros</span>
|
||||
</h4>
|
||||
<small>Seleccione la tipología de libro</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><a href="<?= site_url('presupuestos/presupuesto/tapa_blanda_encolada') ?>">Encuadernación encolada tapa blanda</a></h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade" id="delivery" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-briefcase ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Item 2</span>
|
||||
</h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="cancellation" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-rotate-clockwise-2 ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0"><span class="align-middle">Itemm 3</span></h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="orders" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-box ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Item 4</span>
|
||||
</h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
<div class="tab-pane fade" id="product" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-camera ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Item N</span>
|
||||
</h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /FAQ's -->
|
||||
</div>
|
||||
|
||||
<!-- Contact -->
|
||||
<div class="row mt-5">
|
||||
<div class="col-12 text-center mb-4">
|
||||
<div class="badge bg-label-primary">¿Preguntas?</div>
|
||||
<h4 class="my-2">¿Necesita ayuda?</h4>
|
||||
<p>No dude en contactar con nuestro equipo de soporte en soporte@safekat.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center justify-content-center gap-sm-0 gap-3">
|
||||
<div class="col-sm-6">
|
||||
<div class="py-3 rounded bg-faq-section text-center">
|
||||
<span class="badge bg-label-primary my-3 rounded-2 p-2">
|
||||
<i class="ti ti-phone ti-md"></i>
|
||||
</span>
|
||||
<h4 class="mb-2"><a class="text-body" href="tel:+(34)123456789">+(34) 123 456 789</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="py-3 rounded bg-faq-section text-center">
|
||||
<span class="badge bg-label-primary my-3 rounded-2 p-2">
|
||||
<i class="ti ti-mail ti-md"></i>
|
||||
</span>
|
||||
<h4 class="mb-2"><a class="text-body" href="mailto:ayuda@safekat.com">ayuda@safekat.com</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Contact -->
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
472
ci4/app/Views/themes/vuexy/form/presupuestos/tapa-blanda-encolada.php
Executable file
472
ci4/app/Views/themes/vuexy/form/presupuestos/tapa-blanda-encolada.php
Executable file
@ -0,0 +1,472 @@
|
||||
<?= $this->extend('themes/backend/vuexy/main/presupuestos_layout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="faq-header d-flex flex-column justify-content-center align-items-center rounded">
|
||||
<h3 class="text-center">Presupuestos SAFEKAT</h3>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<!-- Navigation -->
|
||||
<div class="col-lg-3 col-md-4 col-12 mb-md-0 mb-3">
|
||||
<div class="d-flex justify-content-between flex-column mb-2 mb-md-0">
|
||||
<ul class="nav nav-align-left nav-pills flex-column">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#payment">
|
||||
<i class="ti ti-credit-card me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Libros</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#delivery">
|
||||
<i class="ti ti-briefcase me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Item 2</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#cancellation">
|
||||
<i class="ti ti-rotate-clockwise-2 me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Item 3</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#orders">
|
||||
<i class="ti ti-box me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Item 4</span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#product">
|
||||
<i class="ti ti-settings me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold">Item N</span>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Navigation -->
|
||||
|
||||
<!-- Presupuestos -->
|
||||
<div class="col-lg-9 col-md-8 col-12">
|
||||
<div class="tab-content py-0">
|
||||
<div class="tab-pane fade show active" id="payment" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-credit-card ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Libros</span>
|
||||
</h4>
|
||||
<small>Seleccione la tipología de libro</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><a href="<?= site_url('presupuestos/presupuesto/tapa_blanda_encolada') ?>">Encuadernación encolada tapa blanda</a></h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade" id="delivery" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-briefcase ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Item 2</span>
|
||||
</h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="cancellation" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-rotate-clockwise-2 ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0"><span class="align-middle">Itemm 3</span></h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="orders" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-box ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Item 4</span>
|
||||
</h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
<div class="tab-pane fade" id="product" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-camera ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle">Item N</span>
|
||||
</h4>
|
||||
<small>Lorem ipsum, dolor sit amet.</small>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Libros -->
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-1.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación encolada tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
Este tipo de encuadernación de tapa blanda se destina a proyectos editoriales que buscan un acabado de calidad con buena presentación.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa blanda</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación rústica hace referencia a los libros de tapa blanda.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-right" src="<?= site_url('themes/vuexy/img/safekat/libro-2.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="col-md">
|
||||
<div class="card mb-3">
|
||||
<div class="row g-0">
|
||||
<div class="col-md-3">
|
||||
<img class="card-img card-img-left" src="<?= site_url('themes/vuexy/img/safekat/libro-3.png') ?>" alt="Card image" />
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Encuadernación cosida de tapa dura</h5>
|
||||
<p class="card-text">
|
||||
La encuadernación con cartón o cartoné hace referencia a los libros cosidos de tapa dura.
|
||||
</p>
|
||||
<p class="card-text"><small class="text-muted">Texto Dummy</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ Libros -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /FAQ's -->
|
||||
</div>
|
||||
|
||||
<!-- Contact -->
|
||||
<div class="row mt-5">
|
||||
<div class="col-12 text-center mb-4">
|
||||
<div class="badge bg-label-primary">¿Preguntas?</div>
|
||||
<h4 class="my-2">¿Necesita ayuda?</h4>
|
||||
<p>No dude en contactar con nuestro equipo de soporte en soporte@safekat.com</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center justify-content-center gap-sm-0 gap-3">
|
||||
<div class="col-sm-6">
|
||||
<div class="py-3 rounded bg-faq-section text-center">
|
||||
<span class="badge bg-label-primary my-3 rounded-2 p-2">
|
||||
<i class="ti ti-phone ti-md"></i>
|
||||
</span>
|
||||
<h4 class="mb-2"><a class="text-body" href="tel:+(34)123456789">+(34) 123 456 789</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="py-3 rounded bg-faq-section text-center">
|
||||
<span class="badge bg-label-primary my-3 rounded-2 p-2">
|
||||
<i class="ti ti-mail ti-md"></i>
|
||||
</span>
|
||||
<h4 class="mb-2"><a class="text-body" href="mailto:ayuda@safekat.com">ayuda@safekat.com</a></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Contact -->
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
307
ci4/app/Views/themes/vuexy/form/profile/index.php
Executable file
307
ci4/app/Views/themes/vuexy/form/profile/index.php
Executable file
@ -0,0 +1,307 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/general_settings_layout') ?>
|
||||
|
||||
<?= $this->section('content'); ?>
|
||||
<!--Content Body-->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ul class="nav nav-pills flex-column flex-md-row mb-4">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="javascript:void(0);"
|
||||
><i class="ti-xs ti ti-users me-1"></i> Account</a
|
||||
>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="pages-account-settings-security.html"
|
||||
><i class="ti-xs ti ti-lock me-1"></i> Security</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="card mb-4">
|
||||
<h5 class="card-header">Profile Details</h5>
|
||||
<!-- Account -->
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-start align-items-sm-center gap-4">
|
||||
<img
|
||||
src="<?= $obj->picture ?? '' ?>"
|
||||
alt="user-avatar"
|
||||
class="d-block w-px-100 h-px-100 rounded"
|
||||
id="uploadedAvatar"
|
||||
/>
|
||||
<div class="button-wrapper">
|
||||
<label for="upload" class="btn btn-primary me-2 mb-3" tabindex="0">
|
||||
<span class="d-none d-sm-block"><?= lang("App.profile_change_photo") ?></span>
|
||||
<i class="ti ti-upload d-block d-sm-none"></i>
|
||||
<input
|
||||
type="file"
|
||||
id="upload"
|
||||
class="account-file-input"
|
||||
hidden
|
||||
accept="image/png, image/jpeg"
|
||||
/>
|
||||
</label>
|
||||
<button type="button" class="btn btn-label-secondary account-image-reset mb-3">
|
||||
<i class="ti ti-refresh-dot d-block d-sm-none"></i>
|
||||
<span class="d-none d-sm-block">Reset</span>
|
||||
</button>
|
||||
|
||||
<div class="text-muted">Allowed JPG, GIF or PNG. Max size of 800K</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr class="my-0"/>
|
||||
<div class="card-body">
|
||||
<form id="formAccountSettings" method="POST" action="<?= site_url("profile/store") ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="row">
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="first_name" class="form-label"><?= lang("App.profile_first_name") ?></label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="first_name"
|
||||
name="first_name"
|
||||
placeholder="<?= lang("App.profile_first_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->first_name : set_value('first_name'); ?>"
|
||||
autofocus
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="last_name" class="form-label"><?= lang("App.profile_last_name") ?></label>
|
||||
<input class="form-control"
|
||||
type="text"
|
||||
name="last_name"
|
||||
id="last_name"
|
||||
placeholder="<?= lang("App.profile_last_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->last_name : set_value('last_name'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="email" class="form-label"><?= lang("App.profile_email") ?></label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="email"
|
||||
name="email"
|
||||
placeholder="<?= lang("App.profile_email_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->email : set_value('email'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label class="form-label" for="mobile"><?= lang("App.profile_mobile") ?></label>
|
||||
<div class="input-group input-group-merge">
|
||||
<input
|
||||
type="text"
|
||||
id="mobile"
|
||||
name="mobile"
|
||||
class="form-control"
|
||||
placeholder="<?= lang("App.profile_mobile_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->mobile : set_value('mobile'); ?>"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="address" class="form-label"><?= lang("App.profile_address") ?></label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="address"
|
||||
name="address"
|
||||
placeholder="<?= lang("App.profile_address_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->address : set_value('address'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="state" class="form-label"><?= lang("App.profile_state") ?></label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="state"
|
||||
name="state"
|
||||
placeholder="<?= lang("App.profile_state_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->state : set_value('state'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="city" class="form-label"><?= lang("App.profile_city") ?></label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="city"
|
||||
name="city"
|
||||
placeholder="<?= lang("App.profile_city_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->city : set_value('city'); ?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label class="form-label" for="country"><?= lang("App.profile_country") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->country ?? [] : set_value('country'); ?>
|
||||
<select name="country" id="country" class="select2 form-select">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<?php foreach ($country ?? [] as $item) : ?>
|
||||
<option value="<?= $item['code'] ?? '' ?>" <?= $id_select == $item['code'] ? 'selected' : '' ?>><?= $item['name'] ?? '' ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3 col-md-6">
|
||||
<label for="language" class="form-label"><?= lang("App.profile_language") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->language ?? [] : set_value('language'); ?>
|
||||
<select name="language" id="language" class="select2 form-select">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?= lang("App.lang_en") ?></option>
|
||||
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?= lang("App.lang_es") ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<button type="submit" class="btn btn-primary me-2"><?= $btn_submit['title'] ?? '' ?></button>
|
||||
<button type="reset" class="btn btn-label-secondary"><?= $btn_return['title'] ?? '' ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /Account -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="card">
|
||||
<h5 class="card-header">Delete Account</h5>
|
||||
<div class="card-body">
|
||||
<div class="mb-3 col-12 mb-0">
|
||||
<div class="alert alert-warning">
|
||||
<h5 class="alert-heading mb-1">Are you sure you want to delete your account?</h5>
|
||||
<p class="mb-0">Once you delete your account, there is no going back. Please be certain.</p>
|
||||
</div>
|
||||
</div>
|
||||
<form id="formAccountDeactivation" onsubmit="return false">
|
||||
<div class="form-check mb-4">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
name="accountActivation"
|
||||
id="accountActivation"
|
||||
/>
|
||||
<label class="form-check-label" for="accountActivation"
|
||||
>I confirm my account deactivation</label
|
||||
>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-danger deactivate-account">Deactivate Account</button>
|
||||
</form>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php $settings = session()->get('settings'); ?>
|
||||
|
||||
<?php if ($settings['two_factor_auth']) : ?>
|
||||
<form name="form_otp" class="form" action="<?= site_url("profile/store") ?>" method="post" id="sendFormTFA">
|
||||
<?= csrf_field() ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row mx-0" style="width: 100%;">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<h4 class="card-title"><?= lang("App.profile_subtitle_tfa") ?></h4>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<div class="custom-control custom-switch ml-2">
|
||||
<input type="checkbox" id="tfa" name="tfa" class="custom-control-input"
|
||||
onchange="tfaView()" <?= $obj['tfa'] ?? false ? 'checked' : '' ?>>
|
||||
<label for="tfa"
|
||||
class="custom-control-label"><?= lang("App.profile_tfa_msg") ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="otp" style="display: <?= $obj['tfa'] ?? false ? 'block' : 'none' ?>">
|
||||
<?php
|
||||
$tfa = new \App\Libraries\Authenticator();
|
||||
$name = $obj['first_name'] ?? '';
|
||||
if ($obj['tfa'] && !empty($obj['tfa_secret'])) {
|
||||
$tfa_secret = $obj['tfa_secret'] ?? '';
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
} else {
|
||||
$tfa_secret = $tfa->createSecret();
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<p><b><?= lang("App.profile_qrcode") ?></b></p>
|
||||
<img src="<?php echo $qrcode; ?>" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<p><b><?= lang("App.profile_backup_code") ?></b></p>
|
||||
<?php
|
||||
$codes = "";
|
||||
if (!empty($obj['tfa_code'] ?? '')) {
|
||||
$codes = explode(',', $obj['tfa_code'] ?? '');
|
||||
foreach ($codes as $item) {
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $item . '</span>';
|
||||
}
|
||||
} else {
|
||||
$codes = array();
|
||||
for ($i = 1; $i <= 8; $i++) {
|
||||
$code = random_string('numeric', 6);
|
||||
$codes[] = $code;
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $code . '</span>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p class="mt-2"><b><?= lang("App.profile_tfa_secret") ?></b><br><b
|
||||
class="text-primary"><?= $tfa_secret ?></b></p>
|
||||
<input type="hidden" id="tfa_secret" name="tfa_secret"
|
||||
value="<?= $tfa_secret ?>">
|
||||
<input type="hidden" id="tfa_code" name="tfa_code"
|
||||
value="<?= implode(',', $codes) ?>">
|
||||
<button type="button" class="btn btn-primary btn-block mt-2"
|
||||
onclick="download('<?= lang("App.profile_qrcode") ?>\n<?= implode(",", $codes) ?>\n<?= lang("App.profile_tfa_secret") ?>\n<?= $tfa_secret ?>','backup_codes.txt')">
|
||||
<i class="fas fa-download mr-1"></i> <?= lang("App.profile_tfa_download") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
$('#first_name').focus();
|
||||
});
|
||||
$('.file-upload').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#file').trigger('click');
|
||||
});
|
||||
|
||||
<?php if ($settings['two_factor_auth']) : ?>
|
||||
function download(text, filename) {
|
||||
let blob = new Blob([text], {type: "text/plain;charset=utf-8"});
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
}
|
||||
|
||||
function tfaView() {
|
||||
document.getElementById("sendFormTFA").submit();
|
||||
}
|
||||
<?php endif; ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
444
ci4/app/Views/themes/vuexy/form/profile/index_old.php
Executable file
444
ci4/app/Views/themes/vuexy/form/profile/index_old.php
Executable file
@ -0,0 +1,444 @@
|
||||
<!--Style-->
|
||||
<link href="<?= site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css") ?>"
|
||||
rel="stylesheet">
|
||||
<style>
|
||||
.input_hidden {
|
||||
border: 0;
|
||||
clip: rect(0 0 0 0);
|
||||
height: 1px;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
</style>
|
||||
<!--Content Body-->
|
||||
<div class="content-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row page-titles mx-0">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<div class="welcome-text">
|
||||
<h4><i class="<?= $title['icon'] ?? '' ?>"></i> <?= $title['module'] ?? '' ?></h4>
|
||||
<span class="ml-1"><?= $title['page'] ?? '' ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<ol class="breadcrumb">
|
||||
<?php foreach ($breadcrumb ?? [] as $item) : ?>
|
||||
<?php if (!$item['active']) : ?>
|
||||
<li class="breadcrumb-item"><a
|
||||
href="<?= site_url($item['route']) ?>"><?= $item['title'] ?></a></li>
|
||||
<?php else : ?>
|
||||
<li class="breadcrumb-item active"><?= $item['title'] ?></li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= $title['page'] ?? '' ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<?= formAlert() ?>
|
||||
<form class="form" action="<?= site_url("profile/store") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?= lang("App.profile_msg_desc_1") ?></label>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_first_name") ?></label>
|
||||
<input type="text" id="first_name" name="first_name" class="form-control"
|
||||
placeholder="<?= lang("App.profile_first_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->first_name : set_value('first_name'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_last_name") ?></label>
|
||||
<input type="text" id="last_name" name="last_name" class="form-control"
|
||||
placeholder="<?= lang("App.profile_last_name_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->last_name : set_value('last_name'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_date_birth") ?></label>
|
||||
<input type="text" class="form-control"
|
||||
placeholder="<?= lang("App.profile_date_birth_ph") ?>"
|
||||
id="date_birth" name="date_birth"
|
||||
value="<?= (isset($obj)) ? $obj->date_birth : set_value('date_birth'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_email") ?></label>
|
||||
<input type="text" id="email" name="email" class="form-control"
|
||||
placeholder="<?= lang("App.profile_email_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->email : set_value('email'); ?>"
|
||||
disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="mobile"
|
||||
class="text-dark"><?= lang("App.profile_mobile") ?></label>
|
||||
<input type="text" id="mobile" name="mobile" class="form-control"
|
||||
placeholder="<?= lang("App.profile_mobile_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->mobile : set_value('mobile'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="password"
|
||||
class="text-dark"><?= lang("App.profile_password") ?></label>
|
||||
<input type="password" id="password" name="password" class="form-control"
|
||||
placeholder="<?= lang("App.profile_password_ph") ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="confirm_password"
|
||||
class="text-dark"><?= lang("App.profile_confirm_password") ?></label>
|
||||
<input type="password" id="confirm_password" name="confirm_password"
|
||||
class="form-control"
|
||||
placeholder="<?= lang("App.profile_confirm_password_ph") ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<label class="text-primary"><?= lang("App.profile_msg_desc_2") ?></label>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="form-group">
|
||||
<label class="text-dark"><?= lang("App.profile_address") ?></label>
|
||||
<input type="text" id="address" name="address" class="form-control"
|
||||
placeholder="<?= lang("App.profile_address_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->address : set_value('address'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="city" class="text-dark"><?= lang("App.profile_city") ?></label>
|
||||
<input type="text" id="city" name="city" class="form-control"
|
||||
placeholder="<?= lang("App.profile_city_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->city : set_value('city'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="state"
|
||||
class="text-dark"><?= lang("App.profile_state") ?></label>
|
||||
<input type="text" id="state" name="state" class="form-control"
|
||||
placeholder="<?= lang("App.profile_state_ph") ?>"
|
||||
value="<?= (isset($obj)) ? $obj->state : set_value('state'); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="country"
|
||||
class="text-dark"><?= lang("App.profile_country") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->country ?? [] : set_value('country'); ?>
|
||||
<select name="country" id="country" class="form-control">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<?php foreach ($country ?? [] as $item) : ?>
|
||||
<option value="<?= $item['code'] ?? '' ?>" <?= $id_select == $item['code'] ? 'selected' : '' ?>><?= $item['name'] ?? '' ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="form-group">
|
||||
<label for="language"
|
||||
class="text-dark"><?= lang("App.profile_language") ?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj->language ?? [] : set_value('language'); ?>
|
||||
<select name="language" id="language" class="form-control">
|
||||
<option value=""><?= lang("App.global_select") ?></option>
|
||||
<option value="en" <?= $id_select == "en" ? 'selected' : '' ?>><?= lang("App.lang_en") ?></option>
|
||||
<option value="es" <?= $id_select == "es" ? 'selected' : '' ?>><?= lang("App.lang_es") ?></option>
|
||||
<option value="pt" <?= $id_select == "pt" ? 'selected' : '' ?>><?= lang("App.lang_pt") ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<a href="<?= site_url($btn_return['route'] ?? '#') ?>"
|
||||
class="<?= $btn_return['class'] ?? '' ?>">
|
||||
<i class="<?= $btn_return['icon'] ?? '' ?>"></i> <?= $btn_return['title'] ?? '' ?>
|
||||
</a>
|
||||
<button type="submit" class="<?= $btn_submit['class'] ?? '' ?>">
|
||||
<i class="<?= $btn_submit['icon'] ?? '' ?>"></i> <?= $btn_submit['title'] ?? '' ?>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title"><?= lang("App.profile_subtitle_image") ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<img src="<?= $obj->picture ?? '' ?>" class="btn-circle btn-circle-md">
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-3">
|
||||
<span><b><?= $obj->first_name ?? '' ?></b></span><br>
|
||||
<span><?= $obj->email ?? '' ?></span>
|
||||
</div>
|
||||
<div class="col-lg-12 mt-3">
|
||||
<button type="button" class="btn btn-primary btn-block" data-toggle="modal"
|
||||
data-target="#photoModalCenter"><i
|
||||
class="fas fa-camera"></i> <?= lang("App.profile_change_photo") ?></button>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="photoModalCenter">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 mb-2">
|
||||
<h5><?= lang("App.profile_change_image") ?></h5>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_upload" class="form"
|
||||
action="<?= site_url("profile") ?>"
|
||||
enctype="multipart/form-data" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="file" name="file" id="file"
|
||||
class="input_hidden"
|
||||
onchange="form_upload.submit()" accept="image/*">
|
||||
<div class="btn btn-light btn-circle btn-circle-md"><a
|
||||
href="#" class="file-upload"><i
|
||||
class="fas fa-cloud-upload-alt fa-2xl"></i></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-upload"></i> <?= strtoupper(lang("App.profile_upload_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_not" action="<?= site_url("profile") ?>"
|
||||
method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_not" name="image_not"
|
||||
value="<?= site_url("assets/img/default-user.png") ?>">
|
||||
<a href="javascript:form_not.submit()"><img
|
||||
src="<?= site_url("assets/img/default-user.png") ?>"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-user-slash"></i> <?= strtoupper(lang("App.profile_no_image_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_gravatar"
|
||||
action="<?= site_url("profile") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" id="image_gravatar"
|
||||
name="image_gravatar"
|
||||
value="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150">
|
||||
<a href="javascript:form_gravatar.submit()"><img
|
||||
src="https://s.gravatar.com/avatar/<?= MD5($obj->email ?? '') ?>?s=150"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><i class="fas fa-user-circle"></i> <?= strtoupper(lang("App.profile_gravatar_msg")) ?>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach ($oauth ?? [] as $item) : ?>
|
||||
<?php
|
||||
$icon = '';
|
||||
switch ($item['provider']) {
|
||||
case "vkontakte":
|
||||
$icon = '<i class="fab fa-vk"></i> ';
|
||||
break;
|
||||
case "wechat":
|
||||
$icon = '<i class="fab fa-weixin"></i> ';
|
||||
break;
|
||||
default:
|
||||
$icon = '<i class="fab fa-' . $item['provider'] . '"></i> ';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div class="col-lg-3 mt-2">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 justify-content-center d-flex">
|
||||
<form name="form_<?= $item['provider'] ?? '' ?>"
|
||||
action="<?= site_url("profile") ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden"
|
||||
id="image_<?= $item['provider'] ?? '' ?>"
|
||||
name="image_<?= $item['provider'] ?? '' ?>"
|
||||
value="<?= $item['picture'] ?? '' ?>">
|
||||
<a href="javascript:form_<?= $item['provider'] ?? '' ?>.submit()"><img
|
||||
src="<?= $item['picture'] ?? '' ?>"
|
||||
class="btn-circle btn-circle-md"></a>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-12 text-center mt-1">
|
||||
<b><?= $icon ?><?= strtoupper($item['provider'] ?? '') ?></b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php $settings = session()->get('settings'); ?>
|
||||
|
||||
<?php if ($settings['two_factor_auth']) : ?>
|
||||
<form name="form_otp" class="form" action="<?= site_url("profile/store") ?>" method="post" id="sendFormTFA">
|
||||
<?= csrf_field() ?>
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="row mx-0" style="width: 100%;">
|
||||
<div class="col-sm-6 p-md-0">
|
||||
<h4 class="card-title"><?= lang("App.profile_subtitle_tfa") ?></h4>
|
||||
</div>
|
||||
<div class="col-sm-6 p-md-0 justify-content-sm-end mt-2 mt-sm-0 d-flex">
|
||||
<div class="custom-control custom-switch ml-2">
|
||||
<input type="checkbox" id="tfa" name="tfa" class="custom-control-input"
|
||||
onchange="tfaView()" <?= $obj['tfa'] ?? false ? 'checked' : '' ?>>
|
||||
<label for="tfa"
|
||||
class="custom-control-label"><?= lang("App.profile_tfa_msg") ?></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="otp" style="display: <?= $obj['tfa'] ?? false ? 'block' : 'none' ?>">
|
||||
<?php
|
||||
$tfa = new \App\Libraries\Authenticator();
|
||||
$name = $obj['first_name'] ?? '';
|
||||
if ($obj['tfa'] && !empty($obj['tfa_secret'])) {
|
||||
$tfa_secret = $obj['tfa_secret'] ?? '';
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
} else {
|
||||
$tfa_secret = $tfa->createSecret();
|
||||
$qrcode = $tfa->GetQR("{$settings['title']} ({$name})", $tfa_secret);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<p><b><?= lang("App.profile_qrcode") ?></b></p>
|
||||
<img src="<?php echo $qrcode; ?>" class="img-responsive">
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<p><b><?= lang("App.profile_backup_code") ?></b></p>
|
||||
<?php
|
||||
$codes = "";
|
||||
if (!empty($obj['tfa_code'] ?? '')) {
|
||||
$codes = explode(',', $obj['tfa_code'] ?? '');
|
||||
foreach ($codes as $item) {
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $item . '</span>';
|
||||
}
|
||||
} else {
|
||||
$codes = array();
|
||||
for ($i = 1; $i <= 8; $i++) {
|
||||
$code = random_string('numeric', 6);
|
||||
$codes[] = $code;
|
||||
echo '<span class="badge badge-primary mr-2 mb-1">' . $code . '</span>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<p class="mt-2"><b><?= lang("App.profile_tfa_secret") ?></b><br><b
|
||||
class="text-primary"><?= $tfa_secret ?></b></p>
|
||||
<input type="hidden" id="tfa_secret" name="tfa_secret"
|
||||
value="<?= $tfa_secret ?>">
|
||||
<input type="hidden" id="tfa_code" name="tfa_code"
|
||||
value="<?= implode(',', $codes) ?>">
|
||||
<button type="button" class="btn btn-primary btn-block mt-2"
|
||||
onclick="download('<?= lang("App.profile_qrcode") ?>\n<?= implode(",", $codes) ?>\n<?= lang("App.profile_tfa_secret") ?>\n<?= $tfa_secret ?>','backup_codes.txt')">
|
||||
<i class="fas fa-download mr-1"></i> <?= lang("App.profile_tfa_download") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Required vendors -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/global/global.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/js/quixnav-init.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/js/custom.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/select2/js/select2.full.min.js") ?>">></script>
|
||||
<!-- Alert -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/sweetalert2/dist/sweetalert2.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/toastr/js/toastr.min.js") ?>">></script>
|
||||
<!-- Date Range Picker -->
|
||||
<!-- momment js is must -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/moment/moment.min.js") ?>">></script>
|
||||
<script src="<?= site_url("themes/focus2/vendor/bootstrap-daterangepicker/daterangepicker.js") ?>">></script>
|
||||
<!-- Material color picker -->
|
||||
<script src="<?= site_url("themes/focus2/vendor/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js") ?>">></script>
|
||||
<!-- Form -->
|
||||
<script>
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
$('#first_name').focus();
|
||||
$("#country").select2();
|
||||
$("#language").select2();
|
||||
$('#date_birth').bootstrapMaterialDatePicker({
|
||||
format: '<?=momentDateJS()?>',
|
||||
time: false
|
||||
});
|
||||
});
|
||||
$('.file-upload').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#file').trigger('click');
|
||||
});
|
||||
|
||||
function download(text, filename) {
|
||||
let blob = new Blob([text], {type: "text/plain;charset=utf-8"});
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
let a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
}
|
||||
|
||||
function tfaView() {
|
||||
document.getElementById("sendFormTFA").submit();
|
||||
}
|
||||
</script>
|
||||
<?= sweetAlert() ?>
|
||||
431
ci4/app/Views/themes/vuexy/form/settings/_settingsFormItems.php
Normal file
431
ci4/app/Views/themes/vuexy/form/settings/_settingsFormItems.php
Normal file
@ -0,0 +1,431 @@
|
||||
<div class="row mt-4">
|
||||
|
||||
<!-- Navigation -->
|
||||
<div class="col-lg-3 col-md-4 col-12 mb-md-0 mb-3">
|
||||
<div class="d-flex justify-content-between flex-column mb-2 mb-md-0">
|
||||
<ul class="nav nav-align-left nav-pills flex-column">
|
||||
<li class="nav-item">
|
||||
<button class="nav-link active" data-bs-toggle="tab" data-bs-target="#general">
|
||||
<i class="ti ti-sitemap me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold"><?=lang("App.settings_label_general")?></span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#email">
|
||||
<i class="ti ti-mail me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold"><?=lang("App.settings_label_email")?></span>
|
||||
</button>
|
||||
</li>
|
||||
<?php /*
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#backup">
|
||||
<i class="ti ti-server me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold"><?=lang("App.settings_label_backup")?></span>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#logs">
|
||||
<i class="ti ti-archive me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold"><?=lang("App.settings_label_logs")?></span>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<button class="nav-link" data-bs-toggle="tab" data-bs-target="#cron">
|
||||
<i class="ti ti-rotate-clockwise me-1 ti-sm"></i>
|
||||
<span class="align-middle fw-semibold"><?=lang("App.settings_label_cron")?></span>
|
||||
</button>
|
||||
</li>
|
||||
*/ ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Navigation -->
|
||||
|
||||
<!-- System Settings -->
|
||||
<div class="col-lg-9 col-md-8 col-12">
|
||||
<form class="form" action="<?= $formAction ?>" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<div class="tab-content py-0">
|
||||
<!-- General Settings -->
|
||||
<div class="tab-pane fade show active" id="general" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-sitemap ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle"><?=lang("App.settings_label_general_title")?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="row card-body">
|
||||
DETALLES ESPECIFICOS DEL ERP (TBD)
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /General Settings -->
|
||||
|
||||
<!-- Email Settings -->
|
||||
<div class="tab-pane fade show" id="email" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-mail ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle"><?=lang("App.settings_label_email_title")?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="row card-body">
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label class="text-primary"><?=lang("App.settings_label_email_subtitle_1")?></label>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<label for="email_gateway" class="form-label"><?=lang("App.settings_field_email_gateway")?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj['email_gateway'] : set_value('email_gateway');?>
|
||||
<select name="email_gateway" id="email_gateway" class="select2 form-control">
|
||||
<option value="smtp" <?= $id_select == "smtp" ? 'selected' : '' ?>><?=lang("App.settings_field_email_gateway_smtp")?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<label for="email_smtp" class="form-label"><?=lang("App.settings_field_email_smtp")?></label>
|
||||
<input
|
||||
type="text"
|
||||
id="email_smtp"
|
||||
name="email_smtp"
|
||||
class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_email_smtp_ph")?>"
|
||||
value="<?= old('email_smtp', $settingsEntity->email_smtp) ?>"
|
||||
>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<label for="email_port" class="form-label"><?=lang("App.settings_field_email_port")?></label>
|
||||
<input
|
||||
type="number"
|
||||
id="email_port"
|
||||
name="email_port"
|
||||
class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_email_port_ph")?>"
|
||||
value="<?= old('email_port', $settingsEntity->email_port) ?>"
|
||||
>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<label for="email_cert" class="form-label"><?=lang("App.settings_field_email_cert")?></label>
|
||||
<?php $id_select = (isset($settingsEntity)) ? $settingsEntity->email_cert : 'none';?>
|
||||
<select name="email_cert" id="email_cert" class="select2 form-control">
|
||||
<option value="none" <?= $id_select == "none" ? 'selected' : '' ?>><?=lang("App.settings_field_email_cert_none")?></option>
|
||||
<option value="ssl" <?= $id_select == "ssl" ? 'selected' : '' ?>><?=lang("App.settings_field_email_cert_ssl")?></option>
|
||||
<option value="tls" <?= $id_select == "tls" ? 'selected' : '' ?>><?=lang("App.settings_field_email_cert_tls")?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label for="email_address" class="form-label"><?=lang("App.settings_field_email_address")?></label>
|
||||
<input
|
||||
type="text"
|
||||
id="email_address"
|
||||
name="email_address"
|
||||
class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_email_address_ph")?>"
|
||||
value="<?= old('email_address', $settingsEntity->email_address) ?>"
|
||||
>
|
||||
</div>
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label for="email_pass" class="form-label"><?=lang("App.settings_field_email_pass")?></label>
|
||||
<input
|
||||
type="password"
|
||||
id="email_pass"
|
||||
name="email_pass"
|
||||
class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_email_pass_ph")?>"
|
||||
value="<?= old('email_pass', $settingsEntity->email_pass) ?>"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label for="email_name" class="form-label"><?=lang("App.settings_field_email_name")?></label>
|
||||
<input
|
||||
type="text"
|
||||
id="email_name"
|
||||
name="email_name" class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_email_name_ph")?>"
|
||||
value="<?= old('email_name', $settingsEntity->email_name) ?>"
|
||||
>
|
||||
</div>
|
||||
<?php /*
|
||||
<div class="col-lg-12 mt-4 mb-3">
|
||||
<label class="text-primary"><?=lang("App.settings_field_test_send")?></label>
|
||||
</div>
|
||||
<div class="col-lg-6 mb-3">
|
||||
<label class="form-label"><?=lang("App.settings_field_email_address")?></label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
type="email"
|
||||
id="send_email_test"
|
||||
name="send_email_test"
|
||||
class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_email_address_ph")?>"
|
||||
>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-primary" onclick="send_test()"><?=lang("App.settings_field_test_send_btn")?></button>
|
||||
</div>
|
||||
</div>
|
||||
<p class="text-primary" id="msg_email_test" style="display: none;"><i class="fas fa-spinner fa-pulse"></i> <?= lang("App.login_wait") ?></p>
|
||||
</div>
|
||||
*/ ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Email Settings -->
|
||||
|
||||
<?php /*
|
||||
<!-- Backup Settings -->
|
||||
<div class="tab-pane fade show" id="backup" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-server ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle"><?=lang("App.settings_label_backup_title")?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="row card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label class="text-primary"><?=lang("App.settings_label_backup_subtitle_1")?></label>
|
||||
</div>
|
||||
<div class="col-lg-4 mb-3">
|
||||
<label for="backup_storage" class="form-label"><?=lang("App.settings_field_backup_storage")?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj['backup_storage'] : set_value('backup_storage');?>
|
||||
<select name="backup_storage" id="backup_storage" class="select2 form-control">
|
||||
<option value="local" <?= $id_select == "local" ? 'selected' : '' ?>><?=lang("App.settings_field_storage_gateway_local")?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-4 mb-3">
|
||||
<label for="backup_table" class="form-label"><?=lang("App.settings_field_backup_table")?></label>
|
||||
<?php $select = (isset($obj)) ? $obj['backup_table'] : set_value('backup_table');?>
|
||||
<select name="backup_table[]" id="backup_table" class="select2 form-control" multiple="multiple">
|
||||
<?php
|
||||
$select = explode(',',$select);
|
||||
foreach($select??[] as $id_select){
|
||||
if ($id_select == "all"){
|
||||
$all = 'selected';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<option value="all" <?=$all??''?>><?=lang("App.settings_field_backup_table_all")?></option>
|
||||
<?php foreach ($tables??[] as $item) : ?>
|
||||
<?php foreach ($select??[] as $id_select) : ?>
|
||||
<?php
|
||||
if ($id_select == $item){
|
||||
$selItem = 'selected';
|
||||
}
|
||||
?>
|
||||
<?php endforeach; ?>
|
||||
<option value="<?=$item?>" <?=$selItem??''?>><?=lang("App.settings_field_backup_table")?> (<?=$item?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-4 mb-3">
|
||||
<label for="backup_time" class="form-label"><?=lang("App.settings_field_backup_time")?></label>
|
||||
<?php $id_select = (isset($obj)) ? $obj['backup_time'] : set_value('backup_time');?>
|
||||
<select name="backup_time" id="backup_time" class="select2 form-control">
|
||||
<?php for ($i = 0; $i <= 23; $i++) : ?>
|
||||
<option value="<?= $i < 10 ? '0'.$i.':00:00':$i.':00:00' ?>" <?= $id_select == "<?= $i < 10 ? '0'.$i.':00:00':$i.':00:00' ?>" ? 'selected' : '' ?>><?= $i < 10 ? '0'.$i.':00':$i.':00' ?></option>
|
||||
<option value="<?= $i < 10 ? '0'.$i.':30:00':$i.':30:00' ?>" <?= $id_select == "<?= $i < 10 ? '0'.$i.':30:00':$i.':30:00' ?>" ? 'selected' : '' ?>><?= $i < 10 ? '0'.$i.':30':$i.':30' ?></option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label for="backup_email" class="form-label"><?=lang("App.settings_field_backup_email")?></label>
|
||||
<input
|
||||
type="text"
|
||||
id="backup_email"
|
||||
min="1"
|
||||
name="backup_email"
|
||||
class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_backup_email_ph")?>"
|
||||
value="<?= (isset($obj)) ? $obj['backup_email'] : set_value('backup_email');?>"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<div class="small mb-3"><?=lang("App.settings_field_backup_notification_email")?></div>
|
||||
<label class="switch">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="backup_notification_email"
|
||||
name="backup_notification_email"
|
||||
class="switch-input"
|
||||
<?= $obj['backup_notification_email']??false ? 'checked' : ''?>
|
||||
/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label"><?=lang("App.global_activate")?></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<div class="small mb-3"><?=lang("App.settings_field_backup_automatic")?></div>
|
||||
<label class="switch">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="backup_automatic"
|
||||
name="backup_automatic"
|
||||
class="switch-input"
|
||||
<?= $obj['backup_automatic']??false ? 'checked' : ''?>
|
||||
/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label"><?=lang("App.global_activate")?></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12 text-right mb-3">
|
||||
<a href="<?=site_url("integration/create_backup/1")?>" class="btn btn-primary mt-2">
|
||||
<i class="fas fa-download"></i> <?=lang("App.settings_label_backup_btn_1")?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Backup Settings -->
|
||||
|
||||
<!-- Logs Settings -->
|
||||
<div class="tab-pane fade show" id="logs" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-archive ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle"><?=lang("App.settings_label_logs_title")?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="row card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label class="text-primary"><?=lang("App.settings_label_logs_subtitle_1")?></label>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<div class="small mb-3"><?=lang("App.settings_field_remove_log")?></div>
|
||||
<label class="switch">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="remove_log"
|
||||
name="remove_log"
|
||||
class="switch-input"
|
||||
<?= $obj['remove_log']??false ? 'checked' : ''?>
|
||||
/>
|
||||
<span class="switch-toggle-slider">
|
||||
<span class="switch-on"></span>
|
||||
<span class="switch-off"></span>
|
||||
</span>
|
||||
<span class="switch-label"><?=lang("App.global_activate")?></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-lg-3 mb-3">
|
||||
<label for="remove_log_time" class="form-label"><?=lang("App.settings_field_remove_log_time")?></label>
|
||||
<div class="input-group">
|
||||
<input
|
||||
type="number"
|
||||
id="remove_log_time"
|
||||
min="1"
|
||||
name="remove_log_time"
|
||||
class="form-control"
|
||||
placeholder="<?=lang("App.settings_field_remove_log_time_ph")?>"
|
||||
value="<?= (isset($obj)) ? $obj['remove_log_time'] : set_value('remove_log_time');?>"
|
||||
/>
|
||||
<span class="input-group-text"><?=lang("App.global_days")?></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Logs Settings -->
|
||||
|
||||
<!-- Cron Settings -->
|
||||
<div class="tab-pane fade show" id="cron" role="tabpanel">
|
||||
<div class="d-flex mb-3 gap-3">
|
||||
<div>
|
||||
<span class="badge bg-label-primary rounded-2 p-2">
|
||||
<i class="ti ti-rotate-clockwise ti-lg"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="mb-0">
|
||||
<span class="align-middle"><?=lang("App.settings_label_cron_title")?></span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="row card-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label class="text-primary"><?=lang("App.settings_label_cron_subtitle_1")?></label>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 mb-3">
|
||||
<p class="form-label">
|
||||
<b><?=lang("App.settings_label_cron_timer")?></b>
|
||||
<br><?=lang("App.settings_label_cron_timer_time")?>
|
||||
<br><?=getenv('app.baseURL').'/cron'?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-lg-12 mb-3">
|
||||
<label class="text-primary"><?=lang("App.settings_label_cron_subtitle_2")?></label>
|
||||
<!-- CSRF token -->
|
||||
<input type="hidden" class="txt_csrfname" name="<?= csrf_token() ?>" value="<?= csrf_hash() ?>" />
|
||||
<!-- Table -->
|
||||
<table id='table-grid' class="table table-striped nowrap" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?=lang("App.settings_grid_routine")?></th>
|
||||
<th><?=lang("App.settings_group_grid_error")?></th>
|
||||
<th><?=lang("App.settings_group_grid_created_at")?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Cron Settings -->
|
||||
*/ ?>
|
||||
|
||||
</div>
|
||||
<div class="tab-content pt-4">
|
||||
<button type="submit" class="btn btn-primary float-start me-sm-3 me-1">
|
||||
<?= lang("App.global_save") ?>
|
||||
</button>
|
||||
<a href="<?= site_url('/') ?>" class="btn btn-secondary">
|
||||
<?= lang("App.global_come_back") ?>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /System Settings -->
|
||||
|
||||
</div>
|
||||
@ -0,0 +1,32 @@
|
||||
<?= $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 -->
|
||||
|
||||
<div class="card-body">
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/settings/_settingsFormItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!-- /.card-footer -->
|
||||
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
56
ci4/app/Views/themes/vuexy/form/tarifas/acabado/_tarifaAcabadoFormItems.php
Executable file
56
ci4/app/Views/themes/vuexy/form/tarifas/acabado/_tarifaAcabadoFormItems.php
Executable file
@ -0,0 +1,56 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('Tarifaacabado.nombre') ?>*
|
||||
</label>
|
||||
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control"
|
||||
value="<?= old('nombre', $tarifaacabadoEntity->nombre) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('Tarifaacabado.precioMin') ?>*
|
||||
</label>
|
||||
<input type="text" id="precio_min" name="precio_min" class="form-control"
|
||||
value="<?= old('precio_min', $tarifaacabadoEntity->precio_min) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="nombre" class="form-label">
|
||||
<?= lang('Tarifaacabado.importeFijo') ?>*
|
||||
</label>
|
||||
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control"
|
||||
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaacabadoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifaacabado.mostrar_en_presupuesto') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="acabado_cubierta" class="form-check-label">
|
||||
<input type="checkbox" id="acabado_cubierta" name="acabado_cubierta" value="1" class="form-check-input" <?= $tarifaacabadoEntity->acabado_cubierta == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifaacabado.acabado_cubierta') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<label for="acabado_sobrecubierta" class="form-check-label">
|
||||
<input type="checkbox" id="acabado_sobrecubierta" name="acabado_sobrecubierta" value="1" class="form-check-input" <?= $tarifaacabadoEntity->acabado_sobrecubierta == true ? 'checked' : ''; ?>>
|
||||
<?= lang('Tarifaacabado.acabado_sobrecubierta') ?>
|
||||
</label>
|
||||
</div><!--//.form-check -->
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!-- //.row -->
|
||||
260
ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoForm.php
Executable file
260
ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoForm.php
Executable file
@ -0,0 +1,260 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
<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="tarifaAcabadoForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/backend/vuexy/form/tarifas/acabado/_tarifaAcabadoFormItems") ?>
|
||||
<div class="pt-4">
|
||||
<input type="submit"
|
||||
class="btn btn-primary float-start me-sm-3 me-1"
|
||||
name="save"
|
||||
value="<?= lang("Basic.global.Save") ?>"
|
||||
/>
|
||||
<?= anchor(route_to("tarifaAcabadoList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
</div><!-- /.card-footer -->
|
||||
</form>
|
||||
</div><!-- //.card -->
|
||||
</div><!--//.col -->
|
||||
|
||||
<?php if($formAction == route_to('createTarifaAcabado')): ?>
|
||||
<div class="accordion mt-3" id="accordionAcabadoLineas" style="visibility:hidden" >
|
||||
<?php else: ?>
|
||||
<div class="accordion mt-3" id="accordionAcabadoLineas" style="visibility:visible" >
|
||||
<?php endif; ?>
|
||||
<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="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||
<h3><?= lang("TarifaAcabadoLineas.moduleTitle") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionAcabadoLineas">
|
||||
<div class="accordion-body">
|
||||
<table id="tableOfTarifaacabadolineas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('TarifaAcabadoLineas.tiradaMin') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.tiradaMax') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaAcabadoLineas.margen') ?></th>
|
||||
<th style="min-width:100px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
let id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-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('editorOfTarifaAcabadoLineas') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfTarifaacabadolineas",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "tirada_min"
|
||||
}, {
|
||||
name: "precio_max"
|
||||
}, {
|
||||
name: "tirada_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
},{
|
||||
name: "margen"
|
||||
}, {
|
||||
"name": "tarifa_acabado_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "deleted_at",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "is_deleted",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['tarifa_acabado_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['tarifa_acabado_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();
|
||||
});
|
||||
|
||||
|
||||
var theTable = $('#tableOfTarifaacabadolineas').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-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfTarifaAcabadoLineas') ?>',
|
||||
data: {
|
||||
id_tarifaacabado: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{ 'data': 'tirada_min' },
|
||||
{ 'data': 'precio_max' },
|
||||
{ 'data': 'tirada_max' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'margen' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
},
|
||||
{"orderData": [ 0, 1 ], "targets": 0 },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
|
||||
},
|
||||
buttons: [ {
|
||||
className: 'btn btn-primary me-sm-3 me-1',
|
||||
extend: "createInline",
|
||||
editor: editor,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfTarifaacabadolineas').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: `/tarifas/tarifaacabadolineas/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
153
ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoList.php
Executable file
153
ci4/app/Views/themes/vuexy/form/tarifas/acabado/viewTarifaAcabadoList.php
Executable file
@ -0,0 +1,153 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
<?= $this->section('content'); ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="card card-info">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><?= lang('Tarifaacabado.tarifaacabadoList') ?></h3>
|
||||
<?= anchor(route_to('newTarifaAcabado'), lang('Basic.global.addNew') . ' ' . lang('Tarifaacabado.tarifaacabado'), ['class' => 'btn btn-primary float-end']); ?>
|
||||
</div><!--//.card-header -->
|
||||
<div class="card-body">
|
||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||
|
||||
<table id="tableOfTarifasacabado" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaacabado.nombre') ?></th>
|
||||
<th><?= lang('Tarifaacabado.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
|
||||
<th><?= lang('Tarifaacabado.mostrar_en_presupuesto') ?></th>
|
||||
<th><?= lang('Tarifaacabado.acabado_cubierta') ?></th>
|
||||
<th><?= lang('Tarifaacabado.acabado_sobrecubierta') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!--//.card-body -->
|
||||
<div class="card-footer">
|
||||
|
||||
</div><!--//.card-footer -->
|
||||
</div><!--//.card -->
|
||||
</div><!--//.col -->
|
||||
</div><!--//.row -->
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalInlineJs') ?>
|
||||
const lastColNr = $('#tableOfTarifasacabado').find("tr:first th").length - 1;
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<td class="text-right py-0 align-middle">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
theTable = $('#tableOfTarifasacabado').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||
pageLength: 50,
|
||||
lengthChange: true,
|
||||
"dom": 'lfBrtip',
|
||||
"buttons": [
|
||||
'copy', 'csv', 'excel', 'print', {
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'A4'
|
||||
}
|
||||
],
|
||||
stateSave: true,
|
||||
order: [[0, 'asc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfTarifasAcabado') ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr]
|
||||
}
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': 'mostrar_en_presupuesto' },
|
||||
{ 'data': 'acabado_cubierta' },
|
||||
{ 'data': 'acabado_sobrecubierta' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [3, 4, 5];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-remove', function(e) {
|
||||
const dataId = $(this).attr('data-id');
|
||||
const row = $(this).closest('tr');
|
||||
if ($.isNumeric(dataId)) {
|
||||
$.ajax({
|
||||
url: `/tarifas/tarifaacabado/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error);
|
||||
})
|
||||
}
|
||||
});
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user