From b4bed608aba47838e500db6ebf5ceb3d28a4f9df Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 9 Feb 2022 15:01:02 +0100 Subject: [PATCH 01/16] refactor(ticket): getMovable --- db/changes/10411-january/00-ticket_getMovable.sql | 2 +- .../ticket/front/basic-data/step-two/index.html | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/db/changes/10411-january/00-ticket_getMovable.sql b/db/changes/10411-january/00-ticket_getMovable.sql index 5f5b0a93a..051a86a7d 100644 --- a/db/changes/10411-january/00-ticket_getMovable.sql +++ b/db/changes/10411-january/00-ticket_getMovable.sql @@ -17,7 +17,7 @@ BEGIN FROM ticket t WHERE t.id = vTicketFk; - CALL itemStock(vWarehouseFk, DATE_SUB(vDatedNew, INTERVAL 1 DAY), NULL); + CALL itemStock(vWarehouseFk, vDatedNew, NULL); CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(vDatedOld, vDatedNew), NULL); SELECT s.id, diff --git a/modules/ticket/front/basic-data/step-two/index.html b/modules/ticket/front/basic-data/step-two/index.html index 092c9e746..af06a0f70 100644 --- a/modules/ticket/front/basic-data/step-two/index.html +++ b/modules/ticket/front/basic-data/step-two/index.html @@ -18,7 +18,14 @@ - {{("000000"+sale.itemFk).slice(-6)}} + + + {{("000000"+sale.itemFk).slice(-6)}} + +
{{::sale.item.name}} @@ -83,5 +90,9 @@
- + + From 135aff27a4caef315760aa1208c8d58ae4a0d3d5 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 10 Feb 2022 09:13:48 +0100 Subject: [PATCH 02/16] fix(getMovable): show correct movable --- db/changes/10411-january/00-ticket_getMovable.sql | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/db/changes/10411-january/00-ticket_getMovable.sql b/db/changes/10411-january/00-ticket_getMovable.sql index 051a86a7d..eb5c722c4 100644 --- a/db/changes/10411-january/00-ticket_getMovable.sql +++ b/db/changes/10411-january/00-ticket_getMovable.sql @@ -6,20 +6,23 @@ CREATE DEFINER=`root`@`%` PROCEDURE `vn`.`ticket_getMovable`(vTicketFk INT, vDat BEGIN /** * Cálcula el stock movible para los artículos de un ticket + * vDatedNew debe ser menor que vDatedOld, en los otros casos se + * asume que siempre es posible * * @param vTicketFk -> Ticket * @param vDatedNew -> Nueva fecha * @return Sales con Movible */ DECLARE vDatedOld DATETIME; - + SET vDatedNew = DATE_ADD(vDatedNew, INTERVAL 1 DAY); + SELECT t.shipped INTO vDatedOld FROM ticket t WHERE t.id = vTicketFk; - CALL itemStock(vWarehouseFk, vDatedNew, NULL); - CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(vDatedOld, vDatedNew), NULL); - + CALL itemStock(vWarehouseFk, vDatedNew, NULL); + CALL item_getMinacum(vWarehouseFk, vDatedNew, DATEDIFF(DATE_SUB(vDatedOld, INTERVAL 1 DAY), vDatedNew), NULL); + SELECT s.id, s.itemFk, s.quantity, From 4e5e6dcccad1c5c5dfb29dc01532d56a9c5316e1 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 10 Feb 2022 10:15:43 +0100 Subject: [PATCH 03/16] fix(test): change movable expeted --- .../ticket/back/methods/ticket/specs/priceDifference.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js b/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js index e9aa5030a..d8c785baa 100644 --- a/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js +++ b/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js @@ -86,8 +86,8 @@ describe('sale priceDifference()', () => { const firstItem = result.items[0]; const secondtItem = result.items[1]; - expect(firstItem.movable).toEqual(440); - expect(secondtItem.movable).toEqual(1980); + expect(firstItem.movable).toEqual(410); + expect(secondtItem.movable).toEqual(1870); await tx.rollback(); } catch (e) { From ac0e55107a6c4c283a75516bc3ec357971538208 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Tue, 15 Feb 2022 12:59:57 +0100 Subject: [PATCH 04/16] 3595 feat(toggleHidden): itemWaste now can hide panels --- modules/item/front/waste/index/index.html | 28 +++++++---- modules/item/front/waste/index/index.js | 29 ++++++++++- modules/item/front/waste/index/index.spec.js | 53 ++++++++++++++++++++ modules/item/front/waste/index/style.scss | 37 +++++++++----- 4 files changed, 123 insertions(+), 24 deletions(-) create mode 100644 modules/item/front/waste/index/index.spec.js diff --git a/modules/item/front/waste/index/index.html b/modules/item/front/waste/index/index.html index 7ad985ea8..c80733e9e 100644 --- a/modules/item/front/waste/index/index.html +++ b/modules/item/front/waste/index/index.html @@ -3,13 +3,21 @@ url="Items/getWasteByWorker" data="details"> - - -
- -
{{detail.buyer}}
-
+
+ +
{{detail.buyer}}
+ + + + +
+ @@ -21,7 +29,7 @@ + ui-sref="item.waste.detail({buyer: waste.buyer, family: waste.family})"> {{::waste.family}} {{::(waste.percentage / 100) | percentage: 2}} {{::waste.dwindle | currency: 'EUR'}} @@ -29,6 +37,6 @@ -
- - + +
+
\ No newline at end of file diff --git a/modules/item/front/waste/index/index.js b/modules/item/front/waste/index/index.js index 15e6b063f..b11f54b08 100644 --- a/modules/item/front/waste/index/index.js +++ b/modules/item/front/waste/index/index.js @@ -2,7 +2,34 @@ import ngModule from '../../module'; import Section from 'salix/components/section'; import './style.scss'; +export default class Controller extends Section { + constructor($element, $) { + super($element, $); + + this.getWasteConfig(); + } + + getWasteConfig() { + return this.wasteConfig = JSON.parse(localStorage.getItem('wasteConfig')) || {}; + } + + setWasteConfig() { + localStorage.setItem('wasteConfig', JSON.stringify(this.wasteConfig)); + } + + toggleHidePanel(detail) { + if (!this.wasteConfig[detail.buyer]) { + this.wasteConfig[detail.buyer] = { + hidden: true + }; + } else + this.wasteConfig[detail.buyer].hidden = !this.wasteConfig[detail.buyer].hidden; + + this.setWasteConfig(); + } +} + ngModule.vnComponent('vnItemWasteIndex', { template: require('./index.html'), - controller: Section + controller: Controller }); diff --git a/modules/item/front/waste/index/index.spec.js b/modules/item/front/waste/index/index.spec.js new file mode 100644 index 000000000..575e773bd --- /dev/null +++ b/modules/item/front/waste/index/index.spec.js @@ -0,0 +1,53 @@ +import './index.js'; +import crudModel from 'core/mocks/crud-model'; + +fdescribe('Item', () => { + describe('Component vnItemWasteIndex', () => { + let $scope; + let controller; + + beforeEach(ngModule('item')); + + beforeEach(inject(($componentController, $rootScope) => { + $scope = $rootScope.$new(); + $scope.model = crudModel; + const $element = angular.element(''); + controller = $componentController('vnItemWasteIndex', {$element, $scope}); + })); + + describe('getWasteConfig / setWasteConfig', () => { + it('should return the local storage wasteConfig', () => { + const result = controller.getWasteConfig(); + + expect(result).toEqual({}); + }); + + it('should set and return the local storage wasteConfig', () => { + controller.wasteConfig = {salesPerson: {hidden: true}}; + controller.setWasteConfig(); + + const result = controller.getWasteConfig(); + + expect(result).toEqual(controller.wasteConfig); + }); + }); + + describe('toggleHidePanel()', () => { + it('should make details hidden by default', () => { + controller.wasteConfig = {}; + + controller.toggleHidePanel({buyer: 'salesPerson'}); + + expect(controller.wasteConfig.salesPerson.hidden).toEqual(true); + }); + + it('should toggle hidden false', () => { + controller.wasteConfig = {salesPerson: {hidden: true}}; + + controller.toggleHidePanel({buyer: 'salesPerson'}); + + expect(controller.wasteConfig.salesPerson.hidden).toEqual(false); + }); + }); + }); +}); diff --git a/modules/item/front/waste/index/style.scss b/modules/item/front/waste/index/style.scss index faac46139..8b44cb6f1 100644 --- a/modules/item/front/waste/index/style.scss +++ b/modules/item/front/waste/index/style.scss @@ -1,21 +1,24 @@ @import "variables"; +@import "effects"; vn-item-waste-index, vn-item-waste-detail { .header { - margin-bottom: 16px; - text-transform: uppercase; - font-size: 1.25rem; - line-height: 1; - padding: 7px; - padding-bottom: 7px; - padding-bottom: 4px; - font-weight: lighter; - background-color: $color-bg; - border-bottom: 1px solid #f7931e; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + padding: 12px 0 5px 0; + color: gray; + font-size: 1.2rem; + border-bottom: $border; + margin-bottom: 10px; + + & > vn-none > vn-icon { + @extend %clickable-light; + color: $color-button; + font-size: 1.4rem; + } + + vn-none > .arrow { + transition: transform 200ms; + } } vn-table vn-th.waste-family, @@ -23,4 +26,12 @@ vn-item-waste-detail { max-width: 64px; width: 64px } + .hidden { + display: none; + + } + .header > vn-none > .arrow.hidden { + display: block; + transform: rotate(180deg); + } } \ No newline at end of file From 401174b27a69ae0d461d735801fdb4e7866e7326 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Tue, 15 Feb 2022 13:46:25 +0100 Subject: [PATCH 05/16] removed focus on describe --- modules/item/front/waste/index/index.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/item/front/waste/index/index.spec.js b/modules/item/front/waste/index/index.spec.js index 575e773bd..fd7332f68 100644 --- a/modules/item/front/waste/index/index.spec.js +++ b/modules/item/front/waste/index/index.spec.js @@ -1,7 +1,7 @@ import './index.js'; import crudModel from 'core/mocks/crud-model'; -fdescribe('Item', () => { +describe('Item', () => { describe('Component vnItemWasteIndex', () => { let $scope; let controller; From 34730f48edc6473b20f0d7cfcd36f9d1a142cff5 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 16 Feb 2022 12:51:45 +0100 Subject: [PATCH 06/16] fix: add role salesBoss to filter --- modules/claim/front/search-panel/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/claim/front/search-panel/index.html b/modules/claim/front/search-panel/index.html index dbbc3a46b..22faf9ec4 100644 --- a/modules/claim/front/search-panel/index.html +++ b/modules/claim/front/search-panel/index.html @@ -28,7 +28,7 @@ url="Workers/activeWithRole" search-function="{firstName: $search}" value-field="id" - where="{role: {inq: ['salesPerson', 'officeBoss']}}" + where="{role: {inq: ['salesBoss', 'salesPerson', 'officeBoss']}}" label="Salesperson"> {{firstName}} {{name}} @@ -38,7 +38,7 @@ url="Workers/activeWithRole" search-function="{firstName: $search}" value-field="id" - where="{role: 'salesPerson'}" + where="{role: {inq: ['salesBoss', 'salesPerson']}}" label="Attended by"> {{firstName}} {{name}} From 89eee042b55327b880352010253da54768ccfd30 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 17 Feb 2022 08:02:02 +0100 Subject: [PATCH 07/16] refactor(ticket_basic-data): zeroFill and move getMovable --- .../00-ticket_getMovable.sql | 0 modules/ticket/front/basic-data/step-two/index.html | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename db/changes/{10411-january => 10420-valentines}/00-ticket_getMovable.sql (100%) diff --git a/db/changes/10411-january/00-ticket_getMovable.sql b/db/changes/10420-valentines/00-ticket_getMovable.sql similarity index 100% rename from db/changes/10411-january/00-ticket_getMovable.sql rename to db/changes/10420-valentines/00-ticket_getMovable.sql diff --git a/modules/ticket/front/basic-data/step-two/index.html b/modules/ticket/front/basic-data/step-two/index.html index af06a0f70..6be455fc9 100644 --- a/modules/ticket/front/basic-data/step-two/index.html +++ b/modules/ticket/front/basic-data/step-two/index.html @@ -23,7 +23,7 @@ title="{{::sale.item.name}}" vn-click-stop="itemDescriptor.show($event, sale.itemFk, sale.id)" class="link"> - {{("000000"+sale.itemFk).slice(-6)}} + {{::sale.itemFk | zeroFill:6}}
From 743972e9c31466ebca89bf051bf73303fdff692b Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 17 Feb 2022 11:23:27 +0100 Subject: [PATCH 08/16] fix(invoice): prevent report empty pages --- print/templates/reports/invoice/assets/css/style.css | 9 ++++++--- print/templates/reports/invoice/invoice.html | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/print/templates/reports/invoice/assets/css/style.css b/print/templates/reports/invoice/assets/css/style.css index cd605db9b..9fda2a613 100644 --- a/print/templates/reports/invoice/assets/css/style.css +++ b/print/templates/reports/invoice/assets/css/style.css @@ -5,7 +5,7 @@ h2 { .table-title { margin-bottom: 15px; - font-size: 0.8rem + font-size: .8rem } .table-title h2 { @@ -16,9 +16,12 @@ h2 { font-size: 22px } + #nickname h2 { - max-width: 400px; - word-wrap: break-word + max-width: 400px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } #phytosanitary { diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html index 8b13f2a15..1d646a0db 100644 --- a/print/templates/reports/invoice/invoice.html +++ b/print/templates/reports/invoice/invoice.html @@ -85,7 +85,7 @@ -
+

{{$t('deliveryNote')}} From 2bdb1075fbc57d2b4ae8064b11e77c6014e6ca1e Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 17 Feb 2022 11:23:27 +0100 Subject: [PATCH 09/16] fix(invoice): prevent report empty pages --- print/templates/reports/invoice/assets/css/style.css | 9 ++++++--- print/templates/reports/invoice/invoice.html | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/print/templates/reports/invoice/assets/css/style.css b/print/templates/reports/invoice/assets/css/style.css index cd605db9b..9fda2a613 100644 --- a/print/templates/reports/invoice/assets/css/style.css +++ b/print/templates/reports/invoice/assets/css/style.css @@ -5,7 +5,7 @@ h2 { .table-title { margin-bottom: 15px; - font-size: 0.8rem + font-size: .8rem } .table-title h2 { @@ -16,9 +16,12 @@ h2 { font-size: 22px } + #nickname h2 { - max-width: 400px; - word-wrap: break-word + max-width: 400px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } #phytosanitary { diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html index 8b13f2a15..1d646a0db 100644 --- a/print/templates/reports/invoice/invoice.html +++ b/print/templates/reports/invoice/invoice.html @@ -85,7 +85,7 @@ -
+

{{$t('deliveryNote')}} From 05aa5791564d4bc9883f9c8e1f566d4a080760bb Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 16 Feb 2022 12:51:45 +0100 Subject: [PATCH 10/16] fix: add role salesBoss to filter --- modules/claim/front/search-panel/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/claim/front/search-panel/index.html b/modules/claim/front/search-panel/index.html index 6efd6603b..b48d94d21 100644 --- a/modules/claim/front/search-panel/index.html +++ b/modules/claim/front/search-panel/index.html @@ -28,7 +28,7 @@ url="Workers/activeWithRole" search-function="{firstName: $search}" value-field="id" - where="{role: {inq: ['salesPerson', 'officeBoss']}}" + where="{role: {inq: ['salesBoss', 'salesPerson', 'officeBoss']}}" label="Salesperson"> {{firstName}} {{name}} @@ -38,7 +38,7 @@ url="Workers/activeWithRole" search-function="{firstName: $search}" value-field="id" - where="{role: 'salesPerson'}" + where="{role: {inq: ['salesBoss', 'salesPerson']}}" label="Attended by"> {{firstName}} {{name}} From 46488aa60002df15f3fde5435e8372c6738e4e6a Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 3 Feb 2022 11:52:55 +0100 Subject: [PATCH 11/16] fix(icon): icon-plant --- front/core/styles/icons/salixfont.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/core/styles/icons/salixfont.css b/front/core/styles/icons/salixfont.css index ff2eaa1f5..e37ccbc1f 100644 --- a/front/core/styles/icons/salixfont.css +++ b/front/core/styles/icons/salixfont.css @@ -290,7 +290,7 @@ .icon-photo:before { content: "\e924"; } -.icon-planta:before { +.icon-plant:before { content: "\e908"; } .icon-polizon:before { From c260917e20a8a87b65a13823625e4245918609e2 Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 18 Feb 2022 08:49:31 +0100 Subject: [PATCH 12/16] fix(closure): removed transaction --- print/methods/closure/closure.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/print/methods/closure/closure.js b/print/methods/closure/closure.js index 8cce8237c..2b58205e3 100644 --- a/print/methods/closure/closure.js +++ b/print/methods/closure/closure.js @@ -12,8 +12,6 @@ module.exports = { const failedtickets = []; for (const ticket of tickets) { try { - await db.rawSql('START TRANSACTION'); - await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]); const invoiceOut = await db.findOne(` @@ -91,9 +89,7 @@ module.exports = { const email = new Email('delivery-note-link', args); await email.send(); } - await db.rawSql('COMMIT'); } catch (error) { - await db.rawSql('ROLLBACK'); // Domain not found if (error.responseCode == 450) return invalidEmail(ticket); From 6f1bfbd955da3e4e92065a29c32a00eef9576aad Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sat, 19 Feb 2022 14:05:35 +0100 Subject: [PATCH 13/16] roleConfig: fixes & refactor --- modules/account/back/models/role-config.js | 41 ++++++++------------ modules/account/back/models/role-config.json | 12 ++++++ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/modules/account/back/models/role-config.js b/modules/account/back/models/role-config.js index b5cfb7b83..c6b32a4c5 100644 --- a/modules/account/back/models/role-config.js +++ b/modules/account/back/models/role-config.js @@ -1,7 +1,9 @@ module.exports = Self => { Self.getSynchronizer = async function() { - return await Self.findOne({fields: ['id']}); + return await Self.findOne({ + fields: ['id', 'rolePrefix', 'userPrefix', 'userHost'] + }); }; Object.assign(Self.prototype, { @@ -14,17 +16,16 @@ module.exports = Self => { }, async syncUser(userName, info, password) { - const mysqlHost = '%'; - let mysqlUser = userName; - if (this.dbType == 'MySQL') mysqlUser = `!${mysqlUser}`; + if (this.dbType == 'MySQL') + mysqlUser = this.userPrefix + mysqlUser; const [row] = await Self.rawSql( `SELECT COUNT(*) AS nRows FROM mysql.user WHERE User = ? AND Host = ?`, - [mysqlUser, mysqlHost] + [mysqlUser, this.userHost] ); let userExists = row.nRows > 0; @@ -35,11 +36,10 @@ module.exports = Self => { FROM mysql.global_priv WHERE User = ? AND Host = ?`, - [mysqlUser, mysqlHost] + [mysqlUser, this.userHost] ); const priv = row && JSON.parse(row.priv); - const role = priv && priv.default_role; - isUpdatable = !row || (role && role.startsWith('z-')); + isUpdatable = !row || (priv && priv.autogenerated); } if (!isUpdatable) { @@ -51,31 +51,27 @@ module.exports = Self => { if (password) { if (!userExists) { await Self.rawSql('CREATE USER ?@? IDENTIFIED BY ?', - [mysqlUser, mysqlHost, password] - ); + [mysqlUser, this.userHost, password]); userExists = true; } else { switch (this.dbType) { case 'MariaDB': await Self.rawSql('ALTER USER ?@? IDENTIFIED BY ?', - [mysqlUser, mysqlHost, password] - ); + [mysqlUser, this.userHost, password]); break; default: await Self.rawSql('SET PASSWORD FOR ?@? = PASSWORD(?)', - [mysqlUser, mysqlHost, password] - ); + [mysqlUser, this.userHost, password]); } } } if (userExists && this.dbType == 'MariaDB') { - let role = `z-${info.user.role().name}`; + let role = `${this.rolePrefix}${info.user.role().name}`; try { await Self.rawSql('REVOKE ALL, GRANT OPTION FROM ?@?', - [mysqlUser, mysqlHost] - ); + [mysqlUser, this.userHost]); } catch (err) { if (err.code == 'ER_REVOKE_GRANTS') console.warn(`${err.code}: ${err.sqlMessage}: ${err.sql}`); @@ -83,21 +79,18 @@ module.exports = Self => { throw err; } await Self.rawSql('GRANT ? TO ?@?', - [role, mysqlUser, mysqlHost] - ); + [role, mysqlUser, this.userHost]); if (role) { await Self.rawSql('SET DEFAULT ROLE ? FOR ?@?', - [role, mysqlUser, mysqlHost] - ); + [role, mysqlUser, this.userHost]); } else { await Self.rawSql('SET DEFAULT ROLE NONE FOR ?@?', - [mysqlUser, mysqlHost] - ); + [mysqlUser, this.userHost]); } } } else if (userExists) - await Self.rawSql('DROP USER ?@?', [mysqlUser, mysqlHost]); + await Self.rawSql('DROP USER ?@?', [mysqlUser, this.userHost]); } }); }; diff --git a/modules/account/back/models/role-config.json b/modules/account/back/models/role-config.json index c2abfcc38..f4138bea8 100644 --- a/modules/account/back/models/role-config.json +++ b/modules/account/back/models/role-config.json @@ -16,6 +16,18 @@ }, "mysqlPassword": { "type": "string" + }, + "rolePrefix": { + "type": "string" + }, + "userPrefix": { + "type": "string" + }, + "userHost": { + "type": "string" + }, + "tplUser": { + "type": "string" } } } From c3e480b2e7832d49aab4ed9de8acfbd823db2260 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 24 Feb 2022 15:02:16 +0100 Subject: [PATCH 14/16] MariaDB user sync disabled in dev environment --- modules/account/back/models/role-config.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/account/back/models/role-config.js b/modules/account/back/models/role-config.js index c6b32a4c5..6051f2060 100644 --- a/modules/account/back/models/role-config.js +++ b/modules/account/back/models/role-config.js @@ -1,6 +1,10 @@ module.exports = Self => { Self.getSynchronizer = async function() { + let NODE_ENV = process.env.NODE_ENV; + if (!NODE_ENV || NODE_ENV == 'development') + return null; + return await Self.findOne({ fields: ['id', 'rolePrefix', 'userPrefix', 'userHost'] }); From bf0734ca67deb114627f8c32544823ee74552f3d Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 28 Feb 2022 10:46:14 +0100 Subject: [PATCH 15/16] excluded 3 test suites until db export --- modules/client/back/methods/client/specs/sendSms.spec.js | 3 ++- modules/client/back/methods/sms/send.spec.js | 3 ++- modules/ticket/back/methods/ticket/specs/sendSms.spec.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/client/back/methods/client/specs/sendSms.spec.js b/modules/client/back/methods/client/specs/sendSms.spec.js index 121d427ce..54fe802e3 100644 --- a/modules/client/back/methods/client/specs/sendSms.spec.js +++ b/modules/client/back/methods/client/specs/sendSms.spec.js @@ -1,7 +1,8 @@ const models = require('vn-loopback/server/server').models; const soap = require('soap'); -describe('client sendSms()', () => { +// #3673 sendSms tests excluded +xdescribe('client sendSms()', () => { it('should now send a message and log it', async() => { spyOn(soap, 'createClientAsync').and.returnValue('a so fake client'); const tx = await models.Client.beginTransaction({}); diff --git a/modules/client/back/methods/sms/send.spec.js b/modules/client/back/methods/sms/send.spec.js index 7ca78b214..a81c24e96 100644 --- a/modules/client/back/methods/sms/send.spec.js +++ b/modules/client/back/methods/sms/send.spec.js @@ -1,6 +1,7 @@ const app = require('vn-loopback/server/server'); -describe('sms send()', () => { +// #3673 sendSms tests excluded +xdescribe('sms send()', () => { it('should not return status error', async() => { const ctx = {req: {accessToken: {userId: 1}}}; const result = await app.models.Sms.send(ctx, 1105, '123456789', 'My SMS Body'); diff --git a/modules/ticket/back/methods/ticket/specs/sendSms.spec.js b/modules/ticket/back/methods/ticket/specs/sendSms.spec.js index 8ec4ca487..46ae23702 100644 --- a/modules/ticket/back/methods/ticket/specs/sendSms.spec.js +++ b/modules/ticket/back/methods/ticket/specs/sendSms.spec.js @@ -1,7 +1,8 @@ const models = require('vn-loopback/server/server').models; const soap = require('soap'); -describe('ticket sendSms()', () => { +// #3673 sendSms tests excluded +xdescribe('ticket sendSms()', () => { it('should send a message and log it', async() => { const tx = await models.Ticket.beginTransaction({}); From 4b963804c61b5c420153c740c6cd2423d8d9096b Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 28 Feb 2022 10:54:32 +0100 Subject: [PATCH 16/16] added transalation to item waste --- modules/item/front/waste/locale/es.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/item/front/waste/locale/es.yml b/modules/item/front/waste/locale/es.yml index 9f08e3a72..b9cd33dec 100644 --- a/modules/item/front/waste/locale/es.yml +++ b/modules/item/front/waste/locale/es.yml @@ -1,3 +1,4 @@ Family: Familia Percentage: Porcentaje -Dwindle: Mermas \ No newline at end of file +Dwindle: Mermas +Minimize/Maximize: Minimizar/Maximizar \ No newline at end of file