Merge branch 'master' into feature/intellipay

This commit is contained in:
Patrick Fic
2023-08-09 19:48:33 -07:00
325 changed files with 19181 additions and 8389 deletions

View File

@@ -36,6 +36,7 @@ const AuditTrailMapping = {
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: () =>

View File

@@ -1,9 +1,9 @@
import React from "react";
import NumberFormat from "react-number-format";
import { NumericFormat } from "react-number-format";
export default function CurrencyFormatter(props) {
return (
<NumberFormat
<NumericFormat
thousandSeparator={true}
decimalScale={2}
fixedDecimalScale={true}

View File

@@ -3,7 +3,10 @@ import { setContext } from "@apollo/client/link/context";
import { HttpLink } from "@apollo/client/link/http"; //"apollo-link-http";
import { RetryLink } from "@apollo/client/link/retry";
import { WebSocketLink } from "@apollo/client/link/ws";
import { getMainDefinition } from "@apollo/client/utilities";
import {
getMainDefinition,
offsetLimitPagination,
} from "@apollo/client/utilities";
//import { split } from "apollo-link";
import apolloLogger from "apollo-link-logger";
//import axios from "axios";
@@ -140,9 +143,17 @@ middlewares.push(
)
);
const cache = new InMemoryCache({});
const cache = new InMemoryCache({
typePolicies: {
Query: {
fields: {
conversations: offsetLimitPagination(),
},
},
},
});
export default new ApolloClient({
const client = new ApolloClient({
link: ApolloLink.from(middlewares),
cache,
connectToDevTools: process.env.NODE_ENV !== "production",
@@ -161,3 +172,4 @@ export default new ApolloClient({
},
},
});
export default client;

View File

@@ -3,6 +3,7 @@ import { Button, notification, Space } from "antd";
import i18n from "i18next";
import React from "react";
import * as serviceWorkerRegistration from "../serviceWorkerRegistration";
import { store } from "../redux/store";
const onServiceWorkerUpdate = (registration) => {
console.log("onServiceWorkerUpdate", registration);
@@ -33,6 +34,9 @@ const onServiceWorkerUpdate = (registration) => {
</Button>
</Space>
);
store.dispatch()
notification.open({
icon: <AlertOutlined />,
message: i18n.t("general.messages.newversiontitle"),

View File

@@ -1,6 +1,5 @@
import { gql } from "@apollo/client";
import { notification } from "antd";
import axios from "axios";
import jsreport from "@jsreport/browser-client";
import _ from "lodash";
import moment from "moment";
@@ -9,7 +8,8 @@ import { setEmailOptions } from "../redux/email/email.actions";
import { store } from "../redux/store";
import client from "../utils/GraphQLClient";
import { TemplateList } from "./TemplateConstants";
import cleanAxios from "./CleanAxios";
import axios from "axios";
const server = process.env.REACT_APP_REPORTS_SERVER_URL;
jsreport.serverUrl = server;
@@ -26,10 +26,14 @@ export default async function RenderTemplate(
if (window.jsr3) {
jsreport.serverUrl = "https://reports3.test.imex.online/";
}
const jsrAuth = (await axios.post("/utils/jsr")).data;
jsreport.headers["Authorization"] = jsrAuth;
//Query assets that match the template name. Must be in format <<templateName>>.query
let { contextData, useShopSpecificTemplate } = await fetchContextData(
templateObject
templateObject,
jsrAuth
);
const { ignoreCustomMargins } = Templates[templateObject.name];
@@ -137,11 +141,15 @@ export async function RenderTemplates(
//Query assets that match the template name. Must be in format <<templateName>>.query
let unsortedTemplatesAndData = [];
let proms = [];
const jsrAuth = (await axios.post("/utils/jsr")).data;
jsreport.headers["Authorization"] = jsrAuth;
templateObjects.forEach((template) => {
proms.push(
(async () => {
let { contextData, useShopSpecificTemplate } = await fetchContextData(
template
template,
jsrAuth
);
unsortedTemplatesAndData.push({
templateObject: template,
@@ -298,19 +306,22 @@ export const GenerateDocuments = async (templates) => {
await RenderTemplates(templates, bodyshop);
};
const fetchContextData = async (templateObject) => {
const fetchContextData = async (templateObject, jsrAuth) => {
const bodyshop = store.getState().user.bodyshop;
jsreport.headers["Authorization"] =
jsreport.headers["FirebaseAuthorization"] =
"Bearer " + (await auth.currentUser.getIdToken());
const folders = await axios.get(`${server}/odata/folders`);
const folders = await cleanAxios.get(`${server}/odata/folders`, {
headers: { Authorization: jsrAuth },
});
const shopSpecificFolder = folders.data.value.find(
(f) => f.name === bodyshop.imexshopid
);
const jsReportQueries = await axios.get(
`${server}/odata/assets?$filter=name eq '${templateObject.name}.query'`
const jsReportQueries = await cleanAxios.get(
`${server}/odata/assets?$filter=name eq '${templateObject.name}.query'`,
{ headers: { Authorization: jsrAuth } }
);
let templateQueryToExecute;

View File

@@ -7,23 +7,24 @@ export const EmailSettings = {
export const TemplateList = (type, context) => {
//const { bodyshop } = store.getState().user;
return {
//If there's no type or the type is job, send it back.
...(!type || type === "job"
? {
casl_authorization: {
title: i18n.t("printcenter.jobs.casl_authorization"),
description: "CASL Authorization",
description: "",
subject: i18n.t("printcenter.jobs.casl_authorization"),
key: "casl_authorization",
disabled: false,
group: "authorization",
regions: {
CA: true,
},
},
fippa_authorization: {
title: i18n.t("printcenter.jobs.fippa_authorization"),
description: "CASL Authorization",
description: "",
subject: i18n.t("printcenter.jobs.fippa_authorization"),
key: "fippa_authorization",
disabled: false,
@@ -31,7 +32,7 @@ export const TemplateList = (type, context) => {
},
diagnostic_authorization: {
title: i18n.t("printcenter.jobs.diagnostic_authorization"),
description: "Diagnostic Authorization",
description: "",
subject: i18n.t("printcenter.jobs.diagnostic_authorization"),
key: "diagnostic_authorization",
disabled: false,
@@ -39,7 +40,7 @@ export const TemplateList = (type, context) => {
},
mechanical_authorization: {
title: i18n.t("printcenter.jobs.mechanical_authorization"),
description: "Diagnostic Authorization",
description: "",
subject: i18n.t("printcenter.jobs.mechanical_authorization"),
key: "mechanical_authorization",
disabled: false,
@@ -47,7 +48,7 @@ export const TemplateList = (type, context) => {
},
appointment_reminder: {
title: i18n.t("printcenter.jobs.appointment_reminder"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.appointment_reminder"),
key: "appointment_reminder",
disabled: false,
@@ -55,7 +56,7 @@ export const TemplateList = (type, context) => {
},
estimate_followup: {
title: i18n.t("printcenter.jobs.estimate_followup"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.estimate_followup"),
key: "estimate_followup",
disabled: false,
@@ -63,7 +64,7 @@ export const TemplateList = (type, context) => {
},
express_repair_checklist: {
title: i18n.t("printcenter.jobs.express_repair_checklist"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.express_repair_checklist"),
key: "express_repair_checklist",
disabled: false,
@@ -71,7 +72,7 @@ export const TemplateList = (type, context) => {
},
glass_express_checklist: {
title: i18n.t("printcenter.jobs.glass_express_checklist"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.glass_express_checklist"),
key: "glass_express_checklist",
disabled: false,
@@ -79,7 +80,7 @@ export const TemplateList = (type, context) => {
},
stolen_recovery_checklist: {
title: i18n.t("printcenter.jobs.stolen_recovery_checklist"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.stolen_recovery_checklist"),
key: "stolen_recovery_checklist",
disabled: false,
@@ -87,7 +88,7 @@ export const TemplateList = (type, context) => {
},
vehicle_check_in: {
title: i18n.t("printcenter.jobs.vehicle_check_in"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.vehicle_check_in"),
key: "vehicle_check_in",
disabled: false,
@@ -95,16 +96,15 @@ export const TemplateList = (type, context) => {
},
parts_order_history: {
title: i18n.t("printcenter.jobs.parts_order_history"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.parts_order_history"),
key: "parts_order_history",
disabled: false,
group: "ro",
},
job_notes: {
title: i18n.t("printcenter.jobs.job_notes"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.job_notes"),
key: "job_notes",
disabled: false,
@@ -112,7 +112,7 @@ export const TemplateList = (type, context) => {
},
ro_with_description: {
title: i18n.t("printcenter.jobs.ro_with_description"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.ro_with_description"),
key: "ro_with_description",
disabled: false,
@@ -120,7 +120,7 @@ export const TemplateList = (type, context) => {
},
window_tag: {
title: i18n.t("printcenter.jobs.window_tag"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.window_tag"),
key: "window_tag",
disabled: false,
@@ -128,7 +128,7 @@ export const TemplateList = (type, context) => {
},
supplement_request: {
title: i18n.t("printcenter.jobs.supplement_request"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.supplement_request"),
key: "supplement_request",
disabled: false,
@@ -136,7 +136,7 @@ export const TemplateList = (type, context) => {
},
estimate: {
title: i18n.t("printcenter.jobs.estimate"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.estimate"),
key: "estimate",
disabled: false,
@@ -144,7 +144,7 @@ export const TemplateList = (type, context) => {
},
parts_list: {
title: i18n.t("printcenter.jobs.parts_list"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.parts_list"),
key: "parts_list",
disabled: false,
@@ -152,7 +152,7 @@ export const TemplateList = (type, context) => {
},
coversheet_portrait: {
title: i18n.t("printcenter.jobs.coversheet_portrait"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.coversheet_portrait"),
key: "coversheet_portrait",
disabled: false,
@@ -160,7 +160,7 @@ export const TemplateList = (type, context) => {
},
coversheet_landscape: {
title: i18n.t("printcenter.jobs.coversheet_landscape"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.coversheet_landscape"),
key: "coversheet_landscape",
disabled: false,
@@ -168,7 +168,7 @@ export const TemplateList = (type, context) => {
},
key_tag: {
title: i18n.t("printcenter.jobs.key_tag"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.key_tag"),
key: "key_tag",
disabled: false,
@@ -176,7 +176,7 @@ export const TemplateList = (type, context) => {
},
paint_grid: {
title: i18n.t("printcenter.jobs.paint_grid"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.paint_grid"),
key: "paint_grid",
disabled: false,
@@ -184,7 +184,7 @@ export const TemplateList = (type, context) => {
},
worksheet_by_line_number: {
title: i18n.t("printcenter.jobs.worksheet_by_line_number"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.worksheet_by_line_number"),
key: "worksheet_by_line_number",
disabled: false,
@@ -194,7 +194,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_type"
),
description: "All Jobs Notes",
description: "",
subject: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_type"
),
@@ -204,7 +204,7 @@ export const TemplateList = (type, context) => {
},
worksheet_sorted_by_operation: {
title: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
key: "worksheet_sorted_by_operation",
disabled: false,
@@ -214,7 +214,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
),
description: "All Jobs Notes",
description: "",
subject: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
),
@@ -226,7 +226,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
),
description: "All Jobs Notes",
description: "",
subject: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
),
@@ -236,7 +236,7 @@ export const TemplateList = (type, context) => {
},
payments_by_job: {
title: i18n.t("printcenter.jobs.payments_by_job"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.payments_by_job"),
key: "payments_by_job",
disabled: false,
@@ -244,7 +244,7 @@ export const TemplateList = (type, context) => {
},
final_invoice: {
title: i18n.t("printcenter.jobs.final_invoice"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.final_invoice"),
key: "final_invoice",
disabled: false,
@@ -252,7 +252,7 @@ export const TemplateList = (type, context) => {
},
payment_request: {
title: i18n.t("printcenter.jobs.payment_request"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.payment_request"),
key: "payment_request",
disabled: false,
@@ -260,7 +260,7 @@ export const TemplateList = (type, context) => {
},
invoice_total_payable: {
title: i18n.t("printcenter.jobs.invoice_total_payable"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.invoice_total_payable"),
key: "invoice_total_payable",
disabled: false,
@@ -268,7 +268,7 @@ export const TemplateList = (type, context) => {
},
invoice_customer_payable: {
title: i18n.t("printcenter.jobs.invoice_customer_payable"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.invoice_customer_payable"),
key: "invoice_customer_payable",
disabled: false,
@@ -276,7 +276,7 @@ export const TemplateList = (type, context) => {
},
ro_totals: {
title: i18n.t("printcenter.jobs.ro_totals"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.ro_totals"),
key: "ro_totals",
disabled: false,
@@ -284,7 +284,7 @@ export const TemplateList = (type, context) => {
},
job_costing_ro: {
title: i18n.t("printcenter.jobs.job_costing_ro"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.job_costing_ro"),
key: "job_costing_ro",
disabled: false,
@@ -292,7 +292,7 @@ export const TemplateList = (type, context) => {
},
purchases_by_ro_detail: {
title: i18n.t("printcenter.jobs.purchases_by_ro_detail"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.purchases_by_ro_detail"),
key: "purchases_by_ro_detail",
disabled: false,
@@ -300,7 +300,7 @@ export const TemplateList = (type, context) => {
},
purchases_by_ro_summary: {
title: i18n.t("printcenter.jobs.purchases_by_ro_summary"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.purchases_by_ro_summary"),
key: "purchases_by_ro_summary",
disabled: false,
@@ -308,7 +308,7 @@ export const TemplateList = (type, context) => {
},
filing_coversheet_portrait: {
title: i18n.t("printcenter.jobs.filing_coversheet_portrait"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.filing_coversheet_portrait"),
key: "filing_coversheet_portrait",
disabled: false,
@@ -316,7 +316,7 @@ export const TemplateList = (type, context) => {
},
filing_coversheet_landscape: {
title: i18n.t("printcenter.jobs.filing_coversheet_landscape"),
description: "CASL Authorization",
description: "",
subject: i18n.t("printcenter.jobs.filing_coversheet_landscape"),
key: "filing_coversheet_landscape",
disabled: false,
@@ -324,25 +324,23 @@ export const TemplateList = (type, context) => {
},
qc_sheet: {
title: i18n.t("printcenter.jobs.qc_sheet"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.qc_sheet"),
key: "qc_sheet",
disabled: false,
group: "post",
},
vehicle_delivery_check: {
title: i18n.t("printcenter.jobs.vehicle_delivery_check"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.vehicle_delivery_check"),
key: "vehicle_delivery_check",
disabled: false,
group: "post",
},
guarantee: {
title: i18n.t("printcenter.jobs.guarantee"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.guarantee"),
key: "guarantee",
disabled: false,
@@ -350,7 +348,7 @@ export const TemplateList = (type, context) => {
},
csi_invitation: {
title: i18n.t("printcenter.jobs.csi_invitation"),
description: "CSI invite",
description: "",
key: "csi_invitation",
subject: i18n.t("printcenter.jobs.csi_invitation"),
disabled: false,
@@ -358,7 +356,7 @@ export const TemplateList = (type, context) => {
},
window_tag_sublet: {
title: i18n.t("printcenter.jobs.window_tag_sublet"),
description: "Window Tag Sublet",
description: "",
key: "window_tag_sublet",
subject: i18n.t("printcenter.jobs.window_tag_sublet"),
disabled: false,
@@ -366,7 +364,7 @@ export const TemplateList = (type, context) => {
},
thank_you_ro: {
title: i18n.t("printcenter.jobs.thank_you_ro"),
description: "Thank You Letter by RO",
description: "",
key: "thank_you_ro",
subject: i18n.t("printcenter.jobs.thank_you_ro"),
disabled: false,
@@ -374,7 +372,7 @@ export const TemplateList = (type, context) => {
},
parts_label_single: {
title: i18n.t("printcenter.jobs.parts_label_single"),
description: "Thank You Letter by RO",
description: "",
key: "parts_label_single",
subject: i18n.t("printcenter.jobs.parts_label_single"),
disabled: false,
@@ -383,7 +381,7 @@ export const TemplateList = (type, context) => {
},
envelope_return_address: {
title: i18n.t("printcenter.jobs.envelope_return_address"),
description: "All Jobs Notes",
description: "",
subject: i18n.t("printcenter.jobs.envelope_return_address"),
key: "envelope_return_address",
disabled: false,
@@ -392,7 +390,7 @@ export const TemplateList = (type, context) => {
},
sgi_certificate_of_repairs: {
title: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"),
description: "Thank You Letter by RO",
description: "",
key: "sgi_certificate_of_repairs",
subject: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"),
disabled: false,
@@ -403,7 +401,7 @@ export const TemplateList = (type, context) => {
},
sgi_windshield_auth: {
title: i18n.t("printcenter.jobs.sgi_windshield_auth"),
description: "Thank You Letter by RO",
description: "",
key: "sgi_windshield_auth",
subject: i18n.t("printcenter.jobs.sgi_windshield_auth"),
disabled: false,
@@ -414,7 +412,7 @@ export const TemplateList = (type, context) => {
},
mpi_final_acct_sheet: {
title: i18n.t("printcenter.jobs.mpi_final_acct_sheet"),
description: "Thank You Letter by RO",
description: "",
key: "mpi_final_acct_sheet",
subject: i18n.t("printcenter.jobs.mpi_final_acct_sheet"),
disabled: false,
@@ -423,9 +421,20 @@ export const TemplateList = (type, context) => {
CA_MB: true,
},
},
mpi_final_repair_acct_sheet: {
title: i18n.t("printcenter.jobs.mpi_final_repair_acct_sheet"),
description: "",
key: "mpi_final_repair_acct_sheet",
subject: i18n.t("printcenter.jobs.mpi_final_repair_acct_sheet"),
disabled: false,
group: "post",
regions: {
CA_MB: true,
},
},
mpi_eglass_auth: {
title: i18n.t("printcenter.jobs.mpi_eglass_auth"),
description: "Thank You Letter by RO",
description: "",
key: "mpi_eglass_auth",
subject: i18n.t("printcenter.jobs.mpi_eglass_auth"),
disabled: false,
@@ -436,7 +445,7 @@ export const TemplateList = (type, context) => {
},
mpi_animal_checklist: {
title: i18n.t("printcenter.jobs.mpi_animal_checklist"),
description: "Thank You Letter by RO",
description: "",
key: "mpi_animal_checklist",
subject: i18n.t("printcenter.jobs.mpi_animal_checklist"),
disabled: false,
@@ -447,7 +456,7 @@ export const TemplateList = (type, context) => {
},
ab_proof_of_loss: {
title: i18n.t("printcenter.jobs.ab_proof_of_loss"),
description: "Thank You Letter by RO",
description: "",
key: "ab_proof_of_loss",
subject: i18n.t("printcenter.jobs.ab_proof_of_loss"),
disabled: false,
@@ -458,7 +467,7 @@ export const TemplateList = (type, context) => {
},
// parts_label_multi: {
// title: i18n.t("printcenter.jobs.parts_label_multi"),
// description: "Thank You Letter by RO",
// description: "",
// key: "parts_label_multi",
// subject: i18n.t("printcenter.jobs.parts_label_multi"),
// disabled: false,
@@ -466,7 +475,7 @@ export const TemplateList = (type, context) => {
// },
iou_form: {
title: i18n.t("printcenter.jobs.iou_form"),
description: "CASL Authorization",
description: "",
subject: i18n.t("printcenter.jobs.iou_form"),
key: "iou_form",
disabled: false,
@@ -474,7 +483,7 @@ export const TemplateList = (type, context) => {
},
lag_time_ro: {
title: i18n.t("printcenter.jobs.lag_time_ro"),
description: "CASL Authorization",
description: "",
subject: i18n.t("printcenter.jobs.lag_time_ro"),
key: "lag_time_ro",
disabled: false,
@@ -482,7 +491,7 @@ export const TemplateList = (type, context) => {
},
rental_reservation: {
title: i18n.t("printcenter.jobs.rental_reservation"),
description: "CASL Authorization",
description: "",
subject: i18n.t("printcenter.jobs.rental_reservation"),
key: "rental_reservation",
disabled: false,
@@ -490,53 +499,62 @@ export const TemplateList = (type, context) => {
},
timetickets_ro: {
title: i18n.t("printcenter.jobs.timetickets_ro"),
description: "CASL Authorization",
description: "",
subject: i18n.t("printcenter.jobs.timetickets_ro"),
key: "timetickets_ro",
disabled: false,
group: "financial",
},
dms_posting_sheet: {
title: i18n.t("printcenter.jobs.dms_posting_sheet"),
description: "",
subject: i18n.t("printcenter.jobs.dms_posting_sheet"),
key: "dms_posting_sheet",
disabled: false,
group: "financial",
dms: true,
},
}
: {}),
...(!type || type === "job_special"
? {
special_thirdpartypayer: {
title: i18n.t("printcenter.jobs.thirdpartypayer"),
description: "CSI invite",
description: "",
key: "special_thirdpartypayer",
disabled: false,
},
folder_label_multiple: {
title: i18n.t("printcenter.jobs.folder_label_multiple"),
description: "Folder Label Multiple",
description: "",
key: "folder_label_multiple",
disabled: false,
},
parts_label_multiple: {
title: i18n.t("printcenter.jobs.parts_label_multiple"),
description: "Parts Label Multiple",
description: "",
key: "parts_label_multiple",
disabled: false,
},
parts_invoice_label_single: {
title: i18n.t("printcenter.jobs.parts_invoice_label_single"),
description: "Parts Label Multiple",
description: "",
key: "parts_invoice_label_single",
disabled: false,
ignoreCustomMargins: true,
},
csi_invitation_action: {
title: i18n.t("printcenter.jobs.csi_invitation_action"),
description: "CSI invite",
description: "",
key: "csi_invitation_action",
subject: i18n.t("printcenter.jobs.csi_invitation_action"),
disabled: false,
},
individual_job_note: {
title: i18n.t("printcenter.jobs.individual_job_note"),
description: "CSI invite",
description: "",
key: "individual_job_note",
subject: i18n.t("printcenter.jobs.individual_job_note", {
subject: i18n.t("printcenter.subjects.jobs.individual_job_note", {
ro_number: (context && context.ro_number) || "",
}),
disabled: false,
@@ -547,7 +565,7 @@ export const TemplateList = (type, context) => {
? {
appointment_confirmation: {
title: i18n.t("printcenter.appointments.appointment_confirmation"),
description: "Appointment Confirmation",
description: "",
subject: i18n.t(
"printcenter.appointments.appointment_confirmation"
),
@@ -560,7 +578,7 @@ export const TemplateList = (type, context) => {
? {
parts_order: {
title: i18n.t("printcenter.jobs.parts_order"),
description: "Parts Order",
description: "",
key: "parts_order",
subject: i18n.t("printcenter.subjects.jobs.parts_order", {
ro_number: context && context.job && context.job.ro_number,
@@ -574,7 +592,7 @@ export const TemplateList = (type, context) => {
},
sublet_order: {
title: i18n.t("printcenter.jobs.sublet_order"),
description: "Parts Order",
description: "",
key: "sublet_order",
subject: i18n.t("printcenter.subjects.jobs.sublet_order", {
ro_number: context && context.job && context.job.ro_number,
@@ -588,8 +606,15 @@ export const TemplateList = (type, context) => {
},
parts_return_slip: {
title: i18n.t("printcenter.jobs.parts_return_slip"),
subject: i18n.t("printcenter.jobs.parts_return_slip"),
description: "Parts Return",
subject: i18n.t("printcenter.subjects.jobs.parts_return_slip", {
ro_number: context && context.job && context.job.ro_number,
name: (
(context && context.job && context.job.ownr_ln) ||
(context && context.job && context.job.ownr_co_nm) ||
""
).trim(),
}),
description: "",
key: "parts_return_slip",
disabled: false,
},
@@ -599,7 +624,7 @@ export const TemplateList = (type, context) => {
? {
payment_receipt: {
title: i18n.t("printcenter.jobs.payment_receipt"),
description: "Payment Receipt",
description: "",
subject: i18n.t("printcenter.jobs.payment_receipt"),
key: "payment_receipt",
disabled: false,
@@ -622,7 +647,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_detail_closed_ins_co: {
title: i18n.t(
"reportcenter.templates.hours_sold_detail_closed_ins_co"
@@ -640,7 +664,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_summary_closed: {
title: i18n.t("reportcenter.templates.hours_sold_summary_closed"),
description: "",
@@ -654,7 +677,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_summary_closed_ins_co: {
title: i18n.t(
"reportcenter.templates.hours_sold_summary_closed_ins_co"
@@ -672,7 +694,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_detail_open: {
title: i18n.t("reportcenter.templates.hours_sold_detail_open"),
description: "",
@@ -686,7 +707,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_detail_open_ins_co: {
title: i18n.t(
"reportcenter.templates.hours_sold_detail_open_ins_co"
@@ -704,7 +724,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_summary_open: {
title: i18n.t("reportcenter.templates.hours_sold_summary_open"),
description: "",
@@ -718,7 +737,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_summary_open_ins_co: {
title: i18n.t(
"reportcenter.templates.hours_sold_summary_open_ins_co"
@@ -736,7 +754,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
hours_sold_detail_closed_csr: {
title: i18n.t(
"reportcenter.templates.hours_sold_detail_closed_csr"
@@ -1090,7 +1107,6 @@ export const TemplateList = (type, context) => {
},
group: "customers",
},
schedule: {
title: i18n.t("reportcenter.templates.schedule"),
subject: i18n.t("reportcenter.templates.schedule"),
@@ -1102,7 +1118,6 @@ export const TemplateList = (type, context) => {
},
group: "customers",
},
timetickets: {
title: i18n.t("reportcenter.templates.timetickets"),
subject: i18n.t("reportcenter.templates.timetickets"),
@@ -1126,7 +1141,6 @@ export const TemplateList = (type, context) => {
title: i18n.t("reportcenter.templates.attendance_detail"),
subject: i18n.t("reportcenter.templates.attendance_detail"),
key: "attendance_detail",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.timetickets"),
@@ -1138,7 +1152,6 @@ export const TemplateList = (type, context) => {
title: i18n.t("reportcenter.templates.attendance_summary"),
subject: i18n.t("reportcenter.templates.attendance_summary"),
key: "attendance_summary",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.timetickets"),
@@ -1158,7 +1171,6 @@ export const TemplateList = (type, context) => {
},
group: "payroll",
},
timetickets_summary: {
title: i18n.t("reportcenter.templates.timetickets_summary"),
subject: i18n.t("reportcenter.templates.timetickets_summary"),
@@ -1171,7 +1183,6 @@ export const TemplateList = (type, context) => {
},
group: "payroll",
},
estimator_detail: {
title: i18n.t("reportcenter.templates.estimator_detail"),
description: "",
@@ -1224,7 +1235,6 @@ export const TemplateList = (type, context) => {
},
group: "purchases",
},
void_ros: {
title: i18n.t("reportcenter.templates.void_ros"),
description: "",
@@ -1234,7 +1244,7 @@ export const TemplateList = (type, context) => {
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_open"),
field: i18n.t("jobs.fields.date_void"),
},
group: "sales",
},
@@ -1329,7 +1339,6 @@ export const TemplateList = (type, context) => {
},
group: "sales",
},
gsr_by_estimator: {
title: i18n.t("reportcenter.templates.gsr_by_estimator"),
description: "",
@@ -1538,6 +1547,19 @@ export const TemplateList = (type, context) => {
},
group: "payroll",
},
work_in_progress_jobs_excel: {
title: i18n.t("reportcenter.templates.work_in_progress_jobs"),
subject: i18n.t("reportcenter.templates.work_in_progress_jobs"),
key: "work_in_progress_jobs_excel",
//idtype: "vendor",
reporttype: "excel",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_open"),
},
group: "jobs",
},
work_in_progress_labour: {
title: i18n.t("reportcenter.templates.work_in_progress_labour"),
description: "",
@@ -1814,7 +1836,9 @@ export const TemplateList = (type, context) => {
group: "jobs",
},
purchase_return_ratio_grouped_by_vendor_detail: {
title: i18n.t("reportcenter.templates.purchase_return_ratio_grouped_by_vendor_detail"),
title: i18n.t(
"reportcenter.templates.purchase_return_ratio_grouped_by_vendor_detail"
),
subject: i18n.t(
"reportcenter.templates.purchase_return_ratio_grouped_by_vendor_detail"
),
@@ -1828,7 +1852,9 @@ export const TemplateList = (type, context) => {
group: "purchases",
},
purchase_return_ratio_grouped_by_vendor_summary: {
title: i18n.t("reportcenter.templates.purchase_return_ratio_grouped_by_vendor_summary"),
title: i18n.t(
"reportcenter.templates.purchase_return_ratio_grouped_by_vendor_summary"
),
subject: i18n.t(
"reportcenter.templates.purchase_return_ratio_grouped_by_vendor_summary"
),
@@ -1841,6 +1867,68 @@ export const TemplateList = (type, context) => {
},
group: "purchases",
},
production_over_time: {
title: i18n.t("reportcenter.templates.production_over_time"),
subject: i18n.t("reportcenter.templates.production_over_time"),
key: "production_over_time",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.actual_in"),
},
group: "jobs",
},
customer_list: {
title: i18n.t("reportcenter.templates.customer_list"),
subject: i18n.t("reportcenter.templates.customer_list"),
key: "customer_list",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_invoiced"),
},
group: "customers",
},
exported_gsr_by_ro: {
title: i18n.t("reportcenter.templates.exported_gsr_by_ro"),
subject: i18n.t("reportcenter.templates.exported_gsr_by_ro"),
key: "exported_gsr_by_ro",
//idtype: "vendor",
reporttype: "excel",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_exported"),
},
group: "sales",
},
exported_gsr_by_ro_labor: {
title: i18n.t("reportcenter.templates.exported_gsr_by_ro_labor"),
subject: i18n.t("reportcenter.templates.exported_gsr_by_ro_labor"),
key: "exported_gsr_by_ro_labor",
//idtype: "vendor",
reporttype: "excel",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_exported"),
},
group: "sales",
},
jobs_scheduled_completion: {
title: i18n.t("reportcenter.templates.jobs_scheduled_completion"),
subject: i18n.t("reportcenter.templates.jobs_scheduled_completion"),
key: "jobs_scheduled_completion",
//idtype: "vendor",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.scheduled_completion"),
},
group: "jobs",
},
}
: {}),
...(!type || type === "courtesycarcontract"
@@ -1849,7 +1937,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_contract"
),
description: "Est Detail",
description: "",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_contract"
),
@@ -1858,7 +1946,7 @@ export const TemplateList = (type, context) => {
},
courtesy_car_terms: {
title: i18n.t("printcenter.courtesycarcontract.courtesy_car_terms"),
description: "Est Detail",
description: "",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_terms"
),
@@ -1869,7 +1957,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_impound"
),
description: "Est Detail",
description: "",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_impound"
),
@@ -1884,7 +1972,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_inventory"
),
description: "Est Detail",
description: "",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_inventory"
),
@@ -1897,7 +1985,7 @@ export const TemplateList = (type, context) => {
? {
inhouse_invoice: {
title: i18n.t("printcenter.bills.inhouse_invoice"),
description: "Est Detail",
description: "",
subject: i18n.t("printcenter.bills.inhouse_invoice"),
key: "inhouse_invoice",
disabled: false,
@@ -1908,7 +1996,7 @@ export const TemplateList = (type, context) => {
? {
// timetickets: {
// title: i18n.t("printcenter.timetickets.timetickets"),
// description: "Est Detail",
// description: "",
// subject: `${i18n.t("printcenter.timetickets.timetickets")} - ${
// context && context.job && context.job.ro_number
// }`,
@@ -1921,21 +2009,20 @@ export const TemplateList = (type, context) => {
? {
purchases_by_vendor_detailed: {
title: i18n.t("printcenter.vendors.purchases_by_vendor_detailed"),
description: "Est Detail",
description: "",
subject: i18n.t("printcenter.vendors.purchases_by_vendor_detailed"),
key: "purchases_by_vendor_detailed",
disabled: false,
},
purchases_by_vendor_summary: {
title: i18n.t("printcenter.vendors.purchases_by_vendor_summary"),
description: "Est Detail",
description: "",
subject: i18n.t("printcenter.vendors.purchases_by_vendor_summary"),
key: "purchases_by_vendor_summary",
disabled: false,
},
}
: {}),
...(!type || type === "production"
? {
production_by_last_name: {
@@ -2002,21 +2089,21 @@ export const TemplateList = (type, context) => {
? {
ca_bc_etf_table: {
title: i18n.t("printcenter.payments.ca_bc_etf_table"),
description: "Est Detail",
description: "",
subject: i18n.t("printcenter.payments.ca_bc_etf_table"),
key: "ca_bc_etf_table",
disabled: false,
},
exported_payroll: {
title: i18n.t("printcenter.payments.exported_payroll"),
description: "Est Detail",
description: "",
subject: i18n.t("printcenter.payments.exported_payroll"),
key: "exported_payroll",
disabled: false,
},
attendance_detail_csv: {
title: i18n.t("printcenter.special.attendance_detail_csv"),
description: "Est Detail",
description: "",
subject: i18n.t("printcenter.special.attendance_detail_csv"),
key: "attendance_detail_csv",
disabled: false,

View File

@@ -0,0 +1,12 @@
import axios from "axios";
import { notification } from "antd";
async function CriticalPartsScan(jobid) {
try {
await axios.post("/job/partsscan", { jobid });
} catch (error) {
notification.open({ type: "error", message: JSON.stringify(error) });
}
}
export default CriticalPartsScan;

View File

@@ -1,6 +1,10 @@
export default function UndefinedToNull(obj) {
export default function UndefinedToNull(obj, keys) {
Object.keys(obj).forEach((key) => {
if (keys && keys.indexOf(key) >= 0) {
if (obj[key] === undefined) obj[key] = null;
} else {
if (obj[key] === undefined) obj[key] = null;
}
});
return obj;
}