diff --git a/back/methods/chat/sendCheckingPresence.js b/back/methods/chat/sendCheckingPresence.js index 5c27d72fd..6560240c6 100644 --- a/back/methods/chat/sendCheckingPresence.js +++ b/back/methods/chat/sendCheckingPresence.js @@ -46,7 +46,7 @@ module.exports = Self => { const {data} = await Self.getUserStatus(recipient.name); if (data) { - if (data.status === 'offline') { + if (data.status === 'offline' || data.status === 'busy') { // Send message to department room const workerDepartment = await models.WorkerDepartment.findById(recipientId, { include: { @@ -58,6 +58,8 @@ module.exports = Self => { if (channelName) return Self.send(ctx, `#${channelName}`, `@${recipient.name} ➔ ${message}`); + else + return Self.send(ctx, `@${recipient.name}`, message); } else return Self.send(ctx, `@${recipient.name}`, message); } diff --git a/modules/zone/front/delivery-days/index.js b/modules/zone/front/delivery-days/index.js index e4d5e72e9..71e8c8ab7 100644 --- a/modules/zone/front/delivery-days/index.js +++ b/modules/zone/front/delivery-days/index.js @@ -73,15 +73,14 @@ class Controller extends Section { for (let event of $events) zoneIds.push(event.zoneFk); - this.$.zoneEvents.show($event.target); - const params = { zoneIds: zoneIds, date: day }; this.$http.post(`Zones/getZoneClosing`, params) - .then(res => this.zoneClosing = res.data); + .then(res => this.zoneClosing = res.data) + .then(() => this.$.zoneEvents.show($event.target)); } preview(zone) { diff --git a/print/templates/reports/delivery-note/delivery-note.js b/print/templates/reports/delivery-note/delivery-note.js index adda6e756..f9dba0578 100755 --- a/print/templates/reports/delivery-note/delivery-note.js +++ b/print/templates/reports/delivery-note/delivery-note.js @@ -7,6 +7,10 @@ const fs = require('fs-extra'); module.exports = { name: 'delivery-note', + created() { + if (!this.type) + this.type = 'deliveryNote'; + }, async serverPrefetch() { this.client = await this.fetchClient(this.ticketId); this.ticket = await this.fetchTicket(this.ticketId); @@ -129,7 +133,7 @@ module.exports = { }, type: { type: String, - required: true + required: false } } };