diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 6b902e03a..a41b5855c 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -73,17 +73,17 @@ let actions = { }, changeLanguageToEnglish: function(done) { - this.wait('#lang') - .evaluate(selector => { - return document.querySelector(selector).title; - }, '#lang') - .then(title => { - if (title === 'Change language') { + let langSelector = 'vn-user-configuration-popover vn-autocomplete[field="$ctrl.lang"]'; + + this.waitToClick('#user') + .wait(langSelector) + .waitToGetProperty(`${langSelector} input`, 'value') + .then(lang => { + if (lang === 'English') { this.then(done) .catch(done); } else { - this.click('#lang') - .click('vn-main-menu [vn-id="langs-menu"] ul > li[name="en"]') + this.autocompleteSearch(langSelector, 'English') .then(done) .catch(done); } diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 4f8a5410d..ede784f6f 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -270,11 +270,11 @@ export default { warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]', }, ticketSummary: { - sale: 'vn-ticket-summary [name="sales"] table > tbody > tr', - firstSaleItemId: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(2) > span', + sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr', + firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]', - firstSaleQuantity: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(4)', - firstSaleDiscount: 'vn-ticket-summary [name="sales"] table > tbody > tr > td:nth-child(6)' + firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(4)', + firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)' }, ticketsIndex: { newTicketButton: 'vn-ticket-index > a', diff --git a/e2e/paths/claim-module/03_detail.spec.js b/e2e/paths/claim-module/03_detail.spec.js index 1a7112ff8..55e12fc52 100644 --- a/e2e/paths/claim-module/03_detail.spec.js +++ b/e2e/paths/claim-module/03_detail.spec.js @@ -44,7 +44,7 @@ describe('Claim detail', () => { .waitToGetProperty(selectors.claimDetail.totalClaimed, 'innerText'); expect(claimedQuantity).toEqual('10'); - expect(totalClaimed).toEqual('29.50 €'); + expect(totalClaimed).toContain('29.50'); }); it('should delete the second item from the claim', async() => { diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js index 9faea512c..964c0d9b1 100644 --- a/e2e/paths/client-module/14_risk.spec.js +++ b/e2e/paths/client-module/14_risk.spec.js @@ -65,7 +65,7 @@ describe('Client risk path', () => { expect(company).toEqual('VNL'); - expect(firstRiskLineBalance).toEqual('0.00 €'); + expect(firstRiskLineBalance).toContain('0.00'); }); it('should now click the new payment button', async() => { @@ -91,7 +91,7 @@ describe('Client risk path', () => { let result = await nightmare .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); - expect(result).toEqual('100.00 €'); + expect(result).toContain('100.00'); }); it('should again click the new payment button', async() => { @@ -117,7 +117,7 @@ describe('Client risk path', () => { let result = await nightmare .waitToGetProperty(selectors.clientRisk.firstRiskLineBalance, 'innerText'); - expect(result).toEqual('-50.00 €'); + expect(result).toContain('-€50.00'); }); it('should now click on the Clients button of the top bar menu', async() => { diff --git a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js index a23363675..d48b67c81 100644 --- a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js +++ b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js @@ -73,7 +73,7 @@ describe('Ticket Edit basic data path', () => { .wait(1900) .waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText'); - expect(result).toContain('-187.75 €'); + expect(result).toContain('-€187.75'); }); it(`should then click next to move on to step three`, async() => { diff --git a/front/core/components/autocomplete/autocomplete.js b/front/core/components/autocomplete/autocomplete.js index 5cd812510..f651fd774 100755 --- a/front/core/components/autocomplete/autocomplete.js +++ b/front/core/components/autocomplete/autocomplete.js @@ -11,6 +11,7 @@ import './style.scss'; * @property {Array} data Static data for the autocomplete * @property {Object} intialData A initial data to avoid the server request used to get the selection * @property {Boolean} multiple Wether to allow multiple selection + * @property {Object} selection Current object selected * * @event change Thrown when value is changed */ @@ -293,7 +294,7 @@ ngModule.component('vnAutocomplete', { valueField: '@?', initialData: ' + tabindex="-1" + translate-attr="{title: 'Remove'}">
@@ -28,8 +28,8 @@ + tabindex="-1" + translate-attr="{title: 'Add'}"> form > vn-horizontal > vn-icon-button { color: black; } +} + +.search-panel { + max-height: 44em; + + & > form { + @extend .pad-large; + } } \ No newline at end of file diff --git a/front/core/filters/currency.js b/front/core/filters/currency.js index 874305f08..d44457813 100644 --- a/front/core/filters/currency.js +++ b/front/core/filters/currency.js @@ -5,15 +5,29 @@ import ngModule from '../module'; * * @return {String} The formated number */ -export default function currency() { - return function(input, symbol, fractionSize) { - if (!fractionSize) - fractionSize = 2; - if (typeof input == 'number' && fractionSize) { - input = input.toFixed(fractionSize); - return `${input} ${symbol}`; + +export default function currency($translate) { + function currency(input, symbol = 'EUR', fractionSize = 2) { + let options = { + style: 'currency', + currency: symbol, + minimumFractionDigits: fractionSize, + maximumFractionDigits: fractionSize + }; + + if (typeof input == 'number') { + return new Intl.NumberFormat($translate.use(), options) + .format(input); } + return undefined; - }; + } + + currency.$stateful = true; + + return currency; } + +currency.$inject = ['$translate']; + ngModule.filter('currency', currency); diff --git a/front/core/filters/specs/currency.spec.js b/front/core/filters/specs/currency.spec.js index db5a0c163..28a4a3640 100644 --- a/front/core/filters/specs/currency.spec.js +++ b/front/core/filters/specs/currency.spec.js @@ -12,28 +12,28 @@ describe('Currency filter', () => { }; it('should return a ONE decimal number as per the argument', () => { - let html = `
{{200 | currency: '€': 1}}
`; + let html = `
{{200 | currency: 'EUR': 1}}
`; compile(html); - expect($element[0].innerHTML).toEqual('200.0 €'); + expect($element[0].innerHTML).toContain('200.0'); }); it('should return a TWO decimals number as per the argument', () => { - let html = `
{{200 | currency: '€': 2}}
`; + let html = `
{{200 | currency: 'EUR': 2}}
`; compile(html); - expect($element[0].innerHTML).toEqual('200.00 €'); + expect($element[0].innerHTML).toContain('200.00'); }); it('should return a TEN decimals number as per the argument', () => { - let html = `
{{200 | currency: '€': 10}}
`; + let html = `
{{200 | currency: 'EUR': 10}}
`; compile(html); - expect($element[0].innerHTML).toEqual('200.0000000000 €'); + expect($element[0].innerHTML).toContain('200.0000000000'); }); it('sould return nothing when the value is not set', () => { - let html = `
{{null | currency: '€': 2}}
`; + let html = `
{{null | currency: 'EUR': 2}}
`; compile(html); expect($element[0].innerHTML).toEqual(''); diff --git a/front/salix/components/app/app.html b/front/salix/components/app/app.html index c24d7d037..922b48ce8 100644 --- a/front/salix/components/app/app.html +++ b/front/salix/components/app/app.html @@ -3,16 +3,22 @@ Logo + ng-click="$ctrl.showLeftMenu()">
{{$ctrl.$state.current.description}}
+ +
+ ng-class="{shown: $ctrl.leftMenuShown || $ctrl.rightMenuShown}" + ng-click="$ctrl.hideMenus()">
\ No newline at end of file diff --git a/front/salix/components/app/app.js b/front/salix/components/app/app.js index 4ed4f6948..6a8ecb247 100644 --- a/front/salix/components/app/app.js +++ b/front/salix/components/app/app.js @@ -12,8 +12,8 @@ export default class App { $transitions.onStart({}, transition => { let state = transition.targetState().name(); - this.showMenuButton = state.split('.').length >= 3; - if (this.menuShown) this.hideMenu(); + this.showLeftMenuButton = state.split('.').length >= 3; + this.hideMenus(); }); } @@ -30,22 +30,31 @@ export default class App { return state && state != 'login'; } - get leftBlock() { - return this.$element[0].querySelector('.left-block'); + get leftMenu() { + return this.$element[0].querySelector('.left-menu'); } - showMenu() { - let leftBlock = this.leftBlock; - if (!leftBlock) return; - leftBlock.classList.add('shown'); - this.menuShown = true; + showLeftMenu() { + if (!this.leftMenu) return; + this.leftMenu.classList.add('shown'); + this.leftMenuShown = true; } - hideMenu() { - this.menuShown = false; - let leftBlock = this.leftBlock; - if (!leftBlock) return; - leftBlock.classList.remove('shown'); + showRightMenu() { + if (!this.rightMenu) return; + this.rightMenu.classList.add('shown'); + this.rightMenuShown = true; + } + + hideMenus() { + if (this.leftMenuShown) { + this.leftMenu.classList.remove('shown'); + this.leftMenuShown = false; + } + if (this.rightMenuShown) { + this.rightMenu.classList.remove('shown'); + this.rightMenuShown = false; + } } showMessage(message) { diff --git a/front/salix/components/app/style.scss b/front/salix/components/app/style.scss index ee2bca6bc..e393ceaff 100644 --- a/front/salix/components/app/style.scss +++ b/front/salix/components/app/style.scss @@ -20,14 +20,14 @@ vn-app { z-index: 2; box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); height: $topbar-height; - padding: .3em; + padding: .4em; & > header { & > * { padding: .3em; } & > .logo > img { - height: 1.6em; + height: 1.4em; display: block; } & > .show-menu { @@ -58,19 +58,24 @@ vn-app { &.padding { padding-top: $topbar-height; } - .index-block { + .content-block { @extend .margin-medium; + + form vn-horizontal { + & > * { + padding: .2em; + } + } } vn-main-block { display: block; margin: 0 auto; padding-left: $menu-width; - - .left-block { + + %side-menu { + display: block; position: fixed; z-index: 5; - top: $topbar-height; - left: 0; bottom: 0; width: $menu-width; min-width: $menu-width; @@ -78,21 +83,16 @@ vn-app { box-shadow: 0 .1em .2em rgba(1, 1, 1, .2); overflow: auto; } - .content-block { - @extend .margin-medium; - - form vn-horizontal { - & > * { - padding: .2em; - } - } + .left-menu { + @extend %side-menu; + top: $topbar-height; + left: 0; } - .right-block { - width: $menu-width; - min-width: $menu-width; - padding-left: 1em; + .right-menu { + @extend %side-menu; + top: $topbar-height; + right: 0; } - } } & > .background { @@ -118,29 +118,32 @@ vn-app { } } & > .main-view { - .index-block { + .content-block { margin-left: 0; margin-right: 0; + + form vn-horizontal { + flex-direction: column; + } } vn-main-block { padding-left: 0; - .left-block { + %side-menu-mobile { top: 0; - transform: translateZ(0) translateX(-$menu-width); transition: transform 200ms ease-out; - + &.shown { transform: translateZ(0) translateX(0); } } - .content-block { - margin-left: 0; - margin-right: 0; - - form vn-horizontal { - flex-direction: column; - } + .left-menu { + @extend %side-menu-mobile; + transform: translateZ(0) translateX(-$menu-width); + } + .right-menu { + @extend %side-menu-mobile; + transform: translateZ(0) translateX($menu-width); } } } diff --git a/front/salix/components/home/home.html b/front/salix/components/home/home.html index 8187cf18b..cfc59bdc4 100644 --- a/front/salix/components/home/home.html +++ b/front/salix/components/home/home.html @@ -9,14 +9,14 @@

- +
diff --git a/front/salix/components/home/style.scss b/front/salix/components/home/style.scss index 63aabe639..a41cdac0c 100644 --- a/front/salix/components/home/style.scss +++ b/front/salix/components/home/style.scss @@ -57,9 +57,9 @@ vn-home { color: white; margin: 0; - & > .bind-letter { + /* & > .bind-letter { color: #FD0; - } + } */ } } } diff --git a/front/salix/components/main-menu/main-menu.html b/front/salix/components/main-menu/main-menu.html index 326d5e18b..b607450b8 100644 --- a/front/salix/components/main-menu/main-menu.html +++ b/front/salix/components/main-menu/main-menu.html @@ -5,22 +5,6 @@ class="unselectable"> {{currentUserName}} - - - - - * { cursor: pointer; - padding-left: .1em; + padding-left: .3em; &:hover { color: $main-01; @@ -21,7 +21,7 @@ vn-main-menu { & > #user { vertical-align: middle; font-weight: bold; - padding-right: .6em; + padding-right: .4em; } & > vn-icon, & > a > vn-icon { @@ -41,6 +41,7 @@ vn-main-menu { padding: .8em; border-radius: .1em; min-width: 8em; + white-space: nowrap; &:last-child { margin-bottom: 0; diff --git a/front/salix/components/user-configuration-popover/index.html b/front/salix/components/user-configuration-popover/index.html index b43ecdf62..3fe9a40a5 100644 --- a/front/salix/components/user-configuration-popover/index.html +++ b/front/salix/components/user-configuration-popover/index.html @@ -16,72 +16,67 @@ data="companiesData" order="code"> - -
- - - - - - - {{id}}: {{bank}} - - - - - - - - - - - - - - -
+ + + + {{id}}: {{bank}} + + + + + + + + +
\ No newline at end of file diff --git a/front/salix/components/user-configuration-popover/index.js b/front/salix/components/user-configuration-popover/index.js index 1f70b9641..18a8aae7e 100644 --- a/front/salix/components/user-configuration-popover/index.js +++ b/front/salix/components/user-configuration-popover/index.js @@ -1,6 +1,16 @@ import ngModule from '../../module'; import './style.scss'; +let languages = { + es: 'Español', + en: 'English', + ca: 'Català', + pt: 'Português', + fr: 'Français', + nl: 'Nederlands', + mn: 'Монгол хэл' +}; + class Controller { constructor($scope, $http, $state, vnApp, $translate) { this.$scope = $scope; @@ -9,6 +19,25 @@ class Controller { this.vnApp = vnApp; this.$translate = $translate; this.getUserConfig(); + + this.lang = $translate.use(); + this.langs = []; + + for (let code of $translate.getAvailableLanguageKeys()) { + this.langs.push({ + code: code, + name: languages[code] ? languages[code] : code + }); + } + } + + set lang(value) { + this._lang = value; + this.$translate.use(value); + } + + get lang() { + return this._lang; } set localBankFk(value) { diff --git a/front/salix/components/user-configuration-popover/index.spec.js b/front/salix/components/user-configuration-popover/index.spec.js index 829ff674a..565c666c2 100644 --- a/front/salix/components/user-configuration-popover/index.spec.js +++ b/front/salix/components/user-configuration-popover/index.spec.js @@ -11,7 +11,7 @@ describe('Salix', () => { beforeEach(angular.mock.inject(($componentController, _$httpBackend_, $rootScope) => { $httpBackend = _$httpBackend_; $scope = $rootScope.$new(); - controller = $componentController('vnUserConfigurationPopover', {$scope: $scope, $translate: null}); + controller = $componentController('vnUserConfigurationPopover', {$scope}); })); describe('localBankFk() setter', () => { diff --git a/front/salix/locale/es.yml b/front/salix/locale/es.yml index 3e17d36c7..9c299c040 100644 --- a/front/salix/locale/es.yml +++ b/front/salix/locale/es.yml @@ -28,6 +28,8 @@ Order by: Ordenar por Order: Orden Ascendant: Ascendente Descendant: Descendente +Add: Añadir +Remove: Quitar # Modules diff --git a/gulpfile.js b/gulpfile.js index fce5555ce..831ae6dde 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -50,6 +50,7 @@ function backWatch(done) { nodemon({ exec: commands.join(' && '), + ext: 'js html css', args: ['backOnly'], watch: backSources, done: done diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 06060fe67..b94e67a0c 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -30,5 +30,6 @@ "You can't create a ticket for a inactive client": "You can't create a ticket for a inactive client", "Worker cannot be blank": "Worker cannot be blank", "You must delete the claim id %d first": "You must delete the claim id %d first", - "You don't have enough privileges": "You don't have enough privileges" + "You don't have enough privileges": "You don't have enough privileges", + "Tag value cannot be blank": "Tag value cannot be blank" } \ No newline at end of file diff --git a/loopback/locale/es.json b/loopback/locale/es.json index cc08b120e..648989cb6 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -58,11 +58,12 @@ "You can't create an order for a inactive client": "You can't create an order for a inactive client", "You can't create an order for a client that doesn't has tax data verified": "You can't create an order for a client that doesn't has tax data verified", "You must delete the claim id %d first": "Antes debes borrar la reclamacion %d", - "You don't have enough privileges": "You don't have enough privileges", + "You don't have enough privileges": "No tienes suficientes permisos", "Cannot check VIES and Equalization Tax": "No puedes marcar VIES y RE al mismo", "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF", "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos", "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ", "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado", - "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo" + "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo", + "Tag value cannot be blank": "El valor del tag no puede quedar en blanco" } \ No newline at end of file diff --git a/modules/agency/front/card/index.html b/modules/agency/front/card/index.html index 7e2f11a72..2b981bf29 100644 --- a/modules/agency/front/card/index.html +++ b/modules/agency/front/card/index.html @@ -1,5 +1,5 @@ -
+
diff --git a/modules/agency/front/create/index.html b/modules/agency/front/create/index.html index c9630b236..43575d179 100644 --- a/modules/agency/front/create/index.html +++ b/modules/agency/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> -
-
+
+ -
- + +
diff --git a/modules/agency/front/descriptor/index.html b/modules/agency/front/descriptor/index.html index 27042bdfc..e3a42f346 100644 --- a/modules/agency/front/descriptor/index.html +++ b/modules/agency/front/descriptor/index.html @@ -35,10 +35,10 @@ value="{{$ctrl.zone.travelingDays}}"> + value="{{$ctrl.zone.price | currency: 'EUR': 2}}"> + value="{{$ctrl.zone.price | currency: 'EUR': 2}}">
diff --git a/modules/agency/front/index/index.html b/modules/agency/front/index/index.html index cf9c651f1..9ee708672 100644 --- a/modules/agency/front/index/index.html +++ b/modules/agency/front/index/index.html @@ -6,7 +6,7 @@ data="zones" auto-load="false"> -
+
{{::zone.agencyMode.name}} {{::zone.warehouse.name}} {{::zone.hour | date: 'HH:mm'}} - {{::zone.price | currency:'€':2}} + {{::zone.price | currency: 'EUR':2}} +
+
+ value="{{::$ctrl.summary.price | currency: 'EUR': 2}}"> + value="{{::$ctrl.summary.price | currency: 'EUR': 2}}"> diff --git a/modules/claim/front/action/index.html b/modules/claim/front/action/index.html index ff979c4be..f86b9650b 100644 --- a/modules/claim/front/action/index.html +++ b/modules/claim/front/action/index.html @@ -10,7 +10,7 @@
+ value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
@@ -75,12 +75,12 @@ {{saleClaimed.sale.ticket.landed | dateTime: 'dd/MM/yyyy'}} {{saleClaimed.sale.quantity}} {{saleClaimed.sale.concept}} - {{saleClaimed.sale.price | currency:'€':2}} + {{saleClaimed.sale.price | currency: 'EUR':2}} {{saleClaimed.sale.discount}} % {{(saleClaimed.sale.quantity * saleClaimed.sale.price) - ((saleClaimed.sale.discount * - (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency:'€':2 + (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency: 'EUR':2 }} @@ -138,10 +138,10 @@ {{sale.landed | dateTime: 'dd/MM/yyyy'}} {{sale.quantity}} {{sale.concept}} - {{sale.price | currency:'€':2}} + {{sale.price | currency: 'EUR':2}} {{sale.discount}} % - {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency:'€':2}} + {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}} diff --git a/modules/claim/front/card/index.html b/modules/claim/front/card/index.html index da7ccc464..82ce962cb 100644 --- a/modules/claim/front/card/index.html +++ b/modules/claim/front/card/index.html @@ -1,5 +1,5 @@ -
+
diff --git a/modules/claim/front/detail/index.html b/modules/claim/front/detail/index.html index c9f6a0f38..0c0fe1140 100644 --- a/modules/claim/front/detail/index.html +++ b/modules/claim/front/detail/index.html @@ -12,10 +12,10 @@
+ value="{{$ctrl.paidTotal | currency: 'EUR':2}}"> + value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
@@ -52,10 +52,10 @@ {{::saleClaimed.sale.concept}} - {{::saleClaimed.sale.price | currency:'€':2}} + {{::saleClaimed.sale.price | currency: 'EUR':2}} {{::saleClaimed.sale.discount}} % - {{::$ctrl.getSaleTotal(saleClaimed.sale) | currency:'€':2}} + {{::$ctrl.getSaleTotal(saleClaimed.sale) | currency: 'EUR':2}} {{sale.landed | dateTime: 'dd/MM/yyyy'}} {{sale.quantity}} {{sale.concept}} - {{sale.price | currency:'€':2}} + {{sale.price | currency: 'EUR':2}} {{sale.discount}} % - {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency:'€':2}} + {{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}} diff --git a/modules/claim/front/index/index.html b/modules/claim/front/index/index.html index 85c79b4f7..271bb862e 100644 --- a/modules/claim/front/index/index.html +++ b/modules/claim/front/index/index.html @@ -6,7 +6,7 @@ data="claims" auto-load="false"> -
+
+
{{saleClaimed.sale.quantity}} {{saleClaimed.quantity}} {{saleClaimed.sale.concept}} - {{saleClaimed.sale.price | currency:'€':2}} + {{saleClaimed.sale.price | currency: 'EUR':2}} {{saleClaimed.sale.discount}} % {{(saleClaimed.sale.quantity * saleClaimed.sale.price) - ((saleClaimed.sale.discount * - (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency:'€':2 + (saleClaimed.sale.quantity * saleClaimed.sale.price))/100) | currency: 'EUR':2 }} @@ -138,7 +138,7 @@ {{(action.sale.quantity * action.sale.price) - ((action.sale.discount * - (action.sale.quantity * action.sale.price))/100) | currency:'€':2 + (action.sale.quantity * action.sale.price))/100) | currency: 'EUR':2 }} diff --git a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js index 91742695c..505026df0 100644 --- a/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js +++ b/modules/client/back/methods/client/specs/activeWorkersWithRole.spec.js @@ -7,7 +7,7 @@ describe('Client activeWorkersWithRole', () => { let isSalesPerson = await app.models.Account.hasRole(result[0].id, 'salesPerson'); - expect(result.length).toEqual(10); + expect(result.length).toEqual(11); expect(isSalesPerson).toBeTruthy(); }); diff --git a/modules/client/back/methods/client/specs/listWorkers.spec.js b/modules/client/back/methods/client/specs/listWorkers.spec.js index 86c0e5fe7..4b85e1c51 100644 --- a/modules/client/back/methods/client/specs/listWorkers.spec.js +++ b/modules/client/back/methods/client/specs/listWorkers.spec.js @@ -6,7 +6,7 @@ describe('Client listWorkers', () => { .then(result => { let amountOfEmployees = Object.keys(result).length; - expect(amountOfEmployees).toEqual(43); + expect(amountOfEmployees).toEqual(44); done(); }) .catch(done.fail); diff --git a/modules/client/front/card/index.html b/modules/client/front/card/index.html index 0fe7e24a6..5c8b6f334 100644 --- a/modules/client/front/card/index.html +++ b/modules/client/front/card/index.html @@ -1,5 +1,5 @@ -
+
diff --git a/modules/client/front/create/index.html b/modules/client/front/create/index.html index 1e9b18e99..dc80af713 100644 --- a/modules/client/front/create/index.html +++ b/modules/client/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> - -
+
+ @@ -87,5 +87,5 @@ -
- + +
diff --git a/modules/client/front/credit-insurance/insurance/index/index.html b/modules/client/front/credit-insurance/insurance/index/index.html index fc58eaa29..6d74d01ea 100644 --- a/modules/client/front/credit-insurance/insurance/index/index.html +++ b/modules/client/front/credit-insurance/insurance/index/index.html @@ -18,7 +18,7 @@ - {{::insurance.credit | currency: ' €': 2}} + {{::insurance.credit | currency: 'EUR': 2}} {{::insurance.grade}} {{::insurance.created | date: 'dd/MM/yyyy'}} diff --git a/modules/client/front/descriptor/index.html b/modules/client/front/descriptor/index.html index 13444a6f4..84f3ca10e 100644 --- a/modules/client/front/descriptor/index.html +++ b/modules/client/front/descriptor/index.html @@ -27,10 +27,10 @@ value="{{$ctrl.client.phone | phone}}"> + value="{{$ctrl.client.credit | currency: 'EUR': 2}}"> + value="{{$ctrl.client.creditInsurance | currency: 'EUR': 2}}"> diff --git a/modules/client/front/greuge/index/index.html b/modules/client/front/greuge/index/index.html index 213ccab53..3e3866b8f 100644 --- a/modules/client/front/greuge/index/index.html +++ b/modules/client/front/greuge/index/index.html @@ -15,7 +15,7 @@
+ value="{{edit.model.sumAmount | currency: 'EUR': 2}}">
@@ -33,7 +33,7 @@ {{::greuge.shipped | date:'dd/MM/yyyy HH:mm' }} {{::greuge.description}} - {{::greuge.amount | currency: ' €': 2}} + {{::greuge.amount | currency: 'EUR': 2}} {{::greuge.greugeType.name}}
diff --git a/modules/client/front/index/index.html b/modules/client/front/index/index.html index c6aa4d110..07b394073 100644 --- a/modules/client/front/index/index.html +++ b/modules/client/front/index/index.html @@ -6,7 +6,7 @@ data="clients" auto-load="false"> -
+
{{::recovery.started | date:'dd/MM/yyyy' }} {{recovery.finished | date:'dd/MM/yyyy' }} - {{::recovery.amount | currency:' €': 0}} + {{::recovery.amount | currency: 'EUR': 0}} {{::recovery.period}} diff --git a/modules/client/front/risk/index/index.html b/modules/client/front/risk/index/index.html index fdea08a5d..e63a616b5 100644 --- a/modules/client/front/risk/index/index.html +++ b/modules/client/front/risk/index/index.html @@ -34,7 +34,7 @@ + value="{{riskByCompany.amount | currency: 'EUR':2}}">
@@ -65,9 +65,9 @@ BILL {{::risk.ref}} {{::risk.bankFk}} - {{::risk.debit | currency:'€':2}} - {{::risk.credit | currency:'€':2}} - {{risk.balance | currency:'€':2}} + {{::risk.debit | currency: 'EUR':2}} + {{::risk.credit | currency: 'EUR':2}} + {{risk.balance | currency: 'EUR':2}} +

Business data

+ value="{{$ctrl.summary.totalGreuge | currency: 'EUR':2}}"> + value="{{$ctrl.summary.mana.mana | currency: 'EUR':2}}"> + value="{{$ctrl.summary.averageInvoiced.invoiced | currency: 'EUR':2}}"> @@ -167,26 +167,26 @@

Financial information

diff --git a/modules/client/front/web-payment/index.html b/modules/client/front/web-payment/index.html index c148a2b52..94da3f9a5 100644 --- a/modules/client/front/web-payment/index.html +++ b/modules/client/front/web-payment/index.html @@ -33,7 +33,7 @@ {{::transaction.id}} - {{::transaction.amount | currency: '€':2}} + {{::transaction.amount | currency: 'EUR':2}} {{::transaction.created | dateTime:'dd/MM/yyyy'}} { - it('should return one entry for a given item', async () => { + it('should return one entry for a given item', async() => { let date = new Date(); let filter = {where: {itemFk: 1, date: date}}; let result = await app.models.Item.getLastEntries(filter); @@ -9,9 +9,10 @@ describe('item getLastEntries()', () => { expect(result.length).toEqual(1); }); - it('should return three entries for a given item', async () => { + it('should return three entries for a given item', async() => { let date = new Date(); - date.setMonth(date.getMonth() - 2); + + date.setMonth(date.getMonth() - 2, 15); let filter = {where: {itemFk: 1, date: date}}; let result = await app.models.Item.getLastEntries(filter); diff --git a/modules/item/back/models/item-tag.js b/modules/item/back/models/item-tag.js index 23a0748f7..0e2bfb694 100644 --- a/modules/item/back/models/item-tag.js +++ b/modules/item/back/models/item-tag.js @@ -3,6 +3,12 @@ let UserError = require('vn-loopback/util/user-error'); module.exports = Self => { require('../methods/item-tag/filterItemTags')(Self); + Self.rewriteDbError(function(err) { + if (err.code === 'ER_BAD_NULL_ERROR') + return new UserError(`Tag value cannot be blank`); + return err; + }); + Self.rewriteDbError(function(err) { if (err.code === 'ER_DUP_ENTRY') return new UserError(`The tag can't be repeated`); diff --git a/modules/item/front/card/index.html b/modules/item/front/card/index.html index 0b717f615..d4cf5ad43 100644 --- a/modules/item/front/card/index.html +++ b/modules/item/front/card/index.html @@ -1,5 +1,5 @@ -
+
diff --git a/modules/item/front/create/index.html b/modules/item/front/create/index.html index 544a10848..7cb96a024 100644 --- a/modules/item/front/create/index.html +++ b/modules/item/front/create/index.html @@ -5,8 +5,8 @@ form="form" save="post"> - -
+
+ Cancel -
- + +
diff --git a/modules/item/front/index/index.html b/modules/item/front/index/index.html index 50930d493..e2d2df6e5 100644 --- a/modules/item/front/index/index.html +++ b/modules/item/front/index/index.html @@ -6,7 +6,7 @@ data="items" auto-load="false"> -
+
-
-
+
+ -
+
diff --git a/modules/order/front/catalog/index.html b/modules/order/front/catalog/index.html index 6542ea976..26389c7b6 100644 --- a/modules/order/front/catalog/index.html +++ b/modules/order/front/catalog/index.html @@ -5,105 +5,101 @@ limit="50" data="items" on-data-change="$ctrl.onDataChange()" > - - - - - - - More than {{model.limit}} results - - - - - - - - +
+ + + + More than {{model.limit}} results + + + + + + + - -
- - - - - - - -

- {{::item.name}} -

- - {{::item.subName}} - - - - - - - - - - - - - - {{::item.available}} - from - {{::item.price | currency: ' €': 2}} - - - - - - - -
-
-
+
+ + +
+ + + + -
-
- - - No results - - - - - - - - - - - - + + +

+ {{::item.name}} +

+ + {{::item.subName}} + + + + + + + + + + + + + + {{::item.available}} + from + {{::item.price | currency: 'EUR': 2}} + + + + + + + +
+
+ + +
+
+ + + No results + + +
+ +
+ + diff --git a/modules/order/front/catalog/index.js b/modules/order/front/catalog/index.js index 2585c19f5..ec28df420 100644 --- a/modules/order/front/catalog/index.js +++ b/modules/order/front/catalog/index.js @@ -125,5 +125,5 @@ ngModule.component('vnOrderCatalog', { controller: Controller, bindings: { order: '<', - }, + } }); diff --git a/modules/order/front/catalog/style.scss b/modules/order/front/catalog/style.scss index 3849ff78b..84c6a6c74 100644 --- a/modules/order/front/catalog/style.scss +++ b/modules/order/front/catalog/style.scss @@ -8,13 +8,18 @@ vn-order-catalog { vn-one:first-child { padding-top: 2em; } - vn-one:nth-child(2) { padding-top: 0.5em; } - span { color: $secondary-font-color } } + & > .items { + padding-right: 16em; + + @media screen and (max-width: 800px) { + padding-right: 0; + } + } } \ No newline at end of file diff --git a/modules/order/front/create/index.html b/modules/order/front/create/index.html index fd76ed156..0f52e18ac 100644 --- a/modules/order/front/create/index.html +++ b/modules/order/front/create/index.html @@ -1,5 +1,5 @@ -
-
+
+
diff --git a/modules/order/front/descriptor/index.html b/modules/order/front/descriptor/index.html index 2d7201a6d..ffdbe2f25 100644 --- a/modules/order/front/descriptor/index.html +++ b/modules/order/front/descriptor/index.html @@ -35,7 +35,7 @@ value="{{$ctrl.order.rows.length || 0}}"> + value="{{$ctrl.order.total | currency: 'EUR': 2}}">