mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en pedidos 3
This commit is contained in:
24
ci4/app/Views/themes/vuexy/form/pedidos/_albaranesItems.php
Normal file
24
ci4/app/Views/themes/vuexy/form/pedidos/_albaranesItems.php
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordioAlbaranes">
|
||||
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingAlbaranes">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionAlbaranesTip" aria-expanded="false" aria-controls="accordionAlbaranesTip">
|
||||
<h3><?= lang("Pedidos.albaranes") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionAlbaranesTip" class="accordion-collapse collapse show" data-bs-parent="#accordioAlbaranes">
|
||||
<div class="accordion-body">
|
||||
|
||||
|
||||
</div> <!-- /.accordion-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -27,7 +27,7 @@
|
||||
<label for="cliente" class="form-label">
|
||||
<?= lang('Pedidos.cliente') ?>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="<?= route_to('editarCliente', $pedidoEntity->cliente_id); ?>" target="_blank" ><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<a href="<?= route_to('editarCliente', $pedidoEntity->cliente_id); ?>" target="_blank" ><i class="ti ti-file-search ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
</div>
|
||||
</label>
|
||||
<input readonly id="cliente" name="cliente" tabindex="2" maxLength="11" class="form-control" value="<?= old('cliente', $pedidoEntity->cliente) ?>" >
|
||||
@ -60,7 +60,7 @@
|
||||
<div class="card accordion-item active mt-3 mx-2">
|
||||
<h2 class="accordion-header" id="headingFechas">
|
||||
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionIcon-1" aria-controls="accordionIcon-1">
|
||||
<?= lang('Pedidos.totales') ?>
|
||||
<i class="ti ti-businessplan ti-sm mx-2"></i><?= lang('Pedidos.totales') ?>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
@ -95,7 +95,7 @@
|
||||
<div class="card accordion-item active mt-3 mx-2">
|
||||
<h2 class="accordion-header" id="headingFechas">
|
||||
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionIcon-1" aria-controls="accordionIcon-1">
|
||||
<?= lang("Pedidos.fechas") ?>
|
||||
<i class="ti ti-calendar ti-sm mx-2"></i><?= lang("Pedidos.fechas") ?>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
|
||||
24
ci4/app/Views/themes/vuexy/form/pedidos/_facturasItems.php
Normal file
24
ci4/app/Views/themes/vuexy/form/pedidos/_facturasItems.php
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="accordioFacturas">
|
||||
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingFacturas">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionFacturasTip" aria-expanded="false" aria-controls="accordionFacturasTip">
|
||||
<h3><?= lang("Pedidos.facturas") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionFacturasTip" class="accordion-collapse collapse show" data-bs-parent="#accordioFacturas">
|
||||
<div class="accordion-body">
|
||||
|
||||
|
||||
</div> <!-- /.accordion-body -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -13,24 +13,21 @@
|
||||
<table id="tableOfLineasPedido" 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>
|
||||
<th><?= lang('Pedidos.presupuesto') ?></th>
|
||||
<th><?=lang('Pedidos.unidades')?></th>
|
||||
<th><?= lang('Pedidos.concepto') ?></th>
|
||||
<th><?= lang('Pedidos.total') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="4" style="text-align:right">Total:</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div> <!-- /.accordion-body -->
|
||||
</div>
|
||||
@ -40,64 +37,97 @@
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
$("#fecha_entrega_real").flatpickr({
|
||||
dateFormat: "d/m/Y",
|
||||
locale: {
|
||||
firstDayOfWeek: 1,
|
||||
weekdays: {
|
||||
shorthand: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
|
||||
longhand: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
||||
},
|
||||
months: {
|
||||
shorthand: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Оct', 'Nov', 'Dic'],
|
||||
longhand: ['Enero', 'Febreo', 'Мarzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
|
||||
const lastColNr = $('#tableOfLineasPedido').find("tr:first th").length - 1;
|
||||
const viewPresupuestoBtns = 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-file-search ti-sm btn-view mx-2" data-id="${data.numero}"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
var tableOfLineasPedido = new DataTable('#tableOfLineasPedido',{
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
searchable: false,
|
||||
info: false,
|
||||
dom: '',
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('tablaLineasPedido') ?>',
|
||||
data: function ( d ) {
|
||||
d.pedido_id = <?= $pedidoEntity->id ?>;
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
orderable: false,
|
||||
data: null,
|
||||
defaultContent: ''
|
||||
},
|
||||
{
|
||||
targets: [1,2,3],
|
||||
orderable: false,
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
data: viewPresupuestoBtns,
|
||||
className: 'dt-center'
|
||||
},
|
||||
{data: 'unidades'},
|
||||
{data: 'concepto'},
|
||||
{data: 'total'},
|
||||
],
|
||||
footerCallback: function (row, data, start, end, display) {
|
||||
let api = this.api();
|
||||
|
||||
// Remove the formatting to get integer data for summation
|
||||
let intVal = function (i) {
|
||||
return typeof i === 'string'
|
||||
? i.replace(/[\$,]/g, '') * 1
|
||||
: typeof i === 'number'
|
||||
? i
|
||||
: 0;
|
||||
};
|
||||
|
||||
// Total over all pages
|
||||
total = api
|
||||
.column(3)
|
||||
.data()
|
||||
.reduce((a, b) => intVal(a) + intVal(b), 0);
|
||||
|
||||
// Update footer
|
||||
api.column(3).footer().innerHTML =
|
||||
'Total: ' + total;
|
||||
}
|
||||
});
|
||||
|
||||
$("#fecha_impresion").flatpickr({
|
||||
dateFormat: "d/m/Y",
|
||||
locale: {
|
||||
firstDayOfWeek: 1,
|
||||
weekdays: {
|
||||
shorthand: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
|
||||
longhand: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
||||
},
|
||||
months: {
|
||||
shorthand: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Оct', 'Nov', 'Dic'],
|
||||
longhand: ['Enero', 'Febreo', 'Мarzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$("#fecha_encuadernado").flatpickr({
|
||||
dateFormat: "d/m/Y",
|
||||
locale: {
|
||||
firstDayOfWeek: 1,
|
||||
weekdays: {
|
||||
shorthand: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
|
||||
longhand: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
||||
},
|
||||
months: {
|
||||
shorthand: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Оct', 'Nov', 'Dic'],
|
||||
longhand: ['Enero', 'Febreo', 'Мarzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$("#fecha_entrega_externo").flatpickr({
|
||||
dateFormat: "d/m/Y",
|
||||
locale: {
|
||||
firstDayOfWeek: 1,
|
||||
weekdays: {
|
||||
shorthand: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
|
||||
longhand: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
|
||||
},
|
||||
months: {
|
||||
shorthand: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Оct', 'Nov', 'Dic'],
|
||||
longhand: ['Enero', 'Febreo', 'Мarzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
|
||||
},
|
||||
},
|
||||
|
||||
$(document).on('click', '.btn-view', function(e) {
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')): ?>
|
||||
var url = '<?= route_to('editarPresupuesto', ':id') ?>';
|
||||
<?php else: ?>
|
||||
var url = '<?= route_to('editarPresupuestoCliente2', ':id') ?>';
|
||||
<?php endif; ?>
|
||||
url = url.replace(':id', `${$(this).attr('data-id')}` );
|
||||
console.log(url);
|
||||
window.open(
|
||||
url,
|
||||
'_blank' // <- This is what makes it open in a new window.
|
||||
);
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -17,6 +17,8 @@
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_cabeceraItems") ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_lineasItems") ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_albaranesItems") ?>
|
||||
<?= view("themes/vuexy/form/pedidos/_facturasItems") ?>
|
||||
</div><!-- /.card-body -->
|
||||
<div class="pt-4">
|
||||
<?= anchor(route_to("listaPresupuestos"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||
@ -30,9 +32,18 @@
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/flatpickr/flatpickr.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/flatpickr/flatpickr.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/select/dataTables.select.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() ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user