diff --git a/client/src/redux/user/user.sagas.js b/client/src/redux/user/user.sagas.js index c508bf96e..12533865c 100644 --- a/client/src/redux/user/user.sagas.js +++ b/client/src/redux/user/user.sagas.js @@ -50,7 +50,7 @@ import { } from "./user.actions"; import UserActionTypes from "./user.types"; //import * as amplitude from '@amplitude/analytics-browser'; -import posthog from 'posthog-js'; +import posthog from "posthog-js"; const fpPromise = FingerprintJS.load(); @@ -269,11 +269,11 @@ export function* signInSuccessSaga({ payload }) { instanceSeg, ...(isParts ? [ - InstanceRenderManager({ - imex: "ImexPartsManagement", - rome: "RomePartsManagement" - }) - ] + InstanceRenderManager({ + imex: "ImexPartsManagement", + rome: "RomePartsManagement" + }) + ] : []) ]; window.$crisp.push(["set", "session:segments", [segs]]); @@ -375,17 +375,31 @@ export function* SetAuthLevelFromShopDetails({ payload }) { const isParts = yield select((state) => state.application.isPartsEntry === true); const instanceSeg = InstanceRenderManager({ imex: "imex", rome: "rome" }); - let featureSegments; - if (payload.features?.allAccess === true) { - featureSegments = ["allAccess"]; - } else { - const featureKeys = Object.keys(payload.features).filter( - (key) => - payload.features[key] === true || - (typeof payload.features[key] === "string" && !isNaN(Date.parse(payload.features[key]))) - ); - featureSegments = ["basic", ...featureKeys]; - } + const featureSegments = + payload.features?.allAccess === true + ? ["allAccess"] + : [ + "basic", + ...Object.keys(payload.features).filter( + (key) => + payload.features[key] === true || + (typeof payload.features[key] === "string" && !isNaN(Date.parse(payload.features[key]))) + ) + ]; + + const additionalSegments = [ + payload.cdk_dealerid && "CDK", + payload.pbs_serialnumber && "PBS", + // payload.rr_dealerid && "Reynolds", + payload.accountingconfig.qbo === true && "QBO", + payload.accountingconfig.qbo === false && + !payload.cdk_dealerid && + !payload.pbs_serialnumber && + // !payload.rr_dealerid && + "QBD" + ].filter(Boolean); + + featureSegments.push(...additionalSegments); const regionSeg = payload.region_config ? `region:${payload.region_config}` : null; const segments = [instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments]; diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 620370169..83a6eca4a 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -1221,7 +1221,7 @@ export const TemplateList = (type, context) => { payments_by_date_excel: { title: i18n.t("reportcenter.templates.payments_by_date_excel"), subject: i18n.t("reportcenter.templates.payments_by_date_excel"), - key: "payments_by_date", + key: "payments_by_date_excel", reporttype: "excel", disabled: false, rangeFilter: { diff --git a/server/notifications/scenarioBuilders.js b/server/notifications/scenarioBuilders.js index d1bdb22a0..ec24e1804 100644 --- a/server/notifications/scenarioBuilders.js +++ b/server/notifications/scenarioBuilders.js @@ -81,8 +81,8 @@ const alternateTransportChangedBuilder = (data) => { * @returns {{app: {jobId, jobRoNumber: *, bodyShopId: *, key: string, body: string, variables: Object, recipients: *[]}, email: {jobId, jobRoNumber: *, bodyShopName: *, body: string, recipients: *[]}, fcm: {recipients: *[]}}} */ const billPostedBuilder = (data) => { - const facing = data?.data?.isinhouse ? "in-house" : "vendor"; - const body = `An ${facing} ${data?.data?.is_credit_memo ? "credit memo" : "bill"} has been posted.`.trim(); + const facing = data?.data?.isinhouse ? "An In House" : "A Vendor"; + const body = `${facing} ${data?.data?.is_credit_memo ? "credit memo" : "bill"} has been posted.`.trim(); return buildNotification(data, "notifications.job.billPosted", body, { isInHouse: data?.data?.isinhouse,