diff --git a/front/core/components/field/index.js b/front/core/components/field/index.js index 8d619e4a3d..d18973bbe6 100644 --- a/front/core/components/field/index.js +++ b/front/core/components/field/index.js @@ -187,7 +187,10 @@ export default class Field extends FormInput { } onChange() { - this.emit('change', {value: this.field}); + // Changes doesn't reflect until appling async + this.$.$applyAsync(() => { + this.emit('change', {value: this.field}); + }); } } Field.$inject = ['$element', '$scope']; diff --git a/front/core/components/searchbar/search-panel.js b/front/core/components/searchbar/search-panel.js index f473c2b049..67fd3fae27 100644 --- a/front/core/components/searchbar/search-panel.js +++ b/front/core/components/searchbar/search-panel.js @@ -1,4 +1,5 @@ import Component from '../../lib/component'; +import './style.scss'; export default class SearchPanel extends Component { set filter(value) { diff --git a/front/core/components/searchbar/style.scss b/front/core/components/searchbar/style.scss index c1d4be21c3..eab9c126b1 100644 --- a/front/core/components/searchbar/style.scss +++ b/front/core/components/searchbar/style.scss @@ -1,4 +1,4 @@ -@import "variables"; +@import "./variables"; vn-searchbar { display: block; @@ -44,4 +44,27 @@ vn-searchbar { & > form { padding: $spacing-lg; } + + & > form#manifold-form { + padding: 0; + + .manifold-panel { + border: $border-thin-light; + border-radius: 5px; + position: relative; + text-align: right; + + .or { + font-weight: bold; + font-size: 26px; + color: $color-font-secondary + } + + vn-icon[icon="info"] { + position: absolute; + top: 2px; + right: 2px + } + } + } } \ No newline at end of file diff --git a/front/core/components/th/index.js b/front/core/components/th/index.js index f815056f6e..b9ea8fde8a 100644 --- a/front/core/components/th/index.js +++ b/front/core/components/th/index.js @@ -1,4 +1,5 @@ import ngModule from '../../module'; +import './style.scss'; export default class Th { constructor($element) { diff --git a/front/salix/components/summary/style.scss b/front/salix/components/summary/style.scss index 85da5aa03c..99854fa9d6 100644 --- a/front/salix/components/summary/style.scss +++ b/front/salix/components/summary/style.scss @@ -73,6 +73,21 @@ ui-view > .vn-summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + position: relative; + span { + display: block; + } + a { + color: $color-font; + } + } + h4 span:after { + font-family: 'Material Icons'; + content: 'open_in_new'; + position: absolute; + right: 5px; + text-transform: none; + color: $color-spacer } & > * { margin: $spacing-sm; diff --git a/front/salix/locale/es.yml b/front/salix/locale/es.yml index f2a23a7a74..98384df835 100644 --- a/front/salix/locale/es.yml +++ b/front/salix/locale/es.yml @@ -52,6 +52,7 @@ Suppliers: Proveedores Summary: Vista previa Basic data: Datos básicos List: Listado +Go to: Ir a # Misc diff --git a/modules/account/front/summary/index.html b/modules/account/front/summary/index.html index 9c96a97036..41632aef69 100644 --- a/modules/account/front/summary/index.html +++ b/modules/account/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -10,7 +11,18 @@
-

Basic data

+

+ + Basic Data + +

+

+ Basic Data +

diff --git a/modules/account/front/summary/index.js b/modules/account/front/summary/index.js index 21be84660f..8ed025b613 100644 --- a/modules/account/front/summary/index.js +++ b/modules/account/front/summary/index.js @@ -18,6 +18,9 @@ class Controller extends Summary { this.$http.get(`Accounts/${value.id}`, {filter}) .then(res => this.$.summary = res.data); } + get isHr() { + return this.aclService.hasAny(['hr']); + } get user() { return this._user; diff --git a/modules/claim/front/summary/index.html b/modules/claim/front/summary/index.html index f4e9c1471a..e9ec1e765f 100644 --- a/modules/claim/front/summary/index.html +++ b/modules/claim/front/summary/index.html @@ -4,7 +4,8 @@
- @@ -54,7 +55,18 @@ -

Detail

+

+ + Detail + +

+

+ Detail +

@@ -105,7 +117,18 @@ -

Development

+

+ + Development + +

+

+ Development +

@@ -136,7 +159,18 @@
-

Action

+

+ + Action + +

+

+ Action +

diff --git a/modules/claim/front/summary/index.js b/modules/claim/front/summary/index.js index 89848ecc6e..bda830d6a6 100644 --- a/modules/claim/front/summary/index.js +++ b/modules/claim/front/summary/index.js @@ -13,6 +13,14 @@ class Controller extends Summary { this.getSummary(); } + get isSalesPerson() { + return this.aclService.hasAny(['salesPerson']); + } + + get isClaimManager() { + return this.aclService.hasAny(['claimManager']); + } + get claim() { return this._claim; } diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 50bdd226cd..3e8f4f7056 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -12,7 +12,18 @@ -

Basic data

+

+ + Basic data + +

+

+ Basic data +

@@ -43,7 +54,18 @@
-

Fiscal address

+

+ + Fiscal address + +

+

+ Fiscal address +

@@ -67,7 +89,18 @@
-

Fiscal data

+

+ + Fiscal data + +

+

+ Fiscal data +

-

Billing data

+

+ + Billing data + +

+

+ Billing data +

@@ -136,7 +180,18 @@
-

Default address

+

+ + Address + +

+

+ Address +

@@ -148,7 +203,17 @@
-

Web access

+

+ + Web access + +

+

Web access +

diff --git a/modules/client/front/summary/index.js b/modules/client/front/summary/index.js index cf59912476..8ef724061a 100644 --- a/modules/client/front/summary/index.js +++ b/modules/client/front/summary/index.js @@ -18,6 +18,9 @@ class Controller extends Summary { } }); } + get isEmployee() { + return this.aclService.hasAny(['employee']); + } sumRisk() { let total = 0; diff --git a/modules/client/front/summary/locale/es.yml b/modules/client/front/summary/locale/es.yml index 0a101f6ef6..6d1c3b4f6d 100644 --- a/modules/client/front/summary/locale/es.yml +++ b/modules/client/front/summary/locale/es.yml @@ -7,6 +7,7 @@ Secured credit: Crédito asegurado Average invoiced: Consumo medio Sales person: Comercial Recovery: Recobro +Basic data: Datos básicos Balance due: Saldo vencido Rate: Tarifa Business data: Datos comerciales diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html index 5fb556bd46..59ceaebbe4 100644 --- a/modules/item/front/summary/index.html +++ b/modules/item/front/summary/index.html @@ -25,7 +25,18 @@
-

Basic data

+

+ + Basic data + +

+

+ Basic data +

@@ -53,7 +64,18 @@
-

Other data

+

+ + Other data + +

+

+ Other data +

@@ -77,7 +99,18 @@
-

Tags

+

+ + Tags + +

+

+ Tags +

-

Tax

+

+ + Tax + +

+

+ Tax +

-

Niche

+

+ + Niche + +

+

+ Niche +

-

Botanical

+

+ + Botanical + +

+

+ Botanical +

@@ -111,7 +177,18 @@
-

Barcode

+

+ + Barcode + +

+

+ Barcode +

{{barcode.code}}

diff --git a/modules/item/front/summary/index.js b/modules/item/front/summary/index.js index dc4e638b82..52753ff650 100644 --- a/modules/item/front/summary/index.js +++ b/modules/item/front/summary/index.js @@ -13,6 +13,22 @@ class Controller extends Summary { if (this.item && this.item.id) this.getSummary(); } + + get isBuyer() { + return this.aclService.hasAny(['buyer']); + } + + get isReplenisher() { + return this.aclService.hasAny(['replenisher']); + } + + get isAdministrative() { + return this.aclService.hasAny(['administrative']); + } + + get isEmployee() { + return this.aclService.hasAny(['employee']); + } } ngModule.vnComponent('vnItemSummary', { diff --git a/modules/route/front/summary/index.html b/modules/route/front/summary/index.html index 6dd01c8b0d..b284851a07 100644 --- a/modules/route/front/summary/index.html +++ b/modules/route/front/summary/index.html @@ -61,7 +61,18 @@
-

Ticket

+

+ + Ticket + +

+

+ Ticket +

diff --git a/modules/route/front/summary/index.js b/modules/route/front/summary/index.js index 762cd8a41d..543c54afcf 100644 --- a/modules/route/front/summary/index.js +++ b/modules/route/front/summary/index.js @@ -16,6 +16,10 @@ class Controller extends Summary { }); } + get isDelivery() { + return this.aclService.hasAny(['delivery']); + } + get route() { return this._route; } diff --git a/modules/supplier/front/summary/index.html b/modules/supplier/front/summary/index.html index 14168f253f..b089f25e93 100644 --- a/modules/supplier/front/summary/index.html +++ b/modules/supplier/front/summary/index.html @@ -10,7 +10,18 @@ -

Basic data

+

+ + Basic data + +

+

+ Basic data +

-

Billing data

+

+ + Billing data + +

+

+ Billing data +

@@ -63,7 +85,18 @@
-

Fiscal data

+

+ + Fiscal data + +

+

+ Fiscal data +

@@ -82,7 +115,18 @@
-

Fiscal address

+

+ + Fiscal address + +

+

+ Fiscal address +

diff --git a/modules/supplier/front/summary/index.js b/modules/supplier/front/summary/index.js index 0992578489..a828379bc9 100644 --- a/modules/supplier/front/summary/index.js +++ b/modules/supplier/front/summary/index.js @@ -10,6 +10,10 @@ class Controller extends Summary { this.getSummary(); } + get isAdministrative() { + return this.aclService.hasAny(['administrative']); + } + getSummary() { return this.$http.get(`Suppliers/${this.supplier.id}/getSummary`).then(response => { this.summary = response.data; diff --git a/modules/ticket/front/search-panel/index.html b/modules/ticket/front/search-panel/index.html index 8570036c01..d9ab2ee910 100644 --- a/modules/ticket/front/search-panel/index.html +++ b/modules/ticket/front/search-panel/index.html @@ -1,6 +1,6 @@
-
- + + - + - - - - - - - - - +
+ + + + + + O + + + + + +
+ - + - + - + - + diff --git a/modules/ticket/front/search-panel/index.js b/modules/ticket/front/search-panel/index.js index 08b0fb2447..6ef47757a8 100644 --- a/modules/ticket/front/search-panel/index.js +++ b/modules/ticket/front/search-panel/index.js @@ -1,8 +1,11 @@ import ngModule from '../module'; import SearchPanel from 'core/components/searchbar/search-panel'; + class Controller extends SearchPanel { constructor($, $element) { super($, $element); + this.filter = this.$.filter; + this.getGroupedStates(); } @@ -19,6 +22,35 @@ class Controller extends SearchPanel { this.groupedStates = groupedStates; }); } + + get from() { + return this._from; + } + + set from(value) { + this._from = value; + this.filter.scopeDays = null; + } + + get to() { + return this._to; + } + + set to(value) { + this._to = value; + this.filter.scopeDays = null; + } + + get scopeDays() { + return this._scopeDays; + } + + set scopeDays(value) { + this._scopeDays = value; + + this.filter.from = null; + this.filter.to = null; + } } ngModule.vnComponent('vnTicketSearchPanel', { diff --git a/modules/ticket/front/search-panel/index.spec.js b/modules/ticket/front/search-panel/index.spec.js index 55d341d2ac..f3a2f39edd 100644 --- a/modules/ticket/front/search-panel/index.spec.js +++ b/modules/ticket/front/search-panel/index.spec.js @@ -10,10 +10,11 @@ describe('Ticket Component vnTicketSearchPanel', () => { $httpBackend = _$httpBackend_; controller = $componentController('vnTicketSearchPanel', {$element: null}); controller.$t = () => {}; + controller.filter = {}; })); describe('getGroupedStates()', () => { - it('should set an array of groupedStates with the aditionof a name translation', () => { + it('should set an array of groupedStates with the adition of a name translation', () => { jest.spyOn(controller, '$t').mockReturnValue('miCodigo'); const data = [ { @@ -32,4 +33,39 @@ describe('Ticket Component vnTicketSearchPanel', () => { }]); }); }); + + describe('from() setter', () => { + it('should clear the scope days when setting the from property', () => { + controller.filter.scopeDays = 1; + + controller.from = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.from).toBeDefined(); + }); + }); + + describe('to() setter', () => { + it('should clear the scope days when setting the to property', () => { + controller.filter.scopeDays = 1; + + controller.to = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.to).toBeDefined(); + }); + }); + + describe('scopeDays() setter', () => { + it('should clear the date range when setting the scopeDays property', () => { + controller.filter.from = new Date(); + controller.filter.to = new Date(); + + controller.scopeDays = 1; + + expect(controller.filter.from).toBeNull(); + expect(controller.filter.to).toBeNull(); + expect(controller.scopeDays).toBeDefined(); + }); + }); }); diff --git a/modules/ticket/front/search-panel/locale/es.yml b/modules/ticket/front/search-panel/locale/es.yml index 5fa75ac099..54a01c82f8 100644 --- a/modules/ticket/front/search-panel/locale/es.yml +++ b/modules/ticket/front/search-panel/locale/es.yml @@ -16,4 +16,5 @@ Pending: Pendiente FREE: Libre DELIVERED: Servido ON_PREPARATION: En preparacion -PACKED: Encajado \ No newline at end of file +PACKED: Encajado +Cannot choose a range of dates and days onward at the same time: No se puede selecionar un rango de fechas y días en adelante a la vez \ No newline at end of file diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 803734c740..dcd4470e4e 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -103,7 +104,13 @@

Total {{$ctrl.summary.total | currency: 'EUR':2}}

-

Sale

+

+ + Sale + +

@@ -158,7 +165,13 @@ -

Packages

+

+ + Packages + +

@@ -177,7 +190,13 @@
-

Service

+

+ + Service + +

@@ -202,7 +221,13 @@ -

Purchase request

+

+ + Purchase request + +

diff --git a/modules/ticket/front/weekly/locale/es.yml b/modules/ticket/front/weekly/locale/es.yml index 804467dae2..62f0f5b53d 100644 --- a/modules/ticket/front/weekly/locale/es.yml +++ b/modules/ticket/front/weekly/locale/es.yml @@ -4,4 +4,4 @@ You are going to delete this weekly ticket: Vas a eliminar este ticket programad This ticket will be removed from weekly tickets! Continue anyway?: Este ticket se eliminará de tickets programados! ¿Continuar de todas formas? Search weekly ticket by id or client id: Busca tickets programados por el identificador o el identificador del cliente Search by weekly ticket: Buscar por tickets programados -weekDay: Dia \ No newline at end of file +Weekday: Llegada \ No newline at end of file diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html index de6f6e979e..90a2ea27f6 100644 --- a/modules/travel/front/summary/index.html +++ b/modules/travel/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -132,7 +133,18 @@ -

Thermographs

+

+ + Thermograph + +

+

+ Thermograph +

diff --git a/modules/travel/front/summary/index.js b/modules/travel/front/summary/index.js index 876d1ec6c2..5144a0bb5e 100644 --- a/modules/travel/front/summary/index.js +++ b/modules/travel/front/summary/index.js @@ -56,6 +56,10 @@ class Controller extends Summary { return total; } + + get isBuyer() { + return this.aclService.hasAny(['buyer']); + } } ngModule.vnComponent('vnTravelSummary', { diff --git a/modules/worker/back/models/calendar.json b/modules/worker/back/models/calendar.json index 199d81e6c7..1da7179c4e 100644 --- a/modules/worker/back/models/calendar.json +++ b/modules/worker/back/models/calendar.json @@ -1,6 +1,6 @@ { "name": "Calendar", - "base": "Loggable", + "base": "VnModel", "log": { "model": "WorkerLog", "relation": "labour" diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index e816f6cf2a..0a99959e4f 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -10,7 +10,17 @@
-

Basic data

+

+ + Basic data + +

+

+ Basic data +

diff --git a/modules/worker/front/summary/index.js b/modules/worker/front/summary/index.js index 178df81a90..6a4d870074 100644 --- a/modules/worker/front/summary/index.js +++ b/modules/worker/front/summary/index.js @@ -52,6 +52,10 @@ class Controller extends Summary { this.$.worker = res.data; }); } + + get isHr() { + return this.aclService.hasAny(['hr']); + } } ngModule.vnComponent('vnWorkerSummary', { diff --git a/modules/zone/front/summary/index.html b/modules/zone/front/summary/index.html index 9247087e60..2fe94388f1 100644 --- a/modules/zone/front/summary/index.html +++ b/modules/zone/front/summary/index.html @@ -1,6 +1,7 @@
- @@ -36,7 +37,11 @@ -

Warehouses

+

+ + Warehouse + +