-
- {event.note && }
- {`${event.job.ro_number || t("general.labels.na")}`}
-
-
-
-
-
-
- {`${(event.job && event.job.v_model_yr) || ""} ${
- (event.job && event.job.v_make_desc) || ""
- } ${(event.job && event.job.v_model_desc) || ""}`}
-
-
- {`(${
- (event.job && event.job.labhrs.aggregate.sum.mod_lb_hrs) || "0"
- } / ${
- (event.job && event.job.larhrs.aggregate.sum.mod_lb_hrs) || "0"
- })`}
-
-
+ {event.note &&
}
+
{`${event.job.ro_number || t("general.labels.na")}`}
+
+
+
+ {`${(event.job && event.job.v_model_yr) || ""} ${
+ (event.job && event.job.v_make_desc) || ""
+ } ${(event.job && event.job.v_model_desc) || ""}`}
+
+ {`(${(event.job && event.job.labhrs.aggregate.sum.mod_lb_hrs) || "0"} / ${
+ (event.job && event.job.larhrs.aggregate.sum.mod_lb_hrs) || "0"
+ })`}
+
{event.job && event.job.alt_transport && (
{event.job.alt_transport}
)}
-
+
) : (
-
+
{`${event.title || ""}`}
);
@@ -291,7 +291,13 @@ export function ScheduleEventComponent({
onVisibleChange={(vis) => !event.vacation && setVisible(vis)}
trigger="click"
content={event.block ? blockContent : popoverContent}
- style={{ height: "100%", width: "100%" }}
+ style={{
+ height: "100%",
+ width: "100%",
+
+ backgroundColor:
+ event.color && event.color.hex ? event.color.hex : event.color,
+ }}
>
{RegularEvent}
diff --git a/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.search.component.jsx b/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.search.component.jsx
index 137ad45f4..b4c4152c8 100644
--- a/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.search.component.jsx
+++ b/client/src/components/jobs-create-vehicle-info/jobs-create-vehicle-info.search.component.jsx
@@ -4,6 +4,7 @@ import { Table, Input, Card, Space } from "antd";
import { Link } from "react-router-dom";
import { alphaSort } from "../../utils/sorters";
import JobCreateContext from "../../pages/jobs-create/jobs-create.context";
+import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
export default function JobsCreateVehicleInfoSearchComponent({
loading,
@@ -27,7 +28,9 @@ export default function JobsCreateVehicleInfoSearchComponent({
tableState.sortedInfo.columnKey === "v_vin" &&
tableState.sortedInfo.order,
render: (text, record) => (
-
{record.v_vin}
+
+
{record.v_vin}
+
),
},
{
diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx
index 56868b9c6..8f41cec59 100644
--- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx
+++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx
@@ -23,6 +23,7 @@ import JobsRelatedRos from "../jobs-related-ros/jobs-related-ros.component";
import { DateTimeFormatter } from "../../utils/DateFormatter";
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
+import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
const mapStateToProps = createStructuredSelector({
jobRO: selectJobReadOnly,
@@ -211,7 +212,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
}`})`}
- {`${job.v_vin || t("general.labels.na")}`}
+
+ {`${job.v_vin || t("general.labels.na")}`}
+
diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx
index cecc22795..bbb09178c 100644
--- a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx
+++ b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx
@@ -1,16 +1,17 @@
import { EditFilled } from "@ant-design/icons";
-import { Card, Space, Table } from "antd";
+import { Card, Col, Row, Space, Table } from "antd";
+import _ from "lodash";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
-import { selectBodyshop } from "../../redux/user/user.selectors";
import { selectTechnician } from "../../redux/tech/tech.selectors";
+import { selectBodyshop } from "../../redux/user/user.selectors";
import { alphaSort } from "../../utils/sorters";
import LaborAllocationsAdjustmentEdit from "../labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component";
import "./labor-allocations-table.styles.scss";
import { CalculateAllocationsTotals } from "./labor-allocations-table.utility";
-import _ from "lodash";
+
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
technician: selectTechnician,
@@ -43,6 +44,11 @@ export function LaborAllocationsTable({
if (!jobId) setTotals([]);
}, [joblines, timetickets, bodyshop, adjustments, jobId]);
+ // const convertedLines = useMemo(
+ // () => joblines && joblines.filter((j) => j.convertedtolbr),
+ // [joblines]
+ // );
+
const columns = [
{
title: t("timetickets.fields.cost_center"),
@@ -114,24 +120,91 @@ export function LaborAllocationsTable({
),
},
];
+ // const convertedTableCols = [
+ // {
+ // title: t("joblines.fields.line_desc"),
+ // dataIndex: "line_desc",
+ // key: "line_desc",
+ // ellipsis: true,
+ // },
+ // {
+ // title: t("joblines.fields.op_code_desc"),
+ // dataIndex: "op_code_desc",
+ // key: "op_code_desc",
+ // ellipsis: true,
+ // render: (text, record) =>
+ // `${record.op_code_desc || ""}${
+ // record.alt_partm ? ` ${record.alt_partm}` : ""
+ // }`,
+ // },
+
+ // {
+ // title: t("joblines.fields.act_price"),
+ // dataIndex: "act_price",
+ // key: "act_price",
+ // ellipsis: true,
+ // render: (text, record) => (
+ // <>
+ //
+ // {record.db_ref === "900510" || record.db_ref === "900511"
+ // ? record.prt_dsmk_m
+ // : record.act_price}
+ //
+ // {record.prt_dsmk_p && record.prt_dsmk_p !== 0 ? (
+ // {`(${record.prt_dsmk_p}%)`}
+ // ) : (
+ // <>>
+ // )}
+ // >
+ // ),
+ // },
+ // {
+ // title: t("joblines.fields.part_qty"),
+ // dataIndex: "part_qty",
+ // key: "part_qty",
+ // },
+ // ];
const handleTableChange = (pagination, filters, sorter) => {
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
};
return (
-
-
-
+
+
+
+
+
+
+ {
+ // convertedLines && convertedLines.length > 0 && (
+ //
+ //
+ //
+ //
+ //
+ // )
+ }
+
);
}
export default connect(mapStateToProps, null)(LaborAllocationsTable);
diff --git a/client/src/components/parts-order-modal/parts-order-modal.container.jsx b/client/src/components/parts-order-modal/parts-order-modal.container.jsx
index ec7cc9470..643d39200 100644
--- a/client/src/components/parts-order-modal/parts-order-modal.container.jsx
+++ b/client/src/components/parts-order-modal/parts-order-modal.container.jsx
@@ -101,7 +101,7 @@ export function PartsOrderModalContainer({
logImEXEvent("parts_order_insert");
setSaving(true);
let insertResult;
- if (!is_quote) {
+
insertResult = await insertPartOrder({
variables: {
po: [
@@ -112,16 +112,18 @@ export function PartsOrderModalContainer({
jobid: jobId,
user_email: currentUser.email,
return: isReturn,
- status: bodyshop.md_order_statuses.default_ordered || "Ordered*",
+ status: is_quote
+ ? bodyshop.md_order_statuses.default_quote || "Quote"
+ : bodyshop.md_order_statuses.default_ordered || "Ordered*",
},
],
},
refetchQueries: ["QUERY_PARTS_BILLS_BY_JOBID"],
});
- if (!!insertResult.error) {
+ if (!!insertResult.errors) {
notification["error"]({
message: t("parts_orders.errors.creating"),
- description: JSON.stringify(insertResult.error),
+ description: JSON.stringify(insertResult.errors),
});
return;
}
@@ -140,7 +142,7 @@ export function PartsOrderModalContainer({
insertResult.data.insert_parts_orders.returning[0].order_number
),
});
- }
+
const jobLinesResult = await updateJobLines({
variables: {
diff --git a/client/src/components/schedule-calendar-wrapper/schedule-calendar.styles.scss b/client/src/components/schedule-calendar-wrapper/schedule-calendar.styles.scss
index 432e46099..a46e37b41 100644
--- a/client/src/components/schedule-calendar-wrapper/schedule-calendar.styles.scss
+++ b/client/src/components/schedule-calendar-wrapper/schedule-calendar.styles.scss
@@ -4,6 +4,10 @@
.rbc-time-view .rbc-allday-cell {
height: unset;
}
+
+.rbc-month-row{
+ overflow: unset !important;
+}
// .rbc-row-content {
// display: none;
// }
diff --git a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx
index 616c58ecb..95f825c6e 100644
--- a/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx
+++ b/client/src/components/schedule-calendar-wrapper/scheduler-calendar-wrapper.component.jsx
@@ -34,7 +34,7 @@ export function ScheduleCalendarWrapperComponent({
const { t } = useTranslation();
const handleEventPropStyles = (event, start, end, isSelected) => {
return {
- ...(event.color
+ ...(event.color && !((search.view || defaultView) === "agenda")
? {
style: {
backgroundColor:
diff --git a/client/src/components/vehicle-tag-popover/vehicle-tag-popover.component.jsx b/client/src/components/vehicle-tag-popover/vehicle-tag-popover.component.jsx
index 5f95a5b05..3005c7a34 100644
--- a/client/src/components/vehicle-tag-popover/vehicle-tag-popover.component.jsx
+++ b/client/src/components/vehicle-tag-popover/vehicle-tag-popover.component.jsx
@@ -2,6 +2,7 @@ import { Button, Col, Descriptions, Popover, Row, Tag } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
+import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
export default function VehicleTagPopoverComponent({ job }) {
const { t } = useTranslation();
@@ -27,7 +28,9 @@ export default function VehicleTagPopoverComponent({ job }) {
{`${job.plate_st || t("general.labels.na")}`}
- {`${job.v_vin || t("general.labels.na")}`}
+
+ {`${job.v_vin || t("general.labels.na")}`}
+
@@ -46,7 +49,9 @@ export default function VehicleTagPopoverComponent({ job }) {
{`${job.vehicle.plate_st || t("general.labels.na")}`}
- {`${job.vehicle.v_vin || t("general.labels.na")}`}
+ {`${
+ job.vehicle.v_vin || t("general.labels.na")
+ }`}
diff --git a/client/src/components/vehicle-vin-display/vehicle-vin-display.component.jsx b/client/src/components/vehicle-vin-display/vehicle-vin-display.component.jsx
new file mode 100644
index 000000000..1ba46b8b5
--- /dev/null
+++ b/client/src/components/vehicle-vin-display/vehicle-vin-display.component.jsx
@@ -0,0 +1,18 @@
+import React from "react";
+
+export default function VehicleVinDisplay({ children }) {
+ if (!children) return null;
+ console.log(children);
+ if (typeof children !== "string" || children.length !== 17) return children;
+ const vin = children.trim();
+
+ const first = vin.substring(0, 9);
+ const second = vin.substring(9, 17);
+
+ return (
+ <>
+ {first}
+ {second}
+ >
+ );
+}
diff --git a/client/src/components/vehicles-list/vehicles-list.component.jsx b/client/src/components/vehicles-list/vehicles-list.component.jsx
index ca9091e67..e7de0acc3 100644
--- a/client/src/components/vehicles-list/vehicles-list.component.jsx
+++ b/client/src/components/vehicles-list/vehicles-list.component.jsx
@@ -4,6 +4,7 @@ import queryString from "query-string";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { Link, useHistory, useLocation } from "react-router-dom";
+import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
export default function VehiclesListComponent({
loading,
vehicles,
@@ -31,7 +32,7 @@ export default function VehiclesListComponent({
key: "v_vin",
render: (text, record) => (
- {record.v_vin || "N/A"}
+ {record.v_vin || "N/A"}
),
},
diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js
index 15a879888..906498299 100644
--- a/client/src/graphql/jobs-lines.queries.js
+++ b/client/src/graphql/jobs-lines.queries.js
@@ -48,6 +48,7 @@ export const GET_LINE_TICKET_BY_PK = gql`
lbr_op
lbr_amt
op_code_desc
+ convertedtolbr
}
timetickets(where: { jobid: { _eq: $id } }) {
actualhrs
diff --git a/client/src/redux/messaging/messaging.sagas.js b/client/src/redux/messaging/messaging.sagas.js
index fb1c7d4db..f2684a171 100644
--- a/client/src/redux/messaging/messaging.sagas.js
+++ b/client/src/redux/messaging/messaging.sagas.js
@@ -1,10 +1,10 @@
import axios from "axios";
-import phone from "phone";
+import parsePhoneNumber from "libphonenumber-js";
import { all, call, put, select, takeLatest } from "redux-saga/effects";
import { logImEXEvent } from "../../firebase/firebase.utils";
import {
CONVERSATION_ID_BY_PHONE,
- CREATE_CONVERSATION,
+ CREATE_CONVERSATION
} from "../../graphql/conversations.queries";
import { INSERT_CONVERSATION_TAG } from "../../graphql/job-conversations.queries";
import client from "../../utils/GraphQLClient";
@@ -12,7 +12,7 @@ import { selectBodyshop } from "../user/user.selectors";
import {
sendMessageFailure,
sendMessageSuccess,
- setSelectedConversation,
+ setSelectedConversation
} from "./messaging.actions";
import MessagingActionTypes from "./messaging.types";
@@ -33,13 +33,14 @@ export function* openChatByPhone({ payload }) {
logImEXEvent("messaging_open_by_phone");
const { phone_num, jobid } = payload;
+ const p = parsePhoneNumber(phone_num, "CA");
const bodyshop = yield select(selectBodyshop);
try {
const {
data: { conversations },
} = yield client.query({
query: CONVERSATION_ID_BY_PHONE,
- variables: { phone: phone(phone_num).phoneNumber },
+ variables: { phone: p.number },
});
if (conversations.length === 0) {
@@ -52,7 +53,7 @@ export function* openChatByPhone({ payload }) {
variables: {
conversation: [
{
- phone_num: phone(phone_num).phoneNumber,
+ phone_num: p.number,
bodyshopid: bodyshop.id,
job_conversations: jobid ? { data: { jobid: jobid } } : null,
},
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 12cf52836..95a6d0ea1 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -1570,6 +1570,7 @@
"closeconfirm": "Are you sure you want to close this job? This cannot be easily undone.",
"closejob": "Close Job {{ro_number}}",
"contracts": "CC Contracts",
+ "convertedtolabor": "Lines Converted to Labor",
"cost": "Cost",
"cost_Additional": "Cost - Additional",
"cost_labor": "Cost - Labor",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index ca23c77a3..402e26e56 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -1570,6 +1570,7 @@
"closeconfirm": "",
"closejob": "",
"contracts": "",
+ "convertedtolabor": "",
"cost": "",
"cost_Additional": "",
"cost_labor": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index 7f5176898..eb6800fb5 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -1570,6 +1570,7 @@
"closeconfirm": "",
"closejob": "",
"contracts": "",
+ "convertedtolabor": "",
"cost": "",
"cost_Additional": "",
"cost_labor": "",