From 4f3090c3bd11901ad6f45087d366e6f517955d80 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Mon, 24 Jan 2022 16:07:08 -0800
Subject: [PATCH 01/16] IO-1377 Vendor name consistency on drawer title.
---
client/src/components/vendors-form/vendors-form.component.jsx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/client/src/components/vendors-form/vendors-form.component.jsx b/client/src/components/vendors-form/vendors-form.component.jsx
index 4f3e07b0f..81101e22d 100644
--- a/client/src/components/vendors-form/vendors-form.component.jsx
+++ b/client/src/components/vendors-form/vendors-form.component.jsx
@@ -32,7 +32,9 @@ export default function VendorsFormComponent({
return (
{() => form.getFieldValue("name")}
+ }
extra={
Date: Mon, 24 Jan 2022 16:22:57 -0800
Subject: [PATCH 02/16] IO-1630 Add count to Visual Board.
---
.../production-board-kanban.component.jsx | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/client/src/components/production-board-kanban/production-board-kanban.component.jsx b/client/src/components/production-board-kanban/production-board-kanban.component.jsx
index 10ed5d440..735a761d6 100644
--- a/client/src/components/production-board-kanban/production-board-kanban.component.jsx
+++ b/client/src/components/production-board-kanban/production-board-kanban.component.jsx
@@ -2,7 +2,7 @@ import { useApolloClient } from "@apollo/client";
import Board, { moveCard } from "@asseinfo/react-kanban";
//import "@asseinfo/react-kanban/dist/styles.css";
import "./production-board-kanban.styles.scss";
-import { SyncOutlined } from '@ant-design/icons'
+import { SyncOutlined } from "@ant-design/icons";
import { Grid, notification, Button, PageHeader, Space, Statistic } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
@@ -49,9 +49,16 @@ export function ProductionBoardKanbanComponent({
const { t } = useTranslation();
useEffect(() => {
- setBoardLanes(
- createBoardData(bodyshop.md_ro_statuses.production_statuses, data, filter)
+ const boardData = createBoardData(
+ bodyshop.md_ro_statuses.production_statuses,
+ data,
+ filter
);
+
+ boardData.columns = boardData.columns.map((d) => {
+ return { ...d, title: `${d.title} (${d.cards.length})` };
+ });
+ setBoardLanes(boardData);
setIsMoving(false);
}, [
data,
From 4bd3b851efaacd2a3b3e5adeff0444ecdec3efac Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Mon, 24 Jan 2022 16:30:10 -0800
Subject: [PATCH 03/16] IO-1657 Add status to global search.
---
.../src/components/global-search/global-search.component.jsx | 1 +
client/src/graphql/search.queries.js | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/client/src/components/global-search/global-search.component.jsx b/client/src/components/global-search/global-search.component.jsx
index 018aefdec..4806c7ab6 100644
--- a/client/src/components/global-search/global-search.component.jsx
+++ b/client/src/components/global-search/global-search.component.jsx
@@ -38,6 +38,7 @@ export default function GlobalSearch() {
}>
{job.ro_number || t("general.labels.na")}
+ {`${job.status || ""}`}
{`${job.ownr_fn || ""} ${job.ownr_ln || ""} ${
job.ownr_co_nm || ""
}`}
diff --git a/client/src/graphql/search.queries.js b/client/src/graphql/search.queries.js
index beb1b1486..a4d8339f9 100644
--- a/client/src/graphql/search.queries.js
+++ b/client/src/graphql/search.queries.js
@@ -5,14 +5,14 @@ export const GLOBAL_SEARCH_QUERY = gql`
search_jobs(args: { search: $search }) {
id
ro_number
+ status
- clm_total
clm_no
v_model_yr
v_model_desc
v_make_desc
v_color
- plate_no
+
ownr_fn
ownr_ln
ownr_co_nm
From 3985293cee76e98a2ad176b68b06e55e67e1dffb Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 08:44:44 -0800
Subject: [PATCH 04/16] IO-1656 Send media through sms fix.
---
.../chat-send-message/chat-send-message.component.jsx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/client/src/components/chat-send-message/chat-send-message.component.jsx b/client/src/components/chat-send-message/chat-send-message.component.jsx
index bc0c0af7c..6ac7cb6b4 100644
--- a/client/src/components/chat-send-message/chat-send-message.component.jsx
+++ b/client/src/components/chat-send-message/chat-send-message.component.jsx
@@ -48,7 +48,11 @@ function ChatSendMessageComponent({
if (message === "" || !message) return;
logImEXEvent("messaging_send_message");
const selectedImages = selectedMedia.filter((i) => i.isSelected);
- if (selectedImages < 11) {
+ console.log(
+ "🚀 ~ file: chat-send-message.component.jsx ~ line 52 ~ selectedImages",
+ selectedImages
+ );
+ if (selectedImages.length < 11) {
sendMessage({
to: conversation.phone_num,
body: message,
From b546d90c9e71ce865b5196c2483e0769394ec9ea Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 08:46:44 -0800
Subject: [PATCH 05/16] IO-1651 add estimates written/converted.
---
README.MD | 2 +-
bodyshop_translations.babel | 21 +++++++++++++++++++
.../chat-send-message.component.jsx | 5 +----
client/src/translations/en_us/common.json | 1 +
client/src/translations/es/common.json | 1 +
client/src/translations/fr/common.json | 1 +
client/src/utils/TemplateConstants.js | 18 ++++++++++++++++
7 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/README.MD b/README.MD
index 910584faf..d0c3915f8 100644
--- a/README.MD
+++ b/README.MD
@@ -10,7 +10,7 @@ npx hasura migrate apply --endpoint https://db.imex.online/ --admin-secret 'Prod
npx hasura migrate apply --endpoint https://db.test.bodyshop.app/ --admin-secret 'Test-ImEXOnlineBySnaptSoftware!'
NGROK TEsting:
-./ngrok.exe http http://localhost:5000 -host-header="localhost:5000"
+./ngrok.exe http http://localhost:4000 -host-header="localhost:4000"
Finding deadfiles - run from client directory
npx deadfile ./src/index.js --exclude build templates
diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 38857c3ad..797cb30cd 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -37167,6 +37167,27 @@
+
+ estimates_written_converted
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
estimator_detail
false
diff --git a/client/src/components/chat-send-message/chat-send-message.component.jsx b/client/src/components/chat-send-message/chat-send-message.component.jsx
index 6ac7cb6b4..9526dc91b 100644
--- a/client/src/components/chat-send-message/chat-send-message.component.jsx
+++ b/client/src/components/chat-send-message/chat-send-message.component.jsx
@@ -48,10 +48,7 @@ function ChatSendMessageComponent({
if (message === "" || !message) return;
logImEXEvent("messaging_send_message");
const selectedImages = selectedMedia.filter((i) => i.isSelected);
- console.log(
- "🚀 ~ file: chat-send-message.component.jsx ~ line 52 ~ selectedImages",
- selectedImages
- );
+
if (selectedImages.length < 11) {
sendMessage({
to: conversation.phone_num,
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 2ec4ddfb9..6dbd52a40 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -2220,6 +2220,7 @@
"attendance_summary": "Attendance Summary (All Employees)",
"credits_not_received_date": "Credits not Received by Date",
"csi": "CSI Responses",
+ "estimates_written_converted": "Estimates Written/Converted",
"estimator_detail": "Jobs by Estimator (Detail)",
"estimator_summary": "Jobs by Estimator (Summary)",
"export_payables": "Export Log - Payables",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 59983bd51..44632a0ff 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -2220,6 +2220,7 @@
"attendance_summary": "",
"credits_not_received_date": "",
"csi": "",
+ "estimates_written_converted": "",
"estimator_detail": "",
"estimator_summary": "",
"export_payables": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index f20e02e42..fbeb51ce4 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -2220,6 +2220,7 @@
"attendance_summary": "",
"credits_not_received_date": "",
"csi": "",
+ "estimates_written_converted": "",
"estimator_detail": "",
"estimator_summary": "",
"export_payables": "",
diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js
index 1c7fe6558..38f99163d 100644
--- a/client/src/utils/TemplateConstants.js
+++ b/client/src/utils/TemplateConstants.js
@@ -1466,6 +1466,24 @@ export const TemplateList = (type, context) => {
},
group: "customers",
},
+ estimates_written_converted: {
+ title: i18n.t("reportcenter.templates.estimates_written_converted"),
+ description: "",
+ subject: i18n.t(
+ "reportcenter.templates.estimates_written_converted"
+ ),
+ key: "estimates_written_converted",
+ //idtype: "vendor",
+ disabled: false,
+ rangeFilter: {
+ object: i18n.t("reportcenter.labels.objects.jobs"),
+ field:
+ i18n.t("jobs.fields.date_open") +
+ "/" +
+ i18n.t("jobs.fields.date_invoiced"), // Also date invoice.
+ },
+ group: "sales",
+ },
}
: {}),
...(!type || type === "courtesycarcontract"
From c17e1e92aaceee1c10681e9ea8e13f9ca4a67a4c Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 12:32:08 -0800
Subject: [PATCH 06/16] IO-1691 Segmented logrocket tracking.
---
client/src/App/App.container.jsx | 6 -----
client/src/App/App.jsx | 38 ++++++++++++++++++++++++++++++--
2 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx
index fb1dcd800..74f6ba4df 100644
--- a/client/src/App/App.container.jsx
+++ b/client/src/App/App.container.jsx
@@ -2,7 +2,6 @@ import { ApolloProvider } from "@apollo/client";
import { SplitFactory, SplitSdk } from "@splitsoftware/splitio-react";
import { ConfigProvider } from "antd";
import enLocale from "antd/es/locale/en_US";
-import LogRocket from "logrocket";
import moment from "moment";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -10,13 +9,8 @@ import GlobalLoadingBar from "../components/global-loading-bar/global-loading-ba
import client from "../utils/GraphQLClient";
import App from "./App";
-
moment.locale("en-US");
-
-//tracker.start();
-if (process.env.NODE_ENV === "production") LogRocket.init("gvfvfw/bodyshopapp");
-
export const factory = SplitSdk({
core: {
authorizationKey: process.env.REACT_APP_SPLIT_API,
diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx
index 6a2bf774a..7a3970a06 100644
--- a/client/src/App/App.jsx
+++ b/client/src/App/App.jsx
@@ -6,6 +6,8 @@ import { Route, Switch } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import DocumentEditorContainer from "../components/document-editor/document-editor.container";
import ErrorBoundary from "../components/error-boundary/error-boundary.component";
+import LogRocket from "logrocket";
+
//Component Imports
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
@@ -13,11 +15,15 @@ import TechPageContainer from "../pages/tech/tech.page.container";
import { setOnline } from "../redux/application/application.actions";
import { selectOnline } from "../redux/application/application.selectors";
import { checkUserSession } from "../redux/user/user.actions";
-import { selectCurrentUser } from "../redux/user/user.selectors";
+import {
+ selectBodyshop,
+ selectCurrentUser,
+} from "../redux/user/user.selectors";
import PrivateRoute from "../utils/private-route";
import "./App.styles.scss";
import LandingPage from "../pages/landing/landing.page";
+import { useTreatments } from "@splitsoftware/splitio-react";
const ResetPassword = lazy(() =>
import("../pages/reset-password/reset-password.component")
);
@@ -32,13 +38,31 @@ const MobilePaymentContainer = lazy(() =>
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
online: selectOnline,
+ bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
checkUserSession: () => dispatch(checkUserSession()),
setOnline: (isOnline) => dispatch(setOnline(isOnline)),
});
-export function App({ checkUserSession, currentUser, online, setOnline }) {
+export function App({
+ bodyshop,
+ checkUserSession,
+ currentUser,
+ online,
+ setOnline,
+}) {
+ const { LogRocket_Tracking } = useTreatments(
+ ["LogRocket_Tracking"],
+ {},
+ bodyshop && bodyshop.imexshopid
+ );
+
+ console.log(
+ "🚀 ~ file: App.jsx ~ line 56 ~ LogRocket_Tracking",
+ LogRocket_Tracking
+ );
+
useEffect(() => {
if (!navigator.onLine) {
setOnline(false);
@@ -59,6 +83,16 @@ export function App({ checkUserSession, currentUser, online, setOnline }) {
window.addEventListener("online", function (e) {
setOnline(true);
});
+ useEffect(() => {
+ if (currentUser.authorized) {
+ if (
+ process.env.NODE_ENV === "production" &&
+ LogRocket_Tracking.treatment === "on"
+ ) {
+ LogRocket.init("gvfvfw/bodyshopapp");
+ }
+ }
+ }, [currentUser.authorized, LogRocket_Tracking.treatment]);
if (currentUser.authorized === null) {
return ;
From cb48ea64f9e3a2cc91b8b31f0128feefadb15587 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 12:34:43 -0800
Subject: [PATCH 07/16] IO-1682 Remove name from Payable/Payments exporting.
---
server/accounting/qbxml/qbxml-payables.js | 4 +---
server/accounting/qbxml/qbxml-payments.js | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/server/accounting/qbxml/qbxml-payables.js b/server/accounting/qbxml/qbxml-payables.js
index dd91a9ae3..97f7f7c90 100644
--- a/server/accounting/qbxml/qbxml-payables.js
+++ b/server/accounting/qbxml/qbxml-payables.js
@@ -76,9 +76,7 @@ const generateBill = (bill) => {
DueDate:
bill.due_date && moment(bill.due_date).format("YYYY-MM-DD"),
RefNumber: bill.invoice_number,
- Memo: `RO ${bill.job.ro_number || ""} OWNER ${
- bill.job.ownr_fn || ""
- } ${bill.job.ownr_ln || ""} ${bill.job.ownr_co_nm || ""}`,
+ Memo: `RO ${bill.job.ro_number || ""}`,
ExpenseLineAdd: bill.billlines.map((il) =>
generateBillLine(
il,
diff --git a/server/accounting/qbxml/qbxml-payments.js b/server/accounting/qbxml/qbxml-payments.js
index 7820f9a7e..ceb07ae99 100644
--- a/server/accounting/qbxml/qbxml-payments.js
+++ b/server/accounting/qbxml/qbxml-payments.js
@@ -136,9 +136,7 @@ const generatePayment = (payment, isThreeTier, twoTierPref) => {
PaymentMethodRef: {
FullName: payment.type,
},
- Memo: `RO ${payment.job.ro_number || ""} OWNER ${
- payment.job.ownr_fn || ""
- } ${payment.job.ownr_ln || ""} ${payment.job.ownr_co_nm || ""} ${
+ Memo: `RO ${payment.job.ro_number || ""} ${
payment.stripeid || ""
} ${payment.payer ? ` PAID BY ${payment.payer}` : ""}`,
IsAutoApply: true,
From 2c702da1fd1a3809c76207e6dd7157e0788bcc8d Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 13:26:28 -0800
Subject: [PATCH 08/16] IO-1664 IO-1670 Improve DMS Story.
---
bodyshop_translations.babel | 21 ++++++++++++++
.../dms-post-form/dms-post-form.component.jsx | 28 ++++++++++++++-----
2 files changed, 42 insertions(+), 7 deletions(-)
diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 797cb30cd..e54117a86 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -25448,6 +25448,27 @@
dms
+
+ damageto
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
defaultstory
false
diff --git a/client/src/components/dms-post-form/dms-post-form.component.jsx b/client/src/components/dms-post-form/dms-post-form.component.jsx
index a5f454d4c..86425750d 100644
--- a/client/src/components/dms-post-form/dms-post-form.component.jsx
+++ b/client/src/components/dms-post-form/dms-post-form.component.jsx
@@ -2,7 +2,6 @@ import { DeleteFilled, DownOutlined } from "@ant-design/icons";
import {
Button,
Card,
- DatePicker,
Divider,
Dropdown,
Form,
@@ -15,6 +14,7 @@ import {
Typography,
} from "antd";
import Dinero from "dinero.js";
+import moment from "moment";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -23,9 +23,9 @@ import { determineDmsType } from "../../pages/dms/dms.container";
import { selectBodyshop } from "../../redux/user/user.selectors";
import DmsCdkMakes from "../dms-cdk-makes/dms-cdk-makes.component";
import DmsCdkMakesRefetch from "../dms-cdk-makes/dms-cdk-makes.refetch.component";
+import FormDatePicker from "../form-date-picker/form-date-picker.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
-import moment from "moment";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -80,11 +80,25 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
layout="vertical"
onFinish={handleFinish}
initialValues={{
- story: t("jobs.labels.dms.defaultstory", {
+ story: `${t("jobs.labels.dms.defaultstory", {
ro_number: job.ro_number,
- area_of_damage:
- (job.area_of_damage && job.area_of_damage.impact1) || "UNKNOWN",
- }).substr(0, 239),
+ ownr_nm: `${job.ownr_fn || ""} ${job.ownr_ln || ""} ${
+ job.ownr_co_nm || ""
+ }`,
+ ins_co_nm: job.ins_co_nm || "N/A",
+ clm_po: `${job.clm_no ? `${job.clm_no} ` : ""}${
+ job.po_number || ""
+ }`,
+ })}.${
+ job.area_of_damage && job.area_of_damage.impact1
+ ? " " +
+ t("jobs.labels.dms.damageto", {
+ area_of_damage:
+ (job.area_of_damage && job.area_of_damage.impact1) ||
+ "UNKNOWN",
+ })
+ : ""
+ }`.substr(0, 239),
inservicedate: moment("2019-01-01"),
}}
>
@@ -162,7 +176,7 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
name="inservicedate"
label={t("jobs.fields.dms.inservicedate")}
>
-
+
From a8b1537cd609622b55bcb0a545d6577b1f38526d Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 13:26:42 -0800
Subject: [PATCH 09/16] IO-1671 Improved date handling for form item.
---
client/src/App/App.jsx | 12 ++----
.../form-date-picker.component.jsx | 39 ++++++++++++++-----
.../jobs-admin-dates.component.jsx | 6 ++-
.../jobs-detail-dates.component.jsx | 4 +-
...production-list-columns.date.component.jsx | 12 ++++--
client/src/translations/en_us/common.json | 3 +-
client/src/translations/es/common.json | 1 +
client/src/translations/fr/common.json | 1 +
8 files changed, 51 insertions(+), 27 deletions(-)
diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx
index 7a3970a06..ccd22f414 100644
--- a/client/src/App/App.jsx
+++ b/client/src/App/App.jsx
@@ -1,4 +1,6 @@
+import { useTreatments } from "@splitsoftware/splitio-react";
import { Button, Result } from "antd";
+import LogRocket from "logrocket";
import React, { lazy, Suspense, useEffect } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -6,11 +8,10 @@ import { Route, Switch } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import DocumentEditorContainer from "../components/document-editor/document-editor.container";
import ErrorBoundary from "../components/error-boundary/error-boundary.component";
-import LogRocket from "logrocket";
-
//Component Imports
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
+import LandingPage from "../pages/landing/landing.page";
import TechPageContainer from "../pages/tech/tech.page.container";
import { setOnline } from "../redux/application/application.actions";
import { selectOnline } from "../redux/application/application.selectors";
@@ -22,8 +23,6 @@ import {
import PrivateRoute from "../utils/private-route";
import "./App.styles.scss";
-import LandingPage from "../pages/landing/landing.page";
-import { useTreatments } from "@splitsoftware/splitio-react";
const ResetPassword = lazy(() =>
import("../pages/reset-password/reset-password.component")
);
@@ -58,11 +57,6 @@ export function App({
bodyshop && bodyshop.imexshopid
);
- console.log(
- "🚀 ~ file: App.jsx ~ line 56 ~ LogRocket_Tracking",
- LogRocket_Tracking
- );
-
useEffect(() => {
if (!navigator.onLine) {
setOnline(false);
diff --git a/client/src/components/form-date-picker/form-date-picker.component.jsx b/client/src/components/form-date-picker/form-date-picker.component.jsx
index f485debfe..9ce7aa7f4 100644
--- a/client/src/components/form-date-picker/form-date-picker.component.jsx
+++ b/client/src/components/form-date-picker/form-date-picker.component.jsx
@@ -1,16 +1,22 @@
import { DatePicker } from "antd";
import moment from "moment";
-import React, { forwardRef } from "react";
+import React, { useRef } from "react";
//To be used as a form element only.
const dateFormat = "MM/DD/YYYY";
-const FormDatePicker = (
- { value, onChange, onBlur, onlyFuture, ...restProps },
- ref
-) => {
+export default function FormDatePicker({
+ value,
+ onChange,
+ onBlur,
+ onlyFuture,
+ ...restProps
+}) {
+ const ref = useRef();
+
const handleChange = (newDate) => {
if (value !== newDate && onChange) {
+ console.log("XXX1");
onChange(newDate);
}
};
@@ -19,17 +25,34 @@ const FormDatePicker = (
if (e.key.toLowerCase() === "t") {
if (onChange) {
onChange(new moment());
+ if (ref.current && ref.current.blur) ref.current.blur();
}
+ } else if (e.key.toLowerCase() === "enter") {
+ if (ref.current && ref.current.blur) ref.current.blur();
}
};
+ const handleBlur = (e) => {
+ const v = e.target.value;
+ if (!v) return;
+
+ const _a = moment(
+ v,
+ ["MMDDYY", "MMDDYYYY", "MMDD", "MM/DD/YY"],
+ "en",
+ false
+ );
+ if (_a.isValid() && onChange) onChange(_a);
+ };
+
return (
moment().subtract(1, "day").isAfter(d),
@@ -38,6 +61,4 @@ const FormDatePicker = (
/>
);
-};
-
-export default forwardRef(FormDatePicker);
+}
diff --git a/client/src/components/jobs-admin-dates/jobs-admin-dates.component.jsx b/client/src/components/jobs-admin-dates/jobs-admin-dates.component.jsx
index f52fe5497..e708cb268 100644
--- a/client/src/components/jobs-admin-dates/jobs-admin-dates.component.jsx
+++ b/client/src/components/jobs-admin-dates/jobs-admin-dates.component.jsx
@@ -1,11 +1,13 @@
import { useMutation } from "@apollo/client";
-import { Button, Form, notification, DatePicker } from "antd";
+import { Button, Form, notification } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import moment from "moment";
+import FormDatePicker from "../form-date-picker/form-date-picker.component";
+
export default function JobsAdminDatesChange({ job }) {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
@@ -54,7 +56,7 @@ export default function JobsAdminDatesChange({ job }) {
label={t("jobs.fields.date_estimated")}
name="date_estimated"
>
-
+
diff --git a/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx b/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx
index b54783f98..ec2c9bcef 100644
--- a/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx
+++ b/client/src/components/jobs-detail-dates/jobs-detail-dates.component.jsx
@@ -1,4 +1,4 @@
-import { DatePicker, Form, Statistic, Tooltip } from "antd";
+import { Form, Statistic, Tooltip } from "antd";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -34,7 +34,7 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
label={t("jobs.fields.date_estimated")}
name="date_estimated"
>
-
+
diff --git a/client/src/components/production-list-columns/production-list-columns.date.component.jsx b/client/src/components/production-list-columns/production-list-columns.date.component.jsx
index 1b201032e..94ca00c88 100644
--- a/client/src/components/production-list-columns/production-list-columns.date.component.jsx
+++ b/client/src/components/production-list-columns/production-list-columns.date.component.jsx
@@ -1,12 +1,12 @@
import { useMutation } from "@apollo/client";
-import { DatePicker, Dropdown, TimePicker, Button, Card } from "antd";
+import { Button, Card, Dropdown, TimePicker } from "antd";
import moment from "moment";
import React, { useState } from "react";
+import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { DateFormatter } from "../../utils/DateFormatter";
-
-import { useTranslation } from "react-i18next";
+import FormDatePicker from "../form-date-picker/form-date-picker.component";
export default function ProductionListDate({
record,
@@ -17,8 +17,12 @@ export default function ProductionListDate({
const [updateAlert] = useMutation(UPDATE_JOB);
const [visible, setVisible] = useState(false);
const { t } = useTranslation();
+
const handleChange = (date) => {
logImEXEvent("product_toggle_date", { field });
+ if (date.isSame(record[field] && moment(record[field]))) {
+ return;
+ }
//e.stopPropagation();
updateAlert({
@@ -58,7 +62,7 @@ export default function ProductionListDate({
style={{ padding: "1rem" }}
onClick={(e) => e.stopPropagation()}
>
- e.stopPropagation()}
value={(record[field] && moment(record[field])) || null}
onChange={handleChange}
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 6dbd52a40..6fc283fd0 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -1506,7 +1506,8 @@
"difference": "Difference",
"diskscan": "Scan Disk for Estimates",
"dms": {
- "defaultstory": "Bodyshop RO {{ro_number}}. Damage to $t(jobs.fields.area_of_damage_impact.{{area_of_damage}}).",
+ "damageto": "Damage to $t(jobs.fields.area_of_damage_impact.{{area_of_damage}}).",
+ "defaultstory": "B/S RO: {{ro_number}}. Owner: {{ownr_nm}}. Insurance Co: {{ins_co_nm}}. Claim/PO #: {{clm_po}}",
"invoicedatefuture": "Invoice date must be today or in the future for CDK posting.",
"kmoutnotgreaterthankmin": "Mileage out must be greater than mileage in.",
"logs": "Logs",
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index 44632a0ff..109ed5b6f 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -1506,6 +1506,7 @@
"difference": "",
"diskscan": "",
"dms": {
+ "damageto": "",
"defaultstory": "",
"invoicedatefuture": "",
"kmoutnotgreaterthankmin": "",
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index fbeb51ce4..6d88ba81b 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -1506,6 +1506,7 @@
"difference": "",
"diskscan": "",
"dms": {
+ "damageto": "",
"defaultstory": "",
"invoicedatefuture": "",
"kmoutnotgreaterthankmin": "",
From aa61aa67029267fdc9aa51e1df5e5a09e2df5f8f Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 14:03:28 -0800
Subject: [PATCH 10/16] IO-1672 Updated bill line discount display.
---
.../bill-enter-modal.container.jsx | 2 +-
.../bill-form/bill-form.lines.component.jsx | 66 ++++++++++++++-----
2 files changed, 51 insertions(+), 17 deletions(-)
diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx
index d7adeb4fe..0ef98325a 100644
--- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx
+++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx
@@ -245,7 +245,7 @@ function BillEnterModalContainer({
return (
(
-
- ),
- additional: (record, index) => (
-
- {() => {
- const line = getFieldsValue(["billlines"]).billlines[index];
- if (!!!line) return null;
- const lineDiscount = (
- 1 -
- Math.round((line.actual_cost / line.actual_price) * 100) / 100
- ).toPrecision(2);
+
+ {() => {
+ const line = getFieldsValue(["billlines"]).billlines[index];
+ if (!!!line) return null;
+ const lineDiscount = 1 - line.actual_cost / line.actual_price;
- if (lineDiscount - discount === 0) return ;
- return ;
- }}
-
+ return (
+
+ 0.005
+ ? "red"
+ : "green",
+ }}
+ />
+
+ );
+ }}
+
+ }
+ />
),
+ // additional: (record, index) => (
+ //
+ // {() => {
+ // const line = getFieldsValue(["billlines"]).billlines[index];
+ // if (!!!line) return null;
+ // const lineDiscount = (
+ // 1 -
+ // Math.round((line.actual_cost / line.actual_price) * 100) / 100
+ // ).toPrecision(2);
+
+ // return (
+ //
+ //
+ //
+ // );
+ // }}
+ //
+ // ),
},
{
title: t("billlines.fields.cost_center"),
From 25fd90f8818e826f52d68c367fc169cb1750b141 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Wed, 26 Jan 2022 14:06:24 -0800
Subject: [PATCH 11/16] IO-1672 Updated vendor discount display.
---
.../components/bill-form/bill-form.lines.component.jsx | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/client/src/components/bill-form/bill-form.lines.component.jsx b/client/src/components/bill-form/bill-form.lines.component.jsx
index 8f80c2452..fa04375d0 100644
--- a/client/src/components/bill-form/bill-form.lines.component.jsx
+++ b/client/src/components/bill-form/bill-form.lines.component.jsx
@@ -211,15 +211,17 @@ export function BillEnterModalLinesComponent({
{() => {
const line = getFieldsValue(["billlines"]).billlines[index];
if (!!!line) return null;
- const lineDiscount = 1 - line.actual_cost / line.actual_price;
-
+ let lineDiscount = 1 - line.actual_cost / line.actual_price;
+ if (isNaN(lineDiscount)) lineDiscount = 0;
return (
0.005
- ? "red"
+ ? lineDiscount > discount
+ ? "orange"
+ : "red"
: "green",
}}
/>
From 9b444a130b5c400e990cd7f899d1a5a056053fd3 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Thu, 27 Jan 2022 08:37:26 -0800
Subject: [PATCH 12/16] IO-1673 Posting bills to removed lines for credit
memos.
---
.../bill-form/bill-form.lines.component.jsx | 77 +++++++++++--------
.../bill-line-search-select.component.jsx | 9 ++-
2 files changed, 51 insertions(+), 35 deletions(-)
diff --git a/client/src/components/bill-form/bill-form.lines.component.jsx b/client/src/components/bill-form/bill-form.lines.component.jsx
index fa04375d0..dd49b4677 100644
--- a/client/src/components/bill-form/bill-form.lines.component.jsx
+++ b/client/src/components/bill-form/bill-form.lines.component.jsx
@@ -59,39 +59,52 @@ export function BillEnterModalLinesComponent({
};
},
formInput: (record, index) => (
- {
- setFieldsValue({
- billlines: getFieldsValue(["billlines"]).billlines.map(
- (item, idx) => {
- if (idx === index) {
- return {
- ...item,
- line_desc: opt.line_desc,
- quantity: opt.part_qty || 1,
- actual_price: opt.cost,
- cost_center: opt.part_type
- ? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
- ? opt.part_type !== "PAE"
- ? opt.part_type
- : null
- : responsibilityCenters.defaults &&
- (responsibilityCenters.defaults.costs[
- opt.part_type
- ] ||
- null)
- : null,
- };
- }
- return item;
- }
- ),
- });
+
+ prev.is_credit_memo !== cur.is_credit_memo
+ }
+ >
+ {() => {
+ return (
+ {
+ setFieldsValue({
+ billlines: getFieldsValue(["billlines"]).billlines.map(
+ (item, idx) => {
+ if (idx === index) {
+ return {
+ ...item,
+ line_desc: opt.line_desc,
+ quantity: opt.part_qty || 1,
+ actual_price: opt.cost,
+ cost_center: opt.part_type
+ ? bodyshop.pbs_serialnumber ||
+ bodyshop.cdk_dealerid
+ ? opt.part_type !== "PAE"
+ ? opt.part_type
+ : null
+ : responsibilityCenters.defaults &&
+ (responsibilityCenters.defaults.costs[
+ opt.part_type
+ ] ||
+ null)
+ : null,
+ };
+ }
+ return item;
+ }
+ ),
+ });
+ }}
+ />
+ );
}}
- />
+
),
},
{
diff --git a/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx b/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx
index 910d29856..38ca6c8b5 100644
--- a/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx
+++ b/client/src/components/bill-line-search-select/bill-line-search-select.component.jsx
@@ -4,9 +4,12 @@ import { useTranslation } from "react-i18next";
//To be used as a form element only.
const { Option } = Select;
-const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
+const BillLineSearchSelect = (
+ { options, disabled, allowRemoved, ...restProps },
+ ref
+) => {
const { t } = useTranslation();
-
+ console.log(allowRemoved);
return (