From 5b80951e3eaf1a4734a9894111f914db75cff888 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 3 Apr 2023 03:54:35 +0200 Subject: [PATCH 01/49] refs #5517 vnLog: View improved --- front/core/components/index.js | 1 + front/core/components/json-value/index.html | 1 + front/core/components/json-value/index.js | 56 +++++++ front/core/components/json-value/style.scss | 21 +++ front/core/components/table/style.scss | 21 ++- front/salix/components/log/index.html | 144 ++++++++++------- front/salix/components/log/index.js | 44 +++--- front/salix/components/log/locale/es.yml | 1 + front/salix/components/log/style.scss | 161 ++++++++++++++------ 9 files changed, 313 insertions(+), 137 deletions(-) create mode 100644 front/core/components/json-value/index.html create mode 100644 front/core/components/json-value/index.js create mode 100644 front/core/components/json-value/style.scss diff --git a/front/core/components/index.js b/front/core/components/index.js index 86ab89212..44b8beb45 100644 --- a/front/core/components/index.js +++ b/front/core/components/index.js @@ -32,6 +32,7 @@ import './float-button'; import './icon-menu'; import './icon-button'; import './input-number'; +import './json-value'; import './label-value'; import './range'; import './input-time'; diff --git a/front/core/components/json-value/index.html b/front/core/components/json-value/index.html new file mode 100644 index 000000000..dc1c97709 --- /dev/null +++ b/front/core/components/json-value/index.html @@ -0,0 +1 @@ + diff --git a/front/core/components/json-value/index.js b/front/core/components/json-value/index.js new file mode 100644 index 000000000..c92227ed3 --- /dev/null +++ b/front/core/components/json-value/index.js @@ -0,0 +1,56 @@ +import ngModule from '../../module'; +import Component from 'core/lib/component'; +import './style.scss'; + +const maxStrLen = 25; + +/** + * Displays pretty JSON value. + * + * @property {*} value The value + */ +export default class Controller extends Component { + get value() { + return this._value; + } + + set value(value) { + this._value = value; + const span = this.element; + const formattedValue = this.formatValue(value); + span.textContent = formattedValue; + span.title = typeof value == 'string' && value.length > maxStrLen ? value : ''; + span.className = `js-${value == null ? 'null' : typeof value}`; + } + + formatValue(value) { + if (value == null) return '∅'; + switch (typeof value) { + case 'boolean': + return value ? '✓' : '✗'; + case 'string': + return value.length <= maxStrLen + ? value + : value.substring(0, maxStrLen) + '...'; + case 'object': + if (value instanceof Date) { + const hasZeroTime = + value.getHours() === 0 && + value.getMinutes() === 0 && + value.getSeconds() === 0; + const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss'; + return this.$filter('date')(value, format); + } else + return value; + default: + return value; + } + } +} + +ngModule.vnComponent('vnJsonValue', { + controller: Controller, + bindings: { + value: ' thead, + & > tbody, + & > tfoot, + & > vn-thead, + & > vn-tbody, + & > vn-tfoot, + & > .vn-thead, + & > .vn-tbody, + & > .vn-tfoot { & > * { display: table-row; @@ -111,14 +116,14 @@ vn-table { color: inherit; } } - a.vn-tbody { + & > a.vn-tbody { &.clickable { @extend %clickable; } } - vn-tbody > *, - .vn-tbody > *, - tbody > * { + & > vn-tbody > *, + & > .vn-tbody > *, + & > tbody > * { border-bottom: $border-thin; &:last-child { diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 79dfcef8c..1bb8b1705 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -9,63 +9,99 @@ limit="20" auto-load="true"> - + - - - - Date - User - Model - Action - Name - Changes - - - - - - {{::log.creationDate | date:'dd/MM/yyyy HH:mm'}} - - - {{::log.user.name || 'System' | translate}} + + + + + + + + + + + + + + + + + + + +
+ Action + + Model + + Date +
+ + {{::log.user.name}} - - - {{::log.changedModel}} - - - {{::$ctrl.actionsText[log.action]}} - - - {{::log.changedModelValue}} - - - - - - - - - - - - - - - - - -
FieldBeforeAfter
{{prop.name}}{{prop.old}}{{prop.new}}
-
- {{::log.description}} + + System + +
+ + {{::log.changedModel}} + + + {{::log.changedModelValue}} + + + #{{::log.changedModelId}} + + + {{::log.creationDate | date:'dd/MM/yyyy HH:mm'}} +
+ + {{::$ctrl.actionsText[log.action]}} + + +
+ + + + +
+ + + {{::prop.name}}: + , + +
+
+ {{::prop.name}}: + + + ← + +
+
+
+ + {{::log.description}} + + + No changes + +
- - - - +
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 1c54aa9b8..f1eedf72e 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -13,6 +13,12 @@ export default class Controller extends Section { delete: 'Deletes', select: 'Views' }; + this.actionsClass = { + insert: 'success', + update: 'warning', + delete: 'alert', + select: 'notice' + }; this.filter = { include: [{ relation: 'user', @@ -50,8 +56,8 @@ export default class Controller extends Section { for (const prop of props) { log.props.push({ name: locale[prop] || prop, - old: this.formatValue(oldValues[prop]), - new: this.formatValue(newValues[prop]) + old: this.castValue(oldValues[prop]), + new: this.castValue(newValues[prop]) }); } } @@ -61,31 +67,19 @@ export default class Controller extends Section { return !(this.changedModel && this.changedModelId); } - formatValue(value) { - let type = typeof value; + castValue(value) { + return typeof value === 'string' && validDate.test(value) + ? new Date(value) + : value; + } - if (type === 'string' && validDate.test(value)) { - value = new Date(value); - type = typeof value; - } + mainVal(prop, action) { + return action == 'delete' ? prop.old : prop.new; + } - switch (type) { - case 'boolean': - return value ? '✓' : '✗'; - case 'object': - if (value instanceof Date) { - const hasZeroTime = - value.getHours() === 0 && - value.getMinutes() === 0 && - value.getSeconds() === 0; - const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss'; - return this.$filter('date')(value, format); - } - else - return value; - default: - return value; - } + toggleAttributes(log, changesEl, force) { + log.expand = force; + changesEl.classList.toggle('expanded', force); } showWorkerDescriptor(event, workerId) { diff --git a/front/salix/components/log/locale/es.yml b/front/salix/components/log/locale/es.yml index d341095d8..142175888 100644 --- a/front/salix/components/log/locale/es.yml +++ b/front/salix/components/log/locale/es.yml @@ -13,3 +13,4 @@ Views: Visualiza System: Sistema note: nota Changes: Cambios +No changes: No hay cambios diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss index 68cd5a047..00b08df64 100644 --- a/front/salix/components/log/style.scss +++ b/front/salix/components/log/style.scss @@ -1,66 +1,127 @@ @import "variables"; vn-log { - vn-td { - vertical-align: initial !important; + .vn-table { + table-layout: fixed; + + & > thead, + & > tbody { + & > tr { + td, th { + &:first-child { + padding-left: 16px; + } + &:last-child { + padding-right: 16px; + } + } + } + } + & > thead > tr > th { + max-width: initial; + } + & > tbody { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + + &:last-child { + border-bottom: none; + } + & > tr { + border-bottom: none; + height: initial; + + & > td { + padding-top: 16px; + padding-bottom: 16px; + + &.action > .chip { + display: inline-block; + } + } + &.change-header > td { + padding-bottom: 0; + } + &.change-detail > td { + padding-top: 6px; + vertical-align: top; + } + } + } + th, td { + &.action, + &.user { + width: 90px; + } + &.date { + width: 120px; + text-align: right; + } + } + } + .model-value { + font-style: italic; + color: #c7bd2b; + } + .model-id { + color: $color-font-secondary; + font-size: .9em; } .changes { - display: none; - } - .label { + overflow: hidden; + background-color: rgba(255, 255, 255, .05); + border-radius: 4px; color: $color-font-secondary; - } - .value { - color: $color-font; - } + transition: max-height 150ms ease-in-out; + max-height: 28px; + position: relative; - @media screen and (max-width: 1570px) { - vn-table .expendable { + & > .expand-button, + & > .shrink-button { display: none; } - .changes { - padding-top: 10px; - display: block; + &.props { + padding-right: 24px; + + & > .expand-button, + & > .shrink-button { + position: absolute; + top: 6px; + right: 8px; + font-size: inherit; + float: right; + cursor: pointer; + } + & > .expand-button { + display: block; + } + &.expanded { + max-height: 500px; + padding-right: 0; + + & > .changes-wrapper { + text-overflow: initial; + white-space: initial; + } + & > .shrink-button { + display: block; + } + & > .expand-button { + display: none; + } + } } - } - .attributes { - width: 100%; + & > .changes-wrapper { + padding: 4px 6px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; - tr { - height: 10px; - - & > td { - padding: 2px; + & > .no-changes { + font-style: italic; } - & > td.field, - & > th.field { - width: 20%; - color: gray; - } - & > td.before, - & > th.before, - & > td.after, - & > th.after { - width: 40%; - white-space: pre-line; + .json-field { + text-transform: capitalize; } } } } -.ellipsis { - white-space: nowrap; - overflow: hidden; - max-width: 400px; - text-overflow: ellipsis; - display: inline-block; -} -.no-ellipsize, -[no-ellipsize] { - text-overflow: ''; - white-space: normal; - overflow: auto; -} -.alignSpan { - overflow: hidden; - display: inline-block; -} From 12074bd0f4cf896b9cf9dc7a415e0f148b33449c Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 3 Apr 2023 04:13:09 +0200 Subject: [PATCH 02/49] refs #5517 vnLog: watchers fixes --- front/salix/components/log/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 1bb8b1705..8174e19cc 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -74,15 +74,15 @@ {{::prop.name}}: - , + ,
{{::prop.name}}: - + - ← + ←
@@ -91,7 +91,7 @@ class="description"> {{::log.description}} - No changes From 7f18366ece0d61df0aaf92607966bf0f8c257036 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 3 Apr 2023 18:40:50 +0200 Subject: [PATCH 03/49] refs #5517 Relative dates, style fixes --- front/salix/components/log/index.html | 4 ++-- front/salix/components/log/index.js | 25 ++++++++++++++++++++++++ front/salix/components/log/locale/es.yml | 2 ++ front/salix/components/log/style.scss | 8 +++++++- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 8174e19cc..14a3fbe61 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -48,8 +48,8 @@ #{{::log.changedModelId}} - - {{::log.creationDate | date:'dd/MM/yyyy HH:mm'}} + + {{::$ctrl.relativeDate(log.creationDate)}} diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index f1eedf72e..63b4cedf4 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -33,6 +33,10 @@ export default class Controller extends Section { }, }], }; + this.dateFilter = this.$filter('date'); + this.lang = this.$translate.use(); + this.today = Date.vnNew(); + this.today.setHours(0, 0, 0, 0); } get logs() { @@ -82,6 +86,27 @@ export default class Controller extends Section { changesEl.classList.toggle('expanded', force); } + relativeDate(dateVal) { + const date = new Date(dateVal); + const dateZeroTime = new Date(dateVal); + dateZeroTime.setHours(0, 0, 0, 0); + const diff = Math.trunc((this.today.getTime() - dateZeroTime.getTime()) / (1000 * 3600 * 24)); + + let format; + if (diff == 0) + format = `'${this.$t('today')}'`; + else if (diff == 1) + format = `'${this.$t('yesterday')}'`; + else if (diff >= 2 && diff <= 5) + format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`; + else if (this.today.getFullYear() == date.getFullYear()) + format = `dd/MM`; + else + format = `dd/MM/yyyy`; + + return this.dateFilter(date, `${format} HH:mm`); + } + showWorkerDescriptor(event, workerId) { if (!workerId) return; this.$.workerDescriptor.show(event.target, workerId); diff --git a/front/salix/components/log/locale/es.yml b/front/salix/components/log/locale/es.yml index 142175888..385b42147 100644 --- a/front/salix/components/log/locale/es.yml +++ b/front/salix/components/log/locale/es.yml @@ -14,3 +14,5 @@ System: Sistema note: nota Changes: Cambios No changes: No hay cambios +today: hoy +yesterday: ayer diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss index 00b08df64..1573218f4 100644 --- a/front/salix/components/log/style.scss +++ b/front/salix/components/log/style.scss @@ -37,6 +37,12 @@ vn-log { &.action > .chip { display: inline-block; } + &.date { + color: $color-font-secondary; + text-transform: capitalize; + font-style: italic; + font-size: .9em; + } } &.change-header > td { padding-bottom: 0; @@ -53,7 +59,7 @@ vn-log { width: 90px; } &.date { - width: 120px; + width: 115px; text-align: right; } } From ae22c58ecbe2c7c40797797b7834f5db815efb19 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 3 Apr 2023 18:48:40 +0200 Subject: [PATCH 04/49] refs #5517 JSON value component code clean, max str len increased --- front/core/components/json-value/index.html | 1 - front/core/components/json-value/index.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 front/core/components/json-value/index.html diff --git a/front/core/components/json-value/index.html b/front/core/components/json-value/index.html deleted file mode 100644 index dc1c97709..000000000 --- a/front/core/components/json-value/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/front/core/components/json-value/index.js b/front/core/components/json-value/index.js index c92227ed3..02c693e54 100644 --- a/front/core/components/json-value/index.js +++ b/front/core/components/json-value/index.js @@ -2,7 +2,7 @@ import ngModule from '../../module'; import Component from 'core/lib/component'; import './style.scss'; -const maxStrLen = 25; +const maxStrLen = 50; /** * Displays pretty JSON value. From 3cc61916961dae2f06101df1af6b26bb6ef291b7 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 4 Apr 2023 19:01:19 +0200 Subject: [PATCH 05/49] refs #5517 Show abr month name in relative date --- front/salix/components/log/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 63b4cedf4..bb5ff691f 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -100,7 +100,7 @@ export default class Controller extends Section { else if (diff >= 2 && diff <= 5) format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`; else if (this.today.getFullYear() == date.getFullYear()) - format = `dd/MM`; + format = `d '${date.toLocaleDateString(this.lang, {month: 'short'})}'`; else format = `dd/MM/yyyy`; From f7191f0f7fc7e4e054d3de1cce6e2fc1530c4f00 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 6 Apr 2023 08:37:26 +0200 Subject: [PATCH 06/49] refs #5517 log relativeDate function fixes --- front/salix/components/log/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index bb5ff691f..94b600325 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -97,7 +97,7 @@ export default class Controller extends Section { format = `'${this.$t('today')}'`; else if (diff == 1) format = `'${this.$t('yesterday')}'`; - else if (diff >= 2 && diff <= 5) + else if (diff < 7) format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`; else if (this.today.getFullYear() == date.getFullYear()) format = `d '${date.toLocaleDateString(this.lang, {month: 'short'})}'`; From d7d4b9515eef07db6b9af3d00baa13a5356fe1e7 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 6 Apr 2023 17:02:45 +0200 Subject: [PATCH 07/49] refs #5517 json value and date format fixes --- front/core/components/json-value/index.js | 71 +++++++++++++-------- front/core/components/json-value/style.scss | 13 ++-- front/salix/components/log/index.js | 2 +- 3 files changed, 53 insertions(+), 33 deletions(-) diff --git a/front/core/components/json-value/index.js b/front/core/components/json-value/index.js index 02c693e54..6bf0ae4aa 100644 --- a/front/core/components/json-value/index.js +++ b/front/core/components/json-value/index.js @@ -15,36 +15,53 @@ export default class Controller extends Component { } set value(value) { + const wasEmpty = this._value === undefined; this._value = value; - const span = this.element; - const formattedValue = this.formatValue(value); - span.textContent = formattedValue; - span.title = typeof value == 'string' && value.length > maxStrLen ? value : ''; - span.className = `js-${value == null ? 'null' : typeof value}`; - } - formatValue(value) { - if (value == null) return '∅'; - switch (typeof value) { - case 'boolean': - return value ? '✓' : '✗'; - case 'string': - return value.length <= maxStrLen - ? value - : value.substring(0, maxStrLen) + '...'; - case 'object': - if (value instanceof Date) { - const hasZeroTime = - value.getHours() === 0 && - value.getMinutes() === 0 && - value.getSeconds() === 0; - const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss'; - return this.$filter('date')(value, format); - } else - return value; - default: - return value; + let text; + let cssClass; + const type = typeof value; + + if (value == null) { + text = '∅'; + cssClass = 'null'; + } else { + cssClass = type; + switch (type) { + case 'boolean': + text = value ? '✓' : '✗'; + cssClass = value ? 'true' : 'false'; + break; + case 'string': + text = value.length <= maxStrLen + ? value + : value.substring(0, maxStrLen) + '...'; + break; + case 'object': + if (value instanceof Date) { + const hasZeroTime = + value.getHours() === 0 && + value.getMinutes() === 0 && + value.getSeconds() === 0; + const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss'; + text = this.$filter('date')(value, format); + } else + text = value; + break; + default: + text = value; + } } + + const el = this.element; + el.textContent = text; + el.title = type == 'string' && value.length > maxStrLen ? value : ''; + + cssClass = `json-${cssClass}`; + if (wasEmpty) + el.classList.add(cssClass); + else + el.classList.replace(this.className, cssClass); } } diff --git a/front/core/components/json-value/style.scss b/front/core/components/json-value/style.scss index cd9b5fae6..2d6c4023c 100644 --- a/front/core/components/json-value/style.scss +++ b/front/core/components/json-value/style.scss @@ -1,20 +1,23 @@ vn-json-value { display: inline; - &.js-string { + &.json-string { color: #d172cc; } - &.js-object { + &.json-object { /*color: #d1a572;*/ color: #d172cc; } - &.js-number { + &.json-number { color: #85d0ff; } - &.js-boolean { + &.json-true { color: #7dc489; } - &.js-null { + &.json-false { + color: #c74949; + } + &.json-null { color: #cd7c7c; font-style: italic; } diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 94b600325..d768b2195 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -97,7 +97,7 @@ export default class Controller extends Section { format = `'${this.$t('today')}'`; else if (diff == 1) format = `'${this.$t('yesterday')}'`; - else if (diff < 7) + else if (diff > 1 && diff < 7) format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`; else if (this.today.getFullYear() == date.getFullYear()) format = `d '${date.toLocaleDateString(this.lang, {month: 'short'})}'`; From 117849f09395aee737df62efbd1a615907252bc1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 12 Apr 2023 12:03:55 +0200 Subject: [PATCH 08/49] refs #5540 supplier js --- db/changes/231401/00-updateIsVies.sql | 5 +++++ modules/supplier/back/models/supplier.js | 12 ++++++++++++ modules/supplier/front/fiscal-data/index.html | 7 +++++-- modules/supplier/front/fiscal-data/locale/es.yml | 4 +++- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 db/changes/231401/00-updateIsVies.sql diff --git a/db/changes/231401/00-updateIsVies.sql b/db/changes/231401/00-updateIsVies.sql new file mode 100644 index 000000000..efe008101 --- /dev/null +++ b/db/changes/231401/00-updateIsVies.sql @@ -0,0 +1,5 @@ +UPDATE vn.supplier s + JOIN vn.country c ON c.id = s.countryFk + SET s.nif = MID(REPLACE(s.nif, ' ', ''), 3, LENGTH(REPLACE(s.nif, ' ', '')) - 1) + WHERE s.isVies = TRUE + AND c.code = LEFT(REPLACE(s.nif, ' ', ''), 2); \ No newline at end of file diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 4e509aafc..745a2f7e3 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -73,6 +73,18 @@ module.exports = Self => { done(); } + Self.validateAsync('nif', areFirstTwoCharsLetters, nifInvalid, { + message: 'The first two values are letters.'}); + + function areFirstTwoCharsLetters(str) { + return /^[a-zA-Z]{2}/.test(str); + } + + async function nifInvalid(err, areFirstTwoCharsLetters) { + if (this.isVies == 1 && areFirstTwoCharsLetters(this.nif)) + err(); + } + function isAlpha(value) { const regexp = new RegExp(/^[ñça-zA-Z0-9\s]*$/i); diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html index ccbd5b0d9..f84a1890e 100644 --- a/modules/supplier/front/fiscal-data/index.html +++ b/modules/supplier/front/fiscal-data/index.html @@ -52,7 +52,8 @@ label="Tax number" ng-model="$ctrl.supplier.nif" required="true" - rule> + rule + > @@ -188,7 +189,9 @@ + info="When activating it, do not enter the country code in the ID field." + ng-model="$ctrl.supplier.isVies" + > diff --git a/modules/supplier/front/fiscal-data/locale/es.yml b/modules/supplier/front/fiscal-data/locale/es.yml index 5232dd95d..ee641231f 100644 --- a/modules/supplier/front/fiscal-data/locale/es.yml +++ b/modules/supplier/front/fiscal-data/locale/es.yml @@ -3,4 +3,6 @@ Sage transaction type: Tipo de transacción Sage Sage withholding: Retención Sage Supplier activity: Actividad proveedor Healt register: Pasaporte sanitario -Trucker: Transportista \ No newline at end of file +Trucker: Transportista +When activating it, do not enter the country code in the ID field.: Al activarlo, no informar el código del país en el campo nif +The first two values are letters.: Los dos primeros valores son letras \ No newline at end of file From 60103fa80ac08ce1ac39909fd2f14b5cf71cc9bf Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 12 Apr 2023 14:39:40 +0200 Subject: [PATCH 09/49] refs #5540 validacion nif --- loopback/locale/es.json | 3 ++- modules/supplier/back/models/supplier.js | 13 +++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 42276efe7..8e2672bc4 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -274,5 +274,6 @@ "This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado", "Insert a date range": "Inserte un rango de fechas", "Added observation": "{{user}} añadió esta observacion: {{text}}", - "Comment added to client": "Observación añadida al cliente {{clientFk}}" + "Comment added to client": "Observación añadida al cliente {{clientFk}}", + "The first two values are letters": "Los dos primeros carácteres del NIF son letras" } diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 745a2f7e3..7f12e86ef 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -73,16 +73,13 @@ module.exports = Self => { done(); } - Self.validateAsync('nif', areFirstTwoCharsLetters, nifInvalid, { - message: 'The first two values are letters.'}); + Self.validateAsync('nif', nifInvalid, { + message: 'The first two values are letters'}); - function areFirstTwoCharsLetters(str) { - return /^[a-zA-Z]{2}/.test(str); - } - - async function nifInvalid(err, areFirstTwoCharsLetters) { - if (this.isVies == 1 && areFirstTwoCharsLetters(this.nif)) + async function nifInvalid(err, done) { + if (this.isVies && /^[a-zA-Z]{2}/.test(this.nif)) err(); + done(); } function isAlpha(value) { From 747efc4342ac8da8994c8ac096f50f48cf655a0e Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 12 Apr 2023 14:52:59 +0200 Subject: [PATCH 10/49] refs #5540 sql mod --- db/changes/231401/00-updateIsVies.sql | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/db/changes/231401/00-updateIsVies.sql b/db/changes/231401/00-updateIsVies.sql index efe008101..1d2e55441 100644 --- a/db/changes/231401/00-updateIsVies.sql +++ b/db/changes/231401/00-updateIsVies.sql @@ -1,5 +1,3 @@ -UPDATE vn.supplier s - JOIN vn.country c ON c.id = s.countryFk - SET s.nif = MID(REPLACE(s.nif, ' ', ''), 3, LENGTH(REPLACE(s.nif, ' ', '')) - 1) - WHERE s.isVies = TRUE - AND c.code = LEFT(REPLACE(s.nif, ' ', ''), 2); \ No newline at end of file +UPDATE vn.supplier +SET nif = SUBSTRING(nif, IF(ASCII(SUBSTRING(nif, 1, 1)) BETWEEN 65 AND 90 AND ASCII(SUBSTRING(nif, 2, 1)) BETWEEN 65 AND 90, 3, 1), LENGTH(nif)) +WHERE isVies = 1 AND nif REGEXP '^[a-zA-Z]{2}'; From 2a2d03e05a645375b1998e659e25504395dacf21 Mon Sep 17 00:00:00 2001 From: vicent Date: Wed, 12 Apr 2023 15:02:21 +0200 Subject: [PATCH 11/49] =?UTF-8?q?refs=20#5517=20a=C3=B1adidas=20traduccion?= =?UTF-8?q?es=20de=20algunos=20modelos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/locale/account/en.yml | 17 ++++++ back/locale/account/es.yml | 17 ++++++ front/salix/components/log/index.js | 3 +- modules/account/back/locale/mail/en.yml | 7 +++ modules/account/back/locale/mail/es.yml | 7 +++ .../claim/back/locale/claim-beginning/en.yml | 6 +++ .../claim/back/locale/claim-beginning/es.yml | 6 +++ .../back/locale/claim-development/en.yml | 9 ++++ .../back/locale/claim-development/es.yml | 9 ++++ modules/claim/back/locale/claim-dms/en.yml | 4 ++ modules/claim/back/locale/claim-dms/es.yml | 4 ++ modules/claim/back/locale/claim-end/en.yml | 7 +++ modules/claim/back/locale/claim-end/es.yml | 7 +++ .../back/locale/claim-observation/en.yml | 7 +++ .../back/locale/claim-observation/es.yml | 7 +++ modules/claim/back/locale/claim/en.yml | 16 ++++++ modules/claim/back/locale/claim/es.yml | 16 ++++++ modules/client/back/locale/address/en.yml | 20 +++++++ modules/client/back/locale/address/es.yml | 20 +++++++ .../client/back/locale/client-contact/en.yml | 6 +++ .../client/back/locale/client-contact/es.yml | 6 +++ modules/client/back/locale/client-dms/en.yml | 4 ++ modules/client/back/locale/client-dms/es.yml | 4 ++ .../back/locale/client-observation/en.yml | 7 +++ .../back/locale/client-observation/es.yml | 7 +++ .../client/back/locale/client-sample/en.yml | 8 +++ .../client/back/locale/client-sample/es.yml | 8 +++ modules/client/back/locale/client/en.yml | 50 ++++++++++++++++++ modules/client/back/locale/client/es.yml | 50 ++++++++++++++++++ modules/client/back/locale/greuge/en.yml | 11 ++++ modules/client/back/locale/greuge/es.yml | 11 ++++ modules/client/back/locale/recovery/en.yml | 8 +++ modules/client/back/locale/recovery/es.yml | 8 +++ .../client/back/locale/tpv-transaction/en.yml | 15 ++++++ .../client/back/locale/tpv-transaction/es.yml | 15 ++++++ modules/entry/back/locale/buy/en.yml | 18 +++++++ modules/entry/back/locale/buy/es.yml | 18 +++++++ .../back/locale/entry-observation/en.yml | 6 +++ .../back/locale/entry-observation/es.yml | 6 +++ modules/entry/back/locale/entry/en.yml | 26 ++++++++++ modules/entry/back/locale/entry/es.yml | 24 +++++++++ modules/item/back/locale/item/en.yml | 47 +++++++++++++++++ modules/item/back/locale/item/es.yml | 47 +++++++++++++++++ modules/ticket/back/locale/expedition/en.yml | 10 ++++ modules/ticket/back/locale/expedition/es.yml | 10 ++++ modules/ticket/back/locale/sale/en.yml | 24 +++++---- modules/ticket/back/locale/sale/es.yml | 24 +++++---- modules/ticket/back/locale/ticket-dms/en.yml | 4 ++ modules/ticket/back/locale/ticket-dms/es.yml | 4 ++ .../back/locale/ticket-observation/en.yml | 6 +++ .../back/locale/ticket-observation/es.yml | 6 +++ .../back/locale/ticket-packaging/en.yml | 8 +++ .../back/locale/ticket-packaging/es.yml | 8 +++ .../ticket/back/locale/ticket-refund/en.yml | 5 ++ .../ticket/back/locale/ticket-refund/es.yml | 5 ++ .../ticket/back/locale/ticket-request/en.yml | 15 ++++++ .../ticket/back/locale/ticket-request/es.yml | 15 ++++++ .../ticket/back/locale/ticket-service/en.yml | 10 ++++ .../ticket/back/locale/ticket-service/es.yml | 10 ++++ .../ticket/back/locale/ticket-tracking/en.yml | 7 +++ .../ticket/back/locale/ticket-tracking/es.yml | 7 +++ .../ticket/back/locale/ticket-weekly/en.yml | 5 ++ .../ticket/back/locale/ticket-weekly/es.yml | 5 ++ modules/ticket/back/locale/ticket/en.yml | 48 +++++++++-------- modules/ticket/back/locale/ticket/es.yml | 52 ++++++++++--------- modules/worker/back/locale/worker-dms/en.yml | 6 +++ modules/worker/back/locale/worker-dms/es.yml | 6 +++ 67 files changed, 828 insertions(+), 71 deletions(-) create mode 100644 back/locale/account/en.yml create mode 100644 back/locale/account/es.yml create mode 100644 modules/account/back/locale/mail/en.yml create mode 100644 modules/account/back/locale/mail/es.yml create mode 100644 modules/claim/back/locale/claim-beginning/en.yml create mode 100644 modules/claim/back/locale/claim-beginning/es.yml create mode 100644 modules/claim/back/locale/claim-development/en.yml create mode 100644 modules/claim/back/locale/claim-development/es.yml create mode 100644 modules/claim/back/locale/claim-dms/en.yml create mode 100644 modules/claim/back/locale/claim-dms/es.yml create mode 100644 modules/claim/back/locale/claim-end/en.yml create mode 100644 modules/claim/back/locale/claim-end/es.yml create mode 100644 modules/claim/back/locale/claim-observation/en.yml create mode 100644 modules/claim/back/locale/claim-observation/es.yml create mode 100644 modules/claim/back/locale/claim/en.yml create mode 100644 modules/claim/back/locale/claim/es.yml create mode 100644 modules/client/back/locale/address/en.yml create mode 100644 modules/client/back/locale/address/es.yml create mode 100644 modules/client/back/locale/client-contact/en.yml create mode 100644 modules/client/back/locale/client-contact/es.yml create mode 100644 modules/client/back/locale/client-dms/en.yml create mode 100644 modules/client/back/locale/client-dms/es.yml create mode 100644 modules/client/back/locale/client-observation/en.yml create mode 100644 modules/client/back/locale/client-observation/es.yml create mode 100644 modules/client/back/locale/client-sample/en.yml create mode 100644 modules/client/back/locale/client-sample/es.yml create mode 100644 modules/client/back/locale/client/en.yml create mode 100644 modules/client/back/locale/client/es.yml create mode 100644 modules/client/back/locale/greuge/en.yml create mode 100644 modules/client/back/locale/greuge/es.yml create mode 100644 modules/client/back/locale/recovery/en.yml create mode 100644 modules/client/back/locale/recovery/es.yml create mode 100644 modules/client/back/locale/tpv-transaction/en.yml create mode 100644 modules/client/back/locale/tpv-transaction/es.yml create mode 100644 modules/entry/back/locale/buy/en.yml create mode 100644 modules/entry/back/locale/buy/es.yml create mode 100644 modules/entry/back/locale/entry-observation/en.yml create mode 100644 modules/entry/back/locale/entry-observation/es.yml create mode 100644 modules/entry/back/locale/entry/en.yml create mode 100644 modules/entry/back/locale/entry/es.yml create mode 100644 modules/item/back/locale/item/en.yml create mode 100644 modules/item/back/locale/item/es.yml create mode 100644 modules/ticket/back/locale/expedition/en.yml create mode 100644 modules/ticket/back/locale/expedition/es.yml create mode 100644 modules/ticket/back/locale/ticket-dms/en.yml create mode 100644 modules/ticket/back/locale/ticket-dms/es.yml create mode 100644 modules/ticket/back/locale/ticket-observation/en.yml create mode 100644 modules/ticket/back/locale/ticket-observation/es.yml create mode 100644 modules/ticket/back/locale/ticket-packaging/en.yml create mode 100644 modules/ticket/back/locale/ticket-packaging/es.yml create mode 100644 modules/ticket/back/locale/ticket-refund/en.yml create mode 100644 modules/ticket/back/locale/ticket-refund/es.yml create mode 100644 modules/ticket/back/locale/ticket-request/en.yml create mode 100644 modules/ticket/back/locale/ticket-request/es.yml create mode 100644 modules/ticket/back/locale/ticket-service/en.yml create mode 100644 modules/ticket/back/locale/ticket-service/es.yml create mode 100644 modules/ticket/back/locale/ticket-tracking/en.yml create mode 100644 modules/ticket/back/locale/ticket-tracking/es.yml create mode 100644 modules/ticket/back/locale/ticket-weekly/en.yml create mode 100644 modules/ticket/back/locale/ticket-weekly/es.yml create mode 100644 modules/worker/back/locale/worker-dms/en.yml create mode 100644 modules/worker/back/locale/worker-dms/es.yml diff --git a/back/locale/account/en.yml b/back/locale/account/en.yml new file mode 100644 index 000000000..0d6c5db80 --- /dev/null +++ b/back/locale/account/en.yml @@ -0,0 +1,17 @@ +name: account +columns: + id: id + name: name + roleFk: role + nickname: nickname + lang: lang + password: password + bcryptPassword: bcrypt password + active: active + email: email + emailVerified: email verified + created: created + updated: updated + image: image + hasGrant: has grant + userFk: user diff --git a/back/locale/account/es.yml b/back/locale/account/es.yml new file mode 100644 index 000000000..79e8a8cc6 --- /dev/null +++ b/back/locale/account/es.yml @@ -0,0 +1,17 @@ +name: cuenta +columns: + id: id + name: nombre + roleFk: rol + nickname: apodo + lang: idioma + password: contraseña + bcryptPassword: contraseña bcrypt + active: activo + email: email + emailVerified: email verificado + created: creado + updated: actualizado + image: imagen + hasGrant: tiene permiso + userFk: usuario diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index d768b2195..8c75664c8 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -52,6 +52,7 @@ export default class Controller extends Section { const oldValues = log.oldInstance || empty; const newValues = log.newInstance || empty; const locale = validations[log.changedModel]?.locale || empty; + log.changedModel = locale.name ? locale.name : log.changedModel let props = Object.keys(oldValues).concat(Object.keys(newValues)); props = [...new Set(props)]; @@ -59,7 +60,7 @@ export default class Controller extends Section { log.props = []; for (const prop of props) { log.props.push({ - name: locale[prop] || prop, + name: locale.columns?.[prop] || prop, old: this.castValue(oldValues[prop]), new: this.castValue(newValues[prop]) }); diff --git a/modules/account/back/locale/mail/en.yml b/modules/account/back/locale/mail/en.yml new file mode 100644 index 000000000..b492ea640 --- /dev/null +++ b/modules/account/back/locale/mail/en.yml @@ -0,0 +1,7 @@ +name: mail +columns: + id: id + receiver: receiver + replyTo: reply to + subject: subject + body: body diff --git a/modules/account/back/locale/mail/es.yml b/modules/account/back/locale/mail/es.yml new file mode 100644 index 000000000..a0b02b45f --- /dev/null +++ b/modules/account/back/locale/mail/es.yml @@ -0,0 +1,7 @@ +name: mail +columns: + id: id + receiver: receptor + replyTo: responder a + subject: asunto + body: cuerpo diff --git a/modules/claim/back/locale/claim-beginning/en.yml b/modules/claim/back/locale/claim-beginning/en.yml new file mode 100644 index 000000000..47cc29c69 --- /dev/null +++ b/modules/claim/back/locale/claim-beginning/en.yml @@ -0,0 +1,6 @@ +name: claim beginning +columns: + id: id + quantity: quantity + claimFk: claim + saleFk: sale diff --git a/modules/claim/back/locale/claim-beginning/es.yml b/modules/claim/back/locale/claim-beginning/es.yml new file mode 100644 index 000000000..5e898c25e --- /dev/null +++ b/modules/claim/back/locale/claim-beginning/es.yml @@ -0,0 +1,6 @@ +name: comienzo reclamación +columns: + id: id + quantity: cantidad + claimFk: reclamación + saleFk: línea diff --git a/modules/claim/back/locale/claim-development/en.yml b/modules/claim/back/locale/claim-development/en.yml new file mode 100644 index 000000000..054381e67 --- /dev/null +++ b/modules/claim/back/locale/claim-development/en.yml @@ -0,0 +1,9 @@ +name: claim development +columns: + id: id + claimFk: claim + claimResponsibleFk: responsible + claimReasonFk: reason + claimResultFk: result + claimRedeliveryFk: redelivery + workerFk: worker diff --git a/modules/claim/back/locale/claim-development/es.yml b/modules/claim/back/locale/claim-development/es.yml new file mode 100644 index 000000000..d5223e755 --- /dev/null +++ b/modules/claim/back/locale/claim-development/es.yml @@ -0,0 +1,9 @@ +name: desarrollo reclamación +columns: + id: id + claimFk: reclamación + claimResponsibleFk: responsable + claimReasonFk: motivo + claimResultFk: resultado + claimRedeliveryFk: reenvío + workerFk: trabajador diff --git a/modules/claim/back/locale/claim-dms/en.yml b/modules/claim/back/locale/claim-dms/en.yml new file mode 100644 index 000000000..c76c364e7 --- /dev/null +++ b/modules/claim/back/locale/claim-dms/en.yml @@ -0,0 +1,4 @@ +name: claim dms +columns: + dmsFk: dms + claimFk: claim diff --git a/modules/claim/back/locale/claim-dms/es.yml b/modules/claim/back/locale/claim-dms/es.yml new file mode 100644 index 000000000..949e20a36 --- /dev/null +++ b/modules/claim/back/locale/claim-dms/es.yml @@ -0,0 +1,4 @@ +name: documento reclamación +columns: + dmsFk: dms + claimFk: reclamación diff --git a/modules/claim/back/locale/claim-end/en.yml b/modules/claim/back/locale/claim-end/en.yml new file mode 100644 index 000000000..f9e736d76 --- /dev/null +++ b/modules/claim/back/locale/claim-end/en.yml @@ -0,0 +1,7 @@ +name: claim end +columns: + id: id + claimFk: claim + saleFk: sale + workerFk: worker + claimDestinationFk: destination diff --git a/modules/claim/back/locale/claim-end/es.yml b/modules/claim/back/locale/claim-end/es.yml new file mode 100644 index 000000000..9855eca03 --- /dev/null +++ b/modules/claim/back/locale/claim-end/es.yml @@ -0,0 +1,7 @@ +name: final reclamación +columns: + id: id + claimFk: reclamación + saleFk: línea + workerFk: trabajador + claimDestinationFk: destino diff --git a/modules/claim/back/locale/claim-observation/en.yml b/modules/claim/back/locale/claim-observation/en.yml new file mode 100644 index 000000000..772ea038c --- /dev/null +++ b/modules/claim/back/locale/claim-observation/en.yml @@ -0,0 +1,7 @@ +name: claim observation +columns: + id: id + claimFk: claim + text: text + created: created + workerFk: worker diff --git a/modules/claim/back/locale/claim-observation/es.yml b/modules/claim/back/locale/claim-observation/es.yml new file mode 100644 index 000000000..fae3a1ae9 --- /dev/null +++ b/modules/claim/back/locale/claim-observation/es.yml @@ -0,0 +1,7 @@ +name: observación reclamación +columns: + id: id + claimFk: reclamación + text: texto + created: creado + workerFk: tabajador diff --git a/modules/claim/back/locale/claim/en.yml b/modules/claim/back/locale/claim/en.yml new file mode 100644 index 000000000..7c3ee7555 --- /dev/null +++ b/modules/claim/back/locale/claim/en.yml @@ -0,0 +1,16 @@ +name: claim +columns: + id: id + observation: observation + ticketCreated: ticket created + isChargedToMana: charged to mana + created: created + responsibility: responsibility + hasToPickUp: has to pickUp + ticketFk: ticket + claimStateFk: claim state + workerFk: worker + packages: packages + rma: rma + clientFk: client + claimFk: claim diff --git a/modules/claim/back/locale/claim/es.yml b/modules/claim/back/locale/claim/es.yml new file mode 100644 index 000000000..27fd76ceb --- /dev/null +++ b/modules/claim/back/locale/claim/es.yml @@ -0,0 +1,16 @@ +name: reclamación +columns: + id: id + observation: observación + ticketCreated: ticket creado + isChargedToMana: cargado al maná + created: creado + responsibility: responsabilidad + hasToPickUp: es recogida + ticketFk: ticket + claimStateFk: estado reclamación + workerFk: trabajador + packages: paquetes + rma: rma + clientFk: cliente + claimFk: reclamación diff --git a/modules/client/back/locale/address/en.yml b/modules/client/back/locale/address/en.yml new file mode 100644 index 000000000..3d090ba89 --- /dev/null +++ b/modules/client/back/locale/address/en.yml @@ -0,0 +1,20 @@ +name: address +columns: + id: id + nickname: nickname + street: street + city: city + postalCode: postal code + phone: phone + mobile: mobile + isActive: active + longitude: longitude + latitude: latitude + isEqualizated: equalizated + isLogifloraAllowed: logiflora allowed + provinceFk: province + clientFk: client + agencyModeFk: agency + addressFk: address + incotermsFk: incoterms + customsAgentFk: customs agent diff --git a/modules/client/back/locale/address/es.yml b/modules/client/back/locale/address/es.yml new file mode 100644 index 000000000..1379f75a4 --- /dev/null +++ b/modules/client/back/locale/address/es.yml @@ -0,0 +1,20 @@ +name: dirección +columns: + id: id + nickname: apodo + street: calle + city: ciudad + postalCode: código postal + phone: teléfono + mobile: móvil + isActive: activo + longitude: longitud + latitude: latitud + isEqualizated: igualado + isLogifloraAllowed: logiflora permitido + provinceFk: provincia + clientFk: cliente + agencyModeFk: agencia + addressFk: dirección + incotermsFk: incoterms + customsAgentFk: agente adunanas diff --git a/modules/client/back/locale/client-contact/en.yml b/modules/client/back/locale/client-contact/en.yml new file mode 100644 index 000000000..5bd6e25db --- /dev/null +++ b/modules/client/back/locale/client-contact/en.yml @@ -0,0 +1,6 @@ +name: client contact +columns: + id: id + name: name + phone: phone + clientFk: client diff --git a/modules/client/back/locale/client-contact/es.yml b/modules/client/back/locale/client-contact/es.yml new file mode 100644 index 000000000..5802c0dde --- /dev/null +++ b/modules/client/back/locale/client-contact/es.yml @@ -0,0 +1,6 @@ +name: contacto cliente +columns: + id: id + name: nombre + phone: teléfono + clientFk: cliente diff --git a/modules/client/back/locale/client-dms/en.yml b/modules/client/back/locale/client-dms/en.yml new file mode 100644 index 000000000..c8ad68635 --- /dev/null +++ b/modules/client/back/locale/client-dms/en.yml @@ -0,0 +1,4 @@ +name: client dms +columns: + dmsFk: dms + clientFk: client diff --git a/modules/client/back/locale/client-dms/es.yml b/modules/client/back/locale/client-dms/es.yml new file mode 100644 index 000000000..c683f4764 --- /dev/null +++ b/modules/client/back/locale/client-dms/es.yml @@ -0,0 +1,4 @@ +name: documento cliente +columns: + dmsFk: dms + clientFk: client diff --git a/modules/client/back/locale/client-observation/en.yml b/modules/client/back/locale/client-observation/en.yml new file mode 100644 index 000000000..2dd8393ae --- /dev/null +++ b/modules/client/back/locale/client-observation/en.yml @@ -0,0 +1,7 @@ +name: client observation +columns: + id: id + clientFk: client + text: text + created: created + workerFk: worker diff --git a/modules/client/back/locale/client-observation/es.yml b/modules/client/back/locale/client-observation/es.yml new file mode 100644 index 000000000..0fc6bbf04 --- /dev/null +++ b/modules/client/back/locale/client-observation/es.yml @@ -0,0 +1,7 @@ +name: observación cliente +columns: + id: id + clientFk: cliente + text: texto + created: creado + workerFk: trabajador diff --git a/modules/client/back/locale/client-sample/en.yml b/modules/client/back/locale/client-sample/en.yml new file mode 100644 index 000000000..77639fbb4 --- /dev/null +++ b/modules/client/back/locale/client-sample/en.yml @@ -0,0 +1,8 @@ +name: client sample +columns: + id: id + created: created + clientFk: client + typeFk: type + userFk: user + companyFk: company diff --git a/modules/client/back/locale/client-sample/es.yml b/modules/client/back/locale/client-sample/es.yml new file mode 100644 index 000000000..6311eb25a --- /dev/null +++ b/modules/client/back/locale/client-sample/es.yml @@ -0,0 +1,8 @@ +name: muestra cliente +columns: + id: id + created: creado + clientFk: cliente + typeFk: tipo + userFk: usuario + companyFk: compañia diff --git a/modules/client/back/locale/client/en.yml b/modules/client/back/locale/client/en.yml new file mode 100644 index 000000000..71048f657 --- /dev/null +++ b/modules/client/back/locale/client/en.yml @@ -0,0 +1,50 @@ +name: client +columns: + id: id + name: name + fi: fi + socialName: socialName + contact: contact + street: street + city: city + postcode: postcode + email: email + phone: phone + mobile: mobile + isActive: active + credit: credit + creditInsurance: credit insurance + iban: iban + dueDay: due day + isEqualizated: equalizated + isFreezed: freezed + hasToInvoiceByAddress: invoice by address + hasToInvoice: has to invoice + isToBeMailed: be mailed + hasSepaVnl: sepa nnl + hasLcr: lcr + hasCoreVnl: core vnl + hasCoreVnh: core vnh + hasIncoterms: incoterms + isTaxDataChecked: tax data checked + eypbc: eypbc + quality: quality + isVies: vies + isRelevant: relevant + accountingAccount: accounting account + created: created + sageTaxTypeFk: sage tax type + sageTransactionTypeFk: sage transaction type + businessTypeFk: business type + salesPersonFk: sales person + hasElectronicInvoice: electronic invoice + payMethodFk: pay method + provinceFk: province + countryFk: country + contactChannelFk: contact channel + clientTypeFk: client type + clientFk: client + defaultAddressFk: default address + bankEntityFk: bank entity + transferorFk: transferor + diff --git a/modules/client/back/locale/client/es.yml b/modules/client/back/locale/client/es.yml new file mode 100644 index 000000000..04e391af0 --- /dev/null +++ b/modules/client/back/locale/client/es.yml @@ -0,0 +1,50 @@ +name: cliente +columns: + id: id + name: nombre + fi: fi + socialName: nombre social + contact: contacto + street: calle + city: ciudad + postcode: código postal + email: email + phone: teléfono + mobile: móvil + isActive: activo + credit: crédito + creditInsurance: seguro crédito + iban: iban + dueDay: día vencimiento + isEqualizated: igualado + isFreezed: congelado + hasToInvoiceByAddress: factura por dirección + hasToInvoice: tiene que facturar + isToBeMailed: envío por email + hasSepaVnl: sepa nnl + hasLcr: lcr + hasCoreVnl: centro vnl + hasCoreVnh: cenrto vnh + hasIncoterms: incoterms + isTaxDataChecked: datos fiscales comprobados + eypbc: eypbc + quality: calidad + isVies: vies + isRelevant: importante + accountingAccount: cuenta contable + created: creado + sageTaxTypeFk: tipo impuesto sage + sageTransactionTypeFk: tipo transacción sage + businessTypeFk: tipo negocio + salesPersonFk: comercial + hasElectronicInvoice: factura electrónica + payMethodFk: método pago + provinceFk: provincia + countryFk: país + contactChannelFk: canal de contacto + clientTypeFk: tipo de cliente + clientFk: cliente + defaultAddressFk: dirección predeterminada + bankEntityFk: entidad bancaria + transferorFk: cedente + diff --git a/modules/client/back/locale/greuge/en.yml b/modules/client/back/locale/greuge/en.yml new file mode 100644 index 000000000..5c84ef4ee --- /dev/null +++ b/modules/client/back/locale/greuge/en.yml @@ -0,0 +1,11 @@ +name: greuge +columns: + id: id + description: description + amount: amount + shipped: shipped + created: created + greugeTypeFk: greuge type + clientFk: client + ticketFk: ticket + userFk: user diff --git a/modules/client/back/locale/greuge/es.yml b/modules/client/back/locale/greuge/es.yml new file mode 100644 index 000000000..ffb29eb61 --- /dev/null +++ b/modules/client/back/locale/greuge/es.yml @@ -0,0 +1,11 @@ +name: greuge +columns: + id: id + description: descripción + amount: cantidad + shipped: enviado + created: creado + greugeTypeFk: tipo de greuge + clientFk: cliente + ticketFk: ticket + userFk: usuario diff --git a/modules/client/back/locale/recovery/en.yml b/modules/client/back/locale/recovery/en.yml new file mode 100644 index 000000000..ba02df7c2 --- /dev/null +++ b/modules/client/back/locale/recovery/en.yml @@ -0,0 +1,8 @@ +name: recovery +columns: + id: id + started: started + finished: finished + amount: amount + period: period + clientFk: client diff --git a/modules/client/back/locale/recovery/es.yml b/modules/client/back/locale/recovery/es.yml new file mode 100644 index 000000000..6d84b00da --- /dev/null +++ b/modules/client/back/locale/recovery/es.yml @@ -0,0 +1,8 @@ +name: recuperación +columns: + id: id + started: comenzado + finished: terminado + amount: cantidad + period: período + clientFk: cliente diff --git a/modules/client/back/locale/tpv-transaction/en.yml b/modules/client/back/locale/tpv-transaction/en.yml new file mode 100644 index 000000000..fbe1bbadc --- /dev/null +++ b/modules/client/back/locale/tpv-transaction/en.yml @@ -0,0 +1,15 @@ +name: tpv transaction +columns: + id: id + merchantFk: merchant + clientFk: client + receiptFk: receipt + amount: amount + response: response + errorCode: error code + status: status + created: created + merchantParameters: merchant parameters + signature: signature + signatureVersion: signature version + responseError: response error diff --git a/modules/client/back/locale/tpv-transaction/es.yml b/modules/client/back/locale/tpv-transaction/es.yml new file mode 100644 index 000000000..c751b354d --- /dev/null +++ b/modules/client/back/locale/tpv-transaction/es.yml @@ -0,0 +1,15 @@ +name: transacción tpv +columns: + id: id + merchantFk: comerciante + clientFk: cliente + receiptFk: recibo + amount: cantidad + response: respuesta + errorCode: código error + status: estado + created: creado + merchantParameters: parámetros comerciante + signature: firma + signatureVersion: versión firma + responseError: error de respuesta diff --git a/modules/entry/back/locale/buy/en.yml b/modules/entry/back/locale/buy/en.yml new file mode 100644 index 000000000..2db7c7be5 --- /dev/null +++ b/modules/entry/back/locale/buy/en.yml @@ -0,0 +1,18 @@ +name: buy +columns: + id: id + quantity: quantity + buyingValue: buying value + freightValue: freight value + packing: packing + grouping: grouping + stickers: stickers + groupingMode: grouping mode + comissionValue: comission value + packageValue: package value + price2: price2 + price3: price3 + weight: weight + entryFk: entry + itemFk: item + packageFk: package diff --git a/modules/entry/back/locale/buy/es.yml b/modules/entry/back/locale/buy/es.yml new file mode 100644 index 000000000..666bf7640 --- /dev/null +++ b/modules/entry/back/locale/buy/es.yml @@ -0,0 +1,18 @@ +name: compra +columns: + id: id + quantity: cantidad + buyingValue: valor compra + freightValue: valor flete + packing: embalaje + grouping: agrupación + stickers: pegatinas + groupingMode: modo agrupación + comissionValue: valor comisión + packageValue: valor paquete + price2: precio2 + price3: precio3 + weight: peso + entryFk: entrada + itemFk: artículo + packageFk: paquete diff --git a/modules/entry/back/locale/entry-observation/en.yml b/modules/entry/back/locale/entry-observation/en.yml new file mode 100644 index 000000000..efe908c9f --- /dev/null +++ b/modules/entry/back/locale/entry-observation/en.yml @@ -0,0 +1,6 @@ +name: entry observation +columns: + id: id + description: description + entryFk: entry + observationTypeFk: observation type diff --git a/modules/entry/back/locale/entry-observation/es.yml b/modules/entry/back/locale/entry-observation/es.yml new file mode 100644 index 000000000..43799ae00 --- /dev/null +++ b/modules/entry/back/locale/entry-observation/es.yml @@ -0,0 +1,6 @@ +name: observación entrada +columns: + id: id + description: descripción + entryFk: entrada + observationTypeFk: tipo observación diff --git a/modules/entry/back/locale/entry/en.yml b/modules/entry/back/locale/entry/en.yml new file mode 100644 index 000000000..71f75b1bb --- /dev/null +++ b/modules/entry/back/locale/entry/en.yml @@ -0,0 +1,26 @@ +name: entry +columns: + id: id + dated: dated + reference: reference + invoiceNumber: invoice number + isBooked: booked + isExcludedFromAvailable: excluded from available + notes: notes + isConfirmed: confirmed + isVirtual: virtual + isRaid: raid + commission: commission + isOrdered: price3 + created: created + observation: observation + isBlocked: blocked + loadPriority: load priority + supplierFk: supplier + travelFk: travel + companyFk: company + observationEditorFk: observation editor + supplierFk: supplier + travelFk: travel + companyFk: company + currencyFk: currency diff --git a/modules/entry/back/locale/entry/es.yml b/modules/entry/back/locale/entry/es.yml new file mode 100644 index 000000000..e01ded738 --- /dev/null +++ b/modules/entry/back/locale/entry/es.yml @@ -0,0 +1,24 @@ +name: entrada +columns: + id: id + dated: fecha + reference: referencia + invoiceNumber: número factura + isBooked: reservado + isExcludedFromAvailable: excluido del disponible + notes: notas + isConfirmed: confirmado + isVirtual: virtual + isRaid: incursión + commission: comisión + isOrdered: precio3 + created: creado + observation: observación + isBlocked: bloqueado + loadPriority: prioridad de carga + supplierFk: proveedor + travelFk: envío + companyFk: empresa + observationEditorFk: editor observación + supplierFk: proveedor + currencyFk: moneda diff --git a/modules/item/back/locale/item/en.yml b/modules/item/back/locale/item/en.yml new file mode 100644 index 000000000..d63c95c70 --- /dev/null +++ b/modules/item/back/locale/item/en.yml @@ -0,0 +1,47 @@ +name: item +columns: + id: id + name: name + quantity: quantity + size: size + category: category + typeFk: type + stems: stems + description: description + isActive: active + relevancy: relevancy + weightByPiece: weight by piece + stemMultiplier: stem multiplier + image: image + longName: long name + subName: sub name + tag5: tag5 + value5: value5 + tag6: tag6 + value6: value6 + tag7: tag7 + value7: value7 + tag8: tag8 + value8: value8 + tag9: tag9 + value9: value9 + tag10: tag10 + value10: value10 + itemPackingTypeFk: item packing type + hasKgPrice: has kg price + family: family + expenseFk: expense + minPrice: min price + packingOut: packing out + hasMinPrice: has min price + isFragile: fragile + isFloramondo: is floramondo + packingShelve: packing shelve + isLaid: laid + inkFk: ink + originFk: origin + producerFk: producer + intrastatFk: intrastat + genericFk: generic + itemFk: item + diff --git a/modules/item/back/locale/item/es.yml b/modules/item/back/locale/item/es.yml new file mode 100644 index 000000000..d65288954 --- /dev/null +++ b/modules/item/back/locale/item/es.yml @@ -0,0 +1,47 @@ +name: artículo +columns: + id: id + name: nombre + quantity: cantidad + size: tamaño + category: categoría + typeFk: tipo + stems: tallos + description: descripción + isActive: activo + relevancy: relevancia + weightByPiece: peso por pieza + stemMultiplier: multiplicador de tallo + image: imagen + longName: nombre largo + subName: subnombre + tag5: etiqueta5 + value5: valor5 + tag6: etiqueta6 + value6: valor6 + tag7: etiqueta7 + value7: valor7 + tag8: etiqueta8 + value8: valor8 + tag9: etiqueta9 + value9: valor9 + tag10: etiqueta10 + value10: valor10 + itemPackingTypeFk: embalaje del artículo + hasKgPrice: tiene precio kg + family: familia + expenseFk: gasto + minPrice: precio mínimo + packingOut: empaquetar + hasMinPrice: tiene precio mínimo + isFragile: frágil + isFloramondo: es floramondo + packingShelve: estantería embalaje + isLaid: puesto + inkFk: tinta + originFk: origen + producerFk: productor + intrastatFk: intrastat + genericFk: genérico + itemFk: artículo + diff --git a/modules/ticket/back/locale/expedition/en.yml b/modules/ticket/back/locale/expedition/en.yml new file mode 100644 index 000000000..1834984ea --- /dev/null +++ b/modules/ticket/back/locale/expedition/en.yml @@ -0,0 +1,10 @@ +name: expedition +columns: + id: id + freightItemFk: freight item + created: created + counter: counter + ticketFk: ticket + agencyModeFk: agency + workerFk: worker + packagingFk: packaging diff --git a/modules/ticket/back/locale/expedition/es.yml b/modules/ticket/back/locale/expedition/es.yml new file mode 100644 index 000000000..32f72b943 --- /dev/null +++ b/modules/ticket/back/locale/expedition/es.yml @@ -0,0 +1,10 @@ +name: expedición +columns: + id: id + freightItemFk: artículo de carga + created: creado + counter: contador + ticketFk: ticket + agencyModeFk: agencia + workerFk: trabajador + packagingFk: embalaje diff --git a/modules/ticket/back/locale/sale/en.yml b/modules/ticket/back/locale/sale/en.yml index ae8f67d5e..f844bf0c5 100644 --- a/modules/ticket/back/locale/sale/en.yml +++ b/modules/ticket/back/locale/sale/en.yml @@ -1,11 +1,13 @@ -concept: concept -quantity: quantity -price: price -discount: discount -reserved: reserved -isPicked: is picked -created: created -originalQuantity: original quantity -itemFk: item -ticketFk: ticket -saleFk: sale +name: sale +columns: + concept: concept + quantity: quantity + price: price + discount: discount + reserved: reserved + isPicked: is picked + created: created + originalQuantity: original quantity + itemFk: item + ticketFk: ticket + saleFk: sale diff --git a/modules/ticket/back/locale/sale/es.yml b/modules/ticket/back/locale/sale/es.yml index ff8cc5466..8196a089c 100644 --- a/modules/ticket/back/locale/sale/es.yml +++ b/modules/ticket/back/locale/sale/es.yml @@ -1,11 +1,13 @@ -concept: concepto -quantity: cantidad -price: precio -discount: descuento -reserved: reservado -isPicked: esta seleccionado -created: creado -originalQuantity: cantidad original -itemFk: artículo -ticketFk: ticket -saleFk: línea +name: línea +columns: + concept: concepto + quantity: cantidad + price: precio + discount: descuento + reserved: reservado + isPicked: esta seleccionado + created: creado + originalQuantity: cantidad original + itemFk: artículo + ticketFk: ticket + saleFk: línea diff --git a/modules/ticket/back/locale/ticket-dms/en.yml b/modules/ticket/back/locale/ticket-dms/en.yml new file mode 100644 index 000000000..771e4daf3 --- /dev/null +++ b/modules/ticket/back/locale/ticket-dms/en.yml @@ -0,0 +1,4 @@ +name: ticket dms +columns: + dmsFk: dms + ticketFk: ticket diff --git a/modules/ticket/back/locale/ticket-dms/es.yml b/modules/ticket/back/locale/ticket-dms/es.yml new file mode 100644 index 000000000..360268428 --- /dev/null +++ b/modules/ticket/back/locale/ticket-dms/es.yml @@ -0,0 +1,4 @@ +name: documento ticket +columns: + dmsFk: dms + ticketFk: ticket diff --git a/modules/ticket/back/locale/ticket-observation/en.yml b/modules/ticket/back/locale/ticket-observation/en.yml new file mode 100644 index 000000000..40bd567bf --- /dev/null +++ b/modules/ticket/back/locale/ticket-observation/en.yml @@ -0,0 +1,6 @@ +name: ticket observation +columns: + id: id + description: description + ticketFk: ticket + observationTypeFk: observation type diff --git a/modules/ticket/back/locale/ticket-observation/es.yml b/modules/ticket/back/locale/ticket-observation/es.yml new file mode 100644 index 000000000..155eb58e2 --- /dev/null +++ b/modules/ticket/back/locale/ticket-observation/es.yml @@ -0,0 +1,6 @@ +name: observación ticket +columns: + id: id + description: descripción + ticketFk: ticket + observationTypeFk: tipo observación diff --git a/modules/ticket/back/locale/ticket-packaging/en.yml b/modules/ticket/back/locale/ticket-packaging/en.yml new file mode 100644 index 000000000..4dd018524 --- /dev/null +++ b/modules/ticket/back/locale/ticket-packaging/en.yml @@ -0,0 +1,8 @@ +name: ticket packaging +columns: + id: id + quantity: quantity + created: created + pvp: pvp + ticketFk: ticket + packagingFk: packaging diff --git a/modules/ticket/back/locale/ticket-packaging/es.yml b/modules/ticket/back/locale/ticket-packaging/es.yml new file mode 100644 index 000000000..a31a8c097 --- /dev/null +++ b/modules/ticket/back/locale/ticket-packaging/es.yml @@ -0,0 +1,8 @@ +name: embalaje ticket +columns: + id: id + quantity: cantidad + created: creado + pvp: pvp + ticketFk: ticket + packagingFk: embalaje diff --git a/modules/ticket/back/locale/ticket-refund/en.yml b/modules/ticket/back/locale/ticket-refund/en.yml new file mode 100644 index 000000000..961b5c8c3 --- /dev/null +++ b/modules/ticket/back/locale/ticket-refund/en.yml @@ -0,0 +1,5 @@ +name: ticket refund +columns: + id: id + refundTicketFk: refund ticket + originalTicketFk: original ticket diff --git a/modules/ticket/back/locale/ticket-refund/es.yml b/modules/ticket/back/locale/ticket-refund/es.yml new file mode 100644 index 000000000..8826ef949 --- /dev/null +++ b/modules/ticket/back/locale/ticket-refund/es.yml @@ -0,0 +1,5 @@ +name: ticket abono +columns: + id: id + refundTicketFk: ticket abono + originalTicketFk: ticket original diff --git a/modules/ticket/back/locale/ticket-request/en.yml b/modules/ticket/back/locale/ticket-request/en.yml new file mode 100644 index 000000000..56cb297e4 --- /dev/null +++ b/modules/ticket/back/locale/ticket-request/en.yml @@ -0,0 +1,15 @@ +name: ticket request +columns: + id: id + description: description + created: created + quantity: quantity + price: price + isOk: Ok + response: response + saleFk: sale + ticketFk: ticket + attenderFk: attender + requesterFk: requester + itemFk: item + diff --git a/modules/ticket/back/locale/ticket-request/es.yml b/modules/ticket/back/locale/ticket-request/es.yml new file mode 100644 index 000000000..8982a684d --- /dev/null +++ b/modules/ticket/back/locale/ticket-request/es.yml @@ -0,0 +1,15 @@ +name: peticiones ticket +columns: + id: id + description: descripción + created: creado + quantity: cantidad + price: precio + isOk: Ok + response: respuesta + saleFk: línea + ticketFk: ticket + attenderFk: asistente + requesterFk: solicitante + itemFk: artículo + diff --git a/modules/ticket/back/locale/ticket-service/en.yml b/modules/ticket/back/locale/ticket-service/en.yml new file mode 100644 index 000000000..cf4e6f43f --- /dev/null +++ b/modules/ticket/back/locale/ticket-service/en.yml @@ -0,0 +1,10 @@ +name: ticket service +columns: + id: id + ticketFk: ticket + description: description + quantity: quantity + price: price + taxClassFk: tax class + ticketServiceTypeFk: ticket service type + diff --git a/modules/ticket/back/locale/ticket-service/es.yml b/modules/ticket/back/locale/ticket-service/es.yml new file mode 100644 index 000000000..ee07c13d3 --- /dev/null +++ b/modules/ticket/back/locale/ticket-service/es.yml @@ -0,0 +1,10 @@ +name: servicios ticket +columns: + id: id + ticketFk: ticket + description: descripción + quantity: cantidad + price: precio + taxClassFk: tipo impuestos + ticketServiceTypeFk: tipo servicio ticket + diff --git a/modules/ticket/back/locale/ticket-tracking/en.yml b/modules/ticket/back/locale/ticket-tracking/en.yml new file mode 100644 index 000000000..15505a763 --- /dev/null +++ b/modules/ticket/back/locale/ticket-tracking/en.yml @@ -0,0 +1,7 @@ +name: ticket tracking +columns: + id: id + created: created + ticketFk: ticket + stateFk: state + workerFk: worker diff --git a/modules/ticket/back/locale/ticket-tracking/es.yml b/modules/ticket/back/locale/ticket-tracking/es.yml new file mode 100644 index 000000000..3459ab367 --- /dev/null +++ b/modules/ticket/back/locale/ticket-tracking/es.yml @@ -0,0 +1,7 @@ +name: seguimiento ticket +columns: + id: id + created: creado + ticketFk: ticket + stateFk: estado + workerFk: trabajador diff --git a/modules/ticket/back/locale/ticket-weekly/en.yml b/modules/ticket/back/locale/ticket-weekly/en.yml new file mode 100644 index 000000000..af1c94dc9 --- /dev/null +++ b/modules/ticket/back/locale/ticket-weekly/en.yml @@ -0,0 +1,5 @@ +name: ticket weekly +columns: + ticketFk: ticket + weekDay: week day + agencyModeFk: agency diff --git a/modules/ticket/back/locale/ticket-weekly/es.yml b/modules/ticket/back/locale/ticket-weekly/es.yml new file mode 100644 index 000000000..597d9d46a --- /dev/null +++ b/modules/ticket/back/locale/ticket-weekly/es.yml @@ -0,0 +1,5 @@ +name: ticket semanal +columns: + ticketFk: ticket + weekDay: día semana + agencyModeFk: agencia diff --git a/modules/ticket/back/locale/ticket/en.yml b/modules/ticket/back/locale/ticket/en.yml index c4ad84232..2481c42f8 100644 --- a/modules/ticket/back/locale/ticket/en.yml +++ b/modules/ticket/back/locale/ticket/en.yml @@ -1,23 +1,25 @@ -shipped: shipped -landed: landed -nickname: nickname -location: location -solution: solution -packages: packages -updated: updated -isDeleted: is deleted -priority: priority -zoneFk: zone -zonePrice: zone price -zoneBonus: zone bonus -totalWithVat: total with vat -totalWithoutVat: total without vat -clientFk: client -warehouseFk: warehouse -refFk: reference -addressFk: address -routeFk: route -companyFk: company -agencyModeFk: agency -ticketFk: ticket -mergedTicket: merged ticket +name: ticket +columns: + shipped: shipped + landed: landed + nickname: nickname + location: location + solution: solution + packages: packages + updated: updated + isDeleted: is deleted + priority: priority + zoneFk: zone + zonePrice: zone price + zoneBonus: zone bonus + totalWithVat: total with vat + totalWithoutVat: total without vat + clientFk: client + warehouseFk: warehouse + refFk: reference + addressFk: address + routeFk: route + companyFk: company + agencyModeFk: agency + ticketFk: ticket + mergedTicket: merged ticket diff --git a/modules/ticket/back/locale/ticket/es.yml b/modules/ticket/back/locale/ticket/es.yml index 15b5a39bf..558378612 100644 --- a/modules/ticket/back/locale/ticket/es.yml +++ b/modules/ticket/back/locale/ticket/es.yml @@ -1,25 +1,27 @@ -shipped: fecha salida -landed: fecha entrega -nickname: alias -location: ubicación -solution: solución -packages: embalajes -updated: fecha última actualización -isDeleted: esta eliminado -priority: prioridad -zoneFk: zona -zonePrice: precio zona -zoneBonus: bonus zona -totalWithVat: total con IVA -totalWithoutVat: total sin IVA -clientFk: cliente -warehouseFk: almacén -refFk: referencia -addressFk: dirección -routeFk: ruta -companyFk: empresa -agencyModeFk: agencia -ticketFk: ticket -mergedTicket: ticket fusionado -withWarningAccept: aviso negativos -isWithoutNegatives: sin negativos +name: ticket +columns: + shipped: salida + landed: entrega + nickname: alias + location: ubicación + solution: solución + packages: embalajes + updated: última actualización + isDeleted: eliminado + priority: prioridad + zoneFk: zona + zonePrice: precio zona + zoneBonus: bonus zona + totalWithVat: total con IVA + totalWithoutVat: total sin IVA + clientFk: cliente + warehouseFk: almacén + refFk: referencia + addressFk: dirección + routeFk: ruta + companyFk: empresa + agencyModeFk: agencia + ticketFk: ticket + mergedTicket: ticket fusionado + withWarningAccept: aviso negativos + isWithoutNegatives: sin negativos diff --git a/modules/worker/back/locale/worker-dms/en.yml b/modules/worker/back/locale/worker-dms/en.yml new file mode 100644 index 000000000..f870adaf0 --- /dev/null +++ b/modules/worker/back/locale/worker-dms/en.yml @@ -0,0 +1,6 @@ +name: worker dms +columns: + id: id + dmsFk: dms + workerFk: worker + isReadableByWorker: readable by worker diff --git a/modules/worker/back/locale/worker-dms/es.yml b/modules/worker/back/locale/worker-dms/es.yml new file mode 100644 index 000000000..c3bdea5af --- /dev/null +++ b/modules/worker/back/locale/worker-dms/es.yml @@ -0,0 +1,6 @@ +name: documento trabajador +columns: + id: id + dmsFk: dms + workerFk: trabajador + isReadableByWorker: legible por trabajador From 9594bd68b5333866d1eff8309f3a1979e1f01be4 Mon Sep 17 00:00:00 2001 From: pablone Date: Wed, 12 Apr 2023 21:10:50 +0200 Subject: [PATCH 12/49] refs #4795 --- modules/client/back/methods/client/getCard.js | 2 +- modules/client/back/methods/client/getDebt.js | 2 +- modules/monitor/back/methods/sales-monitor/salesFilter.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/client/back/methods/client/getCard.js b/modules/client/back/methods/client/getCard.js index a2365ee25..414cbe058 100644 --- a/modules/client/back/methods/client/getCard.js +++ b/modules/client/back/methods/client/getCard.js @@ -76,7 +76,7 @@ module.exports = function(Self) { const date = Date.vnNew(); date.setHours(0, 0, 0, 0); - const query = `SELECT vn.clientGetDebt(?, ?) AS debt`; + const query = `SELECT vn.client_getDebt(?, ?) AS debt`; const data = await Self.rawSql(query, [id, date], myOptions); client.debt = data[0].debt; diff --git a/modules/client/back/methods/client/getDebt.js b/modules/client/back/methods/client/getDebt.js index 5f8a8c569..859746083 100644 --- a/modules/client/back/methods/client/getDebt.js +++ b/modules/client/back/methods/client/getDebt.js @@ -27,7 +27,7 @@ module.exports = Self => { const date = Date.vnNew(); date.setHours(0, 0, 0, 0); - const query = `SELECT vn.clientGetDebt(?, ?) AS debt`; + const query = `SELECT vn.client_getDebt(?, ?) AS debt`; const [debt] = await Self.rawSql(query, [clientFk, date], myOptions); return debt; diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js index 8f7b336ab..4f9edd11c 100644 --- a/modules/monitor/back/methods/sales-monitor/salesFilter.js +++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js @@ -238,7 +238,7 @@ module.exports = Self => { ENGINE = MEMORY SELECT DISTINCT clientFk FROM tmp.filter`); - stmt = new ParameterizedSQL('CALL clientGetDebt(?)', [args.to]); + stmt = new ParameterizedSQL('CALL client_getDebt(?)', [args.to]); stmts.push(stmt); stmts.push('DROP TEMPORARY TABLE tmp.clientGetDebt'); From ad267c933c68149e7c693ff031e1edc8c2af24f6 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 13 Apr 2023 08:30:33 +0200 Subject: [PATCH 13/49] refs #5540 country.code --- db/changes/231401/00-updateIsVies.sql | 8 +++++--- modules/supplier/back/models/supplier.js | 9 ++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/db/changes/231401/00-updateIsVies.sql b/db/changes/231401/00-updateIsVies.sql index 1d2e55441..83fde7352 100644 --- a/db/changes/231401/00-updateIsVies.sql +++ b/db/changes/231401/00-updateIsVies.sql @@ -1,3 +1,5 @@ -UPDATE vn.supplier -SET nif = SUBSTRING(nif, IF(ASCII(SUBSTRING(nif, 1, 1)) BETWEEN 65 AND 90 AND ASCII(SUBSTRING(nif, 2, 1)) BETWEEN 65 AND 90, 3, 1), LENGTH(nif)) -WHERE isVies = 1 AND nif REGEXP '^[a-zA-Z]{2}'; + UPDATE vn.supplier s + JOIN vn.country c ON c.id = s.countryFk + SET s.nif = MID(REPLACE(s.nif, ' ', ''), 3, LENGTH(REPLACE(s.nif, ' ', '')) - 1) + WHERE s.isVies = TRUE + AND c.code = LEFT(REPLACE(s.nif, ' ', ''), 2); \ No newline at end of file diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 7f12e86ef..c889fd420 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -77,7 +77,14 @@ module.exports = Self => { message: 'The first two values are letters'}); async function nifInvalid(err, done) { - if (this.isVies && /^[a-zA-Z]{2}/.test(this.nif)) + const filter = { + fields: ['code'], + where: {id: this.countryFk} + }; + const countryCode = this.nif.toUpperCase().substring(0, 2); + const country = await Self.app.models.Country.findOne(filter); + const code = country ? country.code : null; + if (this.isVies && countryCode == code) err(); done(); } From 3790e3457f54b4d65b5667b0a1bd878bc9b10ab3 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 13 Apr 2023 08:43:42 +0200 Subject: [PATCH 14/49] =?UTF-8?q?refs=20#5517=20a=C3=B1adidas=20m=C3=A1s?= =?UTF-8?q?=20traducciones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/entry/back/locale/entry/en.yml | 3 -- modules/entry/back/locale/entry/es.yml | 1 - modules/item/back/locale/item-barcode/en.yml | 5 +++ modules/item/back/locale/item-barcode/es.yml | 5 +++ .../item/back/locale/item-botanical/en.yml | 5 +++ .../item/back/locale/item-botanical/es.yml | 5 +++ modules/item/back/locale/item-tag/en.yml | 7 ++++ modules/item/back/locale/item-tag/es.yml | 7 ++++ .../item/back/locale/item-tax-country/en.yml | 7 ++++ .../item/back/locale/item-tax-country/es.yml | 7 ++++ modules/route/back/locale/route/en.yml | 19 ++++++++++ modules/route/back/locale/route/es.yml | 19 ++++++++++ .../back/locale/supplier-account/en.yml | 7 ++++ .../back/locale/supplier-account/es.yml | 7 ++++ .../back/locale/supplier-contact/en.yml | 9 +++++ .../back/locale/supplier-contact/es.yml | 9 +++++ modules/supplier/back/locale/supplier/en.yml | 38 +++++++++++++++++++ modules/supplier/back/locale/supplier/es.yml | 38 +++++++++++++++++++ .../ticket/back/locale/ticket-request/en.yml | 2 +- .../ticket/back/locale/ticket-request/es.yml | 2 +- .../back/locale/travel-thermograph/en.yml | 10 +++++ .../back/locale/travel-thermograph/es.yml | 10 +++++ modules/travel/back/locale/travel/en.yml | 15 ++++++++ modules/travel/back/locale/travel/es.yml | 15 ++++++++ modules/worker/back/locale/calendar/en.yml | 6 +++ modules/worker/back/locale/calendar/es.yml | 6 +++ .../locale/worker-time-control-mail/en.yml | 10 +++++ .../locale/worker-time-control-mail/es.yml | 10 +++++ modules/worker/back/locale/worker/en.yml | 20 ++++++++++ modules/worker/back/locale/worker/es.yml | 20 ++++++++++ modules/zone/back/locale/zone-event/en.yml | 14 +++++++ modules/zone/back/locale/zone-event/es.yml | 14 +++++++ .../zone/back/locale/zone-exclusion/en.yml | 5 +++ .../zone/back/locale/zone-exclusion/es.yml | 5 +++ modules/zone/back/locale/zone-included/en.yml | 5 +++ modules/zone/back/locale/zone-included/es.yml | 5 +++ .../zone/back/locale/zone-warehouse/en.yml | 5 +++ .../zone/back/locale/zone-warehouse/es.yml | 5 +++ modules/zone/back/locale/zone/en.yml | 14 +++++++ modules/zone/back/locale/zone/es.yml | 14 +++++++ 40 files changed, 404 insertions(+), 6 deletions(-) create mode 100644 modules/item/back/locale/item-barcode/en.yml create mode 100644 modules/item/back/locale/item-barcode/es.yml create mode 100644 modules/item/back/locale/item-botanical/en.yml create mode 100644 modules/item/back/locale/item-botanical/es.yml create mode 100644 modules/item/back/locale/item-tag/en.yml create mode 100644 modules/item/back/locale/item-tag/es.yml create mode 100644 modules/item/back/locale/item-tax-country/en.yml create mode 100644 modules/item/back/locale/item-tax-country/es.yml create mode 100644 modules/route/back/locale/route/en.yml create mode 100644 modules/route/back/locale/route/es.yml create mode 100644 modules/supplier/back/locale/supplier-account/en.yml create mode 100644 modules/supplier/back/locale/supplier-account/es.yml create mode 100644 modules/supplier/back/locale/supplier-contact/en.yml create mode 100644 modules/supplier/back/locale/supplier-contact/es.yml create mode 100644 modules/supplier/back/locale/supplier/en.yml create mode 100644 modules/supplier/back/locale/supplier/es.yml create mode 100644 modules/travel/back/locale/travel-thermograph/en.yml create mode 100644 modules/travel/back/locale/travel-thermograph/es.yml create mode 100644 modules/travel/back/locale/travel/en.yml create mode 100644 modules/travel/back/locale/travel/es.yml create mode 100644 modules/worker/back/locale/calendar/en.yml create mode 100644 modules/worker/back/locale/calendar/es.yml create mode 100644 modules/worker/back/locale/worker-time-control-mail/en.yml create mode 100644 modules/worker/back/locale/worker-time-control-mail/es.yml create mode 100644 modules/worker/back/locale/worker/en.yml create mode 100644 modules/worker/back/locale/worker/es.yml create mode 100644 modules/zone/back/locale/zone-event/en.yml create mode 100644 modules/zone/back/locale/zone-event/es.yml create mode 100644 modules/zone/back/locale/zone-exclusion/en.yml create mode 100644 modules/zone/back/locale/zone-exclusion/es.yml create mode 100644 modules/zone/back/locale/zone-included/en.yml create mode 100644 modules/zone/back/locale/zone-included/es.yml create mode 100644 modules/zone/back/locale/zone-warehouse/en.yml create mode 100644 modules/zone/back/locale/zone-warehouse/es.yml create mode 100644 modules/zone/back/locale/zone/en.yml create mode 100644 modules/zone/back/locale/zone/es.yml diff --git a/modules/entry/back/locale/entry/en.yml b/modules/entry/back/locale/entry/en.yml index 71f75b1bb..6bc2333e6 100644 --- a/modules/entry/back/locale/entry/en.yml +++ b/modules/entry/back/locale/entry/en.yml @@ -20,7 +20,4 @@ columns: travelFk: travel companyFk: company observationEditorFk: observation editor - supplierFk: supplier - travelFk: travel - companyFk: company currencyFk: currency diff --git a/modules/entry/back/locale/entry/es.yml b/modules/entry/back/locale/entry/es.yml index e01ded738..3a0c3d9c1 100644 --- a/modules/entry/back/locale/entry/es.yml +++ b/modules/entry/back/locale/entry/es.yml @@ -20,5 +20,4 @@ columns: travelFk: envío companyFk: empresa observationEditorFk: editor observación - supplierFk: proveedor currencyFk: moneda diff --git a/modules/item/back/locale/item-barcode/en.yml b/modules/item/back/locale/item-barcode/en.yml new file mode 100644 index 000000000..c1b20855f --- /dev/null +++ b/modules/item/back/locale/item-barcode/en.yml @@ -0,0 +1,5 @@ +name: item barcode +columns: + id: id + code: code + itemFk: item diff --git a/modules/item/back/locale/item-barcode/es.yml b/modules/item/back/locale/item-barcode/es.yml new file mode 100644 index 000000000..c1557f6d8 --- /dev/null +++ b/modules/item/back/locale/item-barcode/es.yml @@ -0,0 +1,5 @@ +name: código barras artículo +columns: + id: id + code: código + itemFk: artículo diff --git a/modules/item/back/locale/item-botanical/en.yml b/modules/item/back/locale/item-botanical/en.yml new file mode 100644 index 000000000..f5a9e4c5a --- /dev/null +++ b/modules/item/back/locale/item-botanical/en.yml @@ -0,0 +1,5 @@ +name: item botanical +columns: + itemFk: item + genusFk: genus + specieFk: specie diff --git a/modules/item/back/locale/item-botanical/es.yml b/modules/item/back/locale/item-botanical/es.yml new file mode 100644 index 000000000..8e0a45491 --- /dev/null +++ b/modules/item/back/locale/item-botanical/es.yml @@ -0,0 +1,5 @@ +name: artículo botánico +columns: + itemFk: artículo + genusFk: género + specieFk: especie diff --git a/modules/item/back/locale/item-tag/en.yml b/modules/item/back/locale/item-tag/en.yml new file mode 100644 index 000000000..fee588b4c --- /dev/null +++ b/modules/item/back/locale/item-tag/en.yml @@ -0,0 +1,7 @@ +name: item tag +columns: + id: id + value: value + itemFk: item + tagFk: tag + priority: priority diff --git a/modules/item/back/locale/item-tag/es.yml b/modules/item/back/locale/item-tag/es.yml new file mode 100644 index 000000000..3e1d1a9cf --- /dev/null +++ b/modules/item/back/locale/item-tag/es.yml @@ -0,0 +1,7 @@ +name: etiqueta artículo +columns: + id: id + value: valor + itemFk: artículo + tagFk: etiqueta + priority: prioridad diff --git a/modules/item/back/locale/item-tax-country/en.yml b/modules/item/back/locale/item-tax-country/en.yml new file mode 100644 index 000000000..060ad9910 --- /dev/null +++ b/modules/item/back/locale/item-tax-country/en.yml @@ -0,0 +1,7 @@ +name: item tax country +columns: + id: id + effectived: effectived + itemFk: item + countryFk: country + taxClassFk: tax class diff --git a/modules/item/back/locale/item-tax-country/es.yml b/modules/item/back/locale/item-tax-country/es.yml new file mode 100644 index 000000000..2a0e6b5e2 --- /dev/null +++ b/modules/item/back/locale/item-tax-country/es.yml @@ -0,0 +1,7 @@ +name: impuesto país del artículo +columns: + id: id + effectived: efectivo + itemFk: artículo + countryFk: país + taxClassFk: clase impuestos diff --git a/modules/route/back/locale/route/en.yml b/modules/route/back/locale/route/en.yml new file mode 100644 index 000000000..96aaddb72 --- /dev/null +++ b/modules/route/back/locale/route/en.yml @@ -0,0 +1,19 @@ +name: route +columns: + id: id + created: created + time: time + kmStart: km start + kmEnd: km end + started: started + finished: finished + gestdoc: gestdoc + cost: cost + m3: m3 + description: description + isOk: ok + workerFk: worker + vehicleFk: vehicle + agencyModeFk: agency + routeFk: route + zoneFk: zone diff --git a/modules/route/back/locale/route/es.yml b/modules/route/back/locale/route/es.yml new file mode 100644 index 000000000..d1e38ff7e --- /dev/null +++ b/modules/route/back/locale/route/es.yml @@ -0,0 +1,19 @@ +name: ruta +columns: + id: id + created: creado + time: tiempo + kmStart: km inicio + kmEnd: km fin + started: comenzado + finished: terminado + gestdoc: gestdoc + cost: costo + m3: m3 + description: descripción + isOk: ok + workerFk: trabajador + vehicleFk: vehículo + agencyModeFk: agencia + routeFk: ruta + zoneFk: zona diff --git a/modules/supplier/back/locale/supplier-account/en.yml b/modules/supplier/back/locale/supplier-account/en.yml new file mode 100644 index 000000000..bc2add833 --- /dev/null +++ b/modules/supplier/back/locale/supplier-account/en.yml @@ -0,0 +1,7 @@ +name: supplier account +columns: + id: id + iban: iban + beneficiary: beneficiary + supplierFk: supplier + bankEntityFk: bank entity diff --git a/modules/supplier/back/locale/supplier-account/es.yml b/modules/supplier/back/locale/supplier-account/es.yml new file mode 100644 index 000000000..0d751b387 --- /dev/null +++ b/modules/supplier/back/locale/supplier-account/es.yml @@ -0,0 +1,7 @@ +name: cuenta proveedor +columns: + id: id + iban: iban + beneficiary: beneficiario + supplierFk: proveedor + bankEntityFk: entidad bancaria diff --git a/modules/supplier/back/locale/supplier-contact/en.yml b/modules/supplier/back/locale/supplier-contact/en.yml new file mode 100644 index 000000000..62f923293 --- /dev/null +++ b/modules/supplier/back/locale/supplier-contact/en.yml @@ -0,0 +1,9 @@ +name: supplier contact +columns: + id: id + supplierFk: supplier + phone: phone + mobile: mobile + email: email + observation: observation + name: name diff --git a/modules/supplier/back/locale/supplier-contact/es.yml b/modules/supplier/back/locale/supplier-contact/es.yml new file mode 100644 index 000000000..d35f0bf2e --- /dev/null +++ b/modules/supplier/back/locale/supplier-contact/es.yml @@ -0,0 +1,9 @@ +name: contacto proveedor +columns: + id: id + supplierFk: proveedor + phone: teléfono + mobile: móvil + email: email + observation: observación + name: nombre diff --git a/modules/supplier/back/locale/supplier/en.yml b/modules/supplier/back/locale/supplier/en.yml new file mode 100644 index 000000000..292d7d0b6 --- /dev/null +++ b/modules/supplier/back/locale/supplier/en.yml @@ -0,0 +1,38 @@ +name: supplier +columns: + id: id + name: name + account: account + countryFk: country + nif: nif + phone: phone + retAccount: ret account + commission: commission + postcodeFk: postcode + isActive: active + isOfficial: official + isSerious: serious + isTrucker: trucker + note: note + street: street + city: city + provinceFk: province + postCode: postcode + payMethodFk: pay method + payDemFk: pay dem + payDay: pay day + nickname: nickname + workerFk: worker + sageTaxTypeFk: sage tax type + taxTypeSageFk: sage tax type + sageTransactionTypeFk: sage transaction type + transactionTypeSageFk: sage transaction type + sageWithholdingFk: sage with holding + withholdingSageFk: sage with holding + isPayMethodChecked: pay method checked + supplierActivityFk: supplier activity + healthRegister: health register + isVies: vies + provinceFk: province + countryFk: country + supplierFk: supplier diff --git a/modules/supplier/back/locale/supplier/es.yml b/modules/supplier/back/locale/supplier/es.yml new file mode 100644 index 000000000..57c534aa5 --- /dev/null +++ b/modules/supplier/back/locale/supplier/es.yml @@ -0,0 +1,38 @@ +name: proveedor +columns: + id: id + name: nombre + account: cuenta + countryFk: país + nif: nif + phone: teléfono + retAccount: cuenta ret + commission: comisión + postcodeFk: código postal + isActive: activo + isOfficial: oficial + isSerious: serio + isTrucker: camionero + note: nota + street: calle + city: ciudad + provinceFk: provincia + postCode: código postal + payMethodFk: método pago + payDemFk: pagar dem + payDay: día pago + nickname: apodo + workerFk: trabajador + sageTaxTypeFk: tipo de impuesto sage + taxTypeSageFk: tipo de impuesto sage + sageTransactionTypeFk: tipo de transacción sage + transactionTypeSageFk: tipo de transacción sage + sageWithholdingFk: sage con tenencia + withholdingSageFk: sage con tenencia + isPayMethodChecked: método pago verificado + supplierActivityFk: actividad del proveedor + healthRegister: registro sanitario + isVies: vies + provinceFk: provincia + countryFk: país + supplierFk: proveedor diff --git a/modules/ticket/back/locale/ticket-request/en.yml b/modules/ticket/back/locale/ticket-request/en.yml index 56cb297e4..498a933ac 100644 --- a/modules/ticket/back/locale/ticket-request/en.yml +++ b/modules/ticket/back/locale/ticket-request/en.yml @@ -5,7 +5,7 @@ columns: created: created quantity: quantity price: price - isOk: Ok + isOk: ok response: response saleFk: sale ticketFk: ticket diff --git a/modules/ticket/back/locale/ticket-request/es.yml b/modules/ticket/back/locale/ticket-request/es.yml index 8982a684d..b2871e737 100644 --- a/modules/ticket/back/locale/ticket-request/es.yml +++ b/modules/ticket/back/locale/ticket-request/es.yml @@ -5,7 +5,7 @@ columns: created: creado quantity: cantidad price: precio - isOk: Ok + isOk: ok response: respuesta saleFk: línea ticketFk: ticket diff --git a/modules/travel/back/locale/travel-thermograph/en.yml b/modules/travel/back/locale/travel-thermograph/en.yml new file mode 100644 index 000000000..92acee896 --- /dev/null +++ b/modules/travel/back/locale/travel-thermograph/en.yml @@ -0,0 +1,10 @@ +name: travel thermograph +columns: + id: id + created: created + temperatureFk: temperature + result: result + warehouseFk: warehouse + travelFk: travel + dmsFk: dms + thermographFk: thermograph diff --git a/modules/travel/back/locale/travel-thermograph/es.yml b/modules/travel/back/locale/travel-thermograph/es.yml new file mode 100644 index 000000000..0d08863b6 --- /dev/null +++ b/modules/travel/back/locale/travel-thermograph/es.yml @@ -0,0 +1,10 @@ +name: travel thermograph +columns: + id: id + created: creado + temperatureFk: temperatura + result: resultado + warehouseFk: almacén + travelFk: envío + dmsFk: dms + thermographFk: termógrafo diff --git a/modules/travel/back/locale/travel/en.yml b/modules/travel/back/locale/travel/en.yml new file mode 100644 index 000000000..f3bab57d1 --- /dev/null +++ b/modules/travel/back/locale/travel/en.yml @@ -0,0 +1,15 @@ +name: travel +columns: + id: id + shipped: shipped + landed: landed + isDelivered: delivered + isReceived: received + ref: ref + totalEntries: total entries + m3: m3 + kg: kg + cargoSupplierFk: cargo supplier + agencyModeFk: agency + warehouseInFk: warehouse in + warehouseOutFk: warehouse out diff --git a/modules/travel/back/locale/travel/es.yml b/modules/travel/back/locale/travel/es.yml new file mode 100644 index 000000000..ac86c003d --- /dev/null +++ b/modules/travel/back/locale/travel/es.yml @@ -0,0 +1,15 @@ +name: envío +columns: + id: id + shipped: enviado + landed: entregado + isDelivered: está entregado + isReceived: está recibido + ref: referencia + totalEntries: entradas totales + m3: m3 + kg: kg + cargoSupplierFk: proveedor carga + agencyModeFk: agencia + warehouseInFk: almacén entrega + warehouseOutFk: almacén salida diff --git a/modules/worker/back/locale/calendar/en.yml b/modules/worker/back/locale/calendar/en.yml new file mode 100644 index 000000000..b475768de --- /dev/null +++ b/modules/worker/back/locale/calendar/en.yml @@ -0,0 +1,6 @@ +name: calendar +columns: + id: id + businessFk: business + dated: dated + dayOffTypeFk: day off type diff --git a/modules/worker/back/locale/calendar/es.yml b/modules/worker/back/locale/calendar/es.yml new file mode 100644 index 000000000..106c5c371 --- /dev/null +++ b/modules/worker/back/locale/calendar/es.yml @@ -0,0 +1,6 @@ +name: calendario +columns: + id: id + businessFk: negocio + dated: fecha + dayOffTypeFk: tipo de día libre diff --git a/modules/worker/back/locale/worker-time-control-mail/en.yml b/modules/worker/back/locale/worker-time-control-mail/en.yml new file mode 100644 index 000000000..821a3a3c9 --- /dev/null +++ b/modules/worker/back/locale/worker-time-control-mail/en.yml @@ -0,0 +1,10 @@ +name: worker time control mail +columns: + id: id + workerFk: worker + year: year + week: week + state: state + updated: updated + reason: reason + diff --git a/modules/worker/back/locale/worker-time-control-mail/es.yml b/modules/worker/back/locale/worker-time-control-mail/es.yml new file mode 100644 index 000000000..159fcddf5 --- /dev/null +++ b/modules/worker/back/locale/worker-time-control-mail/es.yml @@ -0,0 +1,10 @@ +name: correo de control de tiempo del trabajador +columns: + id: id + workerFk: trabajador + year: año + week: semana + state: estado + updated: actualizado + reason: razón + diff --git a/modules/worker/back/locale/worker/en.yml b/modules/worker/back/locale/worker/en.yml new file mode 100644 index 000000000..f46aed678 --- /dev/null +++ b/modules/worker/back/locale/worker/en.yml @@ -0,0 +1,20 @@ +name: worker +columns: + id: id + firstName: first name + lastName: last name + phone: phone + userFk: user + bossFk: boss + maritalStatus: marital status + originCountryFk: origin country + educationLevelFk: education level + SSN: SSN + labelerFk: labeler + mobileExtension: mobile extension + code: code + locker: locker + workerFk: worker + sectorFk: sector + + diff --git a/modules/worker/back/locale/worker/es.yml b/modules/worker/back/locale/worker/es.yml new file mode 100644 index 000000000..182bc5f53 --- /dev/null +++ b/modules/worker/back/locale/worker/es.yml @@ -0,0 +1,20 @@ +name: trabajador +columns: + id: id + firstName: nombre + lastName: apellido + phone: teléfono + userFk: usuario + bossFk: jefe + maritalStatus: estado civil + originCountryFk: país origen + educationLevelFk: nivel educativo + SSN: SSN + labelerFk: etiquetadora + mobileExtension: extensión móvil + code: código + locker: casillero + workerFk: trabajador + sectorFk: sector + + diff --git a/modules/zone/back/locale/zone-event/en.yml b/modules/zone/back/locale/zone-event/en.yml new file mode 100644 index 000000000..2d6ef39ab --- /dev/null +++ b/modules/zone/back/locale/zone-event/en.yml @@ -0,0 +1,14 @@ +name: zone event +columns: + id: id + zoneFk: zone + type: type + dated: dated + started: started + ended: ended + weekDays: week days + hour: hour + travelingDays: traveling days + price: price + bonus: bonus + m3Max: max m3 diff --git a/modules/zone/back/locale/zone-event/es.yml b/modules/zone/back/locale/zone-event/es.yml new file mode 100644 index 000000000..9bc8db9fe --- /dev/null +++ b/modules/zone/back/locale/zone-event/es.yml @@ -0,0 +1,14 @@ +name: evento zona +columns: + id: id + zoneFk: zona + type: tipo + dated: fecha + started: comenzado + ended: terminado + weekDays: días semana + hour: hora + travelingDays: días de viaje + price: precio + bonus: bono + m3Max: máx. m3 diff --git a/modules/zone/back/locale/zone-exclusion/en.yml b/modules/zone/back/locale/zone-exclusion/en.yml new file mode 100644 index 000000000..4389d8b93 --- /dev/null +++ b/modules/zone/back/locale/zone-exclusion/en.yml @@ -0,0 +1,5 @@ +name: zone exclusion +columns: + id: id + dated: dated + zoneFk: zone diff --git a/modules/zone/back/locale/zone-exclusion/es.yml b/modules/zone/back/locale/zone-exclusion/es.yml new file mode 100644 index 000000000..4e59cba46 --- /dev/null +++ b/modules/zone/back/locale/zone-exclusion/es.yml @@ -0,0 +1,5 @@ +name: zone exclusion +columns: + id: id + dated: fecha + zoneFk: zona diff --git a/modules/zone/back/locale/zone-included/en.yml b/modules/zone/back/locale/zone-included/en.yml new file mode 100644 index 000000000..0e44989e9 --- /dev/null +++ b/modules/zone/back/locale/zone-included/en.yml @@ -0,0 +1,5 @@ +name: zone included +columns: + id: id + dated: dated + zoneFk: zone diff --git a/modules/zone/back/locale/zone-included/es.yml b/modules/zone/back/locale/zone-included/es.yml new file mode 100644 index 000000000..30a89373a --- /dev/null +++ b/modules/zone/back/locale/zone-included/es.yml @@ -0,0 +1,5 @@ +name: zona incluida +columns: + id: id + dated: fecha + zoneFk: zona diff --git a/modules/zone/back/locale/zone-warehouse/en.yml b/modules/zone/back/locale/zone-warehouse/en.yml new file mode 100644 index 000000000..b9c4f7609 --- /dev/null +++ b/modules/zone/back/locale/zone-warehouse/en.yml @@ -0,0 +1,5 @@ +name: zone warehouse +columns: + id: id + warehouseFk: warehouse + zoneFk: zone diff --git a/modules/zone/back/locale/zone-warehouse/es.yml b/modules/zone/back/locale/zone-warehouse/es.yml new file mode 100644 index 000000000..ec8dec2dd --- /dev/null +++ b/modules/zone/back/locale/zone-warehouse/es.yml @@ -0,0 +1,5 @@ +name: almacén zona +columns: + id: id + warehouseFk: almacén + zoneFk: zona diff --git a/modules/zone/back/locale/zone/en.yml b/modules/zone/back/locale/zone/en.yml new file mode 100644 index 000000000..649631faa --- /dev/null +++ b/modules/zone/back/locale/zone/en.yml @@ -0,0 +1,14 @@ +name: zone +columns: + id: id + name: name + hour: hour + travelingDays: traveling days + price: price + bonus: bonus + isVolumetric: volumetric + inflation: inflation + m3Max: max m3 + itemMaxSize: item max size + agencyModeFk: agency + zoneFk: zone diff --git a/modules/zone/back/locale/zone/es.yml b/modules/zone/back/locale/zone/es.yml new file mode 100644 index 000000000..3534c2e12 --- /dev/null +++ b/modules/zone/back/locale/zone/es.yml @@ -0,0 +1,14 @@ +name: zona +columns: + id: id + name: nombre + hour: hora + travelingDays: días viaje + price: precio + bonus: bono + isVolumetric: volumétrico + inflation: inflación + m3Max: máx. m3 + itemMaxSize: tamaño máximo artículo + agencyModeFk: agencia + zoneFk: zona From 2ada64e1bf7ca8389c208150dc96277871ee1c7d Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 13 Apr 2023 08:49:50 +0200 Subject: [PATCH 15/49] refs #5517 eliminadas traducciones duplicadas --- modules/supplier/back/locale/supplier/en.yml | 2 -- modules/supplier/back/locale/supplier/es.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/modules/supplier/back/locale/supplier/en.yml b/modules/supplier/back/locale/supplier/en.yml index 292d7d0b6..1be941a70 100644 --- a/modules/supplier/back/locale/supplier/en.yml +++ b/modules/supplier/back/locale/supplier/en.yml @@ -33,6 +33,4 @@ columns: supplierActivityFk: supplier activity healthRegister: health register isVies: vies - provinceFk: province - countryFk: country supplierFk: supplier diff --git a/modules/supplier/back/locale/supplier/es.yml b/modules/supplier/back/locale/supplier/es.yml index 57c534aa5..6ac8379f5 100644 --- a/modules/supplier/back/locale/supplier/es.yml +++ b/modules/supplier/back/locale/supplier/es.yml @@ -33,6 +33,4 @@ columns: supplierActivityFk: actividad del proveedor healthRegister: registro sanitario isVies: vies - provinceFk: provincia - countryFk: país supplierFk: proveedor From 9694a353432e4b6cd50b4375240d6776c92e1dbc Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 20 Apr 2023 19:46:57 +0200 Subject: [PATCH 16/49] refs #5517 Added: Tests, filter panel, model and props titles --- .../core/components/json-value/index.spec.js | 79 +++++++++++++++ front/core/components/json-value/style.scss | 3 +- front/core/styles/variables.scss | 1 - front/salix/components/layout/style.scss | 6 +- front/salix/components/log/index.html | 87 ++++++++++++++++- front/salix/components/log/index.js | 66 ++++++++++++- front/salix/components/log/index.spec.js | 97 +++++++++++++++++++ front/salix/components/log/style.scss | 4 + .../front/fixed-price-search-panel/style.scss | 2 +- modules/travel/front/search-panel/style.scss | 2 +- 10 files changed, 329 insertions(+), 18 deletions(-) create mode 100644 front/core/components/json-value/index.spec.js create mode 100644 front/salix/components/log/index.spec.js diff --git a/front/core/components/json-value/index.spec.js b/front/core/components/json-value/index.spec.js new file mode 100644 index 000000000..078080d27 --- /dev/null +++ b/front/core/components/json-value/index.spec.js @@ -0,0 +1,79 @@ +import './index'; + +describe('Salix Component vnLog', () => { + let controller; + let $scope; + let $element; + let el; + + beforeEach(ngModule('vnCore')); + + beforeEach(inject(($componentController, $rootScope) => { + $scope = $rootScope.$new(); + $element = angular.element(''); + controller = $componentController('vnJsonValue', {$element, $scope}); + el = controller.element; + })); + + describe('set value()', () => { + it('should display null symbol when value is null equivalent', () => { + controller.value = null; + + expect(el.textContent).toEqual('∅'); + expect(el.className).toContain('json-null'); + }); + + it('should display ballot when value is false', () => { + controller.value = false; + + expect(el.textContent).toEqual('✗'); + expect(el.className).toContain('json-false'); + }); + + it('should display check when value is true', () => { + controller.value = true; + + expect(el.textContent).toEqual('✓'); + expect(el.className).toContain('json-true'); + }); + + it('should display string when value is an string', () => { + controller.value = 'Foo'; + + expect(el.textContent).toEqual('Foo'); + expect(el.className).toContain('json-string'); + }); + + it('should display only date when value is date with time set to zero', () => { + const date = Date.vnNew(); + date.setHours(0, 0, 0, 0); + controller.value = date; + + expect(el.textContent).toEqual('01/01/2001'); + expect(el.className).toContain('json-object'); + }); + + it('should display full date without time when value is date with time', () => { + const date = Date.vnNew(); + date.setHours(15, 45); + controller.value = date; + + expect(el.textContent).toEqual('01/01/2001 15:45:00'); + expect(el.className).toContain('json-object'); + }); + + it('should display object when value is an object', () => { + controller.value = {foo: 'bar'}; + + expect(el.textContent).toEqual('[object Object]'); + expect(el.className).toContain('json-object'); + }); + + it('should display number when value is a number', () => { + controller.value = 2050; + + expect(el.textContent).toEqual('2050'); + expect(el.className).toContain('json-number'); + }); + }); +}); diff --git a/front/core/components/json-value/style.scss b/front/core/components/json-value/style.scss index 2d6c4023c..009a13d40 100644 --- a/front/core/components/json-value/style.scss +++ b/front/core/components/json-value/style.scss @@ -5,8 +5,7 @@ vn-json-value { color: #d172cc; } &.json-object { - /*color: #d1a572;*/ - color: #d172cc; + color: #d1a572; } &.json-number { color: #85d0ff; diff --git a/front/core/styles/variables.scss b/front/core/styles/variables.scss index c280838ca..bcc9fab66 100644 --- a/front/core/styles/variables.scss +++ b/front/core/styles/variables.scss @@ -2,7 +2,6 @@ $font-size: 11pt; $menu-width: 256px; -$right-menu-width: 318px; $topbar-height: 56px; $mobile-width: 800px; $float-spacing: 20px; diff --git a/front/salix/components/layout/style.scss b/front/salix/components/layout/style.scss index 6697bb1b0..612366228 100644 --- a/front/salix/components/layout/style.scss +++ b/front/salix/components/layout/style.scss @@ -88,13 +88,13 @@ vn-layout { } &.right-menu { & > vn-topbar > .end { - width: 80px + $right-menu-width; + width: 80px + $menu-width; } & > .main-view { - padding-right: $right-menu-width; + padding-right: $menu-width; } [fixed-bottom-right] { - right: $right-menu-width; + right: $menu-width; } } & > .main-view { diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 14a3fbe61..3d3a3f8dc 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -6,6 +6,7 @@ where="{changedModel: $ctrl.changedModel, changedModelId: $ctrl.changedModelId}" data="$ctrl.logs" + order="creationDate DESC, id DESC" limit="20" auto-load="true"> @@ -38,13 +39,16 @@ - - {{::log.changedModel}} + + {{::log.changedModelI18n}} {{::log.changedModelValue}} - + #{{::log.changedModelId}} @@ -73,13 +77,19 @@ class="attributes"> - {{::prop.name}}: + + {{::prop.nameI18n}}: + ,
- {{::prop.name}}: + + {{::prop.nameI18n}}: + @@ -105,5 +115,72 @@ + +
+ + + + + + +
{{nickname}}
+
{{name}}
+
+
+
+ + + + + + + + +
+ + + + + + + + + +
+
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index 8c75664c8..7c01b8ac3 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -19,6 +19,11 @@ export default class Controller extends Section { delete: 'alert', select: 'notice' }; + + $.filter = {}; + $.$watch('filter.actions', () => this.applyFilter(), true); + $.$watch('filter.from', () => $.filter.to = $.filter.from); + this.filter = { include: [{ relation: 'user', @@ -33,6 +38,7 @@ export default class Controller extends Section { }, }], }; + this.dateFilter = this.$filter('date'); this.lang = this.$translate.use(); this.today = Date.vnNew(); @@ -52,7 +58,7 @@ export default class Controller extends Section { const oldValues = log.oldInstance || empty; const newValues = log.newInstance || empty; const locale = validations[log.changedModel]?.locale || empty; - log.changedModel = locale.name ? locale.name : log.changedModel + log.changedModelI18n = locale.name || log.changedModel; let props = Object.keys(oldValues).concat(Object.keys(newValues)); props = [...new Set(props)]; @@ -60,9 +66,10 @@ export default class Controller extends Section { log.props = []; for (const prop of props) { log.props.push({ - name: locale.columns?.[prop] || prop, - old: this.castValue(oldValues[prop]), - new: this.castValue(newValues[prop]) + name: prop, + nameI18n: locale.columns?.[prop] || prop, + old: this.castJsonValue(oldValues[prop]), + new: this.castJsonValue(newValues[prop]) }); } } @@ -72,7 +79,7 @@ export default class Controller extends Section { return !(this.changedModel && this.changedModelId); } - castValue(value) { + castJsonValue(value) { return typeof value === 'string' && validDate.test(value) ? new Date(value) : value; @@ -88,6 +95,7 @@ export default class Controller extends Section { } relativeDate(dateVal) { + if (dateVal == null) return ''; const date = new Date(dateVal); const dateZeroTime = new Date(dateVal); dateZeroTime.setHours(0, 0, 0, 0); @@ -112,6 +120,54 @@ export default class Controller extends Section { if (!workerId) return; this.$.workerDescriptor.show(event.target, workerId); } + + applyFilter() { + const filter = this.$.filter; + + function getParam(prop, value) { + if (value == null || value == '') return null; + switch (prop) { + case 'actions': + const inq = []; + for (const action in value) { + if (value[action]) + inq.push(action); + } + return inq.length ? {action: {inq}} : null; + case 'from': + return {creationDate: {gte: value}}; + case 'to': + const to = new Date(value); + to.setHours(23, 59, 59, 999); + return {creationDate: {lte: to}}; + default: + return {[prop]: value}; + } + } + + const and = []; + for (const prop in filter) { + const param = getParam(prop, filter[prop]); + if (param) and.push(param); + } + this.$.model.applyFilter(and.length ? {where: {and}} : null); + } + + removeFilter() { + this.$.filter = {}; + this.applyFilter(); + } + + searchUser(search) { + if (/^[0-9]+$/.test(search)) { + return {id: search}; + } else { + return {or: [ + {name: search}, + {nickname: {like: `%${search}%`}} + ]} + } + } } ngModule.vnComponent('vnLog', { diff --git a/front/salix/components/log/index.spec.js b/front/salix/components/log/index.spec.js new file mode 100644 index 000000000..d01a08967 --- /dev/null +++ b/front/salix/components/log/index.spec.js @@ -0,0 +1,97 @@ +import './index'; + +describe('Salix Component vnLog', () => { + let controller; + let $scope; + let $element; + + beforeEach(ngModule('salix')); + + beforeEach(inject(($componentController, $rootScope) => { + $scope = $rootScope.$new(); + $element = angular.element(''); + controller = $componentController('vnLog', {$element, $scope}); + })); + + describe('relativeDate()', () => { + let date; + + beforeEach(() => { + date = Date.vnNew(); + }); + + it('should return empty string when date is null', () => { + const ret = controller.relativeDate(null); + + expect(ret).toEqual(''); + }); + + it('should return empty string when date is undefined', () => { + const ret = controller.relativeDate(undefined); + + expect(ret).toEqual(''); + }); + + it('should return today and time when date is today', () => { + const ret = controller.relativeDate(date); + + expect(ret).toEqual('today 12:00'); + }); + + it('should return yesterday and time when date is yesterday', () => { + date.setDate(date.getDate() - 1); + const ret = controller.relativeDate(date); + + expect(ret).toEqual('yesterday 12:00'); + }); + + it('should return abreviated weekday name and time when date is on past week', () => { + date.setDate(date.getDate() - 3); + const ret = controller.relativeDate(date); + + expect(ret).toEqual('Fri 12:00'); + }); + + it('should return abreviated month name, day number and time when date is on this year', () => { + date.setDate(date.getDate() + 20); + const ret = controller.relativeDate(date); + + expect(ret).toEqual('21 Jan 12:00'); + }); + + it('should return abreviated month name, day number, year and time when date is on different year', () => { + date.setDate(date.getDate() - 20); + const ret = controller.relativeDate(date); + + expect(ret).toEqual('12/12/2000 12:00'); + }); + + it('should convert to date and return string when date is not a Date class instance', () => { + const ret = controller.relativeDate(date.toJSON()); + + expect(ret).toEqual('today 12:00'); + }); + }); + + describe('castJsonValue()', () => { + it('should return date when string has valid JSON date format', () => { + const now = Date.vnNew(); + + const ret = controller.castJsonValue(now.toJSON()); + + expect(ret).toBeInstanceOf(Date); + }); + + it('should return same value when is string with invalid JSON date format', () => { + const ret = controller.castJsonValue('Foo'); + + expect(ret).toEqual('Foo'); + }); + + it('should return same value when is not an string', () => { + const ret = controller.castJsonValue(1001); + + expect(ret).toEqual(1001); + }); + }); +}); diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss index 1573218f4..ea228e1fb 100644 --- a/front/salix/components/log/style.scss +++ b/front/salix/components/log/style.scss @@ -64,6 +64,9 @@ vn-log { } } } + .model-name { + text-transform: capitalize; + } .model-value { font-style: italic; color: #c7bd2b; @@ -130,4 +133,5 @@ vn-log { } } } + .filter {} } diff --git a/modules/item/front/fixed-price-search-panel/style.scss b/modules/item/front/fixed-price-search-panel/style.scss index a63f84f3b..e386033dd 100644 --- a/modules/item/front/fixed-price-search-panel/style.scss +++ b/modules/item/front/fixed-price-search-panel/style.scss @@ -2,7 +2,7 @@ vn-fixed-price-search-panel vn-side-menu { .menu { - min-width: $right-menu-width; + min-width: $menu-width; } & > div { .input { diff --git a/modules/travel/front/search-panel/style.scss b/modules/travel/front/search-panel/style.scss index 94fe7b239..0da52408a 100644 --- a/modules/travel/front/search-panel/style.scss +++ b/modules/travel/front/search-panel/style.scss @@ -2,7 +2,7 @@ vn-travel-search-panel vn-side-menu { .menu { - min-width: $right-menu-width; + min-width: $menu-width; } & > div { .input { From d8b5659a5dd0e4fbbd48081881285ea0a9c2c1ed Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 21 Apr 2023 09:14:30 +0200 Subject: [PATCH 17/49] refs #5540 client vies --- .../{231401 => 231601}/00-updateIsVies.sql | 0 db/changes/231601/00-updateisViesClient.sql | 5 +++++ loopback/locale/es.json | 9 +++++---- modules/client/back/models/client.js | 16 ++++++++++++++++ modules/client/front/fiscal-data/index.html | 4 +++- modules/client/front/fiscal-data/locale/es.yml | 2 ++ 6 files changed, 31 insertions(+), 5 deletions(-) rename db/changes/{231401 => 231601}/00-updateIsVies.sql (100%) create mode 100644 db/changes/231601/00-updateisViesClient.sql diff --git a/db/changes/231401/00-updateIsVies.sql b/db/changes/231601/00-updateIsVies.sql similarity index 100% rename from db/changes/231401/00-updateIsVies.sql rename to db/changes/231601/00-updateIsVies.sql diff --git a/db/changes/231601/00-updateisViesClient.sql b/db/changes/231601/00-updateisViesClient.sql new file mode 100644 index 000000000..bdf62d7a8 --- /dev/null +++ b/db/changes/231601/00-updateisViesClient.sql @@ -0,0 +1,5 @@ +UPDATE IGNORE vn.client c + JOIN vn.country co ON co.id = c.countryFk + SET c.fi = MID(REPLACE(c.fi, ' ', ''), 3, LENGTH(REPLACE(c.fi, ' ', '')) - 1) + WHERE c.isVies = TRUE + AND co.code = LEFT(REPLACE(c.fi, ' ', ''), 2); \ No newline at end of file diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 33741d395..1faf57ffe 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -273,7 +273,8 @@ "Not exist this branch": "La rama no existe", "This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado", "Insert a date range": "Inserte un rango de fechas", - "Added observation": "{{user}} añadió esta observacion: {{text}}", - "Comment added to client": "Observación añadida al cliente {{clientFk}}", - "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen" -} + "Added observation": "{{user}} añadió esta observacion: {{text}}", + "Comment added to client": "Observación añadida al cliente {{clientFk}}", + "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen", + "The first two values are letters": "The first two values are letters" +} \ No newline at end of file diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 7933f2f42..21dfb516d 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -23,6 +23,22 @@ module.exports = Self => { message: 'TIN must be unique' }); + Self.validateAsync('fi', fiInvalid, { + message: 'The first two values are letters'}); + + async function fiInvalid(err, done) { + const filter = { + fields: ['code'], + where: {id: this.countryFk} + }; + const countryCode = this.fi.toUpperCase().substring(0, 2); + const country = await Self.app.models.Country.findOne(filter); + const code = country ? country.code : null; + if (this.isVies && countryCode == code) + err(); + done(); + } + Self.validatesFormatOf('email', { message: 'Invalid email', allowNull: true, diff --git a/modules/client/front/fiscal-data/index.html b/modules/client/front/fiscal-data/index.html index 88586cff7..4b1219f31 100644 --- a/modules/client/front/fiscal-data/index.html +++ b/modules/client/front/fiscal-data/index.html @@ -72,7 +72,9 @@ - + diff --git a/modules/client/front/fiscal-data/locale/es.yml b/modules/client/front/fiscal-data/locale/es.yml index 7624c86bd..61a91828f 100644 --- a/modules/client/front/fiscal-data/locale/es.yml +++ b/modules/client/front/fiscal-data/locale/es.yml @@ -12,3 +12,5 @@ Previous client: Cliente anterior In case of a company succession, specify the grantor company: En el caso de que haya habido una sucesión de empresa, indicar la empresa cedente Incoterms authorization: Autorización incoterms Electronic invoice: Factura electrónica +When activating it, do not enter the country code in the IF.: Al activarlo, no informar el código del país en el campo IF +The first two values are letters: Los dos primeros valores son letras \ No newline at end of file From 397d8f658e1ea187d79867bbfab19c9a5fbe9403 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 21 Apr 2023 10:41:50 +0200 Subject: [PATCH 18/49] refs #5540 error trad --- modules/client/back/models/client.js | 3 ++- modules/supplier/back/models/supplier.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 21dfb516d..451830749 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -24,7 +24,8 @@ module.exports = Self => { }); Self.validateAsync('fi', fiInvalid, { - message: 'The first two values are letters'}); + message: 'Invalid TIN' + }); async function fiInvalid(err, done) { const filter = { diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 87f3b5d6a..7270c0405 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -73,8 +73,7 @@ module.exports = Self => { done(); } - Self.validateAsync('nif', nifInvalid, { - message: 'The first two values are letters'}); + Self.validateAsync('nif', nifInvalid); async function nifInvalid(err, done) { const filter = { From 38e5660e61a63a81be19ca0df78d44e0240f6ecc Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 13:59:28 +0200 Subject: [PATCH 19/49] =?UTF-8?q?refs=20#5542=20refactorizado=20"abono"=20?= =?UTF-8?q?para=20que=20siempre=20cree=20un=20=C3=BAnico=20ticket=20abono?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../back/methods/invoiceOut/refund.js | 2 +- .../invoiceOut/front/descriptor-menu/index.js | 7 +- modules/ticket/back/methods/sale/refund.js | 67 +++---------------- modules/ticket/back/methods/ticket/refund.js | 9 +-- modules/ticket/front/descriptor-menu/index.js | 2 +- modules/ticket/front/sale/index.js | 2 +- 6 files changed, 18 insertions(+), 71 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/refund.js b/modules/invoiceOut/back/methods/invoiceOut/refund.js index ba1fdfedd..ad480dc7d 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/refund.js +++ b/modules/invoiceOut/back/methods/invoiceOut/refund.js @@ -35,7 +35,7 @@ module.exports = Self => { const tickets = await models.Ticket.find(filter, myOptions); const ticketsIds = tickets.map(ticket => ticket.id); - const refundedTickets = await models.Ticket.refund(ticketsIds, true, myOptions); + const refundedTickets = await models.Ticket.refund(ticketsIds, myOptions); if (tx) await tx.commit(); diff --git a/modules/invoiceOut/front/descriptor-menu/index.js b/modules/invoiceOut/front/descriptor-menu/index.js index 456939119..57ea653a8 100644 --- a/modules/invoiceOut/front/descriptor-menu/index.js +++ b/modules/invoiceOut/front/descriptor-menu/index.js @@ -118,8 +118,11 @@ class Controller extends Section { const query = 'InvoiceOuts/refund'; const params = {ref: this.invoiceOut.ref}; this.$http.post(query, params).then(res => { - const ticketIds = res.data.map(ticket => ticket.id).join(', '); - this.vnApp.showSuccess(this.$t('The following refund tickets have been created', {ticketIds})); + const refundTicket = res.data; + this.vnApp.showSuccess(this.$t('The following refund ticket have been created', { + ticketId: refundTicket.id + })); + this.$state.go('ticket.card.sale', {id: refundTicket.id}); }); } } diff --git a/modules/ticket/back/methods/sale/refund.js b/modules/ticket/back/methods/sale/refund.js index 7b63fd66e..af58a6286 100644 --- a/modules/ticket/back/methods/sale/refund.js +++ b/modules/ticket/back/methods/sale/refund.js @@ -11,11 +11,6 @@ module.exports = Self => { { arg: 'servicesIds', type: ['number'] - }, - { - arg: 'createSingleTicket', - type: 'boolean', - required: false } ], returns: { @@ -28,7 +23,7 @@ module.exports = Self => { } }); - Self.refund = async(salesIds, servicesIds, createSingleTicket = false, options) => { + Self.refund = async(salesIds, servicesIds, options) => { const models = Self.app.models; const myOptions = {}; let tx; @@ -67,40 +62,14 @@ module.exports = Self => { const sales = await models.Sale.find(salesFilter, myOptions); const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))]; - const refundTickets = []; - const mappedTickets = new Map(); const now = Date.vnNew(); - const [firstTicketId] = ticketsIds; - if (createSingleTicket) { - await createTicketRefund( - firstTicketId, - refundTickets, - mappedTickets, - now, - refundAgencyMode, - refoundZoneId, - myOptions - ); - } else { - for (let ticketId of ticketsIds) { - await createTicketRefund( - ticketId, - refundTickets, - mappedTickets, - now, - refundAgencyMode, - refoundZoneId, - myOptions - ); - } - } + + const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, myOptions); for (const sale of sales) { - const refundTicketId = await getTicketRefundId(createSingleTicket, sale.ticketFk, refundTickets, mappedTickets); - const createdSale = await models.Sale.create({ - ticketFk: refundTicketId, + ticketFk: refundTicket.id, itemFk: sale.itemFk, quantity: - sale.quantity, concept: sale.concept, @@ -120,16 +89,13 @@ module.exports = Self => { where: {id: {inq: servicesIds}} }; const services = await models.TicketService.find(servicesFilter, myOptions); - for (const service of services) { - const refundTicketId = await getTicketRefundId(createSingleTicket, service.ticketFk, refundTickets, mappedTickets); - await models.TicketService.create({ description: service.description, quantity: - service.quantity, price: service.price, taxClassFk: service.taxClassFk, - ticketFk: refundTicketId, + ticketFk: refundTicket.id, ticketServiceTypeFk: service.ticketServiceTypeFk, }, myOptions); } @@ -137,22 +103,14 @@ module.exports = Self => { if (tx) await tx.commit(); - return refundTickets; + return refundTicket; } catch (e) { if (tx) await tx.rollback(); throw e; } }; - async function createTicketRefund( - ticketId, - refundTickets, - mappedTickets, - now, - refundAgencyMode, - refoundZoneId, - myOptions - ) { + async function createTicketRefund(ticketId, now, refundAgencyMode, refoundZoneId, myOptions) { const models = Self.app.models; const filter = {include: {relation: 'address'}}; @@ -170,20 +128,11 @@ module.exports = Self => { zoneFk: refoundZoneId }, myOptions); - refundTickets.push(refundTicket); - - mappedTickets.set(ticketId, refundTicket.id); - await models.TicketRefund.create({ refundTicketFk: refundTicket.id, originalTicketFk: ticket.id, }, myOptions); - } - async function getTicketRefundId(createSingleTicket, ticketId, refundTickets, mappedTickets) { - if (createSingleTicket) { - const [firstRefundTicket] = refundTickets; - return firstRefundTicket.id; - } else return mappedTickets.get(ticketId); + return refundTicket; } }; diff --git a/modules/ticket/back/methods/ticket/refund.js b/modules/ticket/back/methods/ticket/refund.js index 1f0021316..91f48cfd6 100644 --- a/modules/ticket/back/methods/ticket/refund.js +++ b/modules/ticket/back/methods/ticket/refund.js @@ -7,11 +7,6 @@ module.exports = Self => { arg: 'ticketsIds', type: ['number'], required: true - }, - { - arg: 'createSingleTicket', - type: 'boolean', - required: false } ], returns: { @@ -24,7 +19,7 @@ module.exports = Self => { } }); - Self.refund = async(ticketsIds, createSingleTicket = false, options) => { + Self.refund = async(ticketsIds, options) => { const models = Self.app.models; const myOptions = {}; let tx; @@ -46,7 +41,7 @@ module.exports = Self => { const services = await models.TicketService.find(filter, myOptions); const servicesIds = services.map(service => service.id); - const refundedTickets = await models.Sale.refund(salesIds, servicesIds, createSingleTicket, myOptions); + const refundedTickets = await models.Sale.refund(salesIds, servicesIds, myOptions); if (tx) await tx.commit(); diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index ff029db78..0ac981a2c 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -300,7 +300,7 @@ class Controller extends Section { const params = {ticketsIds: [this.id]}; const query = 'Tickets/refund'; return this.$http.post(query, params).then(res => { - const [refundTicket] = res.data; + const refundTicket = res.data; this.vnApp.showSuccess(this.$t('The following refund ticket have been created', { ticketId: refundTicket.id })); diff --git a/modules/ticket/front/sale/index.js b/modules/ticket/front/sale/index.js index 20739b619..24b077476 100644 --- a/modules/ticket/front/sale/index.js +++ b/modules/ticket/front/sale/index.js @@ -516,7 +516,7 @@ class Controller extends Section { const params = {salesIds: salesIds}; const query = 'Sales/refund'; this.$http.post(query, params).then(res => { - const [refundTicket] = res.data; + const refundTicket = res.data; this.vnApp.showSuccess(this.$t('The following refund ticket have been created', { ticketId: refundTicket.id })); From 9f04581862ac73e8ec875aa9848dca7e28b50172 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 14:00:28 +0200 Subject: [PATCH 20/49] refs #5542 "importar reclamacion" crea un registro en ticketRefund --- .../back/methods/claim-beginning/importToNewRefundTicket.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js index f0686ffa6..83043f012 100644 --- a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js +++ b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js @@ -109,6 +109,11 @@ module.exports = Self => { zoneFk: zone.id }, myOptions); + await models.TicketRefund.create({ + refundTicketFk: newRefundTicket.id, + originalTicketFk: claim.ticket().id + }, myOptions); + await saveObservation({ description: `Reclama ticket: ${claim.ticketFk}`, ticketFk: newRefundTicket.id, From 2b74ab43aec5243fb7d86406777fb70707ea90fb Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 14:12:53 +0200 Subject: [PATCH 21/49] refactor front --- modules/claim/front/action/index.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/claim/front/action/index.html b/modules/claim/front/action/index.html index 81b14d3a7..9da51b8de 100644 --- a/modules/claim/front/action/index.html +++ b/modules/claim/front/action/index.html @@ -16,7 +16,7 @@ value="{{$ctrl.claimedTotal | currency: 'EUR':2}}"> - + - + label="Change destination" + disabled="$ctrl.checked.length == 0" + ng-click="changeDestination.show()"> + + + - - - + From e24366707b0b7d4be5b7d6ffd6c00012ed397812 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 21 Apr 2023 14:26:12 +0200 Subject: [PATCH 22/49] =?UTF-8?q?refactor:=20=20a=C3=B1adido=20focus=20a?= =?UTF-8?q?=20la=20seccion=20usuarios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/account/front/main/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/account/front/main/index.html b/modules/account/front/main/index.html index dd3489e9f..5872a328d 100644 --- a/modules/account/front/main/index.html +++ b/modules/account/front/main/index.html @@ -6,6 +6,7 @@ - \ No newline at end of file + From cd4f66e292118af0600563039be054e03a47f0a8 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 24 Apr 2023 08:48:35 +0200 Subject: [PATCH 23/49] refs #5540 arreglar e2e --- modules/worker/back/methods/worker/new.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/worker/back/methods/worker/new.js b/modules/worker/back/methods/worker/new.js index 144b07f10..5ff7135a7 100644 --- a/modules/worker/back/methods/worker/new.js +++ b/modules/worker/back/methods/worker/new.js @@ -196,7 +196,7 @@ module.exports = Self => { client = await models.Client.findById( user.id, - {fields: ['id', 'name', 'socialName', 'street', 'city', 'iban', 'bankEntityFk', 'defaultAddressFk']}, + {fields: ['id', 'name', 'socialName', 'street', 'city', 'iban', 'bankEntityFk', 'defaultAddressFk', 'fi']}, myOptions ); From 9b432bac85422c6ed415d3c762881c2aa5916e8b Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 24 Apr 2023 08:57:10 +0200 Subject: [PATCH 24/49] refs #5542 fix: test --- .../methods/invoiceOut/specs/refund.spec.js | 2 +- .../back/methods/sale/specs/refund.spec.js | 28 +++++++------------ .../front/descriptor-menu/index.spec.js | 2 +- modules/ticket/front/sale/index.spec.js | 3 +- 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/refund.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/refund.spec.js index c5a1ac603..35f2b4023 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/refund.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/refund.spec.js @@ -17,7 +17,7 @@ describe('InvoiceOut refund()', () => { try { const result = await models.InvoiceOut.refund('T1111111', options); - expect(result.length).toEqual(1); + expect(result).toBeDefined(); await tx.rollback(); } catch (e) { diff --git a/modules/ticket/back/methods/sale/specs/refund.spec.js b/modules/ticket/back/methods/sale/specs/refund.spec.js index 403b4b477..75cba89a9 100644 --- a/modules/ticket/back/methods/sale/specs/refund.spec.js +++ b/modules/ticket/back/methods/sale/specs/refund.spec.js @@ -22,9 +22,9 @@ describe('Sale refund()', () => { try { const options = {transaction: tx}; - const response = await models.Sale.refund(salesIds, servicesIds, false, options); + const refundedTicket = await models.Sale.refund(salesIds, servicesIds, false, options); - expect(response.length).toBeGreaterThanOrEqual(1); + expect(refundedTicket).toBeDefined(); await tx.rollback(); } catch (e) { @@ -33,7 +33,7 @@ describe('Sale refund()', () => { } }); - it('should create a ticket for each unique ticketFk in the sales', async() => { + it('should create one ticket for each unique ticketFk in the sales', async() => { const tx = await models.Sale.beginTransaction({}); const salesIds = [6, 7]; @@ -41,15 +41,11 @@ describe('Sale refund()', () => { const options = {transaction: tx}; const createSingleTicket = false; - const tickets = await models.Sale.refund(salesIds, servicesIds, createSingleTicket, options); + const ticket = await models.Sale.refund(salesIds, servicesIds, createSingleTicket, options); - const ticketsIds = tickets.map(ticket => ticket.id); - - const refundedTickets = await models.Ticket.find({ + const refundedTicket = await models.Ticket.findOne({ where: { - id: { - inq: ticketsIds - } + id: ticket.id }, include: [ { @@ -66,16 +62,12 @@ describe('Sale refund()', () => { ] }, options); - const firstRefoundedTicket = refundedTickets[0]; - const secondRefoundedTicket = refundedTickets[1]; - const salesLength = firstRefoundedTicket.ticketSales().length; - const componentsLength = firstRefoundedTicket.ticketSales()[0].components().length; - const servicesLength = secondRefoundedTicket.ticketServices().length; + const salesLength = refundedTicket.ticketSales().length; + const componentsLength = refundedTicket.ticketSales()[0].components().length; - expect(refundedTickets.length).toEqual(2); - expect(salesLength).toEqual(1); + expect(refundedTicket).toBeDefined(); + expect(salesLength).toEqual(2); expect(componentsLength).toEqual(4); - expect(servicesLength).toBeGreaterThanOrEqual(1); await tx.rollback(); } catch (e) { diff --git a/modules/ticket/front/descriptor-menu/index.spec.js b/modules/ticket/front/descriptor-menu/index.spec.js index babc22038..48998325a 100644 --- a/modules/ticket/front/descriptor-menu/index.spec.js +++ b/modules/ticket/front/descriptor-menu/index.spec.js @@ -250,7 +250,7 @@ describe('Ticket Component vnTicketDescriptorMenu', () => { const params = { ticketsIds: [16] }; - $httpBackend.expectPOST('Tickets/refund', params).respond([{id: 99}]); + $httpBackend.expectPOST('Tickets/refund', params).respond({id: 99}); controller.refund(); $httpBackend.flush(); diff --git a/modules/ticket/front/sale/index.spec.js b/modules/ticket/front/sale/index.spec.js index c35ed3d9a..5fb3b3df3 100644 --- a/modules/ticket/front/sale/index.spec.js +++ b/modules/ticket/front/sale/index.spec.js @@ -726,8 +726,7 @@ describe('Ticket', () => { salesIds: [1, 4], }; const refundTicket = {id: 99}; - const createdTickets = [refundTicket]; - $httpBackend.expect('POST', 'Sales/refund', params).respond(200, createdTickets); + $httpBackend.expect('POST', 'Sales/refund', params).respond(200, refundTicket); controller.createRefund(); $httpBackend.flush(); From 4983aa1632b2f010acff1c686415bf03acd79ad6 Mon Sep 17 00:00:00 2001 From: vicent Date: Mon, 24 Apr 2023 09:11:09 +0200 Subject: [PATCH 25/49] refs #5542 fix backTest --- modules/ticket/back/methods/sale/specs/refund.spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/ticket/back/methods/sale/specs/refund.spec.js b/modules/ticket/back/methods/sale/specs/refund.spec.js index 75cba89a9..83b3755e2 100644 --- a/modules/ticket/back/methods/sale/specs/refund.spec.js +++ b/modules/ticket/back/methods/sale/specs/refund.spec.js @@ -22,7 +22,7 @@ describe('Sale refund()', () => { try { const options = {transaction: tx}; - const refundedTicket = await models.Sale.refund(salesIds, servicesIds, false, options); + const refundedTicket = await models.Sale.refund(salesIds, servicesIds, options); expect(refundedTicket).toBeDefined(); @@ -40,8 +40,7 @@ describe('Sale refund()', () => { try { const options = {transaction: tx}; - const createSingleTicket = false; - const ticket = await models.Sale.refund(salesIds, servicesIds, createSingleTicket, options); + const ticket = await models.Sale.refund(salesIds, servicesIds, options); const refundedTicket = await models.Ticket.findOne({ where: { From a053764122b9688020ff5723dcbc0bf61ff5bf89 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 24 Apr 2023 12:59:56 +0200 Subject: [PATCH 26/49] refs #5517 E2E fixes --- e2e/helpers/extensions.js | 17 +++ e2e/helpers/selectors.js | 27 ---- .../02-client/07_edit_web_access.spec.js | 96 +++++-------- e2e/paths/13-supplier/03_fiscal_data.spec.js | 136 ++++++------------ modules/supplier/front/fiscal-data/index.html | 48 +++++-- 5 files changed, 130 insertions(+), 194 deletions(-) diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 1fcbfd616..b54afe5a7 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -218,6 +218,23 @@ let actions = { return handle.jsonValue(); }, + getValue: async function(selector) { + return await this.waitToGetProperty(selector, 'value'); + }, + + getValues: async function(selectorMap) { + const values = {}; + for (const key in selectorMap) + values[key] = await this.waitToGetProperty(selectorMap[key], 'value'); + return values; + }, + + innerText: async function(selector) { + const element = await this.$(selector); + const handle = await element.getProperty('innerText'); + return handle.jsonValue(); + }, + waitPropertyLength: async function(selector, property, minLength) { await this.waitForFunction((selector, property, minLength) => { const element = document.querySelector(selector); diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 7e8b91fa1..46dea0ddc 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -283,12 +283,6 @@ export default { cancelEditAddressButton: 'vn-client-address-edit > form > vn-button-bar > vn-button > button', watcher: 'vn-client-address-edit vn-watcher' }, - clientWebAccess: { - enableWebAccessCheckbox: 'vn-check[label="Enable web access"]', - userName: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.name"]', - email: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.email"]', - saveButton: 'button[type=submit]' - }, clientNotes: { addNoteFloatButton: 'vn-float-button', note: 'vn-textarea[ng-model="$ctrl.note.text"]', @@ -312,15 +306,6 @@ export default { clientMandate: { firstMandateText: 'vn-client-mandate vn-card vn-table vn-tbody > vn-tr' }, - clientLog: { - lastModificationPreviousValue: 'vn-client-log vn-tr table tr td.before', - lastModificationCurrentValue: 'vn-client-log vn-tr table tr td.after', - namePreviousValue: 'vn-client-log vn-tr table tr:nth-child(1) td.before', - nameCurrentValue: 'vn-client-log vn-tr table tr:nth-child(1) td.after', - activePreviousValue: 'vn-client-log vn-tr:nth-child(2) table tr:nth-child(2) td.before', - activeCurrentValue: 'vn-client-log vn-tr:nth-child(2) table tr:nth-child(2) td.after' - - }, clientBalance: { company: 'vn-client-balance-index vn-autocomplete[ng-model="$ctrl.companyId"]', newPaymentButton: `vn-float-button`, @@ -1361,18 +1346,6 @@ export default { notes: 'vn-supplier-basic-data vn-textarea[ng-model="$ctrl.supplier.note"]', saveButton: 'vn-supplier-basic-data button[type="submit"]', }, - supplierFiscalData: { - socialName: 'vn-supplier-fiscal-data vn-textfield[ng-model="$ctrl.supplier.name"]', - taxNumber: 'vn-supplier-fiscal-data vn-textfield[ng-model="$ctrl.supplier.nif"]', - account: 'vn-supplier-fiscal-data vn-textfield[ng-model="$ctrl.supplier.account"]', - sageTaxType: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.sageTaxTypeFk"]', - sageWihholding: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.sageWithholdingFk"]', - postCode: 'vn-supplier-fiscal-data vn-datalist[ng-model="$ctrl.supplier.postCode"]', - city: 'vn-supplier-fiscal-data vn-datalist[ng-model="$ctrl.supplier.city"]', - province: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.provinceFk"]', - country: 'vn-supplier-fiscal-data vn-autocomplete[ng-model="$ctrl.supplier.countryFk"]', - saveButton: 'vn-supplier-fiscal-data button[type="submit"]', - }, supplierBillingData: { payMethod: 'vn-supplier-billing-data vn-autocomplete[ng-model="$ctrl.supplier.payMethodFk"]', payDem: 'vn-supplier-billing-data vn-autocomplete[ng-model="$ctrl.supplier.payDemFk"]', diff --git a/e2e/paths/02-client/07_edit_web_access.spec.js b/e2e/paths/02-client/07_edit_web_access.spec.js index 29b39f788..dfcc8604a 100644 --- a/e2e/paths/02-client/07_edit_web_access.spec.js +++ b/e2e/paths/02-client/07_edit_web_access.spec.js @@ -1,88 +1,56 @@ -/* eslint max-len: ["error", { "code": 150 }]*/ -import selectors from '../../helpers/selectors'; import getBrowser from '../../helpers/puppeteer'; -describe('Client Edit web access path', () => { +const $ = { + enableWebAccess: 'vn-client-web-access vn-check[label="Enable web access"]', + userName: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.name"]', + email: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.email"]', + saveButton: 'vn-client-web-access button[type=submit]', + nameValue: 'vn-client-log tbody:nth-child(2) .basic-json:nth-child(1) vn-json-value', + activeValue: 'vn-client-log tbody:nth-child(3) .basic-json:nth-child(2) vn-json-value' +}; + +describe('Client web access path', () => { let browser; let page; + beforeAll(async() => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('salesPerson', 'client'); await page.accessToSearchResult('max'); - await page.accessToSection('client.card.webAccess'); }); afterAll(async() => { await browser.close(); }); - it('should uncheck the Enable web access checkbox', async() => { - await page.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox); - await page.waitToClick(selectors.clientWebAccess.saveButton); - const message = await page.waitForSnackbar(); + it('should modify and save web access attributes', async() => { + await page.accessToSection('client.card.webAccess'); + await page.click($.enableWebAccess); + await page.click($.saveButton); + const enableMessage = await page.waitForSnackbar(); + await page.overwrite($.userName, 'Legion'); + await page.overwrite($.email, 'legion@marvel.com'); + await page.click($.saveButton); + const modifyMessage = await page.waitForSnackbar(); - expect(message.text).toContain('Data saved!'); - }); - - it(`should update the name`, async() => { - await page.clearInput(selectors.clientWebAccess.userName); - await page.write(selectors.clientWebAccess.userName, 'Legion'); - await page.waitToClick(selectors.clientWebAccess.saveButton); - const message = await page.waitForSnackbar(); - - expect(message.text).toContain('Data saved!'); - }); - - it(`should update the email`, async() => { - await page.clearInput(selectors.clientWebAccess.email); - await page.write(selectors.clientWebAccess.email, 'legion@marvel.com'); - await page.waitToClick(selectors.clientWebAccess.saveButton); - const message = await page.waitForSnackbar(); - - expect(message.text).toContain('Data saved!'); - }); - - it('should reload the section and confirm web access is now unchecked', async() => { await page.reloadSection('client.card.webAccess'); - const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox); + const hasAccess = await page.checkboxState($.enableWebAccess); + const userName = await page.getValue($.userName); + const email = await page.getValue($.email); - expect(result).toBe('unchecked'); - }); - - it('should confirm web access name have been updated', async() => { - const result = await page.waitToGetProperty(selectors.clientWebAccess.userName, 'value'); - - expect(result).toEqual('Legion'); - }); - - it('should confirm web access email have been updated', async() => { - const result = await page.waitToGetProperty(selectors.clientWebAccess.email, 'value'); - - expect(result).toEqual('legion@marvel.com'); - }); - - it(`should navigate to the log section`, async() => { await page.accessToSection('client.card.log'); - }); + const logName = await page.innerText($.nameValue); + const logActive = await page.innerText($.activeValue); - it(`should confirm the last log shows the updated client name and no modifications on active checkbox`, async() => { - let namePreviousValue = await page - .waitToGetProperty(selectors.clientLog.namePreviousValue, 'innerText'); - let nameCurrentValue = await page - .waitToGetProperty(selectors.clientLog.nameCurrentValue, 'innerText'); + expect(enableMessage.type).toBe('success'); + expect(modifyMessage.type).toBe('success'); - expect(namePreviousValue).toEqual('MaxEisenhardt'); - expect(nameCurrentValue).toEqual('Legion'); - }); + expect(hasAccess).toBe('unchecked'); + expect(userName).toEqual('Legion'); + expect(email).toEqual('legion@marvel.com'); - it(`should confirm the penultimate log shows the updated active and no modifications on client name`, async() => { - let activePreviousValue = await page - .waitToGetProperty(selectors.clientLog.activePreviousValue, 'innerText'); - let activeCurrentValue = await page - .waitToGetProperty(selectors.clientLog.activeCurrentValue, 'innerText'); - - expect(activePreviousValue).toEqual('✓'); - expect(activeCurrentValue).toEqual('✗'); + expect(logName).toEqual('Legion'); + expect(logActive).toEqual('✗'); }); }); diff --git a/e2e/paths/13-supplier/03_fiscal_data.spec.js b/e2e/paths/13-supplier/03_fiscal_data.spec.js index 4f9581e32..31b3fafd2 100644 --- a/e2e/paths/13-supplier/03_fiscal_data.spec.js +++ b/e2e/paths/13-supplier/03_fiscal_data.spec.js @@ -1,7 +1,21 @@ -import selectors from '../../helpers/selectors.js'; import getBrowser from '../../helpers/puppeteer'; -describe('Supplier fiscal data path', () => { +const $ = { + saveButton: 'vn-supplier-fiscal-data button[type="submit"]', +}; +const $inputs = { + province: 'vn-supplier-fiscal-data [name="province"]', + country: 'vn-supplier-fiscal-data [name="country"]', + postcode: 'vn-supplier-fiscal-data [name="postcode"]', + city: 'vn-supplier-fiscal-data [name="city"]', + socialName: 'vn-supplier-fiscal-data [name="socialName"]', + taxNumber: 'vn-supplier-fiscal-data [name="taxNumber"]', + account: 'vn-supplier-fiscal-data [name="account"]', + sageWithholding: 'vn-supplier-fiscal-data [ng-model="$ctrl.supplier.sageWithholdingFk"]', + sageTaxType: 'vn-supplier-fiscal-data [ng-model="$ctrl.supplier.sageTaxTypeFk"]' +}; + +fdescribe('Supplier fiscal data path', () => { let browser; let page; @@ -10,102 +24,44 @@ describe('Supplier fiscal data path', () => { page = browser.page; await page.loginAndModule('administrative', 'supplier'); await page.accessToSearchResult('2'); - await page.accessToSection('supplier.card.fiscalData'); }); afterAll(async() => { await browser.close(); }); - it('should attempt to edit the fiscal data but fail as the tax number is invalid', async() => { - await page.clearInput(selectors.supplierFiscalData.city); - await page.clearInput(selectors.supplierFiscalData.province); - await page.clearInput(selectors.supplierFiscalData.country); - await page.clearInput(selectors.supplierFiscalData.postCode); - await page.write(selectors.supplierFiscalData.city, 'Valencia'); - await page.waitForTimeout(1000); // must repeat this action twice or fails. also #2699 may be a cool solution to this. - await page.clearInput(selectors.supplierFiscalData.city); - await page.write(selectors.supplierFiscalData.city, 'Valencia'); - await page.clearInput(selectors.supplierFiscalData.socialName); - await page.write(selectors.supplierFiscalData.socialName, 'Farmer King SL'); - await page.clearInput(selectors.supplierFiscalData.taxNumber); - await page.write(selectors.supplierFiscalData.taxNumber, 'Wrong tax number'); - await page.clearInput(selectors.supplierFiscalData.account); - await page.write(selectors.supplierFiscalData.account, '0123456789'); - await page.autocompleteSearch(selectors.supplierFiscalData.sageWihholding, 'retencion estimacion objetiva'); - await page.autocompleteSearch(selectors.supplierFiscalData.sageTaxType, 'operaciones no sujetas'); + it('should attempt to edit the fiscal data and check data is saved', async() => { + await page.accessToSection('supplier.card.fiscalData'); + await page.clearInput($inputs.province); + await page.clearInput($inputs.country); + await page.clearInput($inputs.postcode); + await page.overwrite($inputs.city, 'Valencia'); + await page.overwrite($inputs.socialName, 'Farmer King SL'); + await page.overwrite($inputs.taxNumber, 'Wrong tax number'); + await page.overwrite($inputs.account, '0123456789'); + await page.autocompleteSearch($inputs.sageWithholding, 'retencion estimacion objetiva'); + await page.autocompleteSearch($inputs.sageTaxType, 'operaciones no sujetas'); + await page.click($.saveButton); + const errorMessage = await page.waitForSnackbar(); + await page.overwrite($inputs.taxNumber, '12345678Z'); + await page.click($.saveButton); + const successMessage = await page.waitForSnackbar(); - await page.waitToClick(selectors.supplierFiscalData.saveButton); - const message = await page.waitForSnackbar(); - - expect(message.text).toContain('Invalid Tax number'); - }); - - it('should save the changes as the tax number is valid this time', async() => { - await page.clearInput(selectors.supplierFiscalData.taxNumber); - await page.write(selectors.supplierFiscalData.taxNumber, '12345678Z'); - - await page.waitToClick(selectors.supplierFiscalData.saveButton); - const message = await page.waitForSnackbar(); - - expect(message.text).toContain('Data saved!'); - }); - - it('should reload the section', async() => { await page.reloadSection('supplier.card.fiscalData'); - }); + const values = await page.getValues($inputs); - it('should check the socialName was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.socialName, 'value'); - - expect(result).toEqual('Farmer King SL'); - }); - - it('should check the taxNumber was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.taxNumber, 'value'); - - expect(result).toEqual('12345678Z'); - }); - - it('should check the account was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.account, 'value'); - - expect(result).toEqual('0123456789'); - }); - - it('should check the sageWihholding was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.sageWihholding, 'value'); - - expect(result).toEqual('RETENCION ESTIMACION OBJETIVA'); - }); - - it('should check the sageTaxType was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.sageTaxType, 'value'); - - expect(result).toEqual('Operaciones no sujetas'); - }); - - it('should check the postCode was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.postCode, 'value'); - - expect(result).toEqual('46000'); - }); - - it('should check the city was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.city, 'value'); - - expect(result).toEqual('Valencia'); - }); - - it('should check the province was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.province, 'value'); - - expect(result).toEqual('Province one (España)'); - }); - - it('should check the country was edited', async() => { - const result = await page.waitToGetProperty(selectors.supplierFiscalData.country, 'value'); - - expect(result).toEqual('España'); + expect(errorMessage.text).toContain('Invalid Tax number'); + expect(successMessage.type).toBe('success'); + expect(values).toEqual({ + province: 'Province one (España)', + country: 'España', + postcode: '46000', + city: 'Valencia', + socialName: 'Farmer King SL', + taxNumber: '12345678Z', + account: '0123456789', + sageWithholding: 'RETENCION ESTIMACION OBJETIVA', + sageTaxType: 'Operaciones no sujetas' + }); }); }); diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html index ccbd5b0d9..3c5f64dcf 100644 --- a/modules/supplier/front/fiscal-data/index.html +++ b/modules/supplier/front/fiscal-data/index.html @@ -42,6 +42,7 @@ vn-two vn-focus label="Social name" + name="socialName" ng-model="$ctrl.supplier.name" info="Only letters, numbers and spaces can be used" required="true" @@ -50,6 +51,7 @@ @@ -59,35 +61,42 @@ - - - @@ -95,12 +104,14 @@ - - - - - From 49368a837bfefcfe3653c4ed982d6d48793c263c Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 24 Apr 2023 19:10:04 +0200 Subject: [PATCH 27/49] refs #5517 Filter improved --- front/salix/components/log/index.html | 23 +++++++--- front/salix/components/log/index.js | 20 +++++++-- loopback/common/methods/log/editors.js | 40 +++++++++++++++++ loopback/common/methods/log/models.js | 44 +++++++++++++++++++ loopback/common/models/log.js | 10 +++++ loopback/common/models/log.json | 4 ++ loopback/common/models/vn-model.js | 6 ++- modules/account/back/models/role-log.json | 2 +- modules/account/back/models/user-log.json | 2 +- modules/claim/back/models/claim-log.json | 4 +- modules/client/back/models/client-log.json | 4 +- modules/entry/back/models/entry-log.json | 4 +- .../invoiceIn/back/models/invoice-in-log.json | 4 +- modules/item/back/models/item-log.json | 6 +-- modules/route/back/models/route-log.json | 4 +- .../shelving/back/models/shelving-log.json | 4 +- .../supplier/back/models/supplier-log.json | 4 +- modules/ticket/back/models/ticket-log.json | 4 +- modules/travel/back/models/travel-log.json | 4 +- .../back/models/device-production-log.json | 2 +- modules/worker/back/models/worker-log.json | 4 +- modules/zone/back/models/zone-log.json | 4 +- 22 files changed, 163 insertions(+), 40 deletions(-) create mode 100644 loopback/common/methods/log/editors.js create mode 100644 loopback/common/methods/log/models.js create mode 100644 loopback/common/models/log.js create mode 100644 loopback/common/models/log.json diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 3d3a3f8dc..5ebdabbf0 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -3,13 +3,18 @@ url="{{$ctrl.url}}" filter="$ctrl.filter" link="{originFk: $ctrl.originId}" - where="{changedModel: $ctrl.changedModel, - changedModelId: $ctrl.changedModelId}" + where="{changedModel: $ctrl.changedModel, changedModelId: $ctrl.changedModelId}" data="$ctrl.logs" order="creationDate DESC, id DESC" limit="20" auto-load="true"> + +
@@ -120,10 +125,13 @@ ng-submit="$ctrl.applyFilter(filter)" ng-model-options="{updateOn: 'change blur'}" class="vn-pa-md filter"> - - + ng-model="filter.changedModel" + value-field="changedModel" + show-field="changedModel" + data="models"> + @@ -135,7 +143,8 @@ show-field="nickname" fields="['id', 'name', 'nickname']" search-function="$ctrl.searchUser($search)" - url="VnUsers"> + url="{{$ctrl.url}}/{{$ctrl.originId}}/editors" + order="nickname">
{{nickname}}
{{name}}
@@ -172,7 +181,7 @@ ng-model="filter.to"> - + this.applyFilter(), true); - $.$watch('filter.from', () => $.filter.to = $.filter.from); - this.filter = { include: [{ relation: 'user', @@ -45,6 +42,23 @@ export default class Controller extends Section { this.today.setHours(0, 0, 0, 0); } + $onInit() { + const {$} = this; + $.$watch( + () => [ + $.filter.actions, + $.filter.changedModel, + $.filter.userFk + ], + () => this.applyFilter(), + true + ); + $.$watch( + () => $.filter.from, + () => $.filter.to = $.filter.from + ); + } + get logs() { return this._logs; } diff --git a/loopback/common/methods/log/editors.js b/loopback/common/methods/log/editors.js new file mode 100644 index 000000000..4c0b6d2d5 --- /dev/null +++ b/loopback/common/methods/log/editors.js @@ -0,0 +1,40 @@ +const mergeFilters = require('vn-loopback/util/filter').mergeFilters; + +module.exports = Self => { + Self.remoteMethod('editors', { + description: 'Get the list of entity editors', + accepts: [ + { + arg: 'id', + type: 'integer', + description: 'The model id', + required: true + }, { + arg: 'filter', + type: 'Object', + description: 'The user filter object' + } + ], + returns: { + type: [Self], + root: true + }, + http: { + path: `/:id/editors`, + verb: 'GET' + } + }); + + Self.editors = async(id, filter) => { + const res = await Self.find({ + fields: ['userFk'], + where: {originFk: id} + }); + const userIds = new Set(res.map(x => x.userFk)); + + filter = mergeFilters(filter, { + where: {id: {inq: [...userIds]}} + }); + return await Self.app.models.VnUser.find(filter); + }; +}; diff --git a/loopback/common/methods/log/models.js b/loopback/common/methods/log/models.js new file mode 100644 index 000000000..ec3eac1ad --- /dev/null +++ b/loopback/common/methods/log/models.js @@ -0,0 +1,44 @@ +const mergeFilters = require('vn-loopback/util/filter').mergeFilters; + +module.exports = Self => { + Self.remoteMethod('models', { + description: 'Get the list of entity models', + accepts: [ + { + arg: 'id', + type: 'integer', + description: 'The model id', + required: true + }, { + arg: 'filter', + type: 'Object', + description: 'The filter object' + } + ], + returns: { + type: [Self], + root: true + }, + http: { + path: `/:id/models`, + verb: 'GET' + } + }); + + Self.models = async(id, filter) => { + filter = mergeFilters(filter, { + fields: ['changedModel'], + where: { + originFk: id, + changedModel: {neq: null} + } + }); + const res = await Self.find(filter); + + const set = new Set(); + return res.filter(x => set.has(x.changedModel) + ? false + : set.add(x.changedModel) + ); + }; +}; diff --git a/loopback/common/models/log.js b/loopback/common/models/log.js new file mode 100644 index 000000000..0622431a6 --- /dev/null +++ b/loopback/common/models/log.js @@ -0,0 +1,10 @@ + +module.exports = function(Self) { + Object.assign(Self, { + setup() { + Self.super_.setup.call(this); + require('../methods/log/editors')(this); + require('../methods/log/models')(this); + } + }); +}; diff --git a/loopback/common/models/log.json b/loopback/common/models/log.json new file mode 100644 index 000000000..54046f072 --- /dev/null +++ b/loopback/common/models/log.json @@ -0,0 +1,4 @@ +{ + "name": "Log", + "base": "VnModel" +} diff --git a/loopback/common/models/vn-model.js b/loopback/common/models/vn-model.js index f57fb3c30..f469e893a 100644 --- a/loopback/common/models/vn-model.js +++ b/loopback/common/models/vn-model.js @@ -28,12 +28,14 @@ module.exports = function(Self) { }); // Register field ACL validation - /* this.beforeRemote('prototype.patchAttributes', ctx => this.checkUpdateAcls(ctx)); + /* + this.beforeRemote('prototype.patchAttributes', ctx => this.checkUpdateAcls(ctx)); this.beforeRemote('updateAll', ctx => this.checkUpdateAcls(ctx)); this.beforeRemote('patchOrCreate', ctx => this.checkInsertAcls(ctx)); this.beforeRemote('create', ctx => this.checkInsertAcls(ctx)); this.beforeRemote('replaceById', ctx => this.checkInsertAcls(ctx)); - this.beforeRemote('replaceOrCreate', ctx => this.checkInsertAcls(ctx)); */ + this.beforeRemote('replaceOrCreate', ctx => this.checkInsertAcls(ctx)); + */ this.remoteMethod('crud', { description: `Create, update or/and delete instances from model with a single request`, diff --git a/modules/account/back/models/role-log.json b/modules/account/back/models/role-log.json index b4fc3daf9..510e98b68 100644 --- a/modules/account/back/models/role-log.json +++ b/modules/account/back/models/role-log.json @@ -1,6 +1,6 @@ { "name": "RoleLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "account.roleLog" diff --git a/modules/account/back/models/user-log.json b/modules/account/back/models/user-log.json index 01acb0176..c5aa08e05 100644 --- a/modules/account/back/models/user-log.json +++ b/modules/account/back/models/user-log.json @@ -1,6 +1,6 @@ { "name": "UserLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "account.userLog" diff --git a/modules/claim/back/models/claim-log.json b/modules/claim/back/models/claim-log.json index bb6af02b4..9f28af63e 100644 --- a/modules/claim/back/models/claim-log.json +++ b/modules/claim/back/models/claim-log.json @@ -1,6 +1,6 @@ { "name": "ClaimLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "claimLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/client/back/models/client-log.json b/modules/client/back/models/client-log.json index 28b767b2a..316dbe972 100644 --- a/modules/client/back/models/client-log.json +++ b/modules/client/back/models/client-log.json @@ -1,6 +1,6 @@ { "name": "ClientLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "clientLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/entry/back/models/entry-log.json b/modules/entry/back/models/entry-log.json index 7415a3efe..b4370e3bc 100644 --- a/modules/entry/back/models/entry-log.json +++ b/modules/entry/back/models/entry-log.json @@ -1,6 +1,6 @@ { "name": "EntryLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "entryLog" @@ -55,4 +55,4 @@ "scope": { "order": ["creationDate DESC", "id DESC"] } -} \ No newline at end of file +} diff --git a/modules/invoiceIn/back/models/invoice-in-log.json b/modules/invoiceIn/back/models/invoice-in-log.json index b5c5afea9..70892d0f9 100644 --- a/modules/invoiceIn/back/models/invoice-in-log.json +++ b/modules/invoiceIn/back/models/invoice-in-log.json @@ -1,6 +1,6 @@ { "name": "InvoiceInLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "invoiceInLog" @@ -58,4 +58,4 @@ "id DESC" ] } -} \ No newline at end of file +} diff --git a/modules/item/back/models/item-log.json b/modules/item/back/models/item-log.json index 5bab2af86..19c132187 100644 --- a/modules/item/back/models/item-log.json +++ b/modules/item/back/models/item-log.json @@ -1,6 +1,6 @@ { "name": "ItemLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "itemLog" @@ -12,7 +12,7 @@ "type": "number", "forceId": false }, - "originFk": { + "originFk": { "type": "number", "required": true }, @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/route/back/models/route-log.json b/modules/route/back/models/route-log.json index c8b7b5e9b..93f570593 100644 --- a/modules/route/back/models/route-log.json +++ b/modules/route/back/models/route-log.json @@ -1,6 +1,6 @@ { "name": "RouteLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "routeLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/shelving/back/models/shelving-log.json b/modules/shelving/back/models/shelving-log.json index d47058b8b..e8245f770 100644 --- a/modules/shelving/back/models/shelving-log.json +++ b/modules/shelving/back/models/shelving-log.json @@ -1,6 +1,6 @@ { "name": "ShelvingLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "shelvingLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/supplier/back/models/supplier-log.json b/modules/supplier/back/models/supplier-log.json index b88266988..86fa2e54a 100644 --- a/modules/supplier/back/models/supplier-log.json +++ b/modules/supplier/back/models/supplier-log.json @@ -1,6 +1,6 @@ { "name": "SupplierLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "supplierLog" @@ -55,4 +55,4 @@ "scope": { "order": ["creationDate DESC", "id DESC"] } -} \ No newline at end of file +} diff --git a/modules/ticket/back/models/ticket-log.json b/modules/ticket/back/models/ticket-log.json index 516ea506c..df04348da 100644 --- a/modules/ticket/back/models/ticket-log.json +++ b/modules/ticket/back/models/ticket-log.json @@ -1,6 +1,6 @@ { "name": "TicketLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "ticketLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/travel/back/models/travel-log.json b/modules/travel/back/models/travel-log.json index a72d9e0a5..e781c2948 100644 --- a/modules/travel/back/models/travel-log.json +++ b/modules/travel/back/models/travel-log.json @@ -1,6 +1,6 @@ { "name": "TravelLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "travelLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/worker/back/models/device-production-log.json b/modules/worker/back/models/device-production-log.json index c935398fc..71c54a9c1 100644 --- a/modules/worker/back/models/device-production-log.json +++ b/modules/worker/back/models/device-production-log.json @@ -1,6 +1,6 @@ { "name": "DeviceProductionLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "deviceProductionLog" diff --git a/modules/worker/back/models/worker-log.json b/modules/worker/back/models/worker-log.json index 3cd5f9010..6eb8b75be 100644 --- a/modules/worker/back/models/worker-log.json +++ b/modules/worker/back/models/worker-log.json @@ -1,6 +1,6 @@ { "name": "WorkerLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "workerLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] diff --git a/modules/zone/back/models/zone-log.json b/modules/zone/back/models/zone-log.json index e84153467..72dd305b2 100644 --- a/modules/zone/back/models/zone-log.json +++ b/modules/zone/back/models/zone-log.json @@ -1,6 +1,6 @@ { "name": "ZoneLog", - "base": "VnModel", + "base": "Log", "options": { "mysql": { "table": "zoneLog" @@ -50,7 +50,7 @@ "type": "belongsTo", "model": "VnUser", "foreignKey": "userFk" - } + } }, "scope": { "order": ["creationDate DESC", "id DESC"] From 618100b68a86e35f24009c2e19271bcb550a7328 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 25 Apr 2023 10:40:24 +0200 Subject: [PATCH 28/49] refs #5542 eliminados procesos que no se usan --- db/changes/231601/00-deleteProcs_refund.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 db/changes/231601/00-deleteProcs_refund.sql diff --git a/db/changes/231601/00-deleteProcs_refund.sql b/db/changes/231601/00-deleteProcs_refund.sql new file mode 100644 index 000000000..8bf8982f4 --- /dev/null +++ b/db/changes/231601/00-deleteProcs_refund.sql @@ -0,0 +1,2 @@ +DROP PROCEDURE `vn`.`refund`; +DROP PROCEDURE `vn`.`ticket_doRefund`; From a6653c5622008d66e6295f171c1744b8a42b08a9 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 25 Apr 2023 10:40:35 +0200 Subject: [PATCH 29/49] refs #5542 fix e2e --- e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index 323646d29..1b3204046 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -246,6 +246,7 @@ describe('Ticket Edit sale path', () => { it('should select the third sale and create a claim of it', async() => { await page.accessToSearchResult('16'); await page.accessToSection('ticket.card.sale'); + await page.waitToClick(selectors.ticketSales.firstSaleCheckbox); await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox); await page.waitToClick(selectors.ticketSales.moreMenu); await page.waitToClick(selectors.ticketSales.moreMenuCreateClaim); From 1219cfcc5ca32bf6c6055982c176fbb35c78fd16 Mon Sep 17 00:00:00 2001 From: alexandre Date: Wed, 26 Apr 2023 12:03:17 +0200 Subject: [PATCH 30/49] refs #5255 fixed condition --- modules/ticket/back/methods/boxing/getVideoList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/boxing/getVideoList.js b/modules/ticket/back/methods/boxing/getVideoList.js index 3d45a720d..ba989936e 100644 --- a/modules/ticket/back/methods/boxing/getVideoList.js +++ b/modules/ticket/back/methods/boxing/getVideoList.js @@ -53,7 +53,7 @@ module.exports = Self => { let start = new Date(expedition.created); let end = new Date(start.getTime() + (packingSiteConfig.avgBoxingTime * 1000)); - if (from && to) { + if (from != undefined && to != undefined) { start.setHours(from, 0, 0); end.setHours(to, 0, 0); } From 480784ee18aac40baa1473799d124128428322c2 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 26 Apr 2023 13:48:31 +0200 Subject: [PATCH 31/49] refs #084200 cambio nombre --- db/changes/231601/{00-insertI18n.sql => 01-insert.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename db/changes/231601/{00-insertI18n.sql => 01-insert.sql} (100%) diff --git a/db/changes/231601/00-insertI18n.sql b/db/changes/231601/01-insert.sql similarity index 100% rename from db/changes/231601/00-insertI18n.sql rename to db/changes/231601/01-insert.sql From 09c1d7e393ef62efe3f6d3f12ca72d331d3427f1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 26 Apr 2023 14:30:58 +0200 Subject: [PATCH 32/49] refs #084200 add table --- db/changes/231601/01-insert.sql | 5 ----- db/export-data.sh | 1 + 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 db/changes/231601/01-insert.sql diff --git a/db/changes/231601/01-insert.sql b/db/changes/231601/01-insert.sql deleted file mode 100644 index f86cb6a73..000000000 --- a/db/changes/231601/01-insert.sql +++ /dev/null @@ -1,5 +0,0 @@ -INSERT INTO `vn`.`companyI18n` (`companyFk`, `lang`, `footnotes`) -VALUES (442, 'en', 'In compliance with the provisions of Organic Law 15/1999, on the Protection of Personal Data, we inform you that the personal data you provide will be included in automated files of VERDNATURA LEVANTE SL, being able at all times to exercise the rights of access, rectification, cancellation and opposition, communicating it in writing to the registered office of the entity. The purpose of the file is administrative management, accounting, and billing.'), - (442, 'es', 'En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.'), - (442, 'fr', 'Conformément aux dispositions de la loi organique 15/1999 sur la protection des données personnelles, nous vous informons que les données personnelles que vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous pouvez à tout moment, exercer les droits d``accès, de rectification, d``annulation et d``opposition, en communiquant par écrit au siège social de la société. Le dossier a pour objet la gestion administrative, la comptabilité et la facturation.'), - (442, 'pt', 'Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão administrativa, contabilidade e facturação.'); diff --git a/db/export-data.sh b/db/export-data.sh index bdf8049e0..11358e64c 100755 --- a/db/export-data.sh +++ b/db/export-data.sh @@ -68,6 +68,7 @@ TABLES=( time volumeConfig workCenter + companyI18n ) dump_tables ${TABLES[@]} From 34bb216f17c2ed909d78e946a9b0e28980fb4ae6 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 27 Apr 2023 08:53:54 +0200 Subject: [PATCH 33/49] deploy(231601): dev to test --- db/changes/231601/00-User.sql | 21 -------------- e2e/helpers/selectors.js | 2 +- ..._smartTable_searchBar_integrations.spec.js | 8 ++--- e2e/paths/05-ticket/21_future.spec.js | 3 +- e2e/paths/09-invoice-in/05_serial.spec.js | 2 +- loopback/locale/en.json | 29 ++++++++++--------- 6 files changed, 21 insertions(+), 44 deletions(-) delete mode 100644 db/changes/231601/00-User.sql diff --git a/db/changes/231601/00-User.sql b/db/changes/231601/00-User.sql deleted file mode 100644 index 6c80d2c2d..000000000 --- a/db/changes/231601/00-User.sql +++ /dev/null @@ -1,21 +0,0 @@ -create or replace definer = root@localhost view User as -select `account`.`user`.`id` AS `id`, - `account`.`user`.`realm` AS `realm`, - `account`.`user`.`name` AS `name`, - `account`.`user`.`nickname` AS `nickname`, - `account`.`user`.`bcryptPassword` AS `password`, - `account`.`user`.`role` AS `role`, - `account`.`user`.`active` AS `active`, - `account`.`user`.`email` AS `email`, - `account`.`user`.`emailVerified` AS `emailVerified`, - `account`.`user`.`verificationToken` AS `verificationToken`, - `account`.`user`.`lang` AS `lang`, - `account`.`user`.`lastPassChange` AS `lastPassChange`, - `account`.`user`.`created` AS `created`, - `account`.`user`.`updated` AS `updated`, - `account`.`user`.`image` AS `image`, - `account`.`user`.`recoverPass` AS `recoverPass`, - `account`.`user`.`sync` AS `sync`, - `account`.`user`.`hasGrant` AS `hasGrant` -from `account`.`user`; - diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 7e8b91fa1..04b9007b9 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -755,6 +755,7 @@ export default { anyDocument: 'vn-ticket-dms-index > vn-data-viewer vn-tbody vn-tr' }, ticketFuture: { + searchResult: 'vn-ticket-future tbody tr', openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]', originDated: 'vn-date-picker[label="Origin date"]', futureDated: 'vn-date-picker[label="Destination date"]', @@ -770,7 +771,6 @@ export default { problems: 'vn-check[label="With problems"]', tableButtonSearch: 'vn-button[vn-tooltip="Search"]', moveButton: 'vn-button[vn-tooltip="Future tickets"]', - acceptButton: '.vn-confirm.shown button[response="accept"]', firstCheck: 'tbody > tr:nth-child(1) > td > vn-check', multiCheck: 'vn-multi-check', tableId: 'vn-textfield[name="id"]', diff --git a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js index 25735e50a..f9844d5f7 100644 --- a/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js +++ b/e2e/paths/01-salix/03_smartTable_searchBar_integrations.spec.js @@ -81,9 +81,7 @@ describe('SmartTable SearchBar integration', () => { await page.accessToSection('item.fixedPrice'); await page.keyboard.press('Enter'); - const result = await page.waitToGetProperty(selectors.itemFixedPrice.firstItemID, 'value'); - - expect(result).toEqual('1'); + await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '1'); }); it('should order by last id, reload page and have same order', async() => { @@ -91,9 +89,7 @@ describe('SmartTable SearchBar integration', () => { await page.reload({ waitUntil: 'networkidle2' }); - const result = await page.waitToGetProperty(selectors.itemFixedPrice.firstItemID, 'value'); - - expect(result).toEqual('13'); + await page.waitForTextInField(selectors.itemFixedPrice.firstItemID, '13'); }); }); }); diff --git a/e2e/paths/05-ticket/21_future.spec.js b/e2e/paths/05-ticket/21_future.spec.js index 626056958..783b0c9b2 100644 --- a/e2e/paths/05-ticket/21_future.spec.js +++ b/e2e/paths/05-ticket/21_future.spec.js @@ -126,10 +126,11 @@ describe('Ticket Future path', () => { }); it('should check the three last tickets and move to the future', async() => { + await page.waitForNumberOfElements(selectors.ticketFuture.searchResult, 4); await page.waitToClick(selectors.ticketFuture.multiCheck); await page.waitToClick(selectors.ticketFuture.firstCheck); await page.waitToClick(selectors.ticketFuture.moveButton); - await page.waitToClick(selectors.ticketFuture.acceptButton); + await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); expect(message.text).toContain('Tickets moved successfully!'); diff --git a/e2e/paths/09-invoice-in/05_serial.spec.js b/e2e/paths/09-invoice-in/05_serial.spec.js index 3aa94f48c..8be5660da 100644 --- a/e2e/paths/09-invoice-in/05_serial.spec.js +++ b/e2e/paths/09-invoice-in/05_serial.spec.js @@ -35,7 +35,7 @@ describe('InvoiceIn serial path', () => { }); it('should go to index and check if the search-panel has the correct params', async() => { - await page.click(selectors.invoiceInSerial.goToIndex); + await page.waitToClick(selectors.invoiceInSerial.goToIndex); const params = await page.$$(selectors.invoiceInIndex.topbarSearchParams); const serial = await params[0].getProperty('title'); const isBooked = await params[1].getProperty('title'); diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 5767632ee..ae0da8170 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -156,18 +156,19 @@ "Component cost not set": "Componente coste no está estabecido", "Tickets with associated refunds can't be deleted. This ticket is associated with refund Nº 2": "Tickets with associated refunds can't be deleted. This ticket is associated with refund Nº 2", "Description cannot be blank": "Description cannot be blank", - "company": "Company", - "country": "Country", - "clientId": "Id client", - "clientSocialName": "Client", - "amount": "Amount", - "taxableBase": "Taxable base", - "ticketFk": "Id ticket", - "isActive": "Active", - "hasToInvoice": "Invoice", - "isTaxDataChecked": "Data checked", - "comercialId": "Id Comercial", - "comercialName": "Comercial", + "company": "Company", + "country": "Country", + "clientId": "Id client", + "clientSocialName": "Client", + "amount": "Amount", + "taxableBase": "Taxable base", + "ticketFk": "Id ticket", + "isActive": "Active", + "hasToInvoice": "Invoice", + "isTaxDataChecked": "Data checked", + "comercialId": "Id Comercial", + "comercialName": "Comercial", "Added observation": "Added observation", - "Comment added to client": "Comment added to client" -} + "Comment added to client": "Comment added to client", + "This ticket is already a refund": "This ticket is already a refund" +} \ No newline at end of file From dd4d0bca84a540bd2729aa67719c41a083188e02 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 27 Apr 2023 10:39:58 +0200 Subject: [PATCH 34/49] refs #5540 delete tinIsValid, solve test back, e2e --- e2e/paths/13-supplier/03_fiscal_data.spec.js | 2 +- .../supplier/specs/newSupplier.spec.js | 5 +-- modules/supplier/back/models/supplier.js | 31 ++++++++++--------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/e2e/paths/13-supplier/03_fiscal_data.spec.js b/e2e/paths/13-supplier/03_fiscal_data.spec.js index 4f9581e32..45e11fbe1 100644 --- a/e2e/paths/13-supplier/03_fiscal_data.spec.js +++ b/e2e/paths/13-supplier/03_fiscal_data.spec.js @@ -38,7 +38,7 @@ describe('Supplier fiscal data path', () => { await page.waitToClick(selectors.supplierFiscalData.saveButton); const message = await page.waitForSnackbar(); - expect(message.text).toContain('Invalid Tax number'); + expect(message.text).toContain('Data saved!'); }); it('should save the changes as the tax number is valid this time', async() => { diff --git a/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js index d4479d00b..c368ec1b8 100644 --- a/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js +++ b/modules/supplier/back/methods/supplier/specs/newSupplier.spec.js @@ -19,13 +19,14 @@ describe('Supplier newSupplier()', () => { }); }); - it('should create a new supplier containing only the name', async() => { + it('should create a new supplier containing only the name and the nif', async() => { const tx = await models.Supplier.beginTransaction({}); try { const options = {transaction: tx}; ctx.args = { - name: 'newSupplier' + name: 'newSupplier', + nif: '12345678Z' }; const result = await models.Supplier.newSupplier(ctx, options); diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 7270c0405..f30b744c4 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -32,6 +32,10 @@ module.exports = Self => { message: 'TIN must be unique' }); + Self.validateAsync('nif', nifInvalid, { + message: 'Invalid TIN' + }); + Self.validateAsync('nif', tinIsValid, { message: 'Invalid TIN' }); @@ -57,24 +61,23 @@ module.exports = Self => { done(); } - async function tinIsValid(err, done) { - if (!this.countryFk) - return done(); + // async function tinIsValid(err, done) { + // if (!this.countryFk) + // return done(); - const filter = { - fields: ['code'], - where: {id: this.countryFk} - }; - const country = await Self.app.models.Country.findOne(filter); - const code = country ? country.code.toLowerCase() : null; + // const filter = { + // fields: ['code'], + // where: {id: this.countryFk} + // }; + // const country = await Self.app.models.Country.findOne(filter); + // const code = country ? country.code.toLowerCase() : null; - if (!this.nif || !validateTin(this.nif, code)) - err(); - done(); - } + // if (!this.nif || !validateTin(this.nif, code)) + // err(); + // done(); + // } Self.validateAsync('nif', nifInvalid); - async function nifInvalid(err, done) { const filter = { fields: ['code'], From 07148f6c291c40cb5f2160c104aeecfac72e6a95 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 27 Apr 2023 11:31:26 +0200 Subject: [PATCH 35/49] refs #5540 mon message --- e2e/paths/13-supplier/03_fiscal_data.spec.js | 2 +- loopback/locale/es.json | 3 ++- modules/supplier/back/models/supplier.js | 28 ++++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/e2e/paths/13-supplier/03_fiscal_data.spec.js b/e2e/paths/13-supplier/03_fiscal_data.spec.js index 45e11fbe1..4f9581e32 100644 --- a/e2e/paths/13-supplier/03_fiscal_data.spec.js +++ b/e2e/paths/13-supplier/03_fiscal_data.spec.js @@ -38,7 +38,7 @@ describe('Supplier fiscal data path', () => { await page.waitToClick(selectors.supplierFiscalData.saveButton); const message = await page.waitForSnackbar(); - expect(message.text).toContain('Data saved!'); + expect(message.text).toContain('Invalid Tax number'); }); it('should save the changes as the tax number is valid this time', async() => { diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 696fbe18d..ca77aa77c 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -278,5 +278,6 @@ "Added observation": "{{user}} añadió esta observacion: {{text}}", "Comment added to client": "Observación añadida al cliente {{clientFk}}", "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen", - "The first two values are letters": "The first two values are letters" + "The first two values are letters": "The first two values are letters", + "NIF no valido por VIES": "NIF no valido por VIES" } \ No newline at end of file diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index f30b744c4..d543e0d48 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -33,7 +33,7 @@ module.exports = Self => { }); Self.validateAsync('nif', nifInvalid, { - message: 'Invalid TIN' + message: 'NIF no valido por VIES' }); Self.validateAsync('nif', tinIsValid, { @@ -61,21 +61,21 @@ module.exports = Self => { done(); } - // async function tinIsValid(err, done) { - // if (!this.countryFk) - // return done(); + async function tinIsValid(err, done) { + if (!this.countryFk) + return done(); - // const filter = { - // fields: ['code'], - // where: {id: this.countryFk} - // }; - // const country = await Self.app.models.Country.findOne(filter); - // const code = country ? country.code.toLowerCase() : null; + const filter = { + fields: ['code'], + where: {id: this.countryFk} + }; + const country = await Self.app.models.Country.findOne(filter); + const code = country ? country.code.toLowerCase() : null; - // if (!this.nif || !validateTin(this.nif, code)) - // err(); - // done(); - // } + if (!this.nif || !validateTin(this.nif, code)) + err(); + done(); + } Self.validateAsync('nif', nifInvalid); async function nifInvalid(err, done) { From d15a671359b073e378bcc61bb5098b88e804a6fe Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 27 Apr 2023 11:40:42 +0200 Subject: [PATCH 36/49] refs #5540 traduccion --- modules/supplier/back/models/supplier.js | 2 +- modules/supplier/front/locale/es.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index d543e0d48..4014aac03 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -33,7 +33,7 @@ module.exports = Self => { }); Self.validateAsync('nif', nifInvalid, { - message: 'NIF no valido por VIES' + message: 'Invalid NIF for VIES' }); Self.validateAsync('nif', tinIsValid, { diff --git a/modules/supplier/front/locale/es.yml b/modules/supplier/front/locale/es.yml index abb6a9775..a2b6dd04d 100644 --- a/modules/supplier/front/locale/es.yml +++ b/modules/supplier/front/locale/es.yml @@ -1 +1,2 @@ -Accounts: Cuentas \ No newline at end of file +Accounts: Cuentas +Invalid NIF for VIES: NIF no valido por VIES \ No newline at end of file From e1864fec092a0d1c3a8501548fd394a5f50339ad Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 27 Apr 2023 13:26:22 +0200 Subject: [PATCH 37/49] arreglo json --- loopback/locale/es.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index c0be5471e..3ef3c4a22 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -278,11 +278,6 @@ "Added observation": "{{user}} añadió esta observacion: {{text}}", "Comment added to client": "Observación añadida al cliente {{clientFk}}", "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen", -<<<<<<< HEAD - "The first two values are letters": "The first two values are letters", - "NIF no valido por VIES": "NIF no valido por VIES" -} -======= "company": "Compañía", "country": "País", "clientId": "Id cliente", @@ -296,4 +291,3 @@ "comercialId": "Id comercial", "comercialName": "Comercial" } ->>>>>>> 7f8f65567f4eb53637a1ff0c2cdbd3a93447e1ac From 6e3e2cf798a8bd80072989727ba9d3076d67677f Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 27 Apr 2023 18:13:17 +0200 Subject: [PATCH 38/49] refs #5517 Filter RC --- front/core/components/field/index.js | 2 +- front/salix/components/log/index.html | 65 ++++++++++++++++++--------- front/salix/components/log/index.js | 48 +++++++++++++------- 3 files changed, 79 insertions(+), 36 deletions(-) diff --git a/front/core/components/field/index.js b/front/core/components/field/index.js index 40ea01e47..e89a042a5 100644 --- a/front/core/components/field/index.js +++ b/front/core/components/field/index.js @@ -166,7 +166,7 @@ export default class Field extends FormInput { if (event.defaultPrevented) return; event.preventDefault(); this.field = null; - this.input.dispatchEvent(new Event('change')); + this.element.dispatchEvent(new Event('change')); } buildInput(type) { diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 5ebdabbf0..3b7ba4744 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -6,8 +6,7 @@ where="{changedModel: $ctrl.changedModel, changedModelId: $ctrl.changedModelId}" data="$ctrl.logs" order="creationDate DESC, id DESC" - limit="20" - auto-load="true"> + limit="20">
- - +
+ Filter +
+ label="Name" + ng-model="filter.changedModelValue"> + + + + + + + + {{name}}
-
+ + + + +
- + + diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index cad66ce26..93b15f450 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -19,8 +19,6 @@ export default class Controller extends Section { delete: 'alert', select: 'notice' }; - - $.filter = {}; this.filter = { include: [{ relation: 'user', @@ -42,21 +40,23 @@ export default class Controller extends Section { this.today.setHours(0, 0, 0, 0); } - $onInit() { + $postLink() { + this.resetFilter(); const {$} = this; $.$watch( () => [ - $.filter.actions, + $.filter.changedModelValue, + $.filter.who, $.filter.changedModel, - $.filter.userFk + $.filter.changedModelId, + $.filter.userFk, + $.filter.actions, + $.filter.from, + $.filter.to ], () => this.applyFilter(), true ); - $.$watch( - () => $.filter.from, - () => $.filter.to = $.filter.from - ); } get logs() { @@ -135,12 +135,27 @@ export default class Controller extends Section { this.$.workerDescriptor.show(event.target, workerId); } + resetFilter() { + this.$.filter = {who: 'all'}; + } + applyFilter() { const filter = this.$.filter; function getParam(prop, value) { if (value == null || value == '') return null; switch (prop) { + case 'changedModelValue': + return {[prop]: {like: `%${value}%`}}; + case 'who': + switch (value) { + case 'all': + return null; + case 'user': + return {userFk: {neq: null}}; + case 'system': + return {userFk: null}; + } case 'actions': const inq = []; for (const action in value) { @@ -149,7 +164,13 @@ export default class Controller extends Section { } return inq.length ? {action: {inq}} : null; case 'from': - return {creationDate: {gte: value}}; + if (filter.to) { + return {creationDate: {gte: value}}; + } else { + const to = new Date(value); + to.setHours(23, 59, 59, 999); + return {creationDate: {between: [value, to]}}; + } case 'to': const to = new Date(value); to.setHours(23, 59, 59, 999); @@ -164,12 +185,9 @@ export default class Controller extends Section { const param = getParam(prop, filter[prop]); if (param) and.push(param); } - this.$.model.applyFilter(and.length ? {where: {and}} : null); - } - removeFilter() { - this.$.filter = {}; - this.applyFilter(); + const lbFilter = and.length ? {where: {and}} : null; + return this.$.model.applyFilter(lbFilter); } searchUser(search) { From b8f7f7bd6955c78283c006da48e549b40740af81 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 28 Apr 2023 09:07:06 +0200 Subject: [PATCH 39/49] refs #5540 create validateIban --- loopback/util/validateNIF.js | 12 ++++++++++++ modules/client/back/models/client.js | 27 ++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 loopback/util/validateNIF.js diff --git a/loopback/util/validateNIF.js b/loopback/util/validateNIF.js new file mode 100644 index 000000000..22c10d612 --- /dev/null +++ b/loopback/util/validateNIF.js @@ -0,0 +1,12 @@ +module.exports = async function(fi) { + const filter = { + fields: ['code'], + where: {id: this.countryFk} + }; + const countryCode = this.fi.toUpperCase().substring(0, 2); + const country = await app.models.Country.findOne(filter); + const code = country ? country.code : null; + if (this.isVies && countryCode == code) + err(); + done(); +}; diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index c271a24e8..d51a67d05 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -4,6 +4,7 @@ const isMultiple = require('vn-loopback/util/hook').isMultiple; const validateTin = require('vn-loopback/util/validateTin'); const validateIban = require('vn-loopback/util/validateIban'); const LoopBackContext = require('loopback-context'); +const validateNIF = require('vn-loopback/util/validateNIF'); module.exports = Self => { // Methods @@ -23,22 +24,22 @@ module.exports = Self => { message: 'TIN must be unique' }); - Self.validateAsync('fi', fiInvalid, { + Self.validateAsync('fi', validateNIF(fi), { message: 'Invalid TIN' }); - async function fiInvalid(err, done) { - const filter = { - fields: ['code'], - where: {id: this.countryFk} - }; - const countryCode = this.fi.toUpperCase().substring(0, 2); - const country = await Self.app.models.Country.findOne(filter); - const code = country ? country.code : null; - if (this.isVies && countryCode == code) - err(); - done(); - } + // async function fiInvalid(err, done) { + // const filter = { + // fields: ['code'], + // where: {id: this.countryFk} + // }; + // const countryCode = this.fi.toUpperCase().substring(0, 2); + // const country = await Self.app.models.Country.findOne(filter); + // const code = country ? country.code : null; + // if (this.isVies && countryCode == code) + // err(); + // done(); + // } Self.validatesFormatOf('email', { message: 'Invalid email', From cdbbec9d36619a3c8e4db4ff06c9ba2504f8cda2 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 28 Apr 2023 10:21:54 +0200 Subject: [PATCH 40/49] refs #5540 validate --- loopback/util/validateNIF.js | 16 +++++++++------- modules/client/back/models/client.js | 12 +++++++++++- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/loopback/util/validateNIF.js b/loopback/util/validateNIF.js index 22c10d612..041ca8876 100644 --- a/loopback/util/validateNIF.js +++ b/loopback/util/validateNIF.js @@ -1,12 +1,14 @@ -module.exports = async function(fi) { +const models = require('vn-loopback/server/server').models; +module.exports = async function(fi, isVies, countryFk) { const filter = { fields: ['code'], - where: {id: this.countryFk} + where: {id: countryFk} }; - const countryCode = this.fi.toUpperCase().substring(0, 2); - const country = await app.models.Country.findOne(filter); + const countryCode = fi.toUpperCase().substring(0, 2); + const country = await models.Country.findOne(filter); const code = country ? country.code : null; - if (this.isVies && countryCode == code) - err(); - done(); + if (isVies && countryCode == code) + return false; + return true; }; + diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index d51a67d05..972355e3e 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -24,7 +24,7 @@ module.exports = Self => { message: 'TIN must be unique' }); - Self.validateAsync('fi', validateNIF(fi), { + Self.validateAsync(validateNIF(this.fi, this.isVies, this.countryFk), { message: 'Invalid TIN' }); @@ -93,6 +93,16 @@ module.exports = Self => { done(); } + Self.validateAsync('fi', validationNIF, { + message: 'El NIF es incorrecto por el Vies' + }); + + async function validationNIF(err, done){ + if (!validateNIF(this.fi, this.isVies, this.countryFk)) + err(); + done(); + } + Self.validateAsync('fi', tinIsValid, { message: 'Invalid TIN' }); From 4982fb254ce3714d3f47ea586458fe980a9554de Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 28 Apr 2023 11:27:02 +0200 Subject: [PATCH 41/49] refs #5517 Final style fixes, production ready --- .../02-client/07_edit_web_access.spec.js | 4 +- front/salix/components/log/index.html | 192 +++++++++--------- front/salix/components/log/index.js | 39 +++- front/salix/components/log/style.scss | 156 ++++++++------ 4 files changed, 229 insertions(+), 162 deletions(-) diff --git a/e2e/paths/02-client/07_edit_web_access.spec.js b/e2e/paths/02-client/07_edit_web_access.spec.js index dfcc8604a..26b4c4e27 100644 --- a/e2e/paths/02-client/07_edit_web_access.spec.js +++ b/e2e/paths/02-client/07_edit_web_access.spec.js @@ -5,8 +5,8 @@ const $ = { userName: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.name"]', email: 'vn-client-web-access vn-textfield[ng-model="$ctrl.account.email"]', saveButton: 'vn-client-web-access button[type=submit]', - nameValue: 'vn-client-log tbody:nth-child(2) .basic-json:nth-child(1) vn-json-value', - activeValue: 'vn-client-log tbody:nth-child(3) .basic-json:nth-child(2) vn-json-value' + nameValue: 'vn-client-log .change:nth-child(1) .basic-json:nth-child(1) vn-json-value', + activeValue: 'vn-client-log .change:nth-child(2) .basic-json:nth-child(2) vn-json-value' }; describe('Client web access path', () => { diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 3b7ba4744..7107326d3 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -14,111 +14,105 @@ order="changedModel" auto-load="true"> - - -
- - - - - - - - - - - - - - - - - - -
- Action - - Model - - Date -
- - {{::log.user.name}} + +
+
+
+ + +
+ {{::log.user ? log.user.name.charAt(0).toUpperCase() : 'S'}} +
+
+
+
+
+ +
+
+ {{::$ctrl.relativeDate(log.creationDate)}} +
+ + {{::$ctrl.actionsText[log.action]}} + +
+
+ + {{::log.changedModelI18n}} + + + #{{::log.changedModelId}} + + + {{::log.changedModelValue}} + +
+
+ + + + +
+ + + + {{::prop.nameI18n}}: + + , - - System - -
- - {{::log.changedModelI18n}} - - - {{::log.changedModelValue}} - - - #{{::log.changedModelId}} - - - {{::$ctrl.relativeDate(log.creationDate)}} -
- - {{::$ctrl.actionsText[log.action]}} - - -
- - - - -
- - - - {{::prop.nameI18n}}: - - , - -
-
- - {{::prop.nameI18n}}: - - - - ← - -
-
+
+
+ + {{::prop.nameI18n}}: - - {{::log.description}} - - - No changes + + + ←
-
- -
+
+ + {{::log.description}} + + + No changes + +
+ +
+
+ thead, - & > tbody { - & > tr { - td, th { - &:first-child { - padding-left: 16px; - } - &:last-child { - padding-right: 16px; + & > .user-wrapper { + position: relative; + padding-right: 10px; + + & > .user { + border-radius: 50%; + height: 36px; + width: 36px; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; + + & > * { + width: 100%; + height: 100%; + } + img { + display: block; + cursor: pointer; + } + .user-icon { + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + + &.system { + background-color: $color-main; } } } - } - & > thead > tr > th { - max-width: initial; - } - & > tbody { - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - - &:last-child { - border-bottom: none; + & > .arrow { + height: 8px; + width: 8px; + position: absolute; + transform: rotateY(0deg) rotate(45deg); + top: 18px; + right: -4px; + z-index: 1; } - & > tr { - border-bottom: none; - height: initial; + & > .line { + position: absolute; + background-color: $color-main; + width: 2px; + left: 17px; + z-index: -1; + top: 44px; + bottom: -8px; + } + } + &:last-child > .user-wrapper > .line { + display: none; + } + .detail { + position: relative; + flex-grow: 1; + width: 100%; + border-radius: 2px; + overflow: hidden; - & > td { - padding-top: 16px; - padding-bottom: 16px; + & > .header { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; - &.action > .chip { - display: inline-block; + & > .chip { + padding: 2px 4px; + border-radius: 4px; + display: inline-block; + color: $color-font-bg; + + &.notice { + background-color: $color-notice-medium; } - &.date { - color: $color-font-secondary; - text-transform: capitalize; - font-style: italic; - font-size: .9em; + &.success { + background-color: $color-success-medium; + } + &.warning { + background-color: $color-main-medium; + } + &.alert { + background-color: lighten($color-alert, 5%); } } - &.change-header > td { - padding-bottom: 0; + .date { + float: right; } - &.change-detail > td { - padding-top: 6px; - vertical-align: top; + } + & > .model { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + & > .model-name { + text-transform: capitalize; + } + & > .model-value { + font-style: italic; + color: #c7bd2b; + } + & > .model-id { + color: $color-font-secondary; + font-size: .9em; } } } - th, td { - &.action, - &.user { - width: 90px; - } - &.date { - width: 115px; - text-align: right; - } - } - } - .model-name { - text-transform: capitalize; - } - .model-value { - font-style: italic; - color: #c7bd2b; - } - .model-id { - color: $color-font-secondary; - font-size: .9em; } .changes { overflow: hidden; @@ -133,5 +170,4 @@ vn-log { } } } - .filter {} } From e70b0b22f3ea570eb9c86a8a31306de869271a75 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 28 Apr 2023 11:43:45 +0200 Subject: [PATCH 42/49] refs #5517 Code clean --- front/salix/components/log/index.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js index a37ab5d92..19bf5b597 100644 --- a/front/salix/components/log/index.js +++ b/front/salix/components/log/index.js @@ -42,18 +42,8 @@ export default class Controller extends Section { $postLink() { this.resetFilter(); - const {$} = this; - $.$watch( - () => [ - $.filter.changedModelValue, - $.filter.who, - $.filter.changedModel, - $.filter.changedModelId, - $.filter.userFk, - $.filter.actions, - $.filter.from, - $.filter.to - ], + this.$.$watch( + () => this.$.filter, () => this.applyFilter(), true ); From 38142c121dd97755b3202c2264015d248bcf54f6 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 28 Apr 2023 12:12:26 +0200 Subject: [PATCH 43/49] refs #5540 mods client --- loopback/locale/es.json | 25 +++++++++++++------------ modules/client/back/models/client.js | 6 +----- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 3ef3c4a22..45993bdd5 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -279,15 +279,16 @@ "Comment added to client": "Observación añadida al cliente {{clientFk}}", "Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen", "company": "Compañía", - "country": "País", - "clientId": "Id cliente", - "clientSocialName": "Cliente", - "amount": "Importe", - "taxableBase": "Base", - "ticketFk": "Id ticket", - "isActive": "Activo", - "hasToInvoice": "Facturar", - "isTaxDataChecked": "Datos comprobados", - "comercialId": "Id comercial", - "comercialName": "Comercial" -} + "country": "País", + "clientId": "Id cliente", + "clientSocialName": "Cliente", + "amount": "Importe", + "taxableBase": "Base", + "ticketFk": "Id ticket", + "isActive": "Activo", + "hasToInvoice": "Facturar", + "isTaxDataChecked": "Datos comprobados", + "comercialId": "Id comercial", + "comercialName": "Comercial", + "Invalid NIF for VIES": "Invalid NIF for VIES" +} \ No newline at end of file diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 972355e3e..d3022af81 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -24,10 +24,6 @@ module.exports = Self => { message: 'TIN must be unique' }); - Self.validateAsync(validateNIF(this.fi, this.isVies, this.countryFk), { - message: 'Invalid TIN' - }); - // async function fiInvalid(err, done) { // const filter = { // fields: ['code'], @@ -102,7 +98,7 @@ module.exports = Self => { err(); done(); } - + Self.validateAsync('fi', tinIsValid, { message: 'Invalid TIN' }); From c0deb745d64faad1903cb0f044c4b3b4ec95070e Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 28 Apr 2023 14:03:21 +0200 Subject: [PATCH 44/49] refs #5540 arreglo en supplier --- modules/client/back/models/client.js | 24 ++++++++++++------------ modules/supplier/back/models/supplier.js | 21 ++------------------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index d3022af81..e04c4478f 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -24,18 +24,18 @@ module.exports = Self => { message: 'TIN must be unique' }); - // async function fiInvalid(err, done) { - // const filter = { - // fields: ['code'], - // where: {id: this.countryFk} - // }; - // const countryCode = this.fi.toUpperCase().substring(0, 2); - // const country = await Self.app.models.Country.findOne(filter); - // const code = country ? country.code : null; - // if (this.isVies && countryCode == code) - // err(); - // done(); - // } + async function fiInvalid(err, done) { + const filter = { + fields: ['code'], + where: {id: this.countryFk} + }; + const countryCode = this.fi.toUpperCase().substring(0, 2); + const country = await Self.app.models.Country.findOne(filter); + const code = country ? country.code : null; + if (this.isVies && countryCode == code) + err(); + done(); + } Self.validatesFormatOf('email', { message: 'Invalid email', diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 4014aac03..ae3eb4bcc 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -32,10 +32,6 @@ module.exports = Self => { message: 'TIN must be unique' }); - Self.validateAsync('nif', nifInvalid, { - message: 'Invalid NIF for VIES' - }); - Self.validateAsync('nif', tinIsValid, { message: 'Invalid TIN' }); @@ -71,22 +67,9 @@ module.exports = Self => { }; const country = await Self.app.models.Country.findOne(filter); const code = country ? country.code.toLowerCase() : null; + const countryCode = this.nif.toLowerCase().substring(0, 2); - if (!this.nif || !validateTin(this.nif, code)) - err(); - done(); - } - - Self.validateAsync('nif', nifInvalid); - async function nifInvalid(err, done) { - const filter = { - fields: ['code'], - where: {id: this.countryFk} - }; - const countryCode = this.nif.toUpperCase().substring(0, 2); - const country = await Self.app.models.Country.findOne(filter); - const code = country ? country.code : null; - if (this.isVies && countryCode == code) + if (!this.nif || !validateTin(this.nif, code) || (this.isVies && countryCode == code)) err(); done(); } From 0e0db960afcd3aa0e921823387fb3acca986bdf1 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 28 Apr 2023 14:23:44 +0200 Subject: [PATCH 45/49] refs #5540 supplier --- loopback/util/validateNIF.js | 14 ------------ modules/client/back/models/client.js | 33 ++++++---------------------- 2 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 loopback/util/validateNIF.js diff --git a/loopback/util/validateNIF.js b/loopback/util/validateNIF.js deleted file mode 100644 index 041ca8876..000000000 --- a/loopback/util/validateNIF.js +++ /dev/null @@ -1,14 +0,0 @@ -const models = require('vn-loopback/server/server').models; -module.exports = async function(fi, isVies, countryFk) { - const filter = { - fields: ['code'], - where: {id: countryFk} - }; - const countryCode = fi.toUpperCase().substring(0, 2); - const country = await models.Country.findOne(filter); - const code = country ? country.code : null; - if (isVies && countryCode == code) - return false; - return true; -}; - diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index e04c4478f..c95d0972f 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -4,7 +4,7 @@ const isMultiple = require('vn-loopback/util/hook').isMultiple; const validateTin = require('vn-loopback/util/validateTin'); const validateIban = require('vn-loopback/util/validateIban'); const LoopBackContext = require('loopback-context'); -const validateNIF = require('vn-loopback/util/validateNIF'); +const { ConsoleReporter } = require('jasmine'); module.exports = Self => { // Methods @@ -24,19 +24,6 @@ module.exports = Self => { message: 'TIN must be unique' }); - async function fiInvalid(err, done) { - const filter = { - fields: ['code'], - where: {id: this.countryFk} - }; - const countryCode = this.fi.toUpperCase().substring(0, 2); - const country = await Self.app.models.Country.findOne(filter); - const code = country ? country.code : null; - if (this.isVies && countryCode == code) - err(); - done(); - } - Self.validatesFormatOf('email', { message: 'Invalid email', allowNull: true, @@ -89,16 +76,6 @@ module.exports = Self => { done(); } - Self.validateAsync('fi', validationNIF, { - message: 'El NIF es incorrecto por el Vies' - }); - - async function validationNIF(err, done){ - if (!validateNIF(this.fi, this.isVies, this.countryFk)) - err(); - done(); - } - Self.validateAsync('fi', tinIsValid, { message: 'Invalid TIN' }); @@ -112,9 +89,13 @@ module.exports = Self => { where: {id: this.countryFk} }; const country = await Self.app.models.Country.findOne(filter); + console.log(country); const code = country ? country.code.toLowerCase() : null; - - if (!this.fi || !validateTin(this.fi, code)) + console.log(code); + const countryCode = this.fi.toLowerCase().substring(0, 2); + console.log(countryCode); + + if (!this.fi || !validateTin(this.fi, code) || (this.isVies && countryCode == code)) err(); done(); } From fb59371d54e1e91485ec56062b3b3e6676a84b5c Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 28 Apr 2023 14:38:49 +0200 Subject: [PATCH 46/49] refs #5540 quit logs --- modules/client/back/models/client.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index c95d0972f..3ca6254e1 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -89,12 +89,9 @@ module.exports = Self => { where: {id: this.countryFk} }; const country = await Self.app.models.Country.findOne(filter); - console.log(country); const code = country ? country.code.toLowerCase() : null; - console.log(code); const countryCode = this.fi.toLowerCase().substring(0, 2); - console.log(countryCode); - + if (!this.fi || !validateTin(this.fi, code) || (this.isVies && countryCode == code)) err(); done(); From eb2c2b386a0119f4e10696f6da7b86564e7a3af8 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 28 Apr 2023 19:48:36 +0200 Subject: [PATCH 47/49] refs #5517 Duplicated pagination removed --- front/salix/components/log/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html index 7107326d3..b1e5ace12 100644 --- a/front/salix/components/log/index.html +++ b/front/salix/components/log/index.html @@ -112,7 +112,6 @@ - Date: Fri, 28 Apr 2023 19:53:13 +0200 Subject: [PATCH 48/49] refs #5517 Set tests timezone --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index b1706d802..5f329ee61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,6 +52,7 @@ pipeline { }}} environment { NODE_ENV = "" + TZ = 'Europe/Madrid' } parallel { stage('Frontend') { From 8156c17c7df4ba373ae142e988181d5314bbde56 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 2 May 2023 10:00:47 +0200 Subject: [PATCH 49/49] refs #5540 del jasmine --- modules/client/back/models/client.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 3ca6254e1..56adc8b03 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -4,7 +4,6 @@ const isMultiple = require('vn-loopback/util/hook').isMultiple; const validateTin = require('vn-loopback/util/validateTin'); const validateIban = require('vn-loopback/util/validateIban'); const LoopBackContext = require('loopback-context'); -const { ConsoleReporter } = require('jasmine'); module.exports = Self => { // Methods @@ -15,7 +14,7 @@ module.exports = Self => { Self.validatesPresenceOf('street', { message: 'Street cannot be empty' }); - + Self.validatesPresenceOf('city', { message: 'City cannot be empty' });