diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 22f214543..8adbd10a7 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -32872,6 +32872,27 @@ templates + + anticipated_revenue + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + attendance_detail false diff --git a/client/src/components/report-center-modal/report-center-modal.component.jsx b/client/src/components/report-center-modal/report-center-modal.component.jsx index 75cbf0454..536d5deed 100644 --- a/client/src/components/report-center-modal/report-center-modal.component.jsx +++ b/client/src/components/report-center-modal/report-center-modal.component.jsx @@ -61,8 +61,12 @@ export function ReportCenterModalComponent({ reportCenterModal }) { { name: values.key, variables: { - ...(start ? { start: moment(start).format("YYYY-MM-DD") } : {}), - ...(end ? { end: moment(end).format("YYYY-MM-DD") } : {}), + ...(start + ? { start: moment(start).startOf("day").format("YYYY-MM-DD") } + : {}), + ...(end + ? { end: moment(end).endOf("day").format("YYYY-MM-DD") } + : {}), ...(id ? { id: id } : {}), }, }, diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 517dadfdd..579b39067 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1982,6 +1982,7 @@ "vendor": "Vendor" }, "templates": { + "anticipated_revenue": "Anticipated Revenue", "attendance_detail": "Attendance (All Employees)", "attendance_employee": "Employee Attendance", "attendance_summary": "Attendance Summary (All Employees)", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 881d830fc..c0a8a2919 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1982,6 +1982,7 @@ "vendor": "" }, "templates": { + "anticipated_revenue": "", "attendance_detail": "", "attendance_employee": "", "attendance_summary": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index c4a9b0cc5..72f5c96a7 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1982,6 +1982,7 @@ "vendor": "" }, "templates": { + "anticipated_revenue": "", "attendance_detail": "", "attendance_employee": "", "attendance_summary": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index f3414e33a..6a6f8452d 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -1238,6 +1238,18 @@ export const TemplateList = (type, context) => { field: i18n.t("scoreboard.fields.date"), }, }, + anticipated_revenue: { + title: i18n.t("reportcenter.templates.anticipated_revenue"), + description: "", + subject: i18n.t("reportcenter.templates.anticipated_revenue"), + key: "anticipated_revenue", + //idtype: "vendor", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.scheduled_completion"), // Also date invoice. + }, + }, } : {}), ...(!type || type === "courtesycarcontract" diff --git a/server/sms/receive.js b/server/sms/receive.js index 081cd383b..3c134fb66 100644 --- a/server/sms/receive.js +++ b/server/sms/receive.js @@ -26,7 +26,7 @@ exports.receive = (req, res) => { client .request(queries.FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID, { mssid: req.body.MessagingServiceSid, - phone: phone(req.body.From)[0], + phone: phone(req.body.From).phoneNumber, }) .then((response) => { console.log("re", req.body); @@ -45,7 +45,7 @@ exports.receive = (req, res) => { newMessage.conversation = { data: { bodyshopid: response.bodyshops[0].id, - phone_num: phone(req.body.From)[0], + phone_num: phone(req.body.From).phoneNumber, }, }; } else if (response.bodyshops[0].conversations.length === 1) { @@ -80,13 +80,13 @@ exports.receive = (req, res) => { const uniqueTokens = [...new Set(allTokens)]; var message = { notification: { - title: `SMS - ${phone(req.body.From)[0]}`, + title: `SMS - ${phone(req.body.From).phoneNumber}`, body: req.body.Body, click_action: "TEST CLICK ACTION", }, data: { jobid: "1234", - title: `New SMS From ${phone(req.body.From)[0]}`, + title: `New SMS From ${phone(req.body.From).phoneNumber}`, body: req.body.Body, }, tokens: uniqueTokens, diff --git a/server/sms/send.js b/server/sms/send.js index dd14bb011..0b6647176 100644 --- a/server/sms/send.js +++ b/server/sms/send.js @@ -30,7 +30,7 @@ exports.send = (req, res) => { .create({ body: body, messagingServiceSid: messagingServiceSid, - to: phone(to)[0], + to: phone(to).phoneNumber, mediaUrl: selectedMedia.map((i) => i.src), }) .then((message) => {