diff --git a/ci4/app/Language/es/ClientePrecios.php b/ci4/app/Language/es/ClientePrecios.php index b54205e1..061e0eac 100755 --- a/ci4/app/Language/es/ClientePrecios.php +++ b/ci4/app/Language/es/ClientePrecios.php @@ -20,6 +20,7 @@ return [ 'tiempo_max' => 'Tiempo Máx.', 'precio_hora' => 'Precio hora', 'margen' => 'Margen', + 'total_precio_hora' => 'Total precio h.', 'cliente_id' => 'Cliente', 'user_updated_id' => 'Usuario edición', 'updated_at' => 'Fecha edición', diff --git a/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php b/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php index 9e1b6852..8b6562e3 100755 --- a/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php +++ b/ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php @@ -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.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.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"); diff --git a/ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteFormItems.php b/ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteFormItems.php index 56654f74..6a237646 100644 --- a/ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/clientes/cliente/_clienteFormItems.php @@ -601,8 +601,9 @@ - - + + + plantilla_id diff --git a/ci4/app/Views/themes/vuexy/form/clientes/plantillaprecios/viewClienteplantillapreciosForm.php b/ci4/app/Views/themes/vuexy/form/clientes/plantillaprecios/viewClienteplantillapreciosForm.php index 4b5541b8..9358b782 100644 --- a/ci4/app/Views/themes/vuexy/form/clientes/plantillaprecios/viewClienteplantillapreciosForm.php +++ b/ci4/app/Views/themes/vuexy/form/clientes/plantillaprecios/viewClienteplantillapreciosForm.php @@ -62,8 +62,9 @@ - - + + + diff --git a/httpdocs/assets/js/safekat/pages/cliente/tarifasCliente.js b/httpdocs/assets/js/safekat/pages/cliente/tarifasCliente.js index 1bc83c7b..a0276268 100644 --- a/httpdocs/assets/js/safekat/pages/cliente/tarifasCliente.js +++ b/httpdocs/assets/js/safekat/pages/cliente/tarifasCliente.js @@ -141,10 +141,12 @@ class tarifasClienteView { name: "precio_hora" }, { name: "margen" + }, { + name: "total_precio_hora", + type: 'hidden', }, { name: "user_updated_id", type: 'hidden', - }, { name: "updated_at", type: 'hidden', @@ -365,10 +367,17 @@ class tarifasClienteView { return window.language.ClientePrecios.colorhq; } }, - { 'data': 'tiempo_min' }, - { 'data': 'tiempo_max' }, - { 'data': 'precio_hora' }, + { 'data': 'tiempo_min', render: (d) => `${d}`}, + { 'data': 'tiempo_max', render: (d) => `${d}`}, + { 'data': 'precio_hora', render: (d) => `${d}`}, { 'data': 'margen' }, + { + 'data': 'total_precio_hora', + 'render': function (data, type, row, meta) { + const value = row.precio_hora*(1+row.margen/100.0); + return `${value}`; + } + }, { 'data': 'user_updated' }, { 'data': 'updated_at' }, { diff --git a/httpdocs/assets/js/safekat/pages/plantillasTarifasCliente/edit.js b/httpdocs/assets/js/safekat/pages/plantillasTarifasCliente/edit.js index 81d5952f..071e158b 100644 --- a/httpdocs/assets/js/safekat/pages/plantillasTarifasCliente/edit.js +++ b/httpdocs/assets/js/safekat/pages/plantillasTarifasCliente/edit.js @@ -192,7 +192,11 @@ class PlantillasTarifasClienteForm { name: "precio_hora" }, { name: "margen" - }, { + },{ + name: "total_precio_hora", + type: "hidden" + }, + { name: "user_updated", type: "hidden", def: '' @@ -560,10 +564,14 @@ class PlantillasTarifasClienteForm { return window.language.ClientePrecios.colorhq; } }, - { 'data': 'tiempo_min' }, - { 'data': 'tiempo_max' }, - { 'data': 'precio_hora' }, + { 'data': 'tiempo_min', render: (d) => `${d}` }, + { 'data': 'tiempo_max', render: (d) => `${d}` }, + { 'data': 'precio_hora', render: (d) => `${d}` }, { 'data': 'margen' }, + { 'data': 'total_precio_hora', render: (d, t, r) => { + const value = r.precio_hora*(1+r.margen/100.0); + return `${value}`; + }}, { 'data': 'user_updated' }, { 'data': 'updated_at' },