diff --git a/ci4/app/Config/RBAC/permissionMatrix.php b/ci4/app/Config/RBAC/permissionMatrix.php
index ed0b4fe3..c9f0a2ee 100644
--- a/ci4/app/Config/RBAC/permissionMatrix.php
+++ b/ci4/app/Config/RBAC/permissionMatrix.php
@@ -121,8 +121,27 @@ const SK_PERMISSION_MATRIX = [
"pedidos-todos.menu",
],
"comercial" => [
- "token.token",
- "token.menu",
+ "clientes.create",
+ "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" => [
"clientes.create",
diff --git a/ci4/app/Controllers/Tarifas/Acabados/TarifaAcabados.php b/ci4/app/Controllers/Tarifas/Acabados/TarifaAcabados.php
index e2553235..a6e66616 100644
--- a/ci4/app/Controllers/Tarifas/Acabados/TarifaAcabados.php
+++ b/ci4/app/Controllers/Tarifas/Acabados/TarifaAcabados.php
@@ -348,7 +348,7 @@ class TarifaAcabados extends BaseResourceController
)->where("deleted_at", null);
if ($this->request->getGet("q")) {
$query->groupStart()
- ->orLike("lg_tarifas_acabado.nombre", $this->request->getGet("q"))
+ ->orLike("lg_tarifa_acabado.nombre", $this->request->getGet("q"))
->groupEnd();
}
diff --git a/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaForm.php b/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaForm.php
index 8a389610..163f500d 100644
--- a/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaForm.php
+++ b/ci4/app/Views/themes/vuexy/form/configuracion/maquinas/viewMaquinaForm.php
@@ -543,7 +543,7 @@
return '= lang('MaquinasTarifasImpresions.colorhq') ?>';
}
},
- { 'data': 'precio',render : (d) => `${d}` },
+ { 'data': 'precio',render : (d) => `${d}` },
{ 'data': 'margen',render : (d) => `${d}` },
{
data: actionBtns,
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/viewPresupuestoAdminList.php b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/viewPresupuestoAdminList.php
index 40f409b5..37de7959 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/admin/viewPresupuestoAdminList.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/admin/viewPresupuestoAdminList.php
@@ -64,7 +64,9 @@ const actionBtns = function(data) {
-
+ user()->can('presupuesto.delete')): ?>
+
+
| `;
}
@@ -240,7 +242,7 @@ $(document).on('click', '.btn-remove', function(e) {
const row = $(this).closest('tr');
if ($.isNumeric(dataId)) {
$.ajax({
- url: `/presupuestoadmin/delete/${dataId}`,
+ url: `/presupuestos/presupuestocliente/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/buscador/viewBuscadorList.php b/ci4/app/Views/themes/vuexy/form/presupuestos/buscador/viewBuscadorList.php
index 51e70074..56b9a9ef 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/buscador/viewBuscadorList.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/buscador/viewBuscadorList.php
@@ -55,7 +55,9 @@ const actionBtns = function(data) {
-
+ user()->can('presupuesto.delete')): ?>
+
+
| `;
};
@@ -287,13 +289,13 @@ $(document).on('click', '.btn-edit', function(e) {
window.location.href = `/presupuestoadmin/edit/${$(this).attr('data-id')}/`;
});
-theTable.on('click', 'tr', function () {
- var data = theTable.row(this).data();
- console.log(data);
+theTable.on('click', 'tbody td:not(:last-child)', function () {
+ var data = theTable.row($(this).closest('tr')).data();
var url = '/presupuestoadmin/edit/' + data['id'];
window.location.href = url;
});
+
$(document).on('click', '.btn-delete', function(e) {
$(".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');
if ($.isNumeric(dataId)) {
$.ajax({
- url: `/presupuestoadmin/delete/${dataId}`,
+ url: `/presupuestos/presupuestocliente/delete/${dataId}`,
method: 'GET',
}).done((data, textStatus, jqXHR) => {
$('#confirm2delete').modal('toggle');
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/viewPresupuestoList.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/viewPresupuestoList.php
index 21629292..907bd706 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/viewPresupuestoList.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/viewPresupuestoList.php
@@ -50,21 +50,25 @@
const lastColNr = $('#tableOfPresupuestos').find("tr:first th").length - 1;
const actionBtns = function(data) {
- if(data.estado == 'borrador')
+ if(data.estado == 'borrador'){
return `
-
+ user()->can('presupuesto-cliente.delete')): ?>
+
+
| `;
- else
+ }
+ else{
return `
| `;
+ }
};
// Setup - add a text input to each footer cell
@@ -292,8 +296,8 @@ theTable = $('#tableOfPresupuestos').DataTable({
]
});
-theTable.on('click', 'tr', function () {
- var data = theTable.row(this).data();
+theTable.on('click', 'tbody td:not(:last-child)', function () {
+ var data = theTable.row($(this).closest('tr')).data();
var url = '/presupuestos/presupuestocliente/edit/' + data['id'];
window.location.href = url;
});
diff --git a/ci4/app/Views/themes/vuexy/main/menus/presupuesto_cliente_menu.php b/ci4/app/Views/themes/vuexy/main/menus/presupuesto_cliente_menu.php
index 4b367bfc..d5bb0e8d 100644
--- a/ci4/app/Views/themes/vuexy/main/menus/presupuesto_cliente_menu.php
+++ b/ci4/app/Views/themes/vuexy/main/menus/presupuesto_cliente_menu.php
@@ -2,19 +2,16 @@
/**
* 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')){
+
?>
diff --git a/httpdocs/assets/js/safekat/common/common.js b/httpdocs/assets/js/safekat/common/common.js
index d9400854..e9a877f2 100644
--- a/httpdocs/assets/js/safekat/common/common.js
+++ b/httpdocs/assets/js/safekat/common/common.js
@@ -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(){
// $(this).attr('type','text')
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
diff --git a/httpdocs/assets/js/safekat/components/preview.js b/httpdocs/assets/js/safekat/components/preview.js
index 2a0c8f55..52a6138f 100644
--- a/httpdocs/assets/js/safekat/components/preview.js
+++ b/httpdocs/assets/js/safekat/components/preview.js
@@ -12,20 +12,31 @@ class previewFormas {
this.lomo = datos.lomo;
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.offsetSolapa = 0.0;
}
else {
- this.solapa = datos.solapas;
+ this.solapa = solapaTemp;
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.offsetSolapa_sobrecubierta = 0.0;
}
else {
- this.solapa_sobrecubierta = datos.solapas_sobrecubierta;
+ this.solapa_sobrecubierta = solapaSobrecubiertaTemp;
this.offsetSolapa_sobrecubierta = 3.0;
}
this.lomoRedondo = datos.lomoRedondo;
@@ -45,14 +56,33 @@ class previewFormas {
this.lomo = datos.lomo;
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.offsetSolapa = 0.0;
}
else {
- this.solapa = datos.solapas;
+ this.solapa = solapaTemp;
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;
}
@@ -486,7 +516,6 @@ class previewFormas {
this.ancho = this.ancho();
this.alto = this.alto();
this.lomoRedondo = this.lomoRedondo();
- this.solapa = this.solapa();
}
let styleCotas = { size: 12, family: 'Public Sans' };