diff --git a/loopback/locale/en.json b/loopback/locale/en.json index 498635832..3dfb73833 100644 --- a/loopback/locale/en.json +++ b/loopback/locale/en.json @@ -73,6 +73,7 @@ "I have deleted the ticket id": "I have deleted the ticket id [{{id}}]({{{url}}})", "I have restored the ticket id": "I have restored the ticket id [{{id}}]({{{url}}})", "Changed this data from the ticket": "I have changed the data from the ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}", + "The grade must be similar to the last one": "The grade must be similar to the last one", "agencyModeFk": "Agency", "clientFk": "Client", "zoneFk": "Zone", diff --git a/modules/item/front/diary/index.html b/modules/item/front/diary/index.html index 080cc0f36..b8572dcff 100644 --- a/modules/item/front/diary/index.html +++ b/modules/item/front/diary/index.html @@ -55,8 +55,8 @@ - {{::sale.origin | dashIfEmpty}} @@ -94,3 +94,7 @@ + + + diff --git a/modules/item/front/diary/index.js b/modules/item/front/diary/index.js index 953d203e8..bf04fabe9 100644 --- a/modules/item/front/diary/index.js +++ b/modules/item/front/diary/index.js @@ -58,10 +58,12 @@ class Controller extends Section { this.$anchorScroll(); } - showTicketDescriptor(event, sale) { - if (!sale.isTicket) return; + showDescriptor(event, sale) { + let descriptor = 'entryDescriptor'; + if (sale.isTicket) + descriptor = 'ticketDescriptor'; - this.$.ticketDescriptor.show(event.target, sale.origin); + this.$[descriptor].show(event.target, sale.origin); } } diff --git a/modules/item/front/diary/index.spec.js b/modules/item/front/diary/index.spec.js index 52608cde3..988914978 100644 --- a/modules/item/front/diary/index.spec.js +++ b/modules/item/front/diary/index.spec.js @@ -60,6 +60,34 @@ describe('Item', () => { expect(controller.$anchorScroll).toHaveBeenCalledWith(); }); }); + + describe('showDescriptor ()', () => { + it('should call to the entryDescriptor show() method', () => { + controller.$.entryDescriptor = {}; + controller.$.entryDescriptor.show = jest.fn(); + + const $event = new Event('click'); + const target = document.createElement('div'); + target.dispatchEvent($event); + const data = {id: 1, origin: 1}; + controller.showDescriptor($event, data); + + expect(controller.$.entryDescriptor.show).toHaveBeenCalledWith($event.target, data.origin); + }); + + it('should call to the ticketDescriptor show() method', () => { + controller.$.ticketDescriptor = {}; + controller.$.ticketDescriptor.show = jest.fn(); + + const $event = new Event('click'); + const target = document.createElement('div'); + target.dispatchEvent($event); + const data = {id: 1, origin: 1, isTicket: true}; + controller.showDescriptor($event, data); + + expect(controller.$.ticketDescriptor.show).toHaveBeenCalledWith($event.target, data.origin); + }); + }); }); }); diff --git a/modules/item/front/routes.json b/modules/item/front/routes.json index 2aab4301e..d3bde0205 100644 --- a/modules/item/front/routes.json +++ b/modules/item/front/routes.json @@ -3,7 +3,7 @@ "name": "Items", "icon": "icon-item", "validations" : true, - "dependencies": ["worker", "client", "ticket"], + "dependencies": ["worker", "client", "ticket", "entry"], "menus": { "main": [ {"state": "item.index", "icon": "icon-item"}, diff --git a/modules/travel/front/routes.json b/modules/travel/front/routes.json index b802aaa4a..5fa43fd1d 100644 --- a/modules/travel/front/routes.json +++ b/modules/travel/front/routes.json @@ -3,7 +3,7 @@ "name": "Travels", "icon": "local_airport", "validations": true, - "dependencies": ["worker"], + "dependencies": ["worker", "entry"], "menus": { "main": [ {"state": "travel.index", "icon": "local_airport"} diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html index 12dbded4e..7e055a0f1 100644 --- a/modules/travel/front/summary/index.html +++ b/modules/travel/front/summary/index.html @@ -41,7 +41,7 @@ value="{{$ctrl.travelData.ref}}"> Package CC Pallet - m3 + @@ -75,7 +75,12 @@ disabled="true"> - {{entry.id}} + + + {{entry.id}} + + {{entry.supplierName}} {{entry.ref}} {{entry.hb}} @@ -141,4 +146,7 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/modules/travel/front/summary/locale/es.yml b/modules/travel/front/summary/locale/es.yml index c82508dfc..8d2e7e78c 100644 --- a/modules/travel/front/summary/locale/es.yml +++ b/modules/travel/front/summary/locale/es.yml @@ -9,7 +9,7 @@ Received: Recibida Agency: Agencia Entries: Entradas Confirmed: Confirmada -Entry Id: Entrada Id +Entry Id: Id entrada Supplier: Proveedor Pallet: Pallet Freight: Porte diff --git a/modules/zone/front/events/index.html b/modules/zone/front/events/index.html index eea24a132..d48b5f0d8 100644 --- a/modules/zone/front/events/index.html +++ b/modules/zone/front/events/index.html @@ -73,7 +73,7 @@ value="{{::row.bonus | currency:'EUR':2}}"> @@ -166,7 +166,7 @@