RO into IO merge as of 02/05/2024.
This commit is contained in:
@@ -6,14 +6,8 @@ const AuditTrailMapping = {
|
||||
admin_jobfieldchange: (field, value) =>
|
||||
"ADMIN: " +
|
||||
i18n.t("audit_trail.messages.jobfieldchanged", {field, value}),
|
||||
admin_jobmarkexported: () =>
|
||||
i18n.t("audit_trail.messages.admin_jobmarkexported"),
|
||||
admin_jobmarkforreexport: () =>
|
||||
i18n.t("audit_trail.messages.admin_jobmarkforreexport"),
|
||||
admin_jobstatuschange: (status) =>
|
||||
"ADMIN: " + i18n.t("audit_trail.messages.jobstatuschange", {status}),
|
||||
admin_jobuninvoice: () => i18n.t("audit_trail.messages.admin_jobuninvoice"),
|
||||
admin_jobunvoid: () => i18n.t("audit_trail.messages.admin_jobunvoid"),
|
||||
alertToggle: (status) =>
|
||||
i18n.t("audit_trail.messages.alerttoggle", {status}),
|
||||
appointmentcancel: (lost_sale_reason) =>
|
||||
@@ -24,7 +18,6 @@ const AuditTrailMapping = {
|
||||
i18n.t("audit_trail.messages.billposted", {invoice_number}),
|
||||
billupdated: (invoice_number) =>
|
||||
i18n.t("audit_trail.messages.billupdated", {invoice_number}),
|
||||
failedpayment: () => i18n.t("audit_trail.messages.failedpayment"),
|
||||
jobassignmentchange: (operation, name) =>
|
||||
i18n.t("audit_trail.messages.jobassignmentchange", {operation, name}),
|
||||
jobassignmentremoved: (operation) =>
|
||||
@@ -42,8 +35,17 @@ const AuditTrailMapping = {
|
||||
jobmodifylbradj: ({mod_lbr_ty, hours}) =>
|
||||
i18n.t("audit_trail.messages.jobmodifylbradj", {mod_lbr_ty, hours}),
|
||||
jobnoteadded: () => i18n.t("audit_trail.messages.jobnoteadded"),
|
||||
jobnotedeleted: () => i18n.t("audit_trail.messages.jobnotedeleted"),
|
||||
jobnoteupdated: () => i18n.t("audit_trail.messages.jobnoteupdated"),
|
||||
jobnotedeleted: () => i18n.t("audit_trail.messages.jobnotedeleted"),
|
||||
admin_jobunvoid: () => i18n.t("audit_trail.messages.admin_jobunvoid"),
|
||||
admin_jobuninvoice: () => i18n.t("audit_trail.messages.admin_jobuninvoice"),
|
||||
admin_jobmarkforreexport: () =>
|
||||
i18n.t("audit_trail.messages.admin_jobmarkforreexport"),
|
||||
admin_jobmarkexported: () =>
|
||||
i18n.t("audit_trail.messages.admin_jobmarkexported"),
|
||||
failedpayment: () => i18n.t("audit_trail.messages.failedpayment"),
|
||||
assignedlinehours: (team, hours) =>
|
||||
i18n.t("audit_trail.messages.assignedlinehours", {team, hours}),
|
||||
jobspartsorder: (order_number) =>
|
||||
i18n.t("audit_trail.messages.jobspartsorder", {order_number}),
|
||||
jobspartsreturn: (order_number) =>
|
||||
|
||||
@@ -4,6 +4,7 @@ import i18n from "i18next";
|
||||
import React from "react";
|
||||
import * as serviceWorkerRegistration from "../serviceWorkerRegistration";
|
||||
import {store} from "../redux/store";
|
||||
import InstanceRenderManager from "./instanceRenderMgr";
|
||||
|
||||
const onServiceWorkerUpdate = (registration) => {
|
||||
console.log("onServiceWorkerUpdate", registration);
|
||||
@@ -12,7 +13,10 @@ const onServiceWorkerUpdate = (registration) => {
|
||||
<Space flex>
|
||||
<Button
|
||||
onClick={async () => {
|
||||
window.open("https://imex-online.noticeable.news/", "_blank");
|
||||
window.open(
|
||||
InstanceRenderManager({imex:"https://imex-online.noticeable.news/",
|
||||
rome: "https://rome-online.noticeable.news/"})
|
||||
, "_blank");
|
||||
}}
|
||||
>
|
||||
{i18n.t("general.actions.viewreleasenotes")}
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
import i18n from "i18next";
|
||||
//import { store } from "../redux/store";
|
||||
import InstanceRenderManager from './instanceRenderMgr'
|
||||
|
||||
export const EmailSettings = {
|
||||
fromNameDefault: "ImEX Online",
|
||||
fromAddress: "noreply@imex.online",
|
||||
fromNameDefault: InstanceRenderManager({
|
||||
imex: "ImEX Online",
|
||||
rome:"Rome Online"
|
||||
}) ,
|
||||
fromAddress: InstanceRenderManager({imex: "noreply@imex.online" ,rome:"noreply@romeonline.io"}) ,
|
||||
};
|
||||
|
||||
export const TemplateList = (type, context) => {
|
||||
@@ -189,6 +194,16 @@ export const TemplateList = (type, context) => {
|
||||
key: "worksheet_by_line_number",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: false,
|
||||
},
|
||||
worksheet_by_line_number_enhanced: {
|
||||
title: i18n.t("printcenter.jobs.worksheet_by_line_number"),
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.worksheet_by_line_number"),
|
||||
key: "worksheet_by_line_number_enhanced",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
worksheet_sorted_by_operation_type: {
|
||||
title: i18n.t(
|
||||
@@ -201,6 +216,20 @@ export const TemplateList = (type, context) => {
|
||||
key: "worksheet_sorted_by_operation_type",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: false,
|
||||
},
|
||||
worksheet_sorted_by_operation_type_enhanced: {
|
||||
title: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_type"
|
||||
),
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_type"
|
||||
),
|
||||
key: "worksheet_sorted_by_operation_type_enhanced",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
worksheet_sorted_by_operation: {
|
||||
title: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
|
||||
@@ -209,6 +238,16 @@ export const TemplateList = (type, context) => {
|
||||
key: "worksheet_sorted_by_operation",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: false,
|
||||
},
|
||||
worksheet_sorted_by_operation_enhanced: {
|
||||
title: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
|
||||
key: "worksheet_sorted_by_operation_enhanced",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
worksheet_sorted_by_operation_no_hours: {
|
||||
title: i18n.t(
|
||||
@@ -221,6 +260,20 @@ export const TemplateList = (type, context) => {
|
||||
key: "worksheet_sorted_by_operation_no_hours",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: false,
|
||||
},
|
||||
worksheet_sorted_by_operation_no_hours_enhanced: {
|
||||
title: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
|
||||
),
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
|
||||
),
|
||||
key: "worksheet_sorted_by_operation_no_hours_enhanced",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
worksheet_sorted_by_operation_part_type: {
|
||||
title: i18n.t(
|
||||
@@ -233,6 +286,20 @@ export const TemplateList = (type, context) => {
|
||||
key: "worksheet_sorted_by_operation_part_type",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: false,
|
||||
},
|
||||
worksheet_sorted_by_operation_part_type_enhanced: {
|
||||
title: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
|
||||
),
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
|
||||
),
|
||||
key: "worksheet_sorted_by_operation_part_type_enhanced",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
payments_by_job: {
|
||||
title: i18n.t("printcenter.jobs.payments_by_job"),
|
||||
@@ -514,6 +581,24 @@ export const TemplateList = (type, context) => {
|
||||
group: "financial",
|
||||
dms: true,
|
||||
},
|
||||
worksheet_sorted_by_team: {
|
||||
title: i18n.t("printcenter.jobs.worksheet_sorted_by_team"),
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.worksheet_sorted_by_team"),
|
||||
key: "worksheet_sorted_by_team",
|
||||
disabled: false,
|
||||
group: "worksheet",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
committed_timetickets_ro: {
|
||||
title: i18n.t("printcenter.jobs.committed_timetickets_ro"),
|
||||
description: "",
|
||||
subject: i18n.t("printcenter.jobs.committed_timetickets_ro"),
|
||||
key: "committed_timetickets_ro",
|
||||
disabled: false,
|
||||
group: "financial",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(!type || type === "job_special"
|
||||
@@ -559,6 +644,15 @@ export const TemplateList = (type, context) => {
|
||||
}),
|
||||
disabled: false,
|
||||
},
|
||||
parts_dispatch: {
|
||||
title: i18n.t("printcenter.jobs.parts_dispatch"),
|
||||
description: "",
|
||||
key: "parts_dispatch",
|
||||
subject: i18n.t("printcenter.subjects.jobs.parts_dispatch", {
|
||||
ro_number: (context && context.ro_number) || "",
|
||||
}),
|
||||
disabled: false,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(!type || type === "appointment"
|
||||
@@ -1658,6 +1752,24 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
group: "jobs",
|
||||
},
|
||||
work_in_progress_committed_labour: {
|
||||
title: i18n.t(
|
||||
"reportcenter.templates.work_in_progress_committed_labour"
|
||||
),
|
||||
description: "",
|
||||
subject: i18n.t(
|
||||
"reportcenter.templates.work_in_progress_committed_labour"
|
||||
),
|
||||
key: "work_in_progress_committed_labour",
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
rangeFilter: {
|
||||
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||
field: i18n.t("jobs.fields.date_open"),
|
||||
},
|
||||
group: "jobs",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
work_in_progress_payables: {
|
||||
title: i18n.t("reportcenter.templates.work_in_progress_payables"),
|
||||
description: "",
|
||||
@@ -2014,6 +2126,52 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
group: "jobs",
|
||||
},
|
||||
committed_timetickets: {
|
||||
title: i18n.t("reportcenter.templates.committed_timetickets"),
|
||||
subject: i18n.t("reportcenter.templates.committed_timetickets"),
|
||||
key: "committed_timetickets",
|
||||
disabled: false,
|
||||
rangeFilter: {
|
||||
object: i18n.t("reportcenter.labels.objects.timetickets"),
|
||||
field: i18n.t("timetickets.fields.committed_at"),
|
||||
},
|
||||
group: "payroll",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
committed_timetickets_employee: {
|
||||
title: i18n.t(
|
||||
"reportcenter.templates.committed_timetickets_employee"
|
||||
),
|
||||
subject: i18n.t(
|
||||
"reportcenter.templates.committed_timetickets_employee"
|
||||
),
|
||||
key: "committed_timetickets_employee",
|
||||
idtype: "employee",
|
||||
disabled: false,
|
||||
rangeFilter: {
|
||||
object: i18n.t("reportcenter.labels.objects.timetickets"),
|
||||
field: i18n.t("timetickets.fields.committed_at"),
|
||||
},
|
||||
group: "payroll",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
committed_timetickets_summary: {
|
||||
title: i18n.t(
|
||||
"reportcenter.templates.committed_timetickets_summary"
|
||||
),
|
||||
subject: i18n.t(
|
||||
"reportcenter.templates.committed_timetickets_summary"
|
||||
),
|
||||
key: "committed_timetickets_summary",
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
rangeFilter: {
|
||||
object: i18n.t("reportcenter.labels.objects.timetickets"),
|
||||
field: i18n.t("timetickets.fields.committed_at"),
|
||||
},
|
||||
group: "payroll",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
lost_sales: {
|
||||
title: i18n.t("reportcenter.templates.lost_sales"),
|
||||
subject: i18n.t("reportcenter.templates.lost_sales"),
|
||||
@@ -2026,6 +2184,20 @@ export const TemplateList = (type, context) => {
|
||||
},
|
||||
group: "customers",
|
||||
},
|
||||
load_level: {
|
||||
title: i18n.t("reportcenter.templates.load_level"),
|
||||
subject: i18n.t("reportcenter.templates.load_level"),
|
||||
key: "load_level",
|
||||
//idtype: "vendor",
|
||||
disabled: false,
|
||||
datedisable: true,
|
||||
rangeFilter: {
|
||||
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||
field: i18n.t("jobs.fields.date_open"),
|
||||
},
|
||||
group: "jobs",
|
||||
enhanced_payroll: true,
|
||||
},
|
||||
open_orders_excel: {
|
||||
title: i18n.t("reportcenter.templates.open_orders_excel"),
|
||||
subject: i18n.t("reportcenter.templates.open_orders_excel"),
|
||||
|
||||
@@ -3,12 +3,18 @@
|
||||
* Based on the node env params, return the correct prop.
|
||||
* Default is to return the ImEX Prop
|
||||
* @typedef {Object} InstanceManagerObject
|
||||
* @property { string | object | function } executeFunction will try to execute the function instead of returning a value.
|
||||
* @property { string | object | function } rome Return this prop if Rome.
|
||||
* @property { string | object | function } proman Return this prop if Rome.
|
||||
* @property { string | object | function } imex Return this prop if Rome.
|
||||
*/
|
||||
|
||||
function InstanceRenderManager({ rome, proman, imex }) {
|
||||
export default function InstanceRenderManager({
|
||||
executeFunction,
|
||||
rome,
|
||||
promanager,
|
||||
imex,
|
||||
}) {
|
||||
let propToReturn = null;
|
||||
|
||||
switch (process.env.INSTANCE) {
|
||||
@@ -19,16 +25,14 @@ function InstanceRenderManager({ rome, proman, imex }) {
|
||||
propToReturn = rome;
|
||||
break;
|
||||
case "PROMANAGER":
|
||||
propToReturn = proman;
|
||||
propToReturn =
|
||||
promanager === "USE_ROME" ? rome : promanager || rome; //default promanager back to rome.
|
||||
break;
|
||||
default:
|
||||
propToReturn = imex;
|
||||
break;
|
||||
}
|
||||
if (!propToReturn) {
|
||||
throw new Error(
|
||||
`Prop to return is not valid for this instance (${process.env.INSTANCE}).`
|
||||
);
|
||||
}
|
||||
return propToReturn;
|
||||
|
||||
if (executeFunction && typeof propToReturn === "function") propToReturn();
|
||||
return propToReturn === undefined ? null : propToReturn;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user