mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'feat/soporte'
Main See merge request jjimenez/safekat!548
This commit is contained in:
@ -121,8 +121,27 @@ const SK_PERMISSION_MATRIX = [
|
|||||||
"pedidos-todos.menu",
|
"pedidos-todos.menu",
|
||||||
],
|
],
|
||||||
"comercial" => [
|
"comercial" => [
|
||||||
"token.token",
|
"clientes.create",
|
||||||
"token.menu",
|
"clientes.edit",
|
||||||
|
"clientes.menu",
|
||||||
|
"direcciones.create",
|
||||||
|
"direcciones.edit",
|
||||||
|
"direcciones.menu",
|
||||||
|
"presupuesto.create",
|
||||||
|
"presupuesto.edit",
|
||||||
|
"presupuesto.delete",
|
||||||
|
"presupuesto.menu",
|
||||||
|
"presupuesto-cliente.create",
|
||||||
|
"presupuesto-cliente.edit",
|
||||||
|
"presupuesto-cliente.menu",
|
||||||
|
"pedidos-activos.view",
|
||||||
|
"pedidos-activos.menu",
|
||||||
|
"pedidos-finalizados.view",
|
||||||
|
"pedidos-finalizados.menu",
|
||||||
|
"pedidos-cancelados.view",
|
||||||
|
"pedidos-cancelados.menu",
|
||||||
|
"pedidos-todos.view",
|
||||||
|
"pedidos-todos.menu",
|
||||||
],
|
],
|
||||||
"produccion" => [
|
"produccion" => [
|
||||||
"clientes.create",
|
"clientes.create",
|
||||||
|
|||||||
@ -348,7 +348,7 @@ class TarifaAcabados extends BaseResourceController
|
|||||||
)->where("deleted_at", null);
|
)->where("deleted_at", null);
|
||||||
if ($this->request->getGet("q")) {
|
if ($this->request->getGet("q")) {
|
||||||
$query->groupStart()
|
$query->groupStart()
|
||||||
->orLike("lg_tarifas_acabado.nombre", $this->request->getGet("q"))
|
->orLike("lg_tarifa_acabado.nombre", $this->request->getGet("q"))
|
||||||
->groupEnd();
|
->groupEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -543,7 +543,7 @@
|
|||||||
return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
|
return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ 'data': 'precio',render : (d) => `<span class="autonumeric">${d}</span>` },
|
{ 'data': 'precio',render : (d) => `<span class="autonumeric-decimal" data-decimal-places="6">${d}</span>` },
|
||||||
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
|
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{
|
{
|
||||||
data: actionBtns,
|
data: actionBtns,
|
||||||
|
|||||||
@ -64,7 +64,9 @@ const actionBtns = function(data) {
|
|||||||
<td class="text-right py-0 align-middle">
|
<td class="text-right py-0 align-middle">
|
||||||
<div class="btn-group btn-group-sm">
|
<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-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>
|
<?php if(auth()->user()->can('presupuesto.delete')): ?>
|
||||||
|
<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>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
}
|
}
|
||||||
@ -240,7 +242,7 @@ $(document).on('click', '.btn-remove', function(e) {
|
|||||||
const row = $(this).closest('tr');
|
const row = $(this).closest('tr');
|
||||||
if ($.isNumeric(dataId)) {
|
if ($.isNumeric(dataId)) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `/presupuestoadmin/delete/${dataId}`,
|
url: `/presupuestos/presupuestocliente/delete/${dataId}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
$('#confirm2delete').modal('toggle');
|
$('#confirm2delete').modal('toggle');
|
||||||
|
|||||||
@ -55,7 +55,9 @@ const actionBtns = function(data) {
|
|||||||
<td class="text-right py-0 align-middle">
|
<td class="text-right py-0 align-middle">
|
||||||
<div class="btn-group btn-group-sm">
|
<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-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>
|
<?php if(auth()->user()->can('presupuesto.delete')): ?>
|
||||||
|
<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>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
};
|
};
|
||||||
@ -287,13 +289,13 @@ $(document).on('click', '.btn-edit', function(e) {
|
|||||||
window.location.href = `/presupuestoadmin/edit/${$(this).attr('data-id')}/`;
|
window.location.href = `/presupuestoadmin/edit/${$(this).attr('data-id')}/`;
|
||||||
});
|
});
|
||||||
|
|
||||||
theTable.on('click', 'tr', function () {
|
theTable.on('click', 'tbody td:not(:last-child)', function () {
|
||||||
var data = theTable.row(this).data();
|
var data = theTable.row($(this).closest('tr')).data();
|
||||||
console.log(data);
|
|
||||||
var url = '/presupuestoadmin/edit/' + data['id'];
|
var url = '/presupuestoadmin/edit/' + data['id'];
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '.btn-delete', function(e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
});
|
});
|
||||||
@ -304,7 +306,7 @@ $(document).on('click', '.btn-remove', function(e) {
|
|||||||
const row = $(this).closest('tr');
|
const row = $(this).closest('tr');
|
||||||
if ($.isNumeric(dataId)) {
|
if ($.isNumeric(dataId)) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: `/presupuestoadmin/delete/${dataId}`,
|
url: `/presupuestos/presupuestocliente/delete/${dataId}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
$('#confirm2delete').modal('toggle');
|
$('#confirm2delete').modal('toggle');
|
||||||
|
|||||||
@ -50,21 +50,25 @@
|
|||||||
|
|
||||||
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
|
||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
if(data.estado == 'borrador')
|
if(data.estado == 'borrador'){
|
||||||
return `
|
return `
|
||||||
<td class="text-right py-0 align-middle">
|
<td class="text-right py-0 align-middle">
|
||||||
<div class="btn-group btn-group-sm">
|
<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-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>
|
<?php if(auth()->user()->can('presupuesto-cliente.delete')): ?>
|
||||||
|
<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>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
else
|
}
|
||||||
|
else{
|
||||||
return `
|
return `
|
||||||
<td class="text-right py-0 align-middle">
|
<td class="text-right py-0 align-middle">
|
||||||
<div class="btn-group btn-group-sm">
|
<div class="btn-group btn-group-sm">
|
||||||
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="${data.id}"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</td>`;
|
</td>`;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Setup - add a text input to each footer cell
|
// Setup - add a text input to each footer cell
|
||||||
@ -292,8 +296,8 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
theTable.on('click', 'tr', function () {
|
theTable.on('click', 'tbody td:not(:last-child)', function () {
|
||||||
var data = theTable.row(this).data();
|
var data = theTable.row($(this).closest('tr')).data();
|
||||||
var url = '/presupuestos/presupuestocliente/edit/' + data['id'];
|
var url = '/presupuestos/presupuestocliente/edit/' + data['id'];
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -2,19 +2,16 @@
|
|||||||
/**
|
/**
|
||||||
* MENU PRESUPUESTOS VISTA CLIENTES
|
* MENU PRESUPUESTOS VISTA CLIENTES
|
||||||
*/
|
*/
|
||||||
if (auth()->user()->inGroup('cliente-admin')
|
|
||||||
|| auth()->user()->inGroup('cliente-editor')
|
|
||||||
|| auth()->user()->inGroup('admin')
|
|
||||||
) {
|
|
||||||
|
|
||||||
if (auth()->user()->can('presupuesto-cliente.menu') || auth()->user()->inGroup('admin')) {
|
if(auth()->user()->can('presupuesto-cliente.menu')){
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li class="menu-item">
|
<li class="menu-item">
|
||||||
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
<a href="javascript:void(0);" class="menu-link menu-toggle">
|
||||||
<i class="menu-icon tf-icons ti ti-currency-dollar"></i>
|
<i class="menu-icon tf-icons ti ti-currency-dollar"></i>
|
||||||
<?php
|
<?php
|
||||||
echo(
|
echo(
|
||||||
auth()->user()->inGroup('admin') ?
|
auth()->user()->can('presupuesto.menu') ?
|
||||||
lang("App.menu_presupuestos_clientes") :
|
lang("App.menu_presupuestos_clientes") :
|
||||||
lang("App.menu_presupuestos")
|
lang("App.menu_presupuestos")
|
||||||
);
|
);
|
||||||
@ -38,6 +35,6 @@ if (auth()->user()->inGroup('cliente-admin')
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
|
||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,19 @@ export const initAutonumeric = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
$("span.autonumeric-decimal").each(function () {
|
||||||
|
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
if (!autoNumericInstance) {
|
||||||
|
new AutoNumeric(this, {
|
||||||
|
digitGroupSeparator: ".",
|
||||||
|
decimalCharacter: ",",
|
||||||
|
allowDecimalPadding : 'floats',
|
||||||
|
decimalPlaces: $(this).data('decimal-places'),
|
||||||
|
unformatOnSubmit: true,
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
// $(':input[type="number"]').each(function(){
|
// $(':input[type="number"]').each(function(){
|
||||||
// $(this).attr('type','text')
|
// $(this).attr('type','text')
|
||||||
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
|
||||||
|
|||||||
@ -12,20 +12,31 @@ class previewFormas {
|
|||||||
this.lomo = datos.lomo;
|
this.lomo = datos.lomo;
|
||||||
this.lomoSobrecubierta = datos.lomoSobrecubierta;
|
this.lomoSobrecubierta = datos.lomoSobrecubierta;
|
||||||
|
|
||||||
if (datos.solapas == undefined || datos.solapas == null || datos.solapas == false) {
|
let solapaTemp = null;
|
||||||
|
let solapaSobrecubiertaTemp = null;
|
||||||
|
if(typeof this.lomo === 'function') {
|
||||||
|
solapaTemp = datos.solapas();
|
||||||
|
solapaSobrecubiertaTemp = datos.solapas_sobrecubierta();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
solapaTemp = datos.solapas;
|
||||||
|
solapaSobrecubiertaTemp = datos.solapas_sobrecubierta;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (solapaTemp == undefined || solapaTemp == null || solapaTemp == false) {
|
||||||
this.solapa = 0;
|
this.solapa = 0;
|
||||||
this.offsetSolapa = 0.0;
|
this.offsetSolapa = 0.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.solapa = datos.solapas;
|
this.solapa = solapaTemp;
|
||||||
this.offsetSolapa = 3.0;
|
this.offsetSolapa = 3.0;
|
||||||
}
|
}
|
||||||
if (datos.solapas_sobrecubierta == undefined || datos.solapas_sobrecubierta == null || datos.solapas_sobrecubierta == false) {
|
if (solapaSobrecubiertaTemp == undefined || solapaSobrecubiertaTemp == null || solapaSobrecubiertaTemp == false) {
|
||||||
this.solapas_sobrecubierta = 0;
|
this.solapas_sobrecubierta = 0;
|
||||||
this.offsetSolapa_sobrecubierta = 0.0;
|
this.offsetSolapa_sobrecubierta = 0.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.solapa_sobrecubierta = datos.solapas_sobrecubierta;
|
this.solapa_sobrecubierta = solapaSobrecubiertaTemp;
|
||||||
this.offsetSolapa_sobrecubierta = 3.0;
|
this.offsetSolapa_sobrecubierta = 3.0;
|
||||||
}
|
}
|
||||||
this.lomoRedondo = datos.lomoRedondo;
|
this.lomoRedondo = datos.lomoRedondo;
|
||||||
@ -45,14 +56,33 @@ class previewFormas {
|
|||||||
this.lomo = datos.lomo;
|
this.lomo = datos.lomo;
|
||||||
this.lomoSobrecubierta = datos.lomoSobrecubierta;
|
this.lomoSobrecubierta = datos.lomoSobrecubierta;
|
||||||
|
|
||||||
if (datos.solapas == undefined || datos.solapas == null || datos.solapas == false) {
|
let solapaTemp = null;
|
||||||
|
let solapaSobrecubiertaTemp = null;
|
||||||
|
if(typeof this.lomo === 'function') {
|
||||||
|
solapaTemp = datos.solapas();
|
||||||
|
solapaSobrecubiertaTemp = datos.solapas_sobrecubierta();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
solapaTemp = datos.solapas;
|
||||||
|
solapaSobrecubiertaTemp = datos.solapas_sobrecubierta;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (solapaTemp == undefined || solapaTemp == null || solapaTemp == false) {
|
||||||
this.solapa = 0;
|
this.solapa = 0;
|
||||||
this.offsetSolapa = 0.0;
|
this.offsetSolapa = 0.0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.solapa = datos.solapas;
|
this.solapa = solapaTemp;
|
||||||
this.offsetSolapa = 3.0;
|
this.offsetSolapa = 3.0;
|
||||||
}
|
}
|
||||||
|
if (solapaSobrecubiertaTemp == undefined || solapaSobrecubiertaTemp == null || solapaSobrecubiertaTemp == false) {
|
||||||
|
this.solapas_sobrecubierta = 0;
|
||||||
|
this.offsetSolapa_sobrecubierta = 0.0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.solapa_sobrecubierta = solapaSobrecubiertaTemp;
|
||||||
|
this.offsetSolapa_sobrecubierta = 3.0;
|
||||||
|
}
|
||||||
this.lomoRedondo = datos.lomoRedondo;
|
this.lomoRedondo = datos.lomoRedondo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,7 +516,6 @@ class previewFormas {
|
|||||||
this.ancho = this.ancho();
|
this.ancho = this.ancho();
|
||||||
this.alto = this.alto();
|
this.alto = this.alto();
|
||||||
this.lomoRedondo = this.lomoRedondo();
|
this.lomoRedondo = this.lomoRedondo();
|
||||||
this.solapa = this.solapa();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let styleCotas = { size: 12, family: 'Public Sans' };
|
let styleCotas = { size: 12, family: 'Public Sans' };
|
||||||
|
|||||||
Reference in New Issue
Block a user