Compare commits

..

6 Commits

Author SHA1 Message Date
swtmply
046d104bfa IO-2208 removed subscriptions to the message 2023-06-09 01:04:59 +08:00
swtmply
27e0f497bb IO-2208 added more conversations on initial load 2023-05-26 20:12:58 +08:00
swtmply
8839fc0293 IO-2208 replaced cache first to network only 2023-05-24 23:07:49 +08:00
swtmply
c5c47e9bfc IO-2208 remove unused variables and imports 2023-05-19 00:14:28 +08:00
swtmply
d66fdfb2e0 IO-2208 added virtualization to conversation list 2023-05-18 23:04:10 +08:00
swtmply
4bc8ff26d2 IO-2208 Added pagination and subscription to chat 2023-05-13 00:32:51 +08:00
16 changed files with 271 additions and 313 deletions

View File

@@ -51,6 +51,7 @@
"react-i18next": "^12.2.0",
"react-icons": "^4.7.1",
"react-image-lightbox": "^5.1.4",
"react-intersection-observer": "^9.4.3",
"react-number-format": "^5.1.3",
"react-redux": "^8.0.5",
"react-resizable": "^3.0.4",

View File

@@ -1,5 +1,5 @@
import { Badge, List, Tag } from "antd";
import React from "react";
import React, { useEffect } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { setSelectedConversation } from "../../redux/messaging/messaging.actions";
@@ -7,6 +7,8 @@ import { selectSelectedConversation } from "../../redux/messaging/messaging.sele
import { TimeAgoFormatter } from "../../utils/DateFormatter";
import PhoneFormatter from "../../utils/PhoneFormatter";
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
import { List as VirtualizedList, AutoSizer } from "react-virtualized";
import "./chat-conversation-list.styles.scss";
const mapStateToProps = createStructuredSelector({
@@ -18,59 +20,79 @@ const mapDispatchToProps = (dispatch) => ({
dispatch(setSelectedConversation(conversationId)),
});
export function ChatConversationListComponent({
function ChatConversationListComponent({
conversationList,
selectedConversation,
setSelectedConversation,
loadMoreConversations,
}) {
const rowRenderer = ({ index, key, style }) => {
const item = conversationList[index];
return (
<List.Item
key={key}
onClick={() => setSelectedConversation(item.id)}
className={`chat-list-item ${
item.id === selectedConversation
? "chat-list-selected-conversation"
: null
}`}
style={style}
>
<div sryle={{ display: "inline-block" }}>
{item.label && <div className="chat-name">{item.label}</div>}
{item.job_conversations.length > 0 ? (
<div className="chat-name">
{item.job_conversations.map((j, idx) => (
<div key={idx}>
<OwnerNameDisplay ownerObject={j.job} />
</div>
))}
</div>
) : (
<PhoneFormatter>{item.phone_num}</PhoneFormatter>
)}
</div>
<div sryle={{ display: "inline-block" }}>
<div>
{item.job_conversations.length > 0
? item.job_conversations.map((j, idx) => (
<Tag key={idx} className="ro-number-tag">
{j.job.ro_number}
</Tag>
))
: null}
</div>
<TimeAgoFormatter>{item.updated_at}</TimeAgoFormatter>
</div>
<Badge count={item.messages_aggregate.aggregate.count || 0} />
</List.Item>
);
};
return (
<div className="chat-list-container">
<List
bordered
dataSource={conversationList}
renderItem={(item) => (
<List.Item
key={item.id}
onClick={() => setSelectedConversation(item.id)}
className={`chat-list-item ${
item.id === selectedConversation
? "chat-list-selected-conversation"
: null
}`}
>
<div sryle={{ display: "inline-block" }}>
{item.label && <div className="chat-name">{item.label}</div>}
{item.job_conversations.length > 0 ? (
<div className="chat-name">
{item.job_conversations.map((j, idx) => (
<div key={idx}>
<OwnerNameDisplay ownerObject={j.job} />
</div>
))}
</div>
) : (
<PhoneFormatter>{item.phone_num}</PhoneFormatter>
)}
</div>
<div sryle={{ display: "inline-block" }}>
<div>
{item.job_conversations.length > 0
? item.job_conversations.map((j, idx) => (
<Tag key={idx} className="ro-number-tag">
{j.job.ro_number}
</Tag>
))
: null}
</div>
<TimeAgoFormatter>{item.updated_at}</TimeAgoFormatter>
</div>
<Badge count={item.messages_aggregate.aggregate.count || 0} />
</List.Item>
<AutoSizer>
{({ height, width }) => (
<VirtualizedList
height={height}
width={width}
rowCount={conversationList.length}
rowHeight={60}
rowRenderer={rowRenderer}
onScroll={({ scrollTop, scrollHeight, clientHeight }) => {
if (scrollTop + clientHeight === scrollHeight) {
loadMoreConversations();
}
}}
/>
)}
/>
</AutoSizer>
</div>
);
}
export default connect(
mapStateToProps,
mapDispatchToProps

View File

@@ -3,8 +3,9 @@
}
.chat-list-container {
flex: 1;
overflow: auto;
overflow: hidden;
height: 100%;
border: 1px solid gainsboro;
}
.chat-list-item {
@@ -21,4 +22,6 @@
.ro-number-tag {
align-self: baseline;
}
padding: 12px 24px;
border-bottom: 1px solid gainsboro;
}

View File

@@ -4,14 +4,15 @@ import {
ShrinkOutlined,
SyncOutlined,
} from "@ant-design/icons";
import { useQuery } from "@apollo/client";
import { useLazyQuery, useQuery } from "@apollo/client";
import { Badge, Card, Col, Row, Space, Tag, Tooltip, Typography } from "antd";
import React, { useEffect, useState } from "react";
import React, { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import {
CONVERSATION_LIST_QUERY,
CONVERSATION_LIST_SUBSCRIPTION,
UNREAD_CONVERSATION_COUNT,
} from "../../graphql/conversations.queries";
import { toggleChatVisible } from "../../redux/messaging/messaging.actions";
@@ -47,12 +48,13 @@ export function ChatPopupComponent({
...(pollInterval > 0 ? { pollInterval } : {}),
});
const { loading, data, refetch, called } = useQuery(CONVERSATION_LIST_QUERY, {
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
skip: !chatVisible,
...(pollInterval > 0 ? { pollInterval } : {}),
});
const [getConversations, { loading, data, refetch, fetchMore }] =
useLazyQuery(CONVERSATION_LIST_QUERY, {
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
skip: !chatVisible,
...(pollInterval > 0 ? { pollInterval } : {}),
});
const fcmToken = sessionStorage.getItem("fcmtoken");
@@ -65,15 +67,22 @@ export function ChatPopupComponent({
}, [fcmToken]);
useEffect(() => {
if (called && chatVisible) refetch();
}, [chatVisible, called, refetch]);
if (chatVisible)
getConversations({
variables: {
offset: 0,
},
});
}, [chatVisible, getConversations]);
// const unreadCount = data
// ? data.conversations.reduce(
// (acc, val) => val.messages_aggregate.aggregate.count + acc,
// 0
// )
// : 0;
const loadMoreConversations = useCallback(() => {
if (data)
fetchMore({
variables: {
offset: data.conversations.length,
},
});
}, [data, fetchMore]);
const unreadCount = unreadData?.messages_aggregate.aggregate.count || 0;
@@ -110,6 +119,7 @@ export function ChatPopupComponent({
) : (
<ChatConversationListComponent
conversationList={data ? data.conversations : []}
loadMoreConversations={loadMoreConversations}
/>
)}
</Col>

View File

@@ -52,7 +52,7 @@ function PaymentModalContainer({
const { useStripe, sendby, ...paymentObj } = values;
setLoading(true);
let updatedPayment; //Moved up from if statement for greater scope.
try {
if (!context || (context && !context.id)) {
const newPayment = await insertPayment({
@@ -87,7 +87,7 @@ function PaymentModalContainer({
);
}
} else {
updatedPayment = await updatePayment({
const updatedPayment = await updatePayment({
variables: {
paymentId: context.id,
payment: paymentObj,
@@ -101,11 +101,7 @@ function PaymentModalContainer({
}
}
if (actions.refetch)
actions.refetch(
updatedPayment && updatedPayment.data.update_payments.returning[0]
);
if (actions.refetch) actions.refetch();
if (enterAgain) {
const prev = form.getFieldsValue(["date"]);

View File

@@ -169,20 +169,7 @@ export function PaymentsListPaginated({
apolloResults = data.payments_by_pk;
}
setPaymentContext({
actions: {
refetch: apolloResults
? (updatedRecord) => {
setOpenSearchResults((results) =>
results.map((result) => {
if (result.id !== record.id) {
return result;
}
return updatedRecord;
})
);
}
: refetch,
},
actions: { refetch: refetch },
context: apolloResults ? apolloResults : record,
});
}}

View File

@@ -29,10 +29,7 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
})
.filter(
(temp) =>
!temp.regions ||
(temp.regions && temp.regions[bodyshop.region_config]) ||
(temp.regions &&
bodyshop.region_config.includes(Object.keys(temp.regions)) === true)
!temp.regions || (temp.regions && temp.regions[bodyshop.region_config])
);
const filteredJobsReportsList =

View File

@@ -1,6 +1,5 @@
import { Card } from "antd";
import Dinero from "dinero.js";
import _ from "lodash";
import { Card } from "antd";
import moment from "moment";
import React from "react";
import { connect } from "react-redux";
@@ -19,6 +18,7 @@ import {
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util";
import _ from "lodash";
import CustomTooltip from "./chart-custom-tooltip";
const graphProps = {
@@ -71,9 +71,7 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) {
bodyshop.scoreboard_target.dailyBodyTarget +
bodyshop.scoreboard_target.dailyPaintTarget,
val
) +
bodyshop.scoreboard_target.dailyBodyTarget +
bodyshop.scoreboard_target.dailyPaintTarget,
),
1
),
accHrs: _.round(

View File

@@ -1,36 +1,5 @@
import { gql } from "@apollo/client";
// export const CONVERSATION_LIST_SUBSCRIPTION = gql`
// subscription CONVERSATION_LIST_SUBSCRIPTION {
// conversations(
// order_by: { updated_at: desc }
// limit: 50
// where: { archived: { _eq: false } }
// ) {
// phone_num
// id
// updated_at
// unreadcnt
// messages_aggregate(
// where: { read: { _eq: false }, isoutbound: { _eq: false } }
// ) {
// aggregate {
// count
// }
// }
// job_conversations {
// job {
// id
// ro_number
// ownr_fn
// ownr_ln
// ownr_co_nm
// }
// }
// }
// }
// `;
export const UNREAD_CONVERSATION_COUNT = gql`
query UNREAD_CONVERSATION_COUNT {
messages_aggregate(
@@ -44,10 +13,11 @@ export const UNREAD_CONVERSATION_COUNT = gql`
`;
export const CONVERSATION_LIST_QUERY = gql`
query CONVERSATION_LIST_QUERY {
query CONVERSATION_LIST_QUERY($offset: Int!) {
conversations(
order_by: { updated_at: desc }
limit: 50
offset: $offset
where: { archived: { _eq: false } }
) {
phone_num

View File

@@ -16,15 +16,19 @@ export const QUERY_ALL_PAYMENTS_PAGINATED = gql`
$limit: Int
$order: [payments_order_by!]!
) {
payments(offset: $offset, limit: $limit, order_by: $order) {
payments(
offset: $offset
limit: $limit
order_by: $order
) {
id
amount
created_at
date
exportedat
jobid
paymentnum
date
job {
id
ro_number
ownerid
ownr_co_nm
ownr_fn
@@ -35,14 +39,15 @@ export const QUERY_ALL_PAYMENTS_PAGINATED = gql`
ownr_fn
ownr_ln
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
memo
type
amount
stripeid
exportedat
stripeid
payer
}
payments_aggregate {
aggregate {
@@ -57,31 +62,16 @@ export const UPDATE_PAYMENT = gql`
update_payments(where: { id: { _eq: $paymentId } }, _set: $payment) {
returning {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
}
transactionid
memo
type
amount
stripeid
exportedat
stripeid
payer
paymentnum
stripeid
transactionid
type
date
}
}
}
@@ -95,31 +85,17 @@ export const UPDATE_PAYMENTS = gql`
update_payments(where: { id: { _in: $paymentIdList } }, _set: $payment) {
returning {
id
amount
created_at
date
exportedat
jobid
job {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
}
transactionid
memo
type
amount
stripeid
exportedat
stripeid
payer
paymentnum
stripeid
transactionid
type
date
}
}
}
@@ -139,35 +115,36 @@ export const QUERY_JOB_PAYMENT_TOTALS = gql`
}
`;
export const QUERY_PAYMENT_BY_ID = gql`
query QUERY_PAYMENT_BY_ID($paymentId: uuid!) {
payments_by_pk(id: $paymentId) {
export const QUERY_PAYMENT_BY_ID = gql`query QUERY_PAYMENT_BY_ID($paymentId: uuid!) {
payments_by_pk(id: $paymentId) {
id
created_at
jobid
paymentnum
date
job {
id
amount
created_at
exportedat
date
jobid
job {
ro_number
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownerid
ownr_co_nm
ownr_fn
ownr_ln
owner {
id
ownr_co_nm
ownr_fn
ownr_ln
}
ro_number
}
memo
payer
paymentnum
stripeid
transactionid
type
}
transactionid
memo
type
amount
stripeid
exportedat
stripeid
payer
}
`;
}
`

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,7 +143,15 @@ middlewares.push(
)
);
const cache = new InMemoryCache({});
const cache = new InMemoryCache({
typePolicies: {
Query: {
fields: {
conversations: offsetLimitPagination(),
},
},
},
});
const client = new ApolloClient({
link: ApolloLink.from(middlewares),

View File

@@ -7,24 +7,22 @@ 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: "",
description: "CASL Authorization",
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: "",
description: "CASL Authorization",
subject: i18n.t("printcenter.jobs.fippa_authorization"),
key: "fippa_authorization",
disabled: false,
@@ -32,7 +30,7 @@ export const TemplateList = (type, context) => {
},
diagnostic_authorization: {
title: i18n.t("printcenter.jobs.diagnostic_authorization"),
description: "",
description: "Diagnostic Authorization",
subject: i18n.t("printcenter.jobs.diagnostic_authorization"),
key: "diagnostic_authorization",
disabled: false,
@@ -40,7 +38,7 @@ export const TemplateList = (type, context) => {
},
mechanical_authorization: {
title: i18n.t("printcenter.jobs.mechanical_authorization"),
description: "",
description: "Diagnostic Authorization",
subject: i18n.t("printcenter.jobs.mechanical_authorization"),
key: "mechanical_authorization",
disabled: false,
@@ -48,7 +46,7 @@ export const TemplateList = (type, context) => {
},
appointment_reminder: {
title: i18n.t("printcenter.jobs.appointment_reminder"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.appointment_reminder"),
key: "appointment_reminder",
disabled: false,
@@ -56,7 +54,7 @@ export const TemplateList = (type, context) => {
},
estimate_followup: {
title: i18n.t("printcenter.jobs.estimate_followup"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.estimate_followup"),
key: "estimate_followup",
disabled: false,
@@ -64,7 +62,7 @@ export const TemplateList = (type, context) => {
},
express_repair_checklist: {
title: i18n.t("printcenter.jobs.express_repair_checklist"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.express_repair_checklist"),
key: "express_repair_checklist",
disabled: false,
@@ -72,7 +70,7 @@ export const TemplateList = (type, context) => {
},
glass_express_checklist: {
title: i18n.t("printcenter.jobs.glass_express_checklist"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.glass_express_checklist"),
key: "glass_express_checklist",
disabled: false,
@@ -80,7 +78,7 @@ export const TemplateList = (type, context) => {
},
stolen_recovery_checklist: {
title: i18n.t("printcenter.jobs.stolen_recovery_checklist"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.stolen_recovery_checklist"),
key: "stolen_recovery_checklist",
disabled: false,
@@ -88,7 +86,7 @@ export const TemplateList = (type, context) => {
},
vehicle_check_in: {
title: i18n.t("printcenter.jobs.vehicle_check_in"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.vehicle_check_in"),
key: "vehicle_check_in",
disabled: false,
@@ -96,7 +94,7 @@ export const TemplateList = (type, context) => {
},
parts_order_history: {
title: i18n.t("printcenter.jobs.parts_order_history"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.parts_order_history"),
key: "parts_order_history",
disabled: false,
@@ -104,7 +102,7 @@ export const TemplateList = (type, context) => {
},
job_notes: {
title: i18n.t("printcenter.jobs.job_notes"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.job_notes"),
key: "job_notes",
disabled: false,
@@ -112,7 +110,7 @@ export const TemplateList = (type, context) => {
},
ro_with_description: {
title: i18n.t("printcenter.jobs.ro_with_description"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.ro_with_description"),
key: "ro_with_description",
disabled: false,
@@ -120,7 +118,7 @@ export const TemplateList = (type, context) => {
},
window_tag: {
title: i18n.t("printcenter.jobs.window_tag"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.window_tag"),
key: "window_tag",
disabled: false,
@@ -128,7 +126,7 @@ export const TemplateList = (type, context) => {
},
supplement_request: {
title: i18n.t("printcenter.jobs.supplement_request"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.supplement_request"),
key: "supplement_request",
disabled: false,
@@ -136,7 +134,7 @@ export const TemplateList = (type, context) => {
},
estimate: {
title: i18n.t("printcenter.jobs.estimate"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.estimate"),
key: "estimate",
disabled: false,
@@ -144,7 +142,7 @@ export const TemplateList = (type, context) => {
},
parts_list: {
title: i18n.t("printcenter.jobs.parts_list"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.parts_list"),
key: "parts_list",
disabled: false,
@@ -152,7 +150,7 @@ export const TemplateList = (type, context) => {
},
coversheet_portrait: {
title: i18n.t("printcenter.jobs.coversheet_portrait"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.coversheet_portrait"),
key: "coversheet_portrait",
disabled: false,
@@ -160,7 +158,7 @@ export const TemplateList = (type, context) => {
},
coversheet_landscape: {
title: i18n.t("printcenter.jobs.coversheet_landscape"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.coversheet_landscape"),
key: "coversheet_landscape",
disabled: false,
@@ -168,7 +166,7 @@ export const TemplateList = (type, context) => {
},
key_tag: {
title: i18n.t("printcenter.jobs.key_tag"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.key_tag"),
key: "key_tag",
disabled: false,
@@ -176,7 +174,7 @@ export const TemplateList = (type, context) => {
},
paint_grid: {
title: i18n.t("printcenter.jobs.paint_grid"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.paint_grid"),
key: "paint_grid",
disabled: false,
@@ -184,7 +182,7 @@ export const TemplateList = (type, context) => {
},
worksheet_by_line_number: {
title: i18n.t("printcenter.jobs.worksheet_by_line_number"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.worksheet_by_line_number"),
key: "worksheet_by_line_number",
disabled: false,
@@ -194,7 +192,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_type"
),
description: "",
description: "All Jobs Notes",
subject: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_type"
),
@@ -204,7 +202,7 @@ export const TemplateList = (type, context) => {
},
worksheet_sorted_by_operation: {
title: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"),
key: "worksheet_sorted_by_operation",
disabled: false,
@@ -214,7 +212,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
),
description: "",
description: "All Jobs Notes",
subject: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_no_hours"
),
@@ -226,7 +224,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
),
description: "",
description: "All Jobs Notes",
subject: i18n.t(
"printcenter.jobs.worksheet_sorted_by_operation_part_type"
),
@@ -236,7 +234,7 @@ export const TemplateList = (type, context) => {
},
payments_by_job: {
title: i18n.t("printcenter.jobs.payments_by_job"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.payments_by_job"),
key: "payments_by_job",
disabled: false,
@@ -244,7 +242,7 @@ export const TemplateList = (type, context) => {
},
final_invoice: {
title: i18n.t("printcenter.jobs.final_invoice"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.final_invoice"),
key: "final_invoice",
disabled: false,
@@ -252,7 +250,7 @@ export const TemplateList = (type, context) => {
},
payment_request: {
title: i18n.t("printcenter.jobs.payment_request"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.payment_request"),
key: "payment_request",
disabled: false,
@@ -260,7 +258,7 @@ export const TemplateList = (type, context) => {
},
invoice_total_payable: {
title: i18n.t("printcenter.jobs.invoice_total_payable"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.invoice_total_payable"),
key: "invoice_total_payable",
disabled: false,
@@ -268,7 +266,7 @@ export const TemplateList = (type, context) => {
},
invoice_customer_payable: {
title: i18n.t("printcenter.jobs.invoice_customer_payable"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.invoice_customer_payable"),
key: "invoice_customer_payable",
disabled: false,
@@ -276,7 +274,7 @@ export const TemplateList = (type, context) => {
},
ro_totals: {
title: i18n.t("printcenter.jobs.ro_totals"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.ro_totals"),
key: "ro_totals",
disabled: false,
@@ -284,7 +282,7 @@ export const TemplateList = (type, context) => {
},
job_costing_ro: {
title: i18n.t("printcenter.jobs.job_costing_ro"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.job_costing_ro"),
key: "job_costing_ro",
disabled: false,
@@ -292,7 +290,7 @@ export const TemplateList = (type, context) => {
},
purchases_by_ro_detail: {
title: i18n.t("printcenter.jobs.purchases_by_ro_detail"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.purchases_by_ro_detail"),
key: "purchases_by_ro_detail",
disabled: false,
@@ -300,7 +298,7 @@ export const TemplateList = (type, context) => {
},
purchases_by_ro_summary: {
title: i18n.t("printcenter.jobs.purchases_by_ro_summary"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.purchases_by_ro_summary"),
key: "purchases_by_ro_summary",
disabled: false,
@@ -308,7 +306,7 @@ export const TemplateList = (type, context) => {
},
filing_coversheet_portrait: {
title: i18n.t("printcenter.jobs.filing_coversheet_portrait"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.filing_coversheet_portrait"),
key: "filing_coversheet_portrait",
disabled: false,
@@ -316,7 +314,7 @@ export const TemplateList = (type, context) => {
},
filing_coversheet_landscape: {
title: i18n.t("printcenter.jobs.filing_coversheet_landscape"),
description: "",
description: "CASL Authorization",
subject: i18n.t("printcenter.jobs.filing_coversheet_landscape"),
key: "filing_coversheet_landscape",
disabled: false,
@@ -324,7 +322,7 @@ export const TemplateList = (type, context) => {
},
qc_sheet: {
title: i18n.t("printcenter.jobs.qc_sheet"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.qc_sheet"),
key: "qc_sheet",
disabled: false,
@@ -332,7 +330,7 @@ export const TemplateList = (type, context) => {
},
vehicle_delivery_check: {
title: i18n.t("printcenter.jobs.vehicle_delivery_check"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.vehicle_delivery_check"),
key: "vehicle_delivery_check",
disabled: false,
@@ -340,7 +338,7 @@ export const TemplateList = (type, context) => {
},
guarantee: {
title: i18n.t("printcenter.jobs.guarantee"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.guarantee"),
key: "guarantee",
disabled: false,
@@ -348,7 +346,7 @@ export const TemplateList = (type, context) => {
},
csi_invitation: {
title: i18n.t("printcenter.jobs.csi_invitation"),
description: "",
description: "CSI invite",
key: "csi_invitation",
subject: i18n.t("printcenter.jobs.csi_invitation"),
disabled: false,
@@ -356,7 +354,7 @@ export const TemplateList = (type, context) => {
},
window_tag_sublet: {
title: i18n.t("printcenter.jobs.window_tag_sublet"),
description: "",
description: "Window Tag Sublet",
key: "window_tag_sublet",
subject: i18n.t("printcenter.jobs.window_tag_sublet"),
disabled: false,
@@ -364,7 +362,7 @@ export const TemplateList = (type, context) => {
},
thank_you_ro: {
title: i18n.t("printcenter.jobs.thank_you_ro"),
description: "",
description: "Thank You Letter by RO",
key: "thank_you_ro",
subject: i18n.t("printcenter.jobs.thank_you_ro"),
disabled: false,
@@ -372,7 +370,7 @@ export const TemplateList = (type, context) => {
},
parts_label_single: {
title: i18n.t("printcenter.jobs.parts_label_single"),
description: "",
description: "Thank You Letter by RO",
key: "parts_label_single",
subject: i18n.t("printcenter.jobs.parts_label_single"),
disabled: false,
@@ -381,7 +379,7 @@ export const TemplateList = (type, context) => {
},
envelope_return_address: {
title: i18n.t("printcenter.jobs.envelope_return_address"),
description: "",
description: "All Jobs Notes",
subject: i18n.t("printcenter.jobs.envelope_return_address"),
key: "envelope_return_address",
disabled: false,
@@ -390,7 +388,7 @@ export const TemplateList = (type, context) => {
},
sgi_certificate_of_repairs: {
title: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"),
description: "",
description: "Thank You Letter by RO",
key: "sgi_certificate_of_repairs",
subject: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"),
disabled: false,
@@ -401,7 +399,7 @@ export const TemplateList = (type, context) => {
},
sgi_windshield_auth: {
title: i18n.t("printcenter.jobs.sgi_windshield_auth"),
description: "",
description: "Thank You Letter by RO",
key: "sgi_windshield_auth",
subject: i18n.t("printcenter.jobs.sgi_windshield_auth"),
disabled: false,
@@ -412,7 +410,7 @@ export const TemplateList = (type, context) => {
},
mpi_final_acct_sheet: {
title: i18n.t("printcenter.jobs.mpi_final_acct_sheet"),
description: "",
description: "Thank You Letter by RO",
key: "mpi_final_acct_sheet",
subject: i18n.t("printcenter.jobs.mpi_final_acct_sheet"),
disabled: false,
@@ -423,7 +421,7 @@ export const TemplateList = (type, context) => {
},
mpi_eglass_auth: {
title: i18n.t("printcenter.jobs.mpi_eglass_auth"),
description: "",
description: "Thank You Letter by RO",
key: "mpi_eglass_auth",
subject: i18n.t("printcenter.jobs.mpi_eglass_auth"),
disabled: false,
@@ -434,7 +432,7 @@ export const TemplateList = (type, context) => {
},
mpi_animal_checklist: {
title: i18n.t("printcenter.jobs.mpi_animal_checklist"),
description: "",
description: "Thank You Letter by RO",
key: "mpi_animal_checklist",
subject: i18n.t("printcenter.jobs.mpi_animal_checklist"),
disabled: false,
@@ -445,7 +443,7 @@ export const TemplateList = (type, context) => {
},
ab_proof_of_loss: {
title: i18n.t("printcenter.jobs.ab_proof_of_loss"),
description: "",
description: "Thank You Letter by RO",
key: "ab_proof_of_loss",
subject: i18n.t("printcenter.jobs.ab_proof_of_loss"),
disabled: false,
@@ -456,7 +454,7 @@ export const TemplateList = (type, context) => {
},
// parts_label_multi: {
// title: i18n.t("printcenter.jobs.parts_label_multi"),
// description: "",
// description: "Thank You Letter by RO",
// key: "parts_label_multi",
// subject: i18n.t("printcenter.jobs.parts_label_multi"),
// disabled: false,
@@ -464,7 +462,7 @@ export const TemplateList = (type, context) => {
// },
iou_form: {
title: i18n.t("printcenter.jobs.iou_form"),
description: "",
description: "CASL Authorization",
subject: i18n.t("printcenter.jobs.iou_form"),
key: "iou_form",
disabled: false,
@@ -472,7 +470,7 @@ export const TemplateList = (type, context) => {
},
lag_time_ro: {
title: i18n.t("printcenter.jobs.lag_time_ro"),
description: "",
description: "CASL Authorization",
subject: i18n.t("printcenter.jobs.lag_time_ro"),
key: "lag_time_ro",
disabled: false,
@@ -480,7 +478,7 @@ export const TemplateList = (type, context) => {
},
rental_reservation: {
title: i18n.t("printcenter.jobs.rental_reservation"),
description: "",
description: "CASL Authorization",
subject: i18n.t("printcenter.jobs.rental_reservation"),
key: "rental_reservation",
disabled: false,
@@ -488,7 +486,7 @@ export const TemplateList = (type, context) => {
},
timetickets_ro: {
title: i18n.t("printcenter.jobs.timetickets_ro"),
description: "",
description: "CASL Authorization",
subject: i18n.t("printcenter.jobs.timetickets_ro"),
key: "timetickets_ro",
disabled: false,
@@ -496,7 +494,7 @@ export const TemplateList = (type, context) => {
},
dms_posting_sheet: {
title: i18n.t("printcenter.jobs.dms_posting_sheet"),
description: "",
description: "DMS Posting Sheet",
subject: i18n.t("printcenter.jobs.dms_posting_sheet"),
key: "dms_posting_sheet",
disabled: false,
@@ -508,39 +506,39 @@ export const TemplateList = (type, context) => {
? {
special_thirdpartypayer: {
title: i18n.t("printcenter.jobs.thirdpartypayer"),
description: "",
description: "CSI invite",
key: "special_thirdpartypayer",
disabled: false,
},
folder_label_multiple: {
title: i18n.t("printcenter.jobs.folder_label_multiple"),
description: "",
description: "Folder Label Multiple",
key: "folder_label_multiple",
disabled: false,
},
parts_label_multiple: {
title: i18n.t("printcenter.jobs.parts_label_multiple"),
description: "",
description: "Parts Label Multiple",
key: "parts_label_multiple",
disabled: false,
},
parts_invoice_label_single: {
title: i18n.t("printcenter.jobs.parts_invoice_label_single"),
description: "",
description: "Parts Label Multiple",
key: "parts_invoice_label_single",
disabled: false,
ignoreCustomMargins: true,
},
csi_invitation_action: {
title: i18n.t("printcenter.jobs.csi_invitation_action"),
description: "",
description: "CSI invite",
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: "",
description: "CSI invite",
key: "individual_job_note",
subject: i18n.t("printcenter.jobs.individual_job_note", {
ro_number: (context && context.ro_number) || "",
@@ -553,7 +551,7 @@ export const TemplateList = (type, context) => {
? {
appointment_confirmation: {
title: i18n.t("printcenter.appointments.appointment_confirmation"),
description: "",
description: "Appointment Confirmation",
subject: i18n.t(
"printcenter.appointments.appointment_confirmation"
),
@@ -566,7 +564,7 @@ export const TemplateList = (type, context) => {
? {
parts_order: {
title: i18n.t("printcenter.jobs.parts_order"),
description: "",
description: "Parts Order",
key: "parts_order",
subject: i18n.t("printcenter.subjects.jobs.parts_order", {
ro_number: context && context.job && context.job.ro_number,
@@ -580,7 +578,7 @@ export const TemplateList = (type, context) => {
},
sublet_order: {
title: i18n.t("printcenter.jobs.sublet_order"),
description: "",
description: "Parts Order",
key: "sublet_order",
subject: i18n.t("printcenter.subjects.jobs.sublet_order", {
ro_number: context && context.job && context.job.ro_number,
@@ -595,7 +593,7 @@ 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: "",
description: "Parts Return",
key: "parts_return_slip",
disabled: false,
},
@@ -605,7 +603,7 @@ export const TemplateList = (type, context) => {
? {
payment_receipt: {
title: i18n.t("printcenter.jobs.payment_receipt"),
description: "",
description: "Payment Receipt",
subject: i18n.t("printcenter.jobs.payment_receipt"),
key: "payment_receipt",
disabled: false,
@@ -1893,7 +1891,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_contract"
),
description: "",
description: "Est Detail",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_contract"
),
@@ -1902,7 +1900,7 @@ export const TemplateList = (type, context) => {
},
courtesy_car_terms: {
title: i18n.t("printcenter.courtesycarcontract.courtesy_car_terms"),
description: "",
description: "Est Detail",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_terms"
),
@@ -1913,7 +1911,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_impound"
),
description: "",
description: "Est Detail",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_impound"
),
@@ -1928,7 +1926,7 @@ export const TemplateList = (type, context) => {
title: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_inventory"
),
description: "",
description: "Est Detail",
subject: i18n.t(
"printcenter.courtesycarcontract.courtesy_car_inventory"
),
@@ -1941,7 +1939,7 @@ export const TemplateList = (type, context) => {
? {
inhouse_invoice: {
title: i18n.t("printcenter.bills.inhouse_invoice"),
description: "",
description: "Est Detail",
subject: i18n.t("printcenter.bills.inhouse_invoice"),
key: "inhouse_invoice",
disabled: false,
@@ -1952,7 +1950,7 @@ export const TemplateList = (type, context) => {
? {
// timetickets: {
// title: i18n.t("printcenter.timetickets.timetickets"),
// description: "",
// description: "Est Detail",
// subject: `${i18n.t("printcenter.timetickets.timetickets")} - ${
// context && context.job && context.job.ro_number
// }`,
@@ -1965,14 +1963,14 @@ export const TemplateList = (type, context) => {
? {
purchases_by_vendor_detailed: {
title: i18n.t("printcenter.vendors.purchases_by_vendor_detailed"),
description: "",
description: "Est Detail",
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: "",
description: "Est Detail",
subject: i18n.t("printcenter.vendors.purchases_by_vendor_summary"),
key: "purchases_by_vendor_summary",
disabled: false,
@@ -2045,21 +2043,21 @@ export const TemplateList = (type, context) => {
? {
ca_bc_etf_table: {
title: i18n.t("printcenter.payments.ca_bc_etf_table"),
description: "",
description: "Est Detail",
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: "",
description: "Est Detail",
subject: i18n.t("printcenter.payments.exported_payroll"),
key: "exported_payroll",
disabled: false,
},
attendance_detail_csv: {
title: i18n.t("printcenter.special.attendance_detail_csv"),
description: "",
description: "Est Detail",
subject: i18n.t("printcenter.special.attendance_detail_csv"),
key: "attendance_detail_csv",
disabled: false,

View File

@@ -11168,6 +11168,11 @@ react-image-lightbox@^5.1.4:
prop-types "^15.7.2"
react-modal "^3.11.1"
react-intersection-observer@^9.4.3:
version "9.4.3"
resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-9.4.3.tgz#ec84ce0c25cad548075130ea045ac5c7adf908f3"
integrity sha512-WNRqMQvKpupr6MzecAQI0Pj0+JQong307knLP4g/nBex7kYfIaZsPpXaIhKHR+oV8z+goUbH9e10j6lGRnTzlQ==
react-is@^16.10.2, react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"

View File

@@ -265,20 +265,20 @@ const CreateRepairOrderTag = (job, errorCallback) => {
}${job.est_ct_fn ? job.est_ct_fn : ""}`,
},
CustomerInformation: {
FirstName: "",
LastName: "",
Street: "",
City: "",
State: "",
FirstName: job.ownr_fn || "",
LastName: job.ownr_ln || "",
Street: job.ownr_addr1 || "",
City: job.ownr_city || "",
State: job.ownr_st || "",
Zip: (job.ownr_zip && job.ownr_zip.substring(0, 3)) || "",
Phone1: "",
Phone1: job.ownr_ph1 || "",
Phone2: null,
Phone2Extension: null,
Phone3: null,
Phone3Extension: null,
FileComments: null,
Source: null,
Email: "",
Email: job.ownr_ea || "",
RetWhsl: null,
Cat: null,
InsuredorClaimantFlag: null,
@@ -762,12 +762,7 @@ const CreateCosts = (job) => {
}, {});
//If the hourly rates for job costing are set, add them in.
if (
job.bodyshop.jc_hourly_rates &&
(job.bodyshop.jc_hourly_rates.mapa ||
typeof job.bodyshop.jc_hourly_rates.mapa === "number" ||
isNaN(job.bodyshop.jc_hourly_rates.mapa) === false)
) {
if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) {
if (
!billTotalsByCostCenters[
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA

View File

@@ -612,12 +612,7 @@ function GenerateCostingData(job) {
//If the hourly rates for job costing are set, add them in.
if (
job.bodyshop.jc_hourly_rates &&
(job.bodyshop.jc_hourly_rates.mapa ||
typeof job.bodyshop.jc_hourly_rates.mapa === "number" ||
isNaN(job.bodyshop.jc_hourly_rates.mapa) === false)
) {
if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) {
if (
!billTotalsByCostCenters.additionalCosts[
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
@@ -631,9 +626,7 @@ function GenerateCostingData(job) {
billTotalsByCostCenters.additionalCosts[
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
] = Dinero({
amount: Math.round(
((job.mixdata[0] && job.mixdata[0].totalliquidcost) || 0) * 100
),
amount: Math.round((job.mixdata[0] && job.mixdata[0].totalliquidcost || 0) * 100)
});
} else {
billTotalsByCostCenters.additionalCosts[

View File

@@ -4312,14 +4312,9 @@ tslib@^1.11.1:
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
tslib@^2.0.1, tslib@^2.1.0:
tslib@^2.3.1, tslib@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
version "2.5.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
version "2.5.3"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913"
integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==
tslib@^2.3.1, tslib@^2.5.0:
version "2.5.0"