mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'rev/roles_1' of https://git.imnavajas.es/jjimenez/safekat into rev/roles_1
This commit is contained in:
@ -97,8 +97,13 @@ const SK_PERMISSION_MATRIX = [
|
|||||||
"roles-permisos.edit",
|
"roles-permisos.edit",
|
||||||
"roles-permisos.delete",
|
"roles-permisos.delete",
|
||||||
"roles-permisos.menu",
|
"roles-permisos.menu",
|
||||||
|
"tickets.create",
|
||||||
"tickets.edit",
|
"tickets.edit",
|
||||||
"tickets.menu",
|
"tickets.menu",
|
||||||
|
"facturas.create",
|
||||||
|
"facturas.edit",
|
||||||
|
"facturas.vencimientos",
|
||||||
|
"facturas.menu",
|
||||||
],
|
],
|
||||||
"cliente-admin" => [
|
"cliente-admin" => [
|
||||||
"presupuesto-cliente.create",
|
"presupuesto-cliente.create",
|
||||||
@ -150,15 +155,29 @@ const SK_PERMISSION_MATRIX = [
|
|||||||
"pedidos-todos.menu",
|
"pedidos-todos.menu",
|
||||||
],
|
],
|
||||||
"produccion" => [
|
"produccion" => [
|
||||||
"clientes.create",
|
|
||||||
"clientes.edit",
|
|
||||||
"clientes.menu",
|
|
||||||
"direcciones.create",
|
"direcciones.create",
|
||||||
"direcciones.edit",
|
"direcciones.edit",
|
||||||
"direcciones.menu",
|
"direcciones.menu",
|
||||||
"presupuesto.create",
|
"presupuesto.create",
|
||||||
"presupuesto.edit",
|
"presupuesto.edit",
|
||||||
"presupuesto.menu",
|
"presupuesto.menu",
|
||||||
|
"presupuesto-cliente.create",
|
||||||
|
"presupuesto-cliente.edit",
|
||||||
|
"presupuesto-cliente.menu",
|
||||||
|
"pedidos-validacion.view",
|
||||||
|
"pedidos-validacion.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",
|
||||||
|
"pedidos-gestion.toprod",
|
||||||
|
"pedidos-gestion.menu",
|
||||||
|
"tickets.edit",
|
||||||
|
"tickets.menu",
|
||||||
],
|
],
|
||||||
"maquina" => [
|
"maquina" => [
|
||||||
"token.token",
|
"token.token",
|
||||||
@ -226,8 +245,34 @@ const SK_PERMISSION_MATRIX = [
|
|||||||
"facturas.menu",
|
"facturas.menu",
|
||||||
],
|
],
|
||||||
"contabilidad" => [
|
"contabilidad" => [
|
||||||
"token.token",
|
"clientes.create",
|
||||||
"token.menu",
|
"clientes.edit",
|
||||||
|
"clientes.menu",
|
||||||
|
"direcciones.create",
|
||||||
|
"direcciones.edit",
|
||||||
|
"direcciones.menu",
|
||||||
|
"presupuesto.create",
|
||||||
|
"presupuesto.edit",
|
||||||
|
"presupuesto.menu",
|
||||||
|
"pedidos-validacion.view",
|
||||||
|
"pedidos-validacion.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",
|
||||||
|
"proveedores.create",
|
||||||
|
"proveedores.edit",
|
||||||
|
"proveedores.menu",
|
||||||
|
"tickets.edit",
|
||||||
|
"tickets.menu",
|
||||||
|
"facturas.create",
|
||||||
|
"facturas.edit",
|
||||||
|
"facturas.vencimientos",
|
||||||
|
"facturas.menu",
|
||||||
],
|
],
|
||||||
"editor" => [
|
"editor" => [
|
||||||
"token.token",
|
"token.token",
|
||||||
@ -334,5 +379,9 @@ const SK_PERMISSION_MATRIX = [
|
|||||||
"roles-permisos.menu",
|
"roles-permisos.menu",
|
||||||
"tickets.edit",
|
"tickets.edit",
|
||||||
"tickets.menu",
|
"tickets.menu",
|
||||||
|
"facturas.create",
|
||||||
|
"facturas.edit",
|
||||||
|
"facturas.vencimientos",
|
||||||
|
"facturas.menu",
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@ -101,6 +101,7 @@ const SK_PERMISSIONS = [
|
|||||||
'roles-permisos.edit' => 'Can edit',
|
'roles-permisos.edit' => 'Can edit',
|
||||||
'roles-permisos.delete' => 'Can delete',
|
'roles-permisos.delete' => 'Can delete',
|
||||||
'roles-permisos.menu' => 'Menu shall be visualize',
|
'roles-permisos.menu' => 'Menu shall be visualize',
|
||||||
|
'tickets.create' => 'Can create',
|
||||||
'tickets.edit' => 'Can edit',
|
'tickets.edit' => 'Can edit',
|
||||||
'tickets.menu' => 'Menu shall be visualize',
|
'tickets.menu' => 'Menu shall be visualize',
|
||||||
'facturas.create' => 'Can create',
|
'facturas.create' => 'Can create',
|
||||||
|
|||||||
@ -20,6 +20,7 @@ return [
|
|||||||
'tiempo_max' => 'Tiempo Máx.',
|
'tiempo_max' => 'Tiempo Máx.',
|
||||||
'precio_hora' => 'Precio hora',
|
'precio_hora' => 'Precio hora',
|
||||||
'margen' => 'Margen',
|
'margen' => 'Margen',
|
||||||
|
'total_precio_hora' => 'Total precio h.',
|
||||||
'cliente_id' => 'Cliente',
|
'cliente_id' => 'Cliente',
|
||||||
'user_updated_id' => 'Usuario edición',
|
'user_updated_id' => 'Usuario edición',
|
||||||
'updated_at' => 'Fecha edición',
|
'updated_at' => 'Fecha edición',
|
||||||
|
|||||||
@ -147,7 +147,7 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
|||||||
"t1.id as id, t1.tipo AS tipo, t1.tipo_maquina AS tipo_maquina, t1.tipo_impresion AS tipo_impresion,
|
"t1.id as id, t1.tipo AS tipo, t1.tipo_maquina AS tipo_maquina, t1.tipo_impresion AS tipo_impresion,
|
||||||
t1.tiempo_min AS tiempo_min, t1.tiempo_max AS tiempo_max, t1.precio_hora AS precio_hora, t1.margen AS margen,
|
t1.tiempo_min AS tiempo_min, t1.tiempo_max AS tiempo_max, t1.precio_hora AS precio_hora, t1.margen AS margen,
|
||||||
t1.user_updated_id AS user_updated_id, t1.updated_at AS updated_at, CONCAT(t2.first_name, ' ', t2.last_name) AS user_updated,
|
t1.user_updated_id AS user_updated_id, t1.updated_at AS updated_at, CONCAT(t2.first_name, ' ', t2.last_name) AS user_updated,
|
||||||
t1.id AS DT_RowId"
|
t1.id AS DT_RowId, t1.precio_hora*(1+t1.margen/100.0) as total_precio_hora"
|
||||||
);
|
);
|
||||||
|
|
||||||
$builder->join("users t2", "t1.user_updated_id = t2.id", "left");
|
$builder->join("users t2", "t1.user_updated_id = t2.id", "left");
|
||||||
|
|||||||
@ -369,6 +369,24 @@ class PapelImpresionModel extends \App\Models\BaseModel
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPapelGenericoNombre($papel_id = 0)
|
||||||
|
{
|
||||||
|
$builder = $this->db
|
||||||
|
->table($this->table . " t1")
|
||||||
|
->select("t2.nombre AS nombre")
|
||||||
|
->join("lg_papel_generico t2", "t1.papel_generico_id = t2.id", "left")
|
||||||
|
->where("t1.id", $papel_id)
|
||||||
|
->where("t1.is_deleted", 0)
|
||||||
|
->where("t1.isActivo", 1)
|
||||||
|
->where("t2.is_deleted", 0);
|
||||||
|
|
||||||
|
$result = $builder->get()->getResultObject();
|
||||||
|
if (count($result) > 0) {
|
||||||
|
return $result[0]->nombre;
|
||||||
|
} else
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
public function querySelect(?string $query)
|
public function querySelect(?string $query)
|
||||||
{
|
{
|
||||||
$q = $this->builder()->select([
|
$q = $this->builder()->select([
|
||||||
|
|||||||
@ -760,7 +760,8 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
$lp_bn_lines = array_values($lp_bn_lines)[0];
|
$lp_bn_lines = array_values($lp_bn_lines)[0];
|
||||||
$paginas_negro = $lp_bn_lines->paginas;
|
$paginas_negro = $lp_bn_lines->paginas;
|
||||||
$gramaje_negro = $lp_bn_lines->gramaje;
|
$gramaje_negro = $lp_bn_lines->gramaje;
|
||||||
$papel_negro = $model_papel->where('id', $lp_bn_lines->papel_impresion_id)->first()->nombre;
|
//$papel_negro = $model_papel->where('id', $lp_bn_lines->papel_impresion_id)->first()->nombre;
|
||||||
|
$papel_negro = $model_papel->getPapelGenericoNombre($lp_bn_lines->papel_impresion_id);
|
||||||
$description_interior .= sprintf(
|
$description_interior .= sprintf(
|
||||||
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
||||||
strval($paginas_negro),
|
strval($paginas_negro),
|
||||||
@ -772,7 +773,8 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
$lp_color_lines = array_values($lp_color_lines)[0];
|
$lp_color_lines = array_values($lp_color_lines)[0];
|
||||||
$paginas_color = $lp_color_lines->paginas;
|
$paginas_color = $lp_color_lines->paginas;
|
||||||
$gramaje_color = $lp_color_lines->gramaje;
|
$gramaje_color = $lp_color_lines->gramaje;
|
||||||
$papel_color = $model_papel->where('id', $lp_color_lines->papel_impresion_id)->first()->nombre;
|
//$papel_color = $model_papel->where('id', $lp_color_lines->papel_impresion_id)->first()->nombre;
|
||||||
|
$papel_color = $model_papel->getPapelGenericoNombre($lp_color_lines->papel_impresion_id);
|
||||||
$description_interior .= sprintf(
|
$description_interior .= sprintf(
|
||||||
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
||||||
strval($paginas_color),
|
strval($paginas_color),
|
||||||
@ -785,7 +787,8 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
$lp_rot_bn = array_values($lp_rot_bn)[0];
|
$lp_rot_bn = array_values($lp_rot_bn)[0];
|
||||||
$paginas_negro = $lp_rot_bn->paginas;
|
$paginas_negro = $lp_rot_bn->paginas;
|
||||||
$gramaje_negro = $lp_rot_bn->gramaje;
|
$gramaje_negro = $lp_rot_bn->gramaje;
|
||||||
$papel_negro = $model_papel->where('id', $lp_rot_bn->papel_impresion_id)->first()->nombre;
|
$papel_negro = $model_papel->getPapelGenericoNombre($lp_rot_bn->papel_impresion_id);
|
||||||
|
//$papel_negro = $model_papel->where('id', $lp_rot_bn->papel_impresion_id)->first()->nombre;
|
||||||
$description_interior .= sprintf(
|
$description_interior .= sprintf(
|
||||||
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
||||||
strval($paginas_negro),
|
strval($paginas_negro),
|
||||||
@ -798,7 +801,8 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
$lp_rot_color = array_values($lp_rot_color)[0];
|
$lp_rot_color = array_values($lp_rot_color)[0];
|
||||||
$paginas_negro = intval($lp_rot_color->paginas) - intval($lp_rot_color->rotativa_pag_color);
|
$paginas_negro = intval($lp_rot_color->paginas) - intval($lp_rot_color->rotativa_pag_color);
|
||||||
$gramaje = $lp_rot_color->gramaje;
|
$gramaje = $lp_rot_color->gramaje;
|
||||||
$papel = $model_papel->where('id', $lp_rot_color->papel_impresion_id)->first()->nombre;
|
//$papel = $model_papel->where('id', $lp_rot_color->papel_impresion_id)->first()->nombre;
|
||||||
|
$papel = $model_papel->getPapelGenericoNombre($lp_rot_color->papel_impresion_id);
|
||||||
if ($paginas_negro > 0) {
|
if ($paginas_negro > 0) {
|
||||||
$description_interior .= sprintf(
|
$description_interior .= sprintf(
|
||||||
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
lang('Pedidos.lineasTemplates.libro_linea_interior'),
|
||||||
@ -833,7 +837,8 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
$description_cubierta = sprintf(
|
$description_cubierta = sprintf(
|
||||||
lang('Pedidos.lineasTemplates.libro_linea_cubierta'),
|
lang('Pedidos.lineasTemplates.libro_linea_cubierta'),
|
||||||
$lp_cubierta->caras,
|
$lp_cubierta->caras,
|
||||||
$model_papel->where('id', $lp_cubierta->papel_impresion_id)->first()->nombre,
|
//$model_papel->where('id', $lp_cubierta->papel_impresion_id)->first()->nombre,
|
||||||
|
$model_papel->getPapelGenericoNombre($lp_cubierta->papel_impresion_id),
|
||||||
strval($lp_cubierta->gramaje)
|
strval($lp_cubierta->gramaje)
|
||||||
);
|
);
|
||||||
$description_cubierta .= ($presupuesto->solapas_cubierta == 1 ? sprintf(lang('Pedidos.lineasTemplates.libro_solapas'), $presupuesto->solapas_ancho_cubierta) : ". ");
|
$description_cubierta .= ($presupuesto->solapas_cubierta == 1 ? sprintf(lang('Pedidos.lineasTemplates.libro_solapas'), $presupuesto->solapas_ancho_cubierta) : ". ");
|
||||||
@ -842,7 +847,8 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
$lp_sobrecubierta = array_values($lp_sobrecubierta)[0];
|
$lp_sobrecubierta = array_values($lp_sobrecubierta)[0];
|
||||||
$description_sobrecubierta = sprintf(
|
$description_sobrecubierta = sprintf(
|
||||||
lang('Pedidos.lineasTemplates.libro_linea_sobrecubierta'),
|
lang('Pedidos.lineasTemplates.libro_linea_sobrecubierta'),
|
||||||
$model_papel->where('id', $lp_sobrecubierta->papel_impresion_id)->first()->nombre,
|
//$model_papel->where('id', $lp_sobrecubierta->papel_impresion_id)->first()->nombre,
|
||||||
|
$model_papel->getPapelGenericoNombre($lp_sobrecubierta->papel_impresion_id),
|
||||||
strval($lp_sobrecubierta->gramaje)
|
strval($lp_sobrecubierta->gramaje)
|
||||||
);
|
);
|
||||||
$description_sobrecubierta .= ($presupuesto->solapas_sobrecubierta == 1 ? sprintf(lang('Pedidos.lineasTemplates.libro_solapas'), $presupuesto->solapas_ancho_sobrecubierta) : ". ");
|
$description_sobrecubierta .= ($presupuesto->solapas_sobrecubierta == 1 ? sprintf(lang('Pedidos.lineasTemplates.libro_solapas'), $presupuesto->solapas_ancho_sobrecubierta) : ". ");
|
||||||
|
|||||||
@ -601,8 +601,9 @@
|
|||||||
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tiempo_min') ?></th>
|
<th><?= lang('ClientePrecios.tiempo_min') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tiempo_max') ?></th>
|
<th><?= lang('ClientePrecios.tiempo_max') ?></th>
|
||||||
<th><?= lang('ClientePrecios.precio_hora') ?></th>
|
<th class="noFilter"><?= lang('ClientePrecios.precio_hora') ?></th>
|
||||||
<th><?= lang('ClientePrecios.margen') ?></th>
|
<th class="noFilter"><?= lang('ClientePrecios.margen') ?></th>
|
||||||
|
<th class="noFilter"><?= lang('ClientePrecios.total_precio_hora') ?></th>
|
||||||
<th class="noFilter"><?= lang('ClientePrecios.user_updated_id') ?></th>
|
<th class="noFilter"><?= lang('ClientePrecios.user_updated_id') ?></th>
|
||||||
<th class="noFilter"><?= lang('ClientePrecios.updated_at') ?></th>
|
<th class="noFilter"><?= lang('ClientePrecios.updated_at') ?></th>
|
||||||
<th class="noFilter noVis">plantilla_id</th>
|
<th class="noFilter noVis">plantilla_id</th>
|
||||||
|
|||||||
@ -62,8 +62,9 @@
|
|||||||
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tiempo_min') ?></th>
|
<th><?= lang('ClientePrecios.tiempo_min') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tiempo_max') ?></th>
|
<th><?= lang('ClientePrecios.tiempo_max') ?></th>
|
||||||
<th><?= lang('ClientePrecios.precio_hora') ?></th>
|
<th class="noFilter"><?= lang('ClientePrecios.precio_hora') ?></th>
|
||||||
<th><?= lang('ClientePrecios.margen') ?></th>
|
<th class="noFilter"><?= lang('ClientePrecios.margen') ?></th>
|
||||||
|
<th class="noFilter"><?= lang('ClientePrecios.total_precio_hora') ?></th>
|
||||||
<th><?= lang('ClientePrecios.user_updated_id') ?></th>
|
<th><?= lang('ClientePrecios.user_updated_id') ?></th>
|
||||||
<th class="noFilter"><?= lang('ClientePrecios.updated_at') ?></th>
|
<th class="noFilter"><?= lang('ClientePrecios.updated_at') ?></th>
|
||||||
<th class="text-nowrap noFilter" style="min-width:100px"><?= lang('Basic.global.Action') ?>
|
<th class="text-nowrap noFilter" style="min-width:100px"><?= lang('Basic.global.Action') ?>
|
||||||
|
|||||||
@ -141,10 +141,12 @@ class tarifasClienteView {
|
|||||||
name: "precio_hora"
|
name: "precio_hora"
|
||||||
}, {
|
}, {
|
||||||
name: "margen"
|
name: "margen"
|
||||||
|
}, {
|
||||||
|
name: "total_precio_hora",
|
||||||
|
type: 'hidden',
|
||||||
}, {
|
}, {
|
||||||
name: "user_updated_id",
|
name: "user_updated_id",
|
||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
name: "updated_at",
|
name: "updated_at",
|
||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
@ -365,10 +367,17 @@ class tarifasClienteView {
|
|||||||
return window.language.ClientePrecios.colorhq;
|
return window.language.ClientePrecios.colorhq;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ 'data': 'tiempo_min' },
|
{ 'data': 'tiempo_min', render: (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'tiempo_max' },
|
{ 'data': 'tiempo_max', render: (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'precio_hora' },
|
{ 'data': 'precio_hora', render: (d) => `<span class="autonumeric">${d}</span>`},
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
|
{
|
||||||
|
'data': 'total_precio_hora',
|
||||||
|
'render': function (data, type, row, meta) {
|
||||||
|
const value = row.precio_hora*(1+row.margen/100.0);
|
||||||
|
return `<span class="autonumeric">${value}</span>`;
|
||||||
|
}
|
||||||
|
},
|
||||||
{ 'data': 'user_updated' },
|
{ 'data': 'user_updated' },
|
||||||
{ 'data': 'updated_at' },
|
{ 'data': 'updated_at' },
|
||||||
{
|
{
|
||||||
|
|||||||
@ -192,7 +192,11 @@ class PlantillasTarifasClienteForm {
|
|||||||
name: "precio_hora"
|
name: "precio_hora"
|
||||||
}, {
|
}, {
|
||||||
name: "margen"
|
name: "margen"
|
||||||
}, {
|
},{
|
||||||
|
name: "total_precio_hora",
|
||||||
|
type: "hidden"
|
||||||
|
},
|
||||||
|
{
|
||||||
name: "user_updated",
|
name: "user_updated",
|
||||||
type: "hidden",
|
type: "hidden",
|
||||||
def: ''
|
def: ''
|
||||||
@ -560,10 +564,14 @@ class PlantillasTarifasClienteForm {
|
|||||||
return window.language.ClientePrecios.colorhq;
|
return window.language.ClientePrecios.colorhq;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ 'data': 'tiempo_min' },
|
{ 'data': 'tiempo_min', render: (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'tiempo_max' },
|
{ 'data': 'tiempo_max', render: (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'precio_hora' },
|
{ 'data': 'precio_hora', render: (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
|
{ 'data': 'total_precio_hora', render: (d, t, r) => {
|
||||||
|
const value = r.precio_hora*(1+r.margen/100.0);
|
||||||
|
return `<span class="autonumeric">${value}</span>`;
|
||||||
|
}},
|
||||||
{ 'data': 'user_updated' },
|
{ 'data': 'user_updated' },
|
||||||
{ 'data': 'updated_at' },
|
{ 'data': 'updated_at' },
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user