diff --git a/client/auth/src/login/login.html b/client/auth/src/login/login.html index 7ca073e72..161ffa732 100644 --- a/client/auth/src/login/login.html +++ b/client/auth/src/login/login.html @@ -1,18 +1,18 @@
-
- -
- - -
diff --git a/client/auth/src/login/style.scss b/client/auth/src/login/style.scss index fddd2d14e..8f1df6705 100644 --- a/client/auth/src/login/style.scss +++ b/client/auth/src/login/style.scss @@ -16,6 +16,7 @@ vn-login > div { margin: auto; height: inherit; } + .box { box-sizing: border-box; position: absolute; @@ -27,15 +28,18 @@ vn-login > div { box-shadow: 0 0 1em 0 rgba(1,1,1,.6); border-radius: .5em; } + img { width: 100%; padding-bottom: 1em; } + .footer { margin-top: 1em; text-align: center; position: relative; } + .spinner-wrapper { position: absolute; width: 0; diff --git a/client/client/src/basic-data/basic-data.html b/client/client/src/basic-data/basic-data.html index 07c60750e..00fca8fd0 100644 --- a/client/client/src/basic-data/basic-data.html +++ b/client/client/src/basic-data/basic-data.html @@ -28,7 +28,9 @@ show-field="name" value-field="id" select-fields="surname" - label="Salesperson"> + label="Salesperson" + filter-search="{where: {or: [{name: {regexp: 'search'}}, {surname: {regexp: 'search'}}]}}" + > - + + + + @@ -72,7 +75,7 @@ + on-response="$ctrl.returnDialogEt(response)"> You changes the equivalent tax diff --git a/client/client/src/billing-data/billing-data.js b/client/client/src/billing-data/billing-data.js index a28aea963..b06f20cd7 100644 --- a/client/client/src/billing-data/billing-data.js +++ b/client/client/src/billing-data/billing-data.js @@ -9,9 +9,11 @@ export default class Controller { this.billData = {}; this.copyData(); } + $onChanges() { this.copyData(); } + copyData() { if (this.client) { this.billData.payMethodFk = this.client.payMethodFk; @@ -23,10 +25,12 @@ export default class Controller { this.equalizationTax = this.client.equalizationTax; } } + submit() { return this.$.watcher.submit().then( () => this.checkPaymentChanges()); } + checkPaymentChanges() { let equals = true; Object.keys(this.billData).forEach( @@ -39,25 +43,26 @@ export default class Controller { ); if (equals) { - this.checkREChanges(); + this.checkEtChanges(); } else { this.$.sendMail.show(); } } + returnDialog(response) { if (response === 'ACCEPT') { this.$http.post(`/mailer/manuscript/payment-update/${this.client.id}`).then( () => { this.vnApp.showMessage(this.translate.instant('Notification sent!')); - this.checkREChanges(); + this.checkEtChanges(); } ); } else { - this.checkREChanges(); + this.checkEtChanges(); } } - checkREChanges() { + checkEtChanges() { let equals = this.equalizationTax == this.client.equalizationTax; this.equalizationTax = this.client.equalizationTax; @@ -65,7 +70,7 @@ export default class Controller { this.$.propagateEqualizationTax.show(); } - returnDialogRE(response) { + returnDialogEt(response) { if (response === 'ACCEPT') { this.$http.patch(`/client/api/Clients/${this.client.id}/addressesPropagateRe`, {isEqualizated: this.client.equalizationTax}).then( res => { diff --git a/client/client/src/billing-data/locale/es.json b/client/client/src/billing-data/locale/es.json index 5706db30e..1d643a934 100644 --- a/client/client/src/billing-data/locale/es.json +++ b/client/client/src/billing-data/locale/es.json @@ -8,5 +8,7 @@ "You changes the equivalent tax": "Has cambiado el recargo de equivalencia", "Do you want to spread the change to their consignees?" : "¿Deseas propagar el cambio a sus consignatarios?", "Yes, propagate": "Si, propagar", - "Equivalent tax spreaded": "Recargo de equivalencia propagado" + "Equivalent tax spreaded": "Recargo de equivalencia propagado", + "Invoice by address": "Facturar por consignatario", + "Equalization tax": "Recargo de equivalencia" } \ No newline at end of file diff --git a/client/client/src/card/style.css b/client/client/src/card/style.css index f788e35c6..195879409 100644 --- a/client/client/src/card/style.css +++ b/client/client/src/card/style.css @@ -1,3 +1,3 @@ -vn-descriptor{ +vn-descriptor { font-family: raleway-bold; } \ No newline at end of file diff --git a/client/client/src/index/style.css b/client/client/src/index/style.css index ba7f75844..b30351f09 100644 --- a/client/client/src/index/style.css +++ b/client/client/src/index/style.css @@ -11,6 +11,6 @@ vn-item-client a:hover { background-color: #424242; } -.vn-item-client-name{ +.vn-item-client-name { font-family: raleway-bold; } diff --git a/client/client/src/notes/notes.js b/client/client/src/notes/notes.js index bd214cf49..7e0ec424a 100644 --- a/client/client/src/notes/notes.js +++ b/client/client/src/notes/notes.js @@ -6,11 +6,13 @@ export default class Controller { this.$http = $http; this.$state = $state; } + $onChanges() { if (this.client) { this.getObservation(this.client.id); } } + getObservation(clientId) { let json = JSON.stringify({where: {clientFk: this.client.id}, order: 'created DESC'}); this.$http.get(`/client/api/clientObservations?filter=${json}`).then( @@ -19,6 +21,7 @@ export default class Controller { } ); } + newObservation() { this.$state.go("clientCard.notes.create", {id: this.client.id}); } diff --git a/client/client/src/notes/style.css b/client/client/src/notes/style.css index b5e17c7a7..4d0f8eba7 100644 --- a/client/client/src/notes/style.css +++ b/client/client/src/notes/style.css @@ -1,3 +1,3 @@ -.notes-date{ +.notes-date { font-family: raleway-bold; } \ No newline at end of file diff --git a/client/client/src/search-panel/search-panel.js b/client/client/src/search-panel/search-panel.js index 87f6308ce..88aa89af3 100644 --- a/client/client/src/search-panel/search-panel.js +++ b/client/client/src/search-panel/search-panel.js @@ -6,15 +6,18 @@ export default class Controller { // onSubmit() is defined by @vnSearchbar this.onSubmit = () => {}; } + onSearch() { this.setStorageValue(); this.onSubmit(this.filter); } + $onChanges() { var value = JSON.parse(this.$window.sessionStorage.getItem('filter')); if (value !== undefined) this.filter = value; } + setStorageValue() { this.$window.sessionStorage.setItem('filter', JSON.stringify(this.filter)); } diff --git a/client/client/src/search-panel/search-panel.spec.js b/client/client/src/search-panel/search-panel.spec.js index 9f7695924..2c3137ff0 100644 --- a/client/client/src/search-panel/search-panel.spec.js +++ b/client/client/src/search-panel/search-panel.spec.js @@ -17,7 +17,7 @@ describe('Client', () => { })); describe('onSearch()', () => { - it(`should call setStorageValue() and onSubmit()`, () => { + it('should call setStorageValue() and onSubmit()', () => { spyOn(controller, 'setStorageValue'); spyOn(controller, 'onSubmit'); controller.setStorageValue(); @@ -29,7 +29,7 @@ describe('Client', () => { }); describe('$onChanges()', () => { - it(`should set filter properties using the search values`, () => { + it('should set filter properties using the search values', () => { expect(controller.filter).not.toBeDefined(); spyOn(JSON, 'parse').and.returnValue({data: 'data'}); controller.$onChanges(); diff --git a/client/client/src/web-access/web-access.js b/client/client/src/web-access/web-access.js index dc61eac82..696d8a0ad 100644 --- a/client/client/src/web-access/web-access.js +++ b/client/client/src/web-access/web-access.js @@ -29,6 +29,7 @@ export default class Controller { this.repeatPassword = ''; this.$.$apply(); } + onPassChange(response) { if (response == 'ACCEPT' && this.canChangePassword) try { diff --git a/client/core/src/autocomplete/autocomplete.js b/client/core/src/autocomplete/autocomplete.js index 0366cece7..853267592 100644 --- a/client/core/src/autocomplete/autocomplete.js +++ b/client/core/src/autocomplete/autocomplete.js @@ -32,6 +32,7 @@ class Autocomplete extends Component { get showDropDown() { return this._showDropDown; } + set showDropDown(value) { if (value && this.url && !this._preLoad) { this._preLoad = true; @@ -77,6 +78,7 @@ class Autocomplete extends Component { get field() { return this.multiple ? this._multiField : this._field; } + set field(value) { if (!angular.equals(value, this.field)) { this.finding = true; @@ -103,7 +105,7 @@ class Autocomplete extends Component { if (value && value.hasOwnProperty(this.valueField)) { this._field = value[this.valueField]; if (this.multiple) { - this._multiField = [value[this.valueField]] + this._multiField = [value[this.valueField]]; } if (value.hasOwnProperty(this.showField)) { this.displayValue = value[this.showField]; @@ -164,6 +166,7 @@ class Autocomplete extends Component { json => this.onItemRequest(null) ); } + onItemRequest(data) { if (data && data.length > 0) this.showItem(data[0]); @@ -191,10 +194,17 @@ class Autocomplete extends Component { findItems(search) { if (this.url && search && !this.finding) { this.maxRow = false; - let filter = {where: {name: {regexp: search}}}; - if (this.filter && this.filter.where) { - Object.assign(filter.where, this.filter.where); + let filter = {}; + if (this.filterSearch) { + let toSearch = this.filterSearch.replace(/search/g, search); + filter = this.$scope.$eval(toSearch); + } else { + filter = {where: {name: {regexp: search}}}; + if (this.filter && this.filter.where) { + Object.assign(filter.where, this.filter.where); + } } + filter.order = this.order; let json = JSON.stringify(filter); this.finding = true; this.$http.get(`${this.url}?filter=${json}`).then( @@ -222,6 +232,7 @@ class Autocomplete extends Component { this.getItems(); } } + getItems() { if (this.url === undefined) { this.items = copyObject(this.data); @@ -273,6 +284,7 @@ class Autocomplete extends Component { } } } + $onInit() { this.findMore = this.url && this.maxRow; this.mouseFocus = false; @@ -321,7 +333,6 @@ class Autocomplete extends Component { } } - Autocomplete.$inject = ['$element', '$scope', '$http', '$timeout', '$filter']; module.component('vnAutocomplete', { @@ -339,7 +350,8 @@ module.component('vnAutocomplete', { label: '@', multiple: '@?', order: '@?', - filter: ' { it(`should perform a query if the item id isn't present in the controller.items property`, () => { controller.url = 'test.com'; - $httpBackend.whenGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}').respond(); - $httpBackend.expectGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}'); + $httpBackend.whenGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`).respond(); + $httpBackend.expectGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`); controller.items = [{id: 1, name: 'test1'}, {id: 2, name: 'Bruce Wayne'}]; controller.field = 3; $httpBackend.flush(); @@ -136,8 +136,8 @@ describe('Component vnAutocomplete', () => { it(`should set field performing a query as the item id isn't present in the controller.items property`, () => { controller.url = 'test.com'; - $httpBackend.whenGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}').respond(); - $httpBackend.expectGET('test.com?filter={"fields":{"id":true,"name":true},"where":{"id":3}}'); + $httpBackend.whenGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`).respond(); + $httpBackend.expectGET(`${controller.url}?filter={"fields":{"id":true,"name":true},"where":{"id":3}}`); controller.items = [{id: 1, name: 'test1'}, {id: 2, name: 'Bruce Wayne'}]; controller.field = 3; $httpBackend.flush(); @@ -150,9 +150,23 @@ describe('Component vnAutocomplete', () => { let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout}); controller.url = 'test.com'; let search = 'The Joker'; - let json = JSON.stringify({where: {name: {regexp: search}}}); - $httpBackend.whenGET(`test.com?filter=${json}`).respond([{id: 3, name: 'The Joker'}]); - $httpBackend.expectGET(`test.com?filter=${json}`); + let json = JSON.stringify({where: {name: {regexp: search}}, order: controller.order}); + $httpBackend.whenGET(`${controller.url}?filter=${json}`).respond([{id: 3, name: 'The Joker'}]); + $httpBackend.expectGET(`${controller.url}?filter=${json}`); + controller.findItems(search); + $httpBackend.flush(); + + expect(controller.items[0]).toEqual({id: 3, name: 'The Joker'}); + }); + + it(`should perform a search and store the result in controller items with filterSearch`, () => { + let controller = $componentController('vnAutocomplete', {$scope, $element, $httpBackend, $timeout}); + controller.url = 'test.com'; + let search = 'The Joker'; + controller.filterSearch = "{where: {surname: {regexp: 'search'}}}"; + let json = JSON.stringify({where: {surname: {regexp: search}}, order: controller.order}); + $httpBackend.whenGET(`${controller.url}?filter=${json}`).respond([{id: 3, name: 'The Joker'}]); + $httpBackend.expectGET(`${controller.url}?filter=${json}`); controller.findItems(search); $httpBackend.flush(); @@ -163,9 +177,9 @@ describe('Component vnAutocomplete', () => { controller.url = 'test.com'; let search = 'Joker'; controller.multiple = true; - let json = JSON.stringify({where: {name: {regexp: search}}}); - $httpBackend.whenGET(`test.com?filter=${json}`).respond([{id: 3, name: 'The Joker'}, {id: 4, name: 'Joker'}]); - $httpBackend.expectGET(`test.com?filter=${json}`); + let json = JSON.stringify({where: {name: {regexp: search}}, order: controller.order}); + $httpBackend.whenGET(`${controller.url}?filter=${json}`).respond([{id: 3, name: 'The Joker'}, {id: 4, name: 'Joker'}]); + $httpBackend.expectGET(`${controller.url}?filter=${json}`); controller.findItems(search); $httpBackend.flush(); @@ -184,8 +198,8 @@ describe('Component vnAutocomplete', () => { describe('getItems()', () => { it(`should perfom a query to fill the items without filter`, () => { controller.url = 'test.com'; - $httpBackend.whenGET(`test.com?filter={"skip":0,"limit":10,"order":"name ASC"}`).respond([{id: 1, name: 'Batman'}, {id: 2, name: 'Bruce Wayne'}]); - $httpBackend.expectGET(`test.com?filter={"skip":0,"limit":10,"order":"name ASC"}`); + $httpBackend.whenGET(`${controller.url}?filter={"skip":0,"limit":10,"order":"name ASC"}`).respond([{id: 1, name: 'Batman'}, {id: 2, name: 'Bruce Wayne'}]); + $httpBackend.expectGET(`${controller.url}?filter={"skip":0,"limit":10,"order":"name ASC"}`); controller.getItems(); $httpBackend.flush(); diff --git a/client/core/src/icon/style.css b/client/core/src/icon/style.css index 064195cd9..881f6d304 100644 --- a/client/core/src/icon/style.css +++ b/client/core/src/icon/style.css @@ -5,4 +5,4 @@ vn-icon { vn-icon > i { display: block; font-size: inherit !important; -} \ No newline at end of file +} diff --git a/client/core/src/lib/index.js b/client/core/src/lib/index.js index 966f25e2f..a081b5f87 100644 --- a/client/core/src/lib/index.js +++ b/client/core/src/lib/index.js @@ -5,6 +5,7 @@ import './getTemplate'; import './app'; import './interceptor'; import './aclService'; +import './storageServices'; export * from './util'; export {default as splitingRegister} from './splitingRegister'; diff --git a/client/core/src/lib/storageServices.js b/client/core/src/lib/storageServices.js new file mode 100644 index 000000000..ee64b6f0c --- /dev/null +++ b/client/core/src/lib/storageServices.js @@ -0,0 +1,66 @@ +import {module} from '../module'; + +class VnStorage { + constructor() { + this._type = ''; + this.prefix = 'vn'; + } + set type(value) { + this._type = value; + this.checkSupport(); + } + get type() { + return this._type; + } + get webStorage() { + return window[this.type]; + } + checkSupport() { + try { + let supported = (this.type in window && window[this.type] !== null); + if (supported) { + let key = '__' + Math.round(Math.random() * 1e7); + let webStorage = window[this.type]; + webStorage.setItem(key, ''); + webStorage.removeItem(key); + } + } catch (e) { + console.error('VnStorage.notification.error', e.message); + return false; + } + } + get(param) { + let toRead = this.webStorage.getItem(`${this.prefix}.${param}`); + if (toRead && toRead.startsWith('jsonObject:')) { + toRead = JSON.parse(toRead.replace('jsonObject:', '')); + } + return toRead; + } + set(param, data) { + let toStorage = typeof data === 'object' ? `jsonObject:${JSON.stringify(data)}` : data; + this.webStorage.setItem(`${this.prefix}.${param}`, toStorage); + } + remove(param) { + this.webStorage.removeItem(`${this.prefix}.${param}`); + } + clear() { + this.webStorage.clear(); + } +} + +class SessionStorage extends VnStorage { + constructor() { + super(); + this.type = 'sessionStorage'; + } +} + +class LocalStorage extends VnStorage { + constructor() { + super(); + this.type = 'localStorage'; + } +} + +module.service('sessionStorage', SessionStorage); +module.service('localStorage', LocalStorage); diff --git a/client/production/src/production-table/production-table.js b/client/production/src/production-table/production-table.js index 96ebf6c2e..91c24314f 100644 --- a/client/production/src/production-table/production-table.js +++ b/client/production/src/production-table/production-table.js @@ -32,7 +32,6 @@ export class ProductionTable { onOrder(field, order) { let reverse = order === 'DESC'; this.tickets = this.$filter('orderBy')(this.tickets, field, reverse); - this.pageTickets(); } pageTickets() { let init = (this.pageTable.filter.page - 1) * this.itemsDisplayedInList; @@ -46,9 +45,9 @@ ProductionTable.$inject = ['$filter']; ngModule.component('vnProductionTable', { template: require('./production-table.html'), bindings: { - tickets: '=', + tickets: '<', footer: '<', - checkAll: '=' + checkAll: '<' }, controller: ProductionTable }); diff --git a/client/salix/src/components/main-menu/main-menu.html b/client/salix/src/components/main-menu/main-menu.html index 25b375fd3..5d96d9b19 100644 --- a/client/salix/src/components/main-menu/main-menu.html +++ b/client/salix/src/components/main-menu/main-menu.html @@ -1,9 +1,13 @@
- - +
  • diff --git a/client/salix/src/components/main-menu/style.scss b/client/salix/src/components/main-menu/style.scss index ea454ebf3..5e1781446 100644 --- a/client/salix/src/components/main-menu/style.scss +++ b/client/salix/src/components/main-menu/style.scss @@ -1,4 +1,13 @@ vn-main-menu { + & > div > vn-icon { + font-size: 2.5em; + cursor: pointer; + + &:hover { + color: #FF9300; + } + } + li.mdl-menu__item{ background-color: #FF9300; margin-bottom: 8px; diff --git a/client/salix/src/styles/display.css b/client/salix/src/styles/display.css index 0a512c090..982432252 100644 --- a/client/salix/src/styles/display.css +++ b/client/salix/src/styles/display.css @@ -1,6 +1,7 @@ .display-block { display: block; } + .well { min-height: 20px; padding: 19px; @@ -10,6 +11,7 @@ border-radius: 4px; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } + .form-group { margin-bottom: 15px; } @@ -20,6 +22,7 @@ height: auto; min-width: auto; } + .popover-label { font-weight: bold; color: black; @@ -32,12 +35,15 @@ height: 46px; line-height: 0px; } + input:disabled, button:disabled { cursor: not-allowed !important; } + input[type="submit"]:disabled, button:disabled { opacity: 0.7; } + .descriptor-icon{ font-size:60px; -} \ No newline at end of file +} diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 0e47740ef..fb968e2d7 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -57,6 +57,8 @@ export default { postcodeInput: `${components.vnTextfield}[name="postcode"]`, provinceInput: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > ${components.vnTextfield}`, provinceFifthOption: `${components.vnAutocomplete}[field="$ctrl.client.provinceFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-one:nth-child(2) > ul > li:nth-child(5)`, - saveButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-horizontal > vn-auto > vn-vertical > vn-client-fiscal-data > form > vn-button-bar > vn-submit > input' + countryInput: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > ${components.vnTextfield}`, + countryThirdOption: `${components.vnAutocomplete}[field="$ctrl.client.countryFk"] > vn-vertical > vn-drop-down > vn-vertical > vn-one:nth-child(3) > ul > li:nth-child(3)`, + saveButton: `${components.vnSubmit}` } }; diff --git a/e2e/paths/edit_basic_data.spec.js b/e2e/paths/edit_basic_data.spec.js index 6ebaeeaf1..8fcd7dca1 100644 --- a/e2e/paths/edit_basic_data.spec.js +++ b/e2e/paths/edit_basic_data.spec.js @@ -299,7 +299,6 @@ describe('Edit basicData path', () => { it('should select the channel', done => { nightmare .waitToClick(selectors.basicData.channelInput) - .waitToClick(selectors.basicData.channelInput) .waitToClick(selectors.basicData.channelMetropolisOption) .waitToClick(selectors.basicData.saveButton) .wait(selectors.globalItems.snackbarIsActive) @@ -317,7 +316,7 @@ describe('Edit basicData path', () => { .click(selectors.fiscalData.fiscalDataButton) .wait(selectors.fiscalData.addressInput) .click(selectors.basicData.basicDataButton) - .wait(100) + .wait(selectors.basicData.basicDataButton) .getInputValue(selectors.basicData.channelInput) .then(result => { expect(result).toEqual('Metropolis newspaper'); diff --git a/e2e/paths/edit_fiscal_data.spec.js b/e2e/paths/edit_fiscal_data.spec.js index c835f60ff..b7cefa28c 100644 --- a/e2e/paths/edit_fiscal_data.spec.js +++ b/e2e/paths/edit_fiscal_data.spec.js @@ -223,33 +223,61 @@ describe('Edit fiscalData path', () => { .catch(catchErrors(done)); }); - // it(`should edit the province`, done => { - // nightmare - // .waitToClick(selectors.fiscalData.provinceInput) - // .waitToClick(selectors.fiscalData.provinceInput) - // .waitToClick(selectors.fiscalData.provinceMetropolisOption) - // .waitToClick(selectors.fiscalData.saveButton) - // .wait(selectors.globalItems.snackbarIsActive) - // .getInnerText(selectors.globalItems.snackbarIsActive) - // .then(result => { - // expect(result).toEqual(`¡Datos guardados!`); - // done(); - // }) - // .catch(catchErrors(done)); - // }); + it(`should edit the province`, done => { + nightmare + .waitToClick(selectors.fiscalData.provinceInput) + .waitToClick(selectors.fiscalData.provinceFifthOption) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual(`¡Datos guardados!`); + done(); + }) + .catch(catchErrors(done)); + }); - // it(`should confirm the province have been selected`, done => { - // nightmare - // .waitForSnackbarReset() - // .click(selectors.fiscalData.fiscalDataButton) - // .wait(selectors.fiscalData.addressInput) - // .click(selectors.fiscalData.basicDataButton) - // .wait(100) - // .getInputValue(selectors.fiscalData.provinceInput) - // .then(result => { - // expect(result).toEqual('Province two'); - // done(); - // }) - // .catch(catchErrors(done)); - // }); + it(`should confirm the province have been selected`, done => { + nightmare + .waitForSnackbarReset() + .click(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .click(selectors.fiscalData.fiscalDataButton) + .wait(100) + .getInputValue(selectors.fiscalData.provinceInput) + .then(result => { + expect(result).toEqual('Province two'); + done(); + }) + .catch(catchErrors(done)); + }); + + it(`should edit the country`, done => { + nightmare + .waitToClick(selectors.fiscalData.countryInput) + .waitToClick(selectors.fiscalData.countryThirdOption) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual(`¡Datos guardados!`); + done(); + }) + .catch(catchErrors(done)); + }); + + it(`should confirm the country have been selected`, done => { + nightmare + .waitForSnackbarReset() + .click(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.addressInput) + .click(selectors.fiscalData.basicDataButton) + .wait(100) + .getInputValue(selectors.fiscalData.countryInput) + .then(result => { + expect(result).toEqual('Holanda'); + done(); + }) + .catch(catchErrors(done)); + }); }); diff --git a/services/client/common/models/client.json b/services/client/common/models/client.json index ddb59bbd7..3ef9b48f2 100644 --- a/services/client/common/models/client.json +++ b/services/client/common/models/client.json @@ -64,6 +64,10 @@ "type": "boolean", "description": "The client has equalization tax" }, + "hasToInvoiceByAddress": { + "type": "boolean", + "description": "The client has to be invoiced by address" + }, "hasToInvoice": { "type": "boolean", "description": "Global invoicing enabled for the client" diff --git a/services/loopback/favicon.ico b/services/loopback/favicon.ico new file mode 100644 index 000000000..affd413f8 Binary files /dev/null and b/services/loopback/favicon.ico differ diff --git a/services/loopback/server/middleware.json b/services/loopback/server/middleware.json index 8412781d5..151b6a0e0 100644 --- a/services/loopback/server/middleware.json +++ b/services/loopback/server/middleware.json @@ -1,6 +1,8 @@ { "initial:before": { - "loopback#favicon": {} + "loopback#favicon": { + "params": "$!../favicon.ico" + } }, "initial": { "compression": {}, diff --git a/services/production/common/methods/fake-production/list.js b/services/production/common/methods/fake-production/list.js index 0ad582160..a52f29f96 100644 --- a/services/production/common/methods/fake-production/list.js +++ b/services/production/common/methods/fake-production/list.js @@ -68,16 +68,17 @@ module.exports = function(Self) { } function sum(tickets) { - var obj = {lines: 0, m3: 0}; - tickets.forEach(function(t, i) { - obj.lines += t.lines; - obj.m3 += t.m3; - if (tickets[i].problem) - tickets[i].problem = tickets[i].problem.trim(); - }, this); + let obj = {lines: 0, m3: 0}; + if (tickets && tickets.length) + tickets.forEach(function(t, i) { + obj.lines += t.lines; + obj.m3 += t.m3; + if (tickets[i].problem) + tickets[i].problem = tickets[i].problem.trim(); + }, this); obj.m3 = obj.m3.toFixed(2); - obj.total = tickets.length; - obj.tickets = tickets; + obj.total = tickets ? tickets.length : 0; + obj.tickets = tickets || []; return obj; } }; diff --git a/services/salix/client/index.ejs b/services/salix/client/index.ejs index 9ed38a508..ed1bd1cd8 100644 --- a/services/salix/client/index.ejs +++ b/services/salix/client/index.ejs @@ -1,24 +1,24 @@ - - - Salix - - - - - - - - - + + + Salix + + + + + + + + +