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: '',
showFilter: '',
- selection: '',
+ selection: '=?',
multiple: '',
data: '',
url: '@?',
diff --git a/front/core/components/input-number/index.html b/front/core/components/input-number/index.html
index 1eb20fda3..894844375 100644
--- a/front/core/components/input-number/index.html
+++ b/front/core/components/input-number/index.html
@@ -5,8 +5,8 @@
+ 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 @@
{{$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}}
+
+
+
+
+
+
+
+
+
\ 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/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}}
+