From 6265796260ce56361c03d10542a813447d962f61 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Mon, 3 Feb 2020 09:24:49 +0100 Subject: [PATCH 1/5] add icon in ticket.basicData --- modules/ticket/front/basic-data/step-one/index.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/ticket/front/basic-data/step-one/index.html b/modules/ticket/front/basic-data/step-one/index.html index ccdf8a15f..0d2a7ecc6 100644 --- a/modules/ticket/front/basic-data/step-one/index.html +++ b/modules/ticket/front/basic-data/step-one/index.html @@ -32,6 +32,13 @@ , {{::street}}, {{::city}}, {{::province.name}} - {{::agencyMode.name}} + + + + Date: Mon, 3 Feb 2020 11:12:04 +0100 Subject: [PATCH 2/5] update lastActiveTickets --- modules/client/back/methods/client/lastActiveTickets.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/client/back/methods/client/lastActiveTickets.js b/modules/client/back/methods/client/lastActiveTickets.js index 4dc1e2c56..0337857a9 100644 --- a/modules/client/back/methods/client/lastActiveTickets.js +++ b/modules/client/back/methods/client/lastActiveTickets.js @@ -1,6 +1,6 @@ module.exports = Self => { Self.remoteMethod('lastActiveTickets', { - description: 'Returns the last three tickets of a client that have the alertLevel at 0 and the shiped day is gt today', + description: 'Returns the last three active tickets of a client', accessType: 'READ', accepts: [{ arg: 'id', @@ -24,16 +24,18 @@ module.exports = Self => { }); Self.lastActiveTickets = async(id, ticketId) => { + const ticket = await Self.app.models.Ticket.findById(ticketId); const query = ` SELECT t.id, t.shipped, a.name AS agencyName, w.name AS warehouseName FROM vn.ticket t JOIN vn.ticketState ts ON t.id = ts.ticketFk JOIN vn.agencyMode a ON t.agencyModeFk = a.id JOIN vn.warehouse w ON t.warehouseFk = w.id - WHERE t.shipped >= CURDATE() AND t.clientFk = ? AND ts.alertLevel = 0 AND t.id <> ? + WHERE t.shipped >= CURDATE() AND t.clientFk = ? AND ts.alertLevel = 0 + AND t.id <> ? AND t.warehouseFk = ? ORDER BY t.shipped LIMIT 3`; - return Self.rawSql(query, [id, ticketId]); + return Self.rawSql(query, [id, ticketId, ticket.warehouseFk]); }; }; From 759ac5b5c749b0a7fdf7bdcff6dabc70d6433fcf Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Mon, 3 Feb 2020 14:03:09 +0100 Subject: [PATCH 3/5] add icon in worker.index --- modules/worker/front/index/index.html | 5 +++++ modules/worker/front/index/index.js | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/modules/worker/front/index/index.html b/modules/worker/front/index/index.html index c5f9239f1..56dde4609 100644 --- a/modules/worker/front/index/index.html +++ b/modules/worker/front/index/index.html @@ -34,6 +34,11 @@ + + Date: Mon, 3 Feb 2020 14:36:04 +0100 Subject: [PATCH 4/5] update ticket.dms.create --- modules/ticket/front/dms/create/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ticket/front/dms/create/index.js b/modules/ticket/front/dms/create/index.js index cb39be7dc..f1b59f6c0 100644 --- a/modules/ticket/front/dms/create/index.js +++ b/modules/ticket/front/dms/create/index.js @@ -47,12 +47,11 @@ class Controller { }}; this.$http.get('DmsTypes/findOne', {params}).then(res => { const dmsTypeId = res.data && res.data.id; - const companyId = this.vnConfig.companyFk; const warehouseId = this.vnConfig.warehouseFk; const defaultParams = { reference: this.ticket.id, warehouseId: warehouseId, - companyId: companyId, + companyId: this.ticket.companyFk, dmsTypeId: dmsTypeId, description: this.$translate.instant('FileDescription', { ticketId: this.ticket.id, From 89dc8e27e037a856474fef9c0363f88d14e58107 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Tue, 4 Feb 2020 11:20:05 +0100 Subject: [PATCH 5/5] update models --- modules/worker/back/model-config.json | 4 ++-- .../{holiday-detail.json => calendar-holidays-name.json} | 6 +++--- .../{holiday-type.json => calendar-holidays-type.json} | 4 ++-- modules/worker/back/models/holiday.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) rename modules/worker/back/models/{holiday-detail.json => calendar-holidays-name.json} (79%) rename modules/worker/back/models/{holiday-type.json => calendar-holidays-type.json} (84%) diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index 4948231b9..5b9136f68 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -8,10 +8,10 @@ "Holiday": { "dataSource": "vn" }, - "HolidayDetail": { + "CalendarHolidaysName": { "dataSource": "vn" }, - "HolidayType": { + "CalendarHolidaysType": { "dataSource": "vn" }, "WorkCenter": { diff --git a/modules/worker/back/models/holiday-detail.json b/modules/worker/back/models/calendar-holidays-name.json similarity index 79% rename from modules/worker/back/models/holiday-detail.json rename to modules/worker/back/models/calendar-holidays-name.json index 86874a02e..d04ef9c74 100644 --- a/modules/worker/back/models/holiday-detail.json +++ b/modules/worker/back/models/calendar-holidays-name.json @@ -1,9 +1,9 @@ { - "name": "HolidayDetail", + "name": "CalendarHolidaysName", "base": "VnModel", "options": { "mysql": { - "table": "holidayDetail" + "table": "calendarHolidaysName" } }, "properties": { @@ -11,7 +11,7 @@ "id": true, "type": "Number" }, - "description": { + "name": { "type": "String" } }, diff --git a/modules/worker/back/models/holiday-type.json b/modules/worker/back/models/calendar-holidays-type.json similarity index 84% rename from modules/worker/back/models/holiday-type.json rename to modules/worker/back/models/calendar-holidays-type.json index 6e40a62c7..a83dbc13c 100644 --- a/modules/worker/back/models/holiday-type.json +++ b/modules/worker/back/models/calendar-holidays-type.json @@ -1,9 +1,9 @@ { - "name": "HolidayType", + "name": "CalendarHolidaysType", "base": "VnModel", "options": { "mysql": { - "table": "holidayType" + "table": "calendarHolidaysType" } }, "properties": { diff --git a/modules/worker/back/models/holiday.json b/modules/worker/back/models/holiday.json index 678910f0a..a820c0d51 100644 --- a/modules/worker/back/models/holiday.json +++ b/modules/worker/back/models/holiday.json @@ -22,12 +22,12 @@ "relations": { "detail": { "type": "belongsTo", - "model": "HolidayDetail", + "model": "CalendarHolidaysName", "foreignKey": "holidayDetailFk" }, "type": { "type": "belongsTo", - "model": "HolidayType", + "model": "CalendarHolidaysType", "foreignKey": "holidayTypeFk" }, "workCenter": {