diff --git a/CHANGELOG.md b/CHANGELOG.md index ca342abbd..e93f2b32f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,9 +19,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - (Tickets -> Abono) Al abonar permite crear el ticket abono con almacén o sin almmacén - (General -> Desplegables) Mejorada eficiencia de carga de datos +- (General -> Históricos) Ahora, ademas de los ids, se muestra la descripión de los atributos +- (General -> Históricos) Botón para hacer más ágil mostrar sólo los cambios en un registro +- (General -> Históricos) Filtro por cambios ### Changed - (General -> Permisos) Mejorada seguridad +- (General -> Históricos) Elementos de la interfaz reorganizados para hacerla más ágil e intuitiva ### Fixed - diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 7b67f9616..35d19da45 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2790,7 +2790,9 @@ INSERT INTO `vn`.`ticketLog` (`originFk`, userFk, `action`, changedModel, oldIns (7, 18, 'update', 'Sale', '{"quantity":1}', '{"quantity":10}', 1, NULL), (7, 18, 'update', 'Ticket', '{"quantity":1,"concept":"Chest ammo box"}', '{"quantity":10,"concept":"Chest ammo box"}', 1, NULL), (7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 1, NULL), - (7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 1x0.5m de '5' a '10'"); + (7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 1x0.5m de '5' a '10'"), + (16, 9, 'update', 'Sale', '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', '{"quantity":8,"concept":"Shield", "price": 10.5, "itemFk": 1}' , 5689, 'Shield'); + INSERT INTO `vn`.`ticketLog` (originFk, userFk, `action`, creationDate, changedModel, changedModelId, changedModelValue, oldInstance, newInstance, description) VALUES @@ -2804,7 +2806,6 @@ INSERT INTO `vn`.`ticketLog` (originFk, userFk, `action`, creationDate, changedM (1, 18, 'select', '2000-12-27 03:40:30', 'Ticket', 45, NULL , NULL, NULL, NULL), (1, 18, 'insert', '2000-04-10 09:40:15', 'Sale', 5689, 'Shield' , NULL, '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', NULL), (1, 18, 'insert', '1999-05-09 10:00:00', 'Ticket', 45, 'Super Man' , NULL, '{"id":45,"clientFk":8608,"warehouseFk":60,"shipped":"2023-05-16T22:00:00.000Z","nickname":"Super Man","addressFk":48637,"isSigned":true,"isLabeled":true,"isPrinted":true,"packages":0,"hour":0,"created":"2023-05-16T11:42:56.000Z","isBlocked":false,"hasPriority":false,"companyFk":442,"agencyModeFk":639,"landed":"2023-05-17T22:00:00.000Z","isBoxed":true,"isDeleted":true,"zoneFk":713,"zonePrice":13,"zoneBonus":0}', NULL); - INSERT INTO `vn`.`osTicketConfig` (`id`, `host`, `user`, `password`, `oldStatus`, `newStatusId`, `day`, `comment`, `hostDb`, `userDb`, `passwordDb`, `portDb`, `responseType`, `fromEmailId`, `replyTo`) VALUES (0, 'http://localhost:56596/scp', 'ostadmin', 'Admin1', '1,6', 3, 60, 'Este CAU se ha cerrado automáticamente. Si el problema persiste responda a este mensaje.', 'localhost', 'osticket', 'osticket', 40003, 'reply', 1, 'all'); diff --git a/front/core/styles/util.scss b/front/core/styles/util.scss index 95a523ff4..8c345ddcc 100644 --- a/front/core/styles/util.scss +++ b/front/core/styles/util.scss @@ -1,4 +1,11 @@ +@import "./variables"; +@import "./effects"; +@mixin mobile { + @media screen and (max-width: $mobile-width) { + @content; + } +} @mixin browser($browser) { html[data-browser*="#{$browser}"] & { @content; diff --git a/front/core/styles/variables.scss b/front/core/styles/variables.scss index bcc9fab66..0a74c8277 100644 --- a/front/core/styles/variables.scss +++ b/front/core/styles/variables.scss @@ -1,5 +1,3 @@ -@import "./util"; - $font-size: 11pt; $menu-width: 256px; $topbar-height: 56px; diff --git a/front/salix/components/background/style.scss b/front/salix/components/background/style.scss index c75b69c52..5bc56683e 100644 --- a/front/salix/components/background/style.scss +++ b/front/salix/components/background/style.scss @@ -1,4 +1,4 @@ -@import "variables"; +@import "util"; @keyframes fadein { from { @@ -16,7 +16,7 @@ vn-background { background-color: black; z-index: 14; - @media screen and (max-width: $mobile-width) { + @include mobile { &.shown { display: block; opacity: .3; diff --git a/front/salix/components/layout/style.scss b/front/salix/components/layout/style.scss index 612366228..fa3e8f918 100644 --- a/front/salix/components/layout/style.scss +++ b/front/salix/components/layout/style.scss @@ -1,4 +1,4 @@ -@import "effects"; +@import "util"; vn-layout { & > vn-topbar { @@ -134,7 +134,7 @@ vn-layout { border-radius: 50%; } } - @media screen and (max-width: $mobile-width) { + @include mobile { & > vn-topbar { & > .start > .logo { display: none; diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index e6ade48fb..8b33c811b 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -16,7 +16,7 @@ + class="vn-w-sm vn-px-sm vn-pb-xl">
-
- - - {{::$ctrl.relativeDate(log.creationDate)}} -
+
+ {{::$ctrl.relativeDate(log.creationDate)}} + + +
+ ng-if="::$ctrl.showModelName"> #{{::log.changedModelId}} + + {{::log.changedModelValue}}
+ +
+ + + + + + + + - - - - - - - - @@ -198,18 +210,6 @@ label="To" ng-model="filter.to"> - - - - - -
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 3392c53be..8aea255a2 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -165,11 +165,10 @@ export default class Controller extends Section { switch (prop) { case 'search': const or = []; - if (/^[\w_-]+$/.test(value)) - or.push({changedModelId: value}); - if (!/^[0-9]+$/.test(value)) - or.push({changedModelValue: {like: `%${value}%`}}); - return or.length ? {or} : null; + if (/^\s*[0-9]+\s*$/.test(value)) + return {changedModelId: value.trim()}; + else + return {changedModelValue: {like: `%${value}%`}}; case 'changes': return {or: [ {oldJson: {like: `%${value}%`}}, @@ -222,6 +221,14 @@ export default class Controller extends Section { return this.$.model.applyFilter(lbFilter); } + filterByEntity(log) { + this.$.filter = { + who: 'all', + search: log.changedModelId, + changedModel: log.changedModel + }; + } + searchUser(search) { if (/^[0-9]+$/.test(search)) { return {id: search}; diff --git a/front/salix/components/log/locale/es.yml b/front/salix/components/log/locale/es.yml index 0f2755f2e..90a42911b 100644 --- a/front/salix/components/log/locale/es.yml +++ b/front/salix/components/log/locale/es.yml @@ -3,8 +3,8 @@ Concept: Concepto Search: Buscar Search by id or concept: Buscar por identificador o concepto Search by changes: | - Buscar por cambios realizados. Los atributos deben buscarse por su nombre - interno, para obtenerlo situar el cursor sobre el nombre. + Buscar por cambios. Los atributos deben buscarse por su nombre interno, + para obtenerlo situar el cursor sobre el atributo. Entity: Entidad Action: Acción Author: Autor @@ -16,9 +16,12 @@ Creates: Crea Edits: Modifica Deletes: Elimina Accesses: Accede +All: Todo System: Sistema Details: Detalles note: nota Changes: Cambios today: hoy yesterday: ayer +Show all record changes: Mostrar todos los cambios realizados en el registro +Quit filter: Quitar filtro diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss index cec591a7f..de294972d 100644 --- a/front/salix/components/log/style.scss +++ b/front/salix/components/log/style.scss @@ -1,5 +1,4 @@ -@import "variables"; -@import "effects"; +@import "util"; vn-log { .change { @@ -77,7 +76,7 @@ vn-log { border-radius: 50%; width: 24px; height: 24px; - font-size: 1.4em; + font-size: 18px; &.notice { background-color: $color-notice-medium @@ -98,16 +97,33 @@ vn-log { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + max-height: 18px; + & > vn-icon { + @extend %clickable-light; + vertical-align: middle; + padding: 2px; + margin: -2px; + font-size: 18px; + color: $color-font-secondary; + float: right; + display: none; + + @include mobile { + display: initial; + } + } & > .model-value { font-style: italic; } & > .model-id { color: $color-font-secondary; font-size: .9rem; - float: right; } } + &:hover > .model > vn-icon { + display: initial; + } } } .changes { diff --git a/front/salix/styles/misc.scss b/front/salix/styles/misc.scss index 02bfd9f17..9b2829d0b 100644 --- a/front/salix/styles/misc.scss +++ b/front/salix/styles/misc.scss @@ -1,5 +1,4 @@ -@import "./variables"; -@import "./effects"; +@import "./util"; form vn-horizontal { align-items: center; @@ -22,10 +21,10 @@ form vn-horizontal { } } - @media screen and (max-width: $mobile-width) { + @include mobile { flex-direction: column; align-items: initial; - + & > * { &, &:first-child, diff --git a/modules/client/front/credit-management/index.html b/modules/client/front/credit-management/index.html index d7456fd06..b9064ff69 100644 --- a/modules/client/front/credit-management/index.html +++ b/modules/client/front/credit-management/index.html @@ -68,7 +68,7 @@ {{::clientInforma.rating}} - {{::clientInforma.recommendedCredit}} + {{::clientInforma.recommendedCredit | currency: 'EUR': 2}} diff --git a/modules/ticket/back/methods/ticket-log/getChanges.js b/modules/ticket/back/methods/ticket-log/getChanges.js index 7a6de49e8..1b74ec1d7 100644 --- a/modules/ticket/back/methods/ticket-log/getChanges.js +++ b/modules/ticket/back/methods/ticket-log/getChanges.js @@ -61,15 +61,15 @@ module.exports = Self => { const oldQuantity = log.oldInstance.quantity; const newQuantity = log.newInstance?.quantity || 0; - if (oldQuantity || newQuantity) { - const changeMessage = $t('Change quantity', { - concept: log.changedModelValue, - oldQuantity: oldQuantity || 0, - newQuantity: newQuantity || 0, - }); - changes.push(changeMessage); + if (oldQuantity > newQuantity) { + const changeMessage = $t('Change quantity', { + concept: log.changedModelValue, + oldQuantity: oldQuantity || 0, + newQuantity: newQuantity || 0, + }); + changes.push(changeMessage); } - } + } return changes.join('\n'); }; diff --git a/modules/ticket/back/methods/ticket-log/specs/getChanges.spec.js b/modules/ticket/back/methods/ticket-log/specs/getChanges.spec.js index c0f7dde0e..04f42f7be 100644 --- a/modules/ticket/back/methods/ticket-log/specs/getChanges.spec.js +++ b/modules/ticket/back/methods/ticket-log/specs/getChanges.spec.js @@ -7,7 +7,7 @@ describe('ticketLog getChanges()', () => { return value; }; it('should return the changes in the sales of a ticket', async() => { - const ticketId = 7; + const ticketId = 16; const changues = await models.TicketLog.getChanges(ctx, ticketId); diff --git a/modules/ticket/front/descriptor/locale/es.yml b/modules/ticket/front/descriptor/locale/es.yml index d921b5dc2..3da013467 100644 --- a/modules/ticket/front/descriptor/locale/es.yml +++ b/modules/ticket/front/descriptor/locale/es.yml @@ -23,4 +23,4 @@ Restore ticket: Restaurar ticket You are going to restore this ticket: Vas a restaurar este ticket Are you sure you want to restore this ticket?: ¿Seguro que quieres restaurar el ticket? Are you sure you want to refund all?: ¿Seguro que quieres abonar todo? -Send changes: "Verdnatura le recuerda:\rPedido {{ticketId}} día {{created | date: 'dd/MM/yyyy'}}\r{{changes}}" +Send changes: "Verdnatura:\rPedido {{ticketId}}\r{{changes}}"