Merge branch 'mod/open_cliente_from' into 'main'

añadido icono para abrir cliente en presupuesto

See merge request jjimenez/safekat!600
This commit is contained in:
2025-03-20 18:10:56 +00:00
2 changed files with 8 additions and 0 deletions

View File

@ -143,6 +143,7 @@
<div class="mb-3"> <div class="mb-3">
<label for="clienteId" class="form-label"> <label for="clienteId" class="form-label">
<?= lang('Presupuestos.clienteId') ?>* <?= lang('Presupuestos.clienteId') ?>*
<a id="openCliente" href="javascript(void)" target="_blank" ><i class="ti ti-file-search ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
</label> </label>
<select id="clienteId" name="cliente_id" class="form-control select2bs2" style="width: 100%;"> <select id="clienteId" name="cliente_id" class="form-control select2bs2" style="width: 100%;">
</select> </select>

View File

@ -16,6 +16,8 @@ class DatosGenerales{
this.numeroEdicion = this.domItem.find('#numeroEdicion'); this.numeroEdicion = this.domItem.find('#numeroEdicion');
this.isbn = this.domItem.find('#isbn'); this.isbn = this.domItem.find('#isbn');
this.openCliente = this.domItem.find('#openCliente');
this.cliente = new ClassSelect($('#clienteId'), '/clientes/cliente/getSelect2', 'Seleccione cliente'); this.cliente = new ClassSelect($('#clienteId'), '/clientes/cliente/getSelect2', 'Seleccione cliente');
this.pais = new ClassSelect($('#paisId'), '/paises/menuitems2', 'Seleccione País'); this.pais = new ClassSelect($('#paisId'), '/paises/menuitems2', 'Seleccione País');
@ -31,6 +33,11 @@ class DatosGenerales{
this.inc_rei.select2({ this.inc_rei.select2({
allowClear: false, allowClear: false,
}); });
this.openCliente.click(()=>{
const urlObj = new URL(window.location.href);
window.open(`${urlObj.origin}` + '/clientes/cliente/edit/' + this.cliente.getVal());
});
} }
cargarDatos(datos){ cargarDatos(datos){