mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
editar factura
This commit is contained in:
@ -0,0 +1,87 @@
|
||||
<div class="row px-0">
|
||||
<div style="padding-left: 0px;" class="col-md-12 col-lg-6 accordion accordion accordion-bordered mt-3 accordion-without-arrow" id="addPedidosImpresion">
|
||||
<div class="card accordion-item active mt-3 mx-2">
|
||||
|
||||
<h3 class="accordion-header" id="headingAddPedidosImpresion">
|
||||
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionIcon-1" aria-controls="accordionIcon-1">
|
||||
<h4><?= lang('Facturas.addPedidosImpresion') ?> </h4>
|
||||
</button>
|
||||
</h3>
|
||||
|
||||
<div id="accordionAddPedidosImpresionTip" class="accordion show" data-bs-parent="#accordioAddPedidosImpresion">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-10">
|
||||
<select name="pedidoImpresion" id="pedidoImpresion" class="form-select">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-label-primary float-start me-sm-3 me-1"
|
||||
name="addNewPedidoImpresion"
|
||||
id="addNewPedidoImpresion" >
|
||||
|
||||
<?= lang("Basic.global.addNew") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div> <!--//row -->
|
||||
|
||||
</div> <!--//accordion-body -->
|
||||
</div> <!--//accordionFechasTip-->
|
||||
</div> <!--//card-->
|
||||
</div>
|
||||
|
||||
|
||||
<div style="padding-right: 0px;" class="col-md-12 col-lg-6 accordion accordion accordion-bordered mt-3 accordion-without-arrow" id="addPedidosMaquetacion">
|
||||
<div class="card accordion-item active mt-3 mx-2">
|
||||
|
||||
<h3 class="accordion-header" id="headingAddPedidosMaquetacion">
|
||||
<button type="button" class="accordion-button collapsed" data-bs-toggle="collapse" data-bs-target="#accordionIcon-1" aria-controls="accordionIcon-1">
|
||||
<h4><?= lang('Facturas.addPedidosMaquetacion') ?> </h4>
|
||||
</button>
|
||||
</h3>
|
||||
|
||||
<div id="accordionAddPedidosMaquetacionTip" class="accordion show" data-bs-parent="#accordioAddPedidosMaquetacion">
|
||||
<div class="accordion-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-10">
|
||||
<select name="pedidoMaquetacion" id="pedidoMaquetacion" class="form-select">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-label-primary float-start me-sm-3 me-1"
|
||||
name="addNewPedidoMaquetacion"
|
||||
id="addNewPedidoMaquetacion" >
|
||||
|
||||
<?= lang("Basic.global.addNew") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div> <!--//row -->
|
||||
|
||||
</div> <!--//accordion-body -->
|
||||
</div> <!--//accordionFechasTip-->
|
||||
</div> <!--//card-->
|
||||
</div>
|
||||
</div> <!--//row -->
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
$('#pedidoImpresion').select2({
|
||||
placeholder: "<?= lang('Facturas.pedidoImpresion') ?>",
|
||||
allowClear: true,
|
||||
width: '100%'
|
||||
});
|
||||
|
||||
$('#pedidoMaquetacion').select2({
|
||||
placeholder: "<?= lang('Facturas.pedidoMaquetacion') ?>",
|
||||
allowClear: true,
|
||||
width: '100%'
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -0,0 +1,307 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="cabeceraFactura">
|
||||
|
||||
<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="#accordionFacturaTip" aria-expanded="false" aria-controls="accordionFacturaTip">
|
||||
<h3><?= lang("Facturas.datosFactura") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionFacturaTip" class="accordion-collapse collapse show" data-bs-parent="#accordioFactura">
|
||||
<div class="accordion-body">
|
||||
|
||||
<div class="row">
|
||||
<h4><?= lang('Facturas.factura') . ': '?> <span style="color:red;"> <?= lang('Facturas.' . $facturaEntity->estado)?> </span></h4>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<?php if ($facturaEntity->estado === 'borrador') : ?>
|
||||
<div class="mb-1">
|
||||
<label for="id" class="form-label">
|
||||
<?= lang('Facturas.id') ?>
|
||||
</label>
|
||||
<input disabled id="id" name="id" tabindex="1" maxLength="11" class="form-control" value="<?= old('id', $facturaEntity->id) ?>" >
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="mb-1">
|
||||
<label for="id" class="form-label">
|
||||
<?= lang('Facturas.numeroFactura') ?>
|
||||
</label>
|
||||
<input disabled id="numero" name="numero" tabindex="1" maxLength="11" class="form-control" value="<?= old('numero', $facturaEntity->numero) ?>" >
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="serie_id" class="form-label">
|
||||
<?= lang('Facturas.serieFacturacion') ?>
|
||||
</label>
|
||||
<select id="serie_id" tabindex="2" name="serie_id" class="form-control select2bs2" style="width: 100%;">
|
||||
<option value="<?= old('serie_id', $facturaEntity->serie_id) ?>" selected><?= old('serie_nombre', $facturaEntity->serie_nombre) ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="creditoAsegurado" class="form-label">
|
||||
<?= lang('Facturas.creditoAsegurado') ?>
|
||||
</label>
|
||||
<select id="creditoAsegurado" tabindex="3" name="creditoAsegurado" class="form-control select2bs2" style="width: 100%;">
|
||||
<option value="0" <?= ($facturaEntity->creditoAsegurado == 0)?'selected':'' ?>> <?= lang('Basic.global.no') ?> </option>
|
||||
<option value="1" <?= ($facturaEntity->creditoAsegurado == 1)?'selected':'' ?>> <?= lang('Basic.global.yes') ?> </option>
|
||||
</select>
|
||||
</div>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="fecha_factura_at" class="form-label">
|
||||
<?= lang('Facturas.fechaFactura') ?>
|
||||
</label>
|
||||
<input type="text" value="" tabindex="4" id="fecha_factura_at" name="fecha_factura_at" tabindex="1" maxLength="11" class="form-control" value="<?= old('fecha_factura_at', $facturaEntity->fecha_factura_at) ?>" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12 col-lg-4 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_id" class="form-label">
|
||||
<?= lang('Facturas.cliente') ?>
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a href="<?= route_to('editarCliente', $facturaEntity->cliente_id); ?>" target="_blank" ><i class="ti ti-file-search ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
</div>
|
||||
</label>
|
||||
<select id="cliente_id" tabindex="5" name="tabindex="5"" class="form-control select2bs2" style="width: 100%;">
|
||||
<option value="<?= old('cliente_id', $facturaEntity->cliente_id) ?>" selected><?= old('cliente_alias', $facturaEntity->cliente_alias) ?></option>
|
||||
</select>
|
||||
</div>
|
||||
</div><!--//.mb-3 -->
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
|
||||
<div class="row mb-2">
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_nombre" class="form-label">
|
||||
<?= lang('Facturas.razonSocial') ?>
|
||||
</label>
|
||||
<input id="cliente_nombre" name="cliente_nombre" tabindex="6" class="form-control"" value="<?= old('cliente_nombre', $facturaEntity->cliente_nombre) ?>"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_cif" class="form-label">
|
||||
<?= lang('Facturas.cif') ?>
|
||||
</label>
|
||||
<input id="cliente_cif" name="cliente_cif" tabindex="7" class="form-control" value="<?= old('cliente_cif', $facturaEntity->cliente_cif) ?>"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_pais" class="form-label">
|
||||
<?= lang('Facturas.pais') ?>
|
||||
</label>
|
||||
<input id="cliente_pais" name="cliente_pais" tabindex="8" class="form-control"" value="<?= old('cliente_pais', $facturaEntity->cliente_pais) ?>"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<div class="row mb-3">
|
||||
|
||||
<div class="col-md-12 col-lg-4 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_direccion" class="form-label">
|
||||
<?= lang('Facturas.direccion') ?>
|
||||
</label>
|
||||
<input id="cliente_direccion" name="cliente_direccion" tabindex="6" class="form-control"" value="<?= old('cliente_address', $facturaEntity->cliente_address) ?>"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_cp" class="form-label">
|
||||
<?= lang('Facturas.cp') ?>
|
||||
</label>
|
||||
<input id="cliente_cp" name="cliente_cp" tabindex="7" class="form-control" value="<?= old('cliente_cp', $facturaEntity->cliente_cp) ?>"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_ciudad" class="form-label">
|
||||
<?= lang('Facturas.localidad') ?>
|
||||
</label>
|
||||
<input id="cliente_ciudad" name="cliente_ciudad" tabindex="8" class="form-control"" value="<?= old('cliente_ciudad', $facturaEntity->cliente_ciudad) ?>"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-lg-3 px-4">
|
||||
<div class="mb-1">
|
||||
<label for="cliente_provincia" class="form-label">
|
||||
<?= lang('Facturas.provincia') ?>
|
||||
</label>
|
||||
<input id="cliente_provincia" name="cliente_provincia" tabindex="8" class="form-control"" value="<?= old('cliente_provincia', $facturaEntity->cliente_provincia) ?>"></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-lg-12 px-4">
|
||||
<div class="pt-4">
|
||||
|
||||
<?php if ($facturaEntity->estado === 'validada' && (auth()->user()->inGroup('beta') || auth()->user()->inGroup('admin'))) : ?>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-label-primary float-start me-sm-3 me-1"
|
||||
name="pasarBorrador"
|
||||
id="pasarBorrador" >
|
||||
<span class="ti-xs ti ti-save me-1"></span>
|
||||
<?= lang("Facturas.pasarBorrador") ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-label-primary float-start me-sm-3 me-1"
|
||||
name="exportar_lineas"
|
||||
id="exportar_lineas" >
|
||||
<span class="ti-xs ti ti-file-spreadsheet me-1"></span>
|
||||
<?= lang("Facturas.exportarLineas") ?>
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-label-primary float-start me-sm-3 me-1"
|
||||
name="duplicar"
|
||||
id="duplicar" >
|
||||
<span class="ti-xs ti ti-copy me-1"></span>
|
||||
<?= lang("Facturas.duplicar") ?>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
$("#fecha_factura_at").flatpickr({
|
||||
defaultDate: <?= $facturaEntity->fecha_factura_at_text ? "'".$facturaEntity->fecha_factura_at_text."'" : 'null' ?>,
|
||||
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'],
|
||||
},
|
||||
},
|
||||
onChange: function(selectedDates, dateStr, instance) {
|
||||
<?php if ($facturaEntity->estado == 'borrador'): ?>
|
||||
updateDate('fecha_entrega_at', dateStr);
|
||||
<?php endif; ?>
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function updateDate(elementId, dateStr) {
|
||||
var id = <?=$facturaEntity->id ?>;
|
||||
|
||||
data = {
|
||||
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v,
|
||||
};
|
||||
var parts = dateStr.split('/');
|
||||
var newFormat = parts[2] + '-' + parts[1] + '-' + parts[0]; // Asume dateStr en formato d/m/Y.
|
||||
|
||||
data[elementId] = newFormat;
|
||||
|
||||
var url = '<?= route_to('actualizarFactura', ':id') ?>';
|
||||
url = url.replace(':id', id );
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: data,
|
||||
success: function(response){
|
||||
|
||||
if('error' in response){
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#serie_id').select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: -1,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfSeriesFacturas") ?>',
|
||||
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
|
||||
}
|
||||
});
|
||||
|
||||
$('#cliente_id').select2({
|
||||
allowClear: false,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfClientes") ?>',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
|
||||
data: function(params) {
|
||||
return {
|
||||
id: 'id',
|
||||
text: 'alias',
|
||||
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() ?>
|
||||
164
ci4/app/Views/themes/vuexy/form/facturas/_facturaLineasItems.php
Normal file
164
ci4/app/Views/themes/vuexy/form/facturas/_facturaLineasItems.php
Normal file
@ -0,0 +1,164 @@
|
||||
<div class="accordion accordion-bordered mt-3" id="lineasFactura">
|
||||
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingLineasFacturas">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionLineasFacturaTip" aria-expanded="false" aria-controls="accordionLineasFacturaTip">
|
||||
<h3><?= lang("Facturas.lineas") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="accordionLineasFacturaTip" class="accordion-collapse collapse show" data-bs-parent="#accordioLineasFactura">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfLineasFactura" class="table table-striped table-hover" style="width: 100%;grid-template-columns: 1fr 1fr 6fr 1fr 1fr 1fr;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><?= lang('Facturas.unidades') ?></th>
|
||||
<th><?= lang('Facturas.concepto') ?></th>
|
||||
<th><?= lang('Facturas.precioUnidad') ?></th>
|
||||
<th><?= lang('Facturas.iva') ?></th>
|
||||
<th><?= lang('Facturas.subtotal') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($facturaEntity->estado =='borrador') : ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-label-primary float-start me-sm-3 me-1"
|
||||
name="addLineaFactura"
|
||||
id="addLineaFactura" >
|
||||
|
||||
<?= lang("Facturas.nuevaLinea") ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?=$this->section('additionalInlineJs') ?>
|
||||
|
||||
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-trash ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
<a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||
</div>
|
||||
</td>`;
|
||||
};
|
||||
|
||||
var editor = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfLineasFacturas') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfLineasFactura",
|
||||
idSrc: 'id',
|
||||
fields: [
|
||||
{
|
||||
name: "unidades",
|
||||
|
||||
}, {
|
||||
name: "concepto",
|
||||
type: "textarea"
|
||||
}, {
|
||||
name: "precio_unidad",
|
||||
|
||||
}, {
|
||||
name: "iva",
|
||||
|
||||
}, {
|
||||
"name": "factura_id",
|
||||
"type": "hidden"
|
||||
}, {
|
||||
"name": "pedido_impresion_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "pedido_maquetacion_id",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['factura_id'] = <?= $facturaEntity->id ?>;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['factura_id'] = <?= $facturaEntity->id ?>;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
editor.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
|
||||
tableLineas.clearPipeline();
|
||||
tableLineas.draw();
|
||||
});
|
||||
|
||||
|
||||
var tableLineas = $('#tableOfLineasFactura').DataTable({
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
scrollX: true,
|
||||
columns: [
|
||||
{data: null, render: actionBtns},
|
||||
{data: "pedido_impresion_id"},
|
||||
{data: "pedido_maquetacion_id"},
|
||||
{data: "unidades"},
|
||||
{data: "concepto"},
|
||||
{data: "precio_unidad"},
|
||||
{data: "iva"},
|
||||
{data: "subtotal"}
|
||||
],
|
||||
order: [[1, "asc"]],
|
||||
dom: 't',
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfLineasFacturas', $facturaEntity->id) ?>',
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [0]
|
||||
},
|
||||
{
|
||||
visible: false,
|
||||
targets: [1, 2]
|
||||
}
|
||||
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
@ -0,0 +1,118 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?=$this->extend('themes/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="addFacturaForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="cliente_id" class="form-label">
|
||||
<?= lang('Presupuestos.clienteId') ?>*
|
||||
</label>
|
||||
<select id="cliente_id" name="cliente_id" class="form-control select2bs2" style="width: 100%;"></select>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12 col-lg-6 px-4">
|
||||
<div class="mb-3">
|
||||
<label for="serie_id" class="form-label">
|
||||
<?= lang('Facturas.serieFacturacion') ?>*
|
||||
</label>
|
||||
<select id="serie_id" name="serie_id" class="form-control select2bs2" style="width: 100%;"></select>
|
||||
</div><!--//.mb-3 -->
|
||||
</div><!--//.col -->
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
|
||||
<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 -->
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
$('#cliente_id').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
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#serie_id').select2({
|
||||
allowClear: false,
|
||||
minimumResultsForSearch: -1,
|
||||
ajax: {
|
||||
url: '<?= route_to("menuItemsOfSeriesFacturas") ?>',
|
||||
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() ?>
|
||||
67
ci4/app/Views/themes/vuexy/form/facturas/viewFacturaForm.php
Normal file
67
ci4/app/Views/themes/vuexy/form/facturas/viewFacturaForm.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?=$this->extend('themes/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="addFacturaForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||
<?= csrf_field() ?>
|
||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||
|
||||
<?= view("themes/vuexy/form/facturas/_facturaCabeceraItems") ?>
|
||||
<?php if($facturaEntity->estado =='borrador') : ?>
|
||||
<?= view("themes/vuexy/form/facturas/_addPedidosItems") ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?= view("themes/vuexy/form/facturas/_facturaLineasItems") ?>
|
||||
|
||||
<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 -->
|
||||
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<?=$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") ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/sk-datatables.css') ?>">
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.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>
|
||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||
<?=$this->endSection() ?>
|
||||
|
||||
|
||||
@ -141,8 +141,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{ 'data': 'total_presupuesto' },
|
||||
{ 'data': forma_pago,
|
||||
{ 'data': 'forma_pago',
|
||||
render: function(data, type, row, meta) {
|
||||
switch(data){
|
||||
case "cheque":
|
||||
@ -176,14 +175,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{ 'data': vencimiento },
|
||||
{ 'data': 'vencimiento' },
|
||||
{ 'data': actionBtns }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-edit', function(e) {
|
||||
var url = '<?= route_to('editarPedido', ':id') ?>';
|
||||
var url = '<?= route_to('editarFactura', ':id') ?>';
|
||||
url = url.replace(':id', `${$(this).attr('data-id')}` );
|
||||
window.location.href = url;
|
||||
});
|
||||
|
||||
@ -12,7 +12,7 @@ if (auth()->user()->inGroup('beta')) {
|
||||
</a>
|
||||
<ul class="menu-sub">
|
||||
<li class="menu-item">
|
||||
<a href="<?= route_to('facturasList') ?>" class="menu-link">
|
||||
<a href="<?= route_to('newFactura') ?>" class="menu-link">
|
||||
<?= lang("App.menu_facturas_nueva") ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user