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: ''
+ filter: '',
+ filterSearch: '@?'
},
transclude: {
tplItem: '?tplItem'
diff --git a/client/core/src/autocomplete/autocomplete.spec.js b/client/core/src/autocomplete/autocomplete.spec.js
index 8401cd1a5..7f8acb427 100644
--- a/client/core/src/autocomplete/autocomplete.spec.js
+++ b/client/core/src/autocomplete/autocomplete.spec.js
@@ -120,8 +120,8 @@ describe('Component vnAutocomplete', () => {
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 @@
-
-
+