From 6d8463265cb76eebab12b1801e5aaa6714237f8a Mon Sep 17 00:00:00 2001 From: swtmply Date: Tue, 6 Jun 2023 02:07:30 +0800 Subject: [PATCH 01/47] IO-2317 Messaging screen on mobile --- .../chat-conversation-title.component.jsx | 23 +++++++++++++++++-- .../chat-popup/chat-popup.component.jsx | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx b/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx index 1503bf46f..9fb9776a3 100644 --- a/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx +++ b/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx @@ -1,14 +1,31 @@ -import { Space } from "antd"; +import { Space, Button, Col } from "antd"; import React from "react"; import PhoneNumberFormatter from "../../utils/PhoneFormatter"; import ChatArchiveButton from "../chat-archive-button/chat-archive-button.component"; import ChatConversationTitleTags from "../chat-conversation-title-tags/chat-conversation-title-tags.component"; import ChatLabelComponent from "../chat-label/chat-label.component"; import ChatTagRoContainer from "../chat-tag-ro/chat-tag-ro.container"; +import { connect } from "react-redux"; +import { setSelectedConversation } from "../../redux/messaging/messaging.actions"; +import { LeftOutlined } from "@ant-design/icons"; -export default function ChatConversationTitle({ conversation }) { +const mapDispatchToProps = (dispatch) => ({ + setSelectedConversation: (conversationId) => + dispatch(setSelectedConversation(conversationId)), +}); + +function ChatConversationTitle({ conversation, setSelectedConversation }) { return ( + + + {conversation && conversation.phone_num} @@ -23,3 +40,5 @@ export default function ChatConversationTitle({ conversation }) { ); } + +export default connect(null, mapDispatchToProps)(ChatConversationTitle); diff --git a/client/src/components/chat-popup/chat-popup.component.jsx b/client/src/components/chat-popup/chat-popup.component.jsx index 1c80d7c4c..45b2a332f 100644 --- a/client/src/components/chat-popup/chat-popup.component.jsx +++ b/client/src/components/chat-popup/chat-popup.component.jsx @@ -112,7 +112,7 @@ export function ChatPopupComponent({ /> - + {loading ? ( ) : ( From 5a3ddfad0fb23b9b10c08f098848b8d160046faf Mon Sep 17 00:00:00 2001 From: swtmply Date: Tue, 6 Jun 2023 22:20:22 +0800 Subject: [PATCH 02/47] IO-2280 fixed query params in shop config --- client/src/components/header/header.component.jsx | 4 +++- client/src/components/shop-info/shop-info.component.jsx | 4 +++- client/src/pages/shop/shop.page.component.jsx | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index 1ed3f526d..f0edf82d2 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -311,7 +311,9 @@ function Header({ icon={} > }> - {t("menus.header.shop_config")} + + {t("menus.header.shop_config")} + }> {t("menus.header.dashboard")} diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx index efabb6d5b..8803500ef 100644 --- a/client/src/components/shop-info/shop-info.component.jsx +++ b/client/src/components/shop-info/shop-info.component.jsx @@ -52,7 +52,9 @@ export function ShopInfoComponent({ bodyshop, form, saveLoading }) { - history.push({ search: `?tab=${search.tab}&subtab=${key}` }) + history.push({ + search: `?tab=${search.tab}&subtab=${key}`, + }) } > diff --git a/client/src/pages/shop/shop.page.component.jsx b/client/src/pages/shop/shop.page.component.jsx index 47107be43..de6b267d5 100644 --- a/client/src/pages/shop/shop.page.component.jsx +++ b/client/src/pages/shop/shop.page.component.jsx @@ -40,6 +40,10 @@ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) { ]); }, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]); + useEffect(() => { + if (!search.tab) history.push({ search: "?tab=info" }); + }, [history, search]); + return ( Date: Tue, 6 Jun 2023 22:39:39 +0800 Subject: [PATCH 03/47] IO-2311 fixed tile height --- .../chat-conversation-list.component.jsx | 97 +++++++++++-------- 1 file changed, 59 insertions(+), 38 deletions(-) diff --git a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx index ffc087ae2..e9afdc83d 100644 --- a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx +++ b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx @@ -7,7 +7,12 @@ 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 { + List as VirtualizedList, + AutoSizer, + CellMeasurerCache, + CellMeasurer, +} from "react-virtualized"; import "./chat-conversation-list.styles.scss"; @@ -33,48 +38,64 @@ function ChatConversationListComponent({ [] ); - const rowRenderer = ({ index, key, style }) => { + const cache = new CellMeasurerCache({ + fixedWidth: true, + defaultHeight: 60, + }); + + const rowRenderer = ({ index, key, style, parent }) => { const item = conversationList[index]; return ( - setSelectedConversation(item.id)} - className={`chat-list-item ${ - item.id === selectedConversation - ? "chat-list-selected-conversation" - : null - }`} - style={style} + cache={cache} + parent={parent} + columnIndex={0} + rowIndex={index} > -
- {item.label &&
{item.label}
} - {item.job_conversations.length > 0 ? ( -
- {item.job_conversations.map((j, idx) => ( -
- -
- ))} -
- ) : ( - {item.phone_num} - )} -
-
-
- {item.job_conversations.length > 0 - ? item.job_conversations.map((j, idx) => ( - - {j.job.ro_number} - - )) - : null} + setSelectedConversation(item.id)} + className={`chat-list-item ${ + item.id === selectedConversation + ? "chat-list-selected-conversation" + : null + }`} + style={style} + > +
+ {item.label &&
{item.label}
} + {item.job_conversations.length > 0 ? ( +
+ {item.job_conversations.map((j, idx) => ( +
+ +
+ ))} +
+ ) : ( + {item.phone_num} + )}
- {item.updated_at} -
- - +
+
+ {item.job_conversations.length > 0 + ? item.job_conversations.map((j, idx) => ( + + {j.job.ro_number} + + )) + : null} +
+ {item.updated_at} +
+ + + ); }; @@ -86,7 +107,7 @@ function ChatConversationListComponent({ height={height} width={width} rowCount={conversationList.length} - rowHeight={60} + rowHeight={cache.rowHeight} rowRenderer={rowRenderer} onScroll={({ scrollTop, scrollHeight, clientHeight }) => { if (scrollTop + clientHeight === scrollHeight) { From 33af544deda0c1ccc84e8d62813fe4afc00fbf91 Mon Sep 17 00:00:00 2001 From: swtmply Date: Tue, 6 Jun 2023 22:47:20 +0800 Subject: [PATCH 04/47] IO-2322 added search function to insurance dropdown --- .../jobs-convert-button/jobs-convert-button.component.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx index b48deb3b5..6e469cb57 100644 --- a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx +++ b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx @@ -108,7 +108,12 @@ export function JobsConvertButton({ }, ]} > - { + return option.value.toLowerCase().includes(input.toLowerCase()); + }} + > {bodyshop.md_ins_cos.map((s, i) => ( {s.name} From 86e14967caf568f352ac8d807af07b56c8a262ef Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 6 Jun 2023 13:38:51 -0700 Subject: [PATCH 05/47] IO-2278 Additional permission for dispatch lines. --- hasura/metadata/tables.yaml | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 952644a60..111374fb5 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -4662,6 +4662,73 @@ - name: parts_dispatch using: foreign_key_constraint_on: partsdispatchid + insert_permissions: + - role: user + permission: + check: + parts_dispatch: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + columns: + - id + - created_at + - updated_at + - partsdispatchid + - joblineid + - quantity + - accepted_at + select_permissions: + - role: user + permission: + columns: + - quantity + - accepted_at + - created_at + - updated_at + - id + - joblineid + - partsdispatchid + filter: + parts_dispatch: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + update_permissions: + - role: user + permission: + columns: + - id + - created_at + - updated_at + - partsdispatchid + - joblineid + - quantity + - accepted_at + filter: + parts_dispatch: + job: + bodyshop: + associations: + _and: + - user: + authid: + _eq: X-Hasura-User-Id + - active: + _eq: true + check: null - table: name: parts_order_lines schema: public From 50230e9f50be6389c644dd31340fa22e0f378eb2 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 6 Jun 2023 13:41:38 -0700 Subject: [PATCH 06/47] IO-2278 adjust schema for parts dispatch. --- .../down.sql | 1 + .../up.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/down.sql create mode 100644 hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/up.sql diff --git a/hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/down.sql b/hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/down.sql new file mode 100644 index 000000000..b88b44672 --- /dev/null +++ b/hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/down.sql @@ -0,0 +1 @@ +alter table "public"."parts_dispatch_lines" alter column "accepted_at" set not null; diff --git a/hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/up.sql b/hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/up.sql new file mode 100644 index 000000000..723108120 --- /dev/null +++ b/hasura/migrations/1686084082349_alter_table_public_parts_dispatch_lines_alter_column_accepted_at/up.sql @@ -0,0 +1 @@ +alter table "public"."parts_dispatch_lines" alter column "accepted_at" drop not null; From daa763105678d29c2862fc0072384ea420f7974c Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 7 Jun 2023 11:23:00 -0700 Subject: [PATCH 07/47] Integration IO-2278 schema changes made on wrong branch. --- .../down.sql | 1 + .../up.sql | 18 ++++++++++++++++++ .../down.sql | 1 + .../up.sql | 18 ++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 hasura/migrations/1685561607407_create_table_public_parts_dispatch/down.sql create mode 100644 hasura/migrations/1685561607407_create_table_public_parts_dispatch/up.sql create mode 100644 hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/down.sql create mode 100644 hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/up.sql diff --git a/hasura/migrations/1685561607407_create_table_public_parts_dispatch/down.sql b/hasura/migrations/1685561607407_create_table_public_parts_dispatch/down.sql new file mode 100644 index 000000000..42325ddf5 --- /dev/null +++ b/hasura/migrations/1685561607407_create_table_public_parts_dispatch/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."parts_dispatch"; diff --git a/hasura/migrations/1685561607407_create_table_public_parts_dispatch/up.sql b/hasura/migrations/1685561607407_create_table_public_parts_dispatch/up.sql new file mode 100644 index 000000000..d8c7c2729 --- /dev/null +++ b/hasura/migrations/1685561607407_create_table_public_parts_dispatch/up.sql @@ -0,0 +1,18 @@ +CREATE TABLE "public"."parts_dispatch" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "jobid" uuid NOT NULL, "number" serial NOT NULL, "employeeid" uuid NOT NULL, "dispatched_at" timestamptz NOT NULL, "dispatched_by" text NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("jobid") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade); +CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() +RETURNS TRIGGER AS $$ +DECLARE + _new record; +BEGIN + _new := NEW; + _new."updated_at" = NOW(); + RETURN _new; +END; +$$ LANGUAGE plpgsql; +CREATE TRIGGER "set_public_parts_dispatch_updated_at" +BEFORE UPDATE ON "public"."parts_dispatch" +FOR EACH ROW +EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); +COMMENT ON TRIGGER "set_public_parts_dispatch_updated_at" ON "public"."parts_dispatch" +IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE EXTENSION IF NOT EXISTS pgcrypto; diff --git a/hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/down.sql b/hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/down.sql new file mode 100644 index 000000000..a12867253 --- /dev/null +++ b/hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."parts_dispatch_lines"; diff --git a/hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/up.sql b/hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/up.sql new file mode 100644 index 000000000..5146e2c7e --- /dev/null +++ b/hasura/migrations/1685561715531_create_table_public_parts_dispatch_lines/up.sql @@ -0,0 +1,18 @@ +CREATE TABLE "public"."parts_dispatch_lines" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "partsdispatchid" UUID NOT NULL, "joblineid" uuid NOT NULL, "quantity" numeric NOT NULL DEFAULT 1, "accepted_at" timestamptz NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("joblineid") REFERENCES "public"."joblines"("id") ON UPDATE cascade ON DELETE cascade); +CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"() +RETURNS TRIGGER AS $$ +DECLARE + _new record; +BEGIN + _new := NEW; + _new."updated_at" = NOW(); + RETURN _new; +END; +$$ LANGUAGE plpgsql; +CREATE TRIGGER "set_public_parts_dispatch_lines_updated_at" +BEFORE UPDATE ON "public"."parts_dispatch_lines" +FOR EACH ROW +EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"(); +COMMENT ON TRIGGER "set_public_parts_dispatch_lines_updated_at" ON "public"."parts_dispatch_lines" +IS 'trigger to set value of column "updated_at" to current timestamp on row update'; +CREATE EXTENSION IF NOT EXISTS pgcrypto; From b791f9846f2af7df2136bb344511f66bcff67b6d Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 7 Jun 2023 12:03:17 -0700 Subject: [PATCH 08/47] IO-2329 Change update alert to be permanent. --- .../update-alert/update-alert.component.jsx | 73 +++++++++++++++++++ .../pages/manage/manage.page.component.jsx | 2 + .../pages/manage/manage.page.container.jsx | 2 +- client/src/pages/tech/tech.page.component.jsx | 3 + client/src/pages/tech/tech.page.container.jsx | 2 +- .../redux/application/application.actions.js | 5 ++ .../redux/application/application.reducer.js | 6 ++ .../application/application.selectors.js | 4 + .../redux/application/application.types.js | 1 + client/src/translations/en_us/common.json | 2 +- client/src/utils/RegisterSw.js | 4 + 11 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 client/src/components/update-alert/update-alert.component.jsx diff --git a/client/src/components/update-alert/update-alert.component.jsx b/client/src/components/update-alert/update-alert.component.jsx new file mode 100644 index 000000000..59febd90c --- /dev/null +++ b/client/src/components/update-alert/update-alert.component.jsx @@ -0,0 +1,73 @@ +import { Alert, Button, Space } from "antd"; +import i18n from "i18next"; +import React from "react"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectUpdateAvailable } from "../../redux/application/application.selectors"; +import { AlertOutlined } from "@ant-design/icons"; +import { useTranslation } from "react-i18next"; +import { setUpdateAvailable } from "../../redux/application/application.actions"; +import { store } from "../../redux/store"; +import * as serviceWorkerRegistration from "../../serviceWorkerRegistration"; + +let globalRegistration; + +const mapStateToProps = createStructuredSelector({ + updateAvailable: selectUpdateAvailable, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); +export default connect(mapStateToProps, mapDispatchToProps)(UpdateAlert); + +export function UpdateAlert({ updateAvailable }) { + const { t } = useTranslation(); + if (!updateAvailable) return null; + return ( + } + description={t("general.messages.newversionmessage")} + closable={false} + type="warning" + action={ + + + + + } + /> + ); +} + +const onServiceWorkerUpdate = (registration) => { + console.log("onServiceWorkerUpdate", registration); + globalRegistration = registration; + store.dispatch(setUpdateAvailable(true)); +}; +store.dispatch(setUpdateAvailable(true)); + +serviceWorkerRegistration.register({ onUpdate: onServiceWorkerUpdate }); diff --git a/client/src/pages/manage/manage.page.component.jsx b/client/src/pages/manage/manage.page.component.jsx index f8ed14fcd..bd63cd011 100644 --- a/client/src/pages/manage/manage.page.component.jsx +++ b/client/src/pages/manage/manage.page.component.jsx @@ -25,6 +25,7 @@ import { import * as Sentry from "@sentry/react"; import "./manage.page.styles.scss"; +import UpdateAlert from "../../components/update-alert/update-alert.component"; const ManageRootPage = lazy(() => import("../manage-root/manage-root.page.container") @@ -394,6 +395,7 @@ export function Manage({ match, conflict, bodyshop }) { <> + diff --git a/client/src/pages/manage/manage.page.container.jsx b/client/src/pages/manage/manage.page.container.jsx index 75f4da328..04505ce2a 100644 --- a/client/src/pages/manage/manage.page.container.jsx +++ b/client/src/pages/manage/manage.page.container.jsx @@ -6,7 +6,7 @@ import AlertComponent from "../../components/alert/alert.component"; import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component"; import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries"; import { setBodyshop } from "../../redux/user/user.actions"; -import "../../utils/RegisterSw"; +//import "../../utils/RegisterSw"; import ManagePage from "./manage.page.component"; const mapDispatchToProps = (dispatch) => ({ diff --git a/client/src/pages/tech/tech.page.component.jsx b/client/src/pages/tech/tech.page.component.jsx index f7639a473..50219f72d 100644 --- a/client/src/pages/tech/tech.page.component.jsx +++ b/client/src/pages/tech/tech.page.component.jsx @@ -12,6 +12,7 @@ import TechSider from "../../components/tech-sider/tech-sider.component"; import { selectTechnician } from "../../redux/tech/tech.selectors"; import FeatureWrapper from "../../components/feature-wrapper/feature-wrapper.component"; import "./tech.page.styles.scss"; +import UpdateAlert from "../../components/update-alert/update-alert.component"; const TimeTicketModalContainer = lazy(() => import("../../components/time-ticket-modal/time-ticket-modal.container") ); @@ -56,7 +57,9 @@ export function TechPage({ technician, match }) { {technician ? null : } + + ({ type: ApplicationActionTypes.SET_PROBLEM_JOBS, payload: problemJobs, }); + +export const setUpdateAvailable = (isUpdateAvailable) => ({ + type: ApplicationActionTypes.SET_UPDATE_AVAILABLE, + payload: isUpdateAvailable, +}); diff --git a/client/src/redux/application/application.reducer.js b/client/src/redux/application/application.reducer.js index 95579574a..0b428209b 100644 --- a/client/src/redux/application/application.reducer.js +++ b/client/src/redux/application/application.reducer.js @@ -3,6 +3,7 @@ import ApplicationActionTypes from "./application.types"; const INITIAL_STATE = { loading: false, online: true, + updateAvailable: false, breadcrumbs: [], recentItems: [], selectedHeader: "home", @@ -18,6 +19,11 @@ const INITIAL_STATE = { const applicationReducer = (state = INITIAL_STATE, action) => { switch (action.type) { + case ApplicationActionTypes.SET_UPDATE_AVAILABLE: + return { + ...state, + updateAvailable: action.payload, + }; case ApplicationActionTypes.SET_SELECTED_HEADER: return { ...state, diff --git a/client/src/redux/application/application.selectors.js b/client/src/redux/application/application.selectors.js index cb5e2c679..e9b293d62 100644 --- a/client/src/redux/application/application.selectors.js +++ b/client/src/redux/application/application.selectors.js @@ -48,3 +48,7 @@ export const selectProblemJobs = createSelector( [selectApplication], (application) => application.problemJobs ); +export const selectUpdateAvailable = createSelector( + [selectApplication], + (application) => application.updateAvailable +); diff --git a/client/src/redux/application/application.types.js b/client/src/redux/application/application.types.js index 1e047bb82..9b95dd6ee 100644 --- a/client/src/redux/application/application.types.js +++ b/client/src/redux/application/application.types.js @@ -12,5 +12,6 @@ const ApplicationActionTypes = { SET_ONLINE_STATUS: "SET_ONLINE_STATUS", INSERT_AUDIT_TRAIL: "INSERT_AUDIT_TRAIL", SET_PROBLEM_JOBS: "SET_PROBLEM_JOBS", + SET_UPDATE_AVAILABLE: "SET_UPDATE_AVAILABLE" }; export default ApplicationActionTypes; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index b93d0c0a4..b857ca7c8 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1118,7 +1118,7 @@ }, "messages": { "exception": "$t(titles.app) has encountered an error. Please try again. If the problem persists, please submit a support ticket or contact us.", - "newversionmessage": "Click refresh below to update to the latest available version of ImEX Online. Please make sure all other tabs and windows are closed.", + "newversionmessage": "Click refresh to update to the latest available version of ImEX Online. Please make sure all other tabs and windows are closed.", "newversiontitle": "New version of ImEX Online Available", "noacctfilepath": "There is no accounting file path set. You will not be able to export any items.", "nofeatureaccess": "You do not have access to this feature of ImEX Online. Please contact support to request a license for this feature.", diff --git a/client/src/utils/RegisterSw.js b/client/src/utils/RegisterSw.js index 8b2477b8e..0b3bce09c 100644 --- a/client/src/utils/RegisterSw.js +++ b/client/src/utils/RegisterSw.js @@ -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) => { ); + + store.dispatch() + notification.open({ icon: , message: i18n.t("general.messages.newversiontitle"), From 2be0f3de094865be294b2faf4cd187b6a206a88f Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 7 Jun 2023 12:05:55 -0700 Subject: [PATCH 09/47] IO-2329 Remove testing statement. --- client/src/components/update-alert/update-alert.component.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/components/update-alert/update-alert.component.jsx b/client/src/components/update-alert/update-alert.component.jsx index 59febd90c..fcd64cabc 100644 --- a/client/src/components/update-alert/update-alert.component.jsx +++ b/client/src/components/update-alert/update-alert.component.jsx @@ -68,6 +68,5 @@ const onServiceWorkerUpdate = (registration) => { globalRegistration = registration; store.dispatch(setUpdateAvailable(true)); }; -store.dispatch(setUpdateAvailable(true)); serviceWorkerRegistration.register({ onUpdate: onServiceWorkerUpdate }); From 046d104bfa6ef323c0b3a91877907e9c8e6fe014 Mon Sep 17 00:00:00 2001 From: swtmply Date: Fri, 9 Jun 2023 01:04:59 +0800 Subject: [PATCH 10/47] IO-2208 removed subscriptions to the message --- .../chat-conversation-list.component.jsx | 7 -- .../chat-popup/chat-popup.component.jsx | 64 ++++--------------- client/src/graphql/conversations.queries.js | 44 ------------- yarn.lock | 11 +--- 4 files changed, 17 insertions(+), 109 deletions(-) diff --git a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx index ffc087ae2..907f8d5db 100644 --- a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx +++ b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx @@ -24,15 +24,8 @@ function ChatConversationListComponent({ conversationList, selectedConversation, setSelectedConversation, - subscribeToMoreConversations, loadMoreConversations, }) { - useEffect( - () => subscribeToMoreConversations(), - // eslint-disable-next-line react-hooks/exhaustive-deps - [] - ); - const rowRenderer = ({ index, key, style }) => { const item = conversationList[index]; diff --git a/client/src/components/chat-popup/chat-popup.component.jsx b/client/src/components/chat-popup/chat-popup.component.jsx index 1c80d7c4c..c179fe4b5 100644 --- a/client/src/components/chat-popup/chat-popup.component.jsx +++ b/client/src/components/chat-popup/chat-popup.component.jsx @@ -4,7 +4,7 @@ import { ShrinkOutlined, SyncOutlined, } from "@ant-design/icons"; -import { useLazyQuery, useSubscription } from "@apollo/client"; +import { useLazyQuery, useQuery } from "@apollo/client"; import { Badge, Card, Col, Row, Space, Tag, Tooltip, Typography } from "antd"; import React, { useCallback, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; @@ -13,7 +13,7 @@ import { createStructuredSelector } from "reselect"; import { CONVERSATION_LIST_QUERY, CONVERSATION_LIST_SUBSCRIPTION, - UNREAD_CONVERSATION_COUNT_SUBSCRIPTION, + UNREAD_CONVERSATION_COUNT, } from "../../graphql/conversations.queries"; import { toggleChatVisible } from "../../redux/messaging/messaging.actions"; import { @@ -42,19 +42,20 @@ export function ChatPopupComponent({ const { t } = useTranslation(); const [pollInterval, setpollInterval] = useState(0); - const { data: unreadData } = useSubscription( - UNREAD_CONVERSATION_COUNT_SUBSCRIPTION - ); - - const [ - getConversations, - { loading, data, called, refetch, fetchMore, subscribeToMore }, - ] = useLazyQuery(CONVERSATION_LIST_QUERY, { + const { data: unreadData } = useQuery(UNREAD_CONVERSATION_COUNT, { 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"); useEffect(() => { @@ -66,13 +67,13 @@ export function ChatPopupComponent({ }, [fcmToken]); useEffect(() => { - if (called && chatVisible) + if (chatVisible) getConversations({ variables: { offset: 0, }, }); - }, [chatVisible, called, getConversations]); + }, [chatVisible, getConversations]); const loadMoreConversations = useCallback(() => { if (data) @@ -119,43 +120,6 @@ export function ChatPopupComponent({ - subscribeToMore({ - document: CONVERSATION_LIST_SUBSCRIPTION, - variables: { offset: 0 }, - updateQuery: (prev, { subscriptionData }) => { - if ( - !subscriptionData.data || - subscriptionData.data.conversations.length === 0 - ) - return prev; - - let conversations = [...prev.conversations]; - const newConversations = - subscriptionData.data.conversations; - - for (const conversation of newConversations) { - const index = conversations.findIndex( - (prevConversation) => - prevConversation.id === conversation.id - ); - - if (index !== -1) { - conversations.splice(index, 1); - conversations.unshift(conversation); - - continue; - } - - conversations.unshift(conversation); - } - - return Object.assign({}, prev, { - conversations: conversations, - }); - }, - }) - } /> )} diff --git a/client/src/graphql/conversations.queries.js b/client/src/graphql/conversations.queries.js index f9feb3f2f..315ba1a5d 100644 --- a/client/src/graphql/conversations.queries.js +++ b/client/src/graphql/conversations.queries.js @@ -1,37 +1,5 @@ import { gql } from "@apollo/client"; -export const CONVERSATION_LIST_SUBSCRIPTION = gql` - subscription CONVERSATION_LIST_SUBSCRIPTION($offset: Int!) { - conversations( - order_by: { updated_at: desc } - limit: 1 - offset: $offset - 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,18 +12,6 @@ export const UNREAD_CONVERSATION_COUNT = gql` } `; -export const UNREAD_CONVERSATION_COUNT_SUBSCRIPTION = gql` - subscription UNREAD_CONVERSATION_COUNT_SUBSCRIPTION { - messages_aggregate( - where: { read: { _eq: false }, isoutbound: { _eq: false } } - ) { - aggregate { - count - } - } - } -`; - export const CONVERSATION_LIST_QUERY = gql` query CONVERSATION_LIST_QUERY($offset: Int!) { conversations( diff --git a/yarn.lock b/yarn.lock index 9659256b2..3226438a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" From be259317f95f6c1396fe0be40040beb8649c867c Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 8 Jun 2023 11:13:35 -0700 Subject: [PATCH 11/47] Update payables posting label. --- .../dms-allocations-summary-ap.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx b/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx index 1da53e3ba..54651544d 100644 --- a/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx +++ b/client/src/components/dms-allocations-summary-ap/dms-allocations-summary-ap.component.jsx @@ -66,7 +66,7 @@ export function DmsAllocationsSummaryAp({ socket, bodyshop, billids, title }) { key: "status", }, { - title: t("jobs.fields.ro_number"), + title: t("bills.fields.invoice_number"), dataIndex: ["Posting", "Reference"], key: "reference", }, From 307c77b30c3c4da5ac2a67545011c08f510dc7c2 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 8 Jun 2023 15:43:21 -0700 Subject: [PATCH 12/47] Remove failing CI components. --- .../chat-conversation-list.component.jsx | 14 +++++++------- .../components/chat-popup/chat-popup.component.jsx | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx index 08972fb89..0642884c1 100644 --- a/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx +++ b/client/src/components/chat-conversation-list/chat-conversation-list.component.jsx @@ -1,18 +1,18 @@ import { Badge, List, Tag } from "antd"; -import React, { useEffect } from "react"; +import React from "react"; import { connect } from "react-redux"; +import { + AutoSizer, + CellMeasurer, + CellMeasurerCache, + List as VirtualizedList, +} from "react-virtualized"; import { createStructuredSelector } from "reselect"; import { setSelectedConversation } from "../../redux/messaging/messaging.actions"; import { selectSelectedConversation } from "../../redux/messaging/messaging.selectors"; 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, - CellMeasurerCache, - CellMeasurer, -} from "react-virtualized"; import "./chat-conversation-list.styles.scss"; diff --git a/client/src/components/chat-popup/chat-popup.component.jsx b/client/src/components/chat-popup/chat-popup.component.jsx index 92ee5d828..58065cd76 100644 --- a/client/src/components/chat-popup/chat-popup.component.jsx +++ b/client/src/components/chat-popup/chat-popup.component.jsx @@ -12,7 +12,6 @@ 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"; From 6262b3ff8304da58408d6e1901730331271ba104 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 8 Jun 2023 16:00:47 -0700 Subject: [PATCH 13/47] Revert changes for IO-2311 IO-2317. --- .../chat-conversation-title.component.jsx | 23 ++----------------- .../chat-popup/chat-popup.component.jsx | 2 +- .../jobs-convert-button.component.jsx | 7 +----- 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx b/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx index 9fb9776a3..1503bf46f 100644 --- a/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx +++ b/client/src/components/chat-conversation-title/chat-conversation-title.component.jsx @@ -1,31 +1,14 @@ -import { Space, Button, Col } from "antd"; +import { Space } from "antd"; import React from "react"; import PhoneNumberFormatter from "../../utils/PhoneFormatter"; import ChatArchiveButton from "../chat-archive-button/chat-archive-button.component"; import ChatConversationTitleTags from "../chat-conversation-title-tags/chat-conversation-title-tags.component"; import ChatLabelComponent from "../chat-label/chat-label.component"; import ChatTagRoContainer from "../chat-tag-ro/chat-tag-ro.container"; -import { connect } from "react-redux"; -import { setSelectedConversation } from "../../redux/messaging/messaging.actions"; -import { LeftOutlined } from "@ant-design/icons"; -const mapDispatchToProps = (dispatch) => ({ - setSelectedConversation: (conversationId) => - dispatch(setSelectedConversation(conversationId)), -}); - -function ChatConversationTitle({ conversation, setSelectedConversation }) { +export default function ChatConversationTitle({ conversation }) { return ( - - - {conversation && conversation.phone_num} @@ -40,5 +23,3 @@ function ChatConversationTitle({ conversation, setSelectedConversation }) { ); } - -export default connect(null, mapDispatchToProps)(ChatConversationTitle); diff --git a/client/src/components/chat-popup/chat-popup.component.jsx b/client/src/components/chat-popup/chat-popup.component.jsx index 58065cd76..6d582bdab 100644 --- a/client/src/components/chat-popup/chat-popup.component.jsx +++ b/client/src/components/chat-popup/chat-popup.component.jsx @@ -112,7 +112,7 @@ export function ChatPopupComponent({ /> - + {loading ? ( ) : ( diff --git a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx index 6e469cb57..b48deb3b5 100644 --- a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx +++ b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx @@ -108,12 +108,7 @@ export function JobsConvertButton({ }, ]} > - {bodyshop.md_ins_cos.map((s, i) => ( {s.name} From f440a2b022675a8d27656d4bb3f50234a6775b6c Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 8 Jun 2023 16:18:12 -0700 Subject: [PATCH 14/47] Improve update alert on mobile devices. --- .../update-alert/update-alert.component.jsx | 66 ++++++++++--------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/client/src/components/update-alert/update-alert.component.jsx b/client/src/components/update-alert/update-alert.component.jsx index fcd64cabc..f0b11520e 100644 --- a/client/src/components/update-alert/update-alert.component.jsx +++ b/client/src/components/update-alert/update-alert.component.jsx @@ -1,4 +1,4 @@ -import { Alert, Button, Space } from "antd"; +import { Alert, Button, Col, Row, Space } from "antd"; import i18n from "i18next"; import React from "react"; import { connect } from "react-redux"; @@ -28,37 +28,43 @@ export function UpdateAlert({ updateAvailable }) { message={t("general.messages.newversiontitle")} showIcon icon={} - description={t("general.messages.newversionmessage")} + description={ + + + {t("general.messages.newversionmessage")} + + + + + + + + + } closable={false} type="warning" - action={ - - - - - } /> ); } From b1c5bbb01f6bfd53fc730042de36f679f9641ad7 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 9 Jun 2023 11:28:22 -0700 Subject: [PATCH 15/47] Change FK relaitonship. --- .../down.sql | 5 +++++ .../up.sql | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/down.sql create mode 100644 hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/up.sql diff --git a/hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/down.sql b/hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/down.sql new file mode 100644 index 000000000..1dfd23a52 --- /dev/null +++ b/hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/down.sql @@ -0,0 +1,5 @@ +alter table "public"."job_conversations" drop constraint "job_conversations_conversationid_fkey", + add constraint "job_conversations_conversationid_fkey" + foreign key ("conversationid") + references "public"."conversations" + ("id") on update restrict on delete restrict; diff --git a/hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/up.sql b/hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/up.sql new file mode 100644 index 000000000..524d765ed --- /dev/null +++ b/hasura/migrations/1686335272144_set_fk_public_job_conversations_conversationid/up.sql @@ -0,0 +1,5 @@ +alter table "public"."job_conversations" drop constraint "job_conversations_conversationid_fkey", + add constraint "job_conversations_conversationid_fkey" + foreign key ("conversationid") + references "public"."conversations" + ("id") on update cascade on delete cascade; From 3812a0650ed97e7702fe7d52a6d9799f6778af83 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 9 Jun 2023 15:11:14 -0700 Subject: [PATCH 16/47] Global search improvements. --- server/opensearch/os-handler.js | 56 +++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/server/opensearch/os-handler.js b/server/opensearch/os-handler.js index 1266e6a6c..0bc72170c 100644 --- a/server/opensearch/os-handler.js +++ b/server/opensearch/os-handler.js @@ -86,6 +86,7 @@ async function OpenSearchUpdateHandler(req, res) { "v_model_yr", "v_make_desc", "v_model_desc", + "v_vin", ]); document.bodyshopid = req.body.event.data.new.shopid; break; @@ -139,7 +140,7 @@ async function OpenSearchUpdateHandler(req, res) { "exported_at", "invoice_number", "is_credit_memo", - "total" + "total", ]), ...bill.bills_by_pk, bodyshopid: bill.bills_by_pk.job.shopid, @@ -244,17 +245,54 @@ async function OpensearchSearchHandler(req, res) { bool: { must: [ { - multi_match: { - query: search, - type: "phrase_prefix", - //fields: ["*"], - // fuzziness: "5", - //prefix_length: 2, + match: { + bodyshopid: assocs.associations[0].shopid, }, }, { - match: { - bodyshopid: assocs.associations[0].shopid, + bool: { + should: [ + { + multi_match: { + query: search, + type: "cross_fields", + fields: ["*ownr_fn", "*ownr_ln"], + }, + }, + { + multi_match: { + query: search, + type: "most_fields", + fields: [ + "*v_model_yr", + "*v_make_desc^2", + "*v_model_desc^3", + ], + }, + }, + { + query_string: { + query: `*${search}*`, + + fields: [ + "*ro_number^20", + "*clm_no^14", + "*v_vin^12", + "*plate_no^12", + "*ownr_ln^10", + "transactionid^10", + "paymentnum^10", + "invoice_number^10", + "*ownr_fn^8", + "*ownr_co_nm^8", + "*ownr_ph1^8", + "*ownr_ph2^8", + "*", + ], + }, + }, + ], + minimum_should_match: 1, }, }, ], From 9b485bfe45365b53f4aab2a24dc9a9f81e157490 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 13 Jun 2023 15:07:10 -0700 Subject: [PATCH 17/47] IO-2247 Schedule In Today Component --- .../scheduled-in-today.component.jsx | 235 ++++++++++++++++++ .../dashboard-grid.component.jsx | 22 +- client/src/translations/en_us/common.json | 3 +- client/src/translations/es/common.json | 3 +- client/src/translations/fr/common.json | 3 +- 5 files changed, 260 insertions(+), 6 deletions(-) create mode 100644 client/src/components/dashboard-components/scheduled-in-today/scheduled-in-today.component.jsx diff --git a/client/src/components/dashboard-components/scheduled-in-today/scheduled-in-today.component.jsx b/client/src/components/dashboard-components/scheduled-in-today/scheduled-in-today.component.jsx new file mode 100644 index 000000000..87d1980a1 --- /dev/null +++ b/client/src/components/dashboard-components/scheduled-in-today/scheduled-in-today.component.jsx @@ -0,0 +1,235 @@ +import { + BranchesOutlined, + ExclamationCircleFilled, + PauseCircleOutlined, +} from "@ant-design/icons"; +import { Card, Space, Table, Tooltip } from "antd"; +import moment from "moment"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; +import ChatOpenButton from "../../chat-open-button/chat-open-button.component"; +import OwnerNameDisplay from "../../owner-name-display/owner-name-display.component"; +import DashboardRefreshRequired from "../refresh-required.component"; + +export default function DashboardScheduledInToday({ data, ...cardProps }) { + const { t } = useTranslation(); + const [state, setState] = useState({ + sortedInfo: {}, + }); + if (!data) return null; + if (!data.scheduled_in_today) + return ; + + const appt = []; // Flatten Data + data.scheduled_in_today.forEach((item) => { + var i = { + canceled: item.canceled, + id: item.id, + alt_transport: item.job.alt_transport, + clm_no: item.job.clm_no, + jobid: item.job.jobid, + ins_co_nm: item.job.ins_co_nm, + iouparent: item.job.iouparent, + ownerid: item.job.ownerid, + ownr_co_nm: item.job.ownr_co_nm, + ownr_ea: item.job.ownr_ea, + ownr_fn: item.job.ownr_fn, + ownr_ln: item.job.ownr_ln, + ownr_ph1: item.job.ownr_ph1, + ownr_ph2: item.job.ownr_ph2, + production_vars: item.job.production_vars, + ro_number: item.job.ro_number, + suspended: item.job.suspended, + v_make_desc: item.job.v_make_desc, + v_model_desc: item.job.v_model_desc, + v_model_yr: item.job.v_model_yr, + v_vin: item.job.v_vin, + vehicleid: item.job.vehicleid, + note: item.note, + start: moment(item.start).format("hh:mm a"), + title: item.title, + }; + appt.push(i); + }); + appt.sort ( function (a, b) { return new Date(a.start) - new Date(b.start); }); + + const columns = [ + { + title: t("jobs.fields.ro_number"), + dataIndex: "ro_number", + key: "ro_number", + render: (text, record) => ( + e.stopPropagation()} + > + + {record.ro_number || t("general.labels.na")} + {record.production_vars && record.production_vars.alert ? ( + + ) : null} + {record.suspended && ( + + )} + {record.iouparent && ( + + + + )} + + + ), + }, + { + title: t("jobs.fields.owner"), + dataIndex: "owner", + key: "owner", + ellipsis: true, + responsive: ["md"], + render: (text, record) => { + return record.ownerid ? ( + e.stopPropagation()} + > + + + ) : ( + + + + ); + }, + }, + { + title: t("jobs.fields.ownr_ph1"), + dataIndex: "ownr_ph1", + key: "ownr_ph1", + ellipsis: true, + responsive: ["md"], + render: (text, record) => ( + + ), + }, + { + title: t("jobs.fields.ownr_ph2"), + dataIndex: "ownr_ph2", + key: "ownr_ph2", + ellipsis: true, + responsive: ["md"], + render: (text, record) => ( + + ), + }, + { + title: t("jobs.fields.ownr_ea"), + dataIndex: "ownr_ea", + key: "ownr_ea", + ellipsis: true, + responsive: ["md"], + render: (text, record) => ( + + ), + }, + { + title: t("jobs.fields.vehicle"), + dataIndex: "vehicle", + key: "vehicle", + ellipsis: true, + render: (text, record) => { + return record.vehicleid ? ( + e.stopPropagation()} + > + {`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${ + record.v_model_desc || "" + }`} + + ) : ( + {`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${ + record.v_model_desc || "" + }`} + ); + }, + }, + { + title: t("jobs.fields.ins_co_nm"), + dataIndex: "ins_co_nm", + key: "ins_co_nm", + ellipsis: true, + responsive: ["md"], + }, + { + title: t("appointments.fields.time"), + dataIndex: "start", + key: "start", + ellipsis: true, + responsive: ["md"], + }, + { + title: t("appointments.fields.alt_transport"), + dataIndex: "alt_transport", + key: "alt_transport", + ellipsis: true, + responsive: ["md"], + }, + ]; + + const handleTableChange = (sorter) => { + setState({ ...state, sortedInfo: sorter }); + }; + + return ( + +
+ + + + ); +} + +export const DashboardScheduledInTodayGql = ` + scheduled_in_today: appointments(where: {start: {_gte: "${moment() + .startOf("day") + .toISOString()}", _lte: "${moment() + .endOf("day") + .toISOString()}"}, canceled: {_eq: false}, block: {_neq: true}}) { + canceled + id + job { + alt_transport + clm_no + jobid: id + ins_co_nm + iouparent + ownerid + ownr_co_nm + ownr_ea + ownr_fn + ownr_ln + ownr_ph1 + ownr_ph2 + production_vars + ro_number + suspended + v_make_desc + v_model_desc + v_model_yr + v_vin + vehicleid + } + note + start + title + } +`; diff --git a/client/src/components/dashboard-grid/dashboard-grid.component.jsx b/client/src/components/dashboard-grid/dashboard-grid.component.jsx index 39a5432c2..d9d7cbf32 100644 --- a/client/src/components/dashboard-grid/dashboard-grid.component.jsx +++ b/client/src/components/dashboard-grid/dashboard-grid.component.jsx @@ -1,6 +1,6 @@ import Icon, { SyncOutlined } from "@ant-design/icons"; import { gql, useMutation, useQuery } from "@apollo/client"; -import { Button, Dropdown, Menu, notification, PageHeader, Space } from "antd"; +import { Button, Dropdown, Menu, PageHeader, Space, notification } from "antd"; import i18next from "i18next"; import _ from "lodash"; import moment from "moment"; @@ -37,6 +37,9 @@ import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; //Combination of the following: // /node_modules/react-grid-layout/css/styles.css // /node_modules/react-resizable/css/styles.css +import DashboardScheduledInToday, { + DashboardScheduledInTodayGql, +} from "./../dashboard-components/scheduled-in-today/scheduled-in-today.component"; import "./dashboard-grid.styles.scss"; import { GenerateDashboardData } from "./dashboard-grid.utils"; @@ -268,6 +271,15 @@ const componentList = { w: 2, h: 2, }, + ScheduleInToday: { + label: i18next.t("dashboard.titles.scheduledintoday", {date: moment().startOf("day").format("MM/DD/YYYY")}), + component: DashboardScheduledInToday, + gqlFragment: DashboardScheduledInTodayGql, + minW: 10, + minH: 2, + w: 10, + h: 2, + }, }; const createDashboardQuery = (state) => { @@ -283,8 +295,12 @@ const createDashboardQuery = (state) => { monthly_sales: jobs(where: {_and: [ { voided: {_eq: false}}, {date_invoiced: {_gte: "${moment() - .startOf("month").startOf('day').toISOString()}"}}, {date_invoiced: {_lte: "${moment() - .endOf("month").endOf('day').toISOString()}"}}]}) { + .startOf("month") + .startOf("day") + .toISOString()}"}}, {date_invoiced: {_lte: "${moment() + .endOf("month") + .endOf("day") + .toISOString()}"}}]}) { id ro_number date_invoiced diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index b857ca7c8..50e516c47 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -858,7 +858,8 @@ "prodhrssummary": "Production Hours Summary", "productiondollars": "Total dollars in Production", "productionhours": "Total hours in Production", - "projectedmonthlysales": "Projected Monthly Sales" + "projectedmonthlysales": "Projected Monthly Sales", + "scheduledintoday": "Sheduled In Today: {{date}}" } }, "dms": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index ff3efbd30..84538854e 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -858,7 +858,8 @@ "prodhrssummary": "", "productiondollars": "", "productionhours": "", - "projectedmonthlysales": "" + "projectedmonthlysales": "", + "scheduledintoday": "" } }, "dms": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index c8fc9ee4a..34165ee38 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -858,7 +858,8 @@ "prodhrssummary": "", "productiondollars": "", "productionhours": "", - "projectedmonthlysales": "" + "projectedmonthlysales": "", + "scheduledintoday": "" } }, "dms": { From 31b4f4e561fe8db3ff1ea927e959d648d9c0f1f0 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 13 Jun 2023 16:23:23 -0700 Subject: [PATCH 18/47] IO-2336 Job Search Query and Autocomplete Query Update queries to include ownr_co_nm --- client/src/graphql/jobs.queries.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 9619d5173..9a226c831 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -1219,10 +1219,10 @@ export const ACTIVE_JOBS_FOR_AUTOCOMPLETE = gql` query ACTIVE_JOBS_FOR_AUTOCOMPLETE($statuses: [String!]!) { jobs(where: { status: { _in: $statuses } }) { id + ownr_co_nm ownr_fn ownr_ln ro_number - vehicleid v_make_desc v_model_desc @@ -1250,6 +1250,7 @@ export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql` } ) { id + ownr_co_nm ownr_fn ownr_ln ro_number @@ -1266,6 +1267,7 @@ export const SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE = gql` query SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) { jobs_by_pk(id: $id) { id + ownr_co_nm ownr_fn ownr_ln ro_number @@ -1284,6 +1286,7 @@ export const SEARCH_FOR_JOBS = gql` search_jobs(args: { search: $search }, limit: 25) { id ro_number + ownr_co_nm ownr_fn ownr_ln } From 255d65e47d0607be8f96b13407a6304a5909393a Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 15 Jun 2023 09:06:38 -0700 Subject: [PATCH 19/47] IO-2337 Billline.applicible_taxes=null and billline.applicible_taxes on entry data cleanup --- .../bill-enter-modal.container.jsx | 29 +++++++++++++------ server/accounting/qbxml/qbxml-payables.js | 5 +++- 2 files changed, 24 insertions(+), 10 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 6fb7692a4..d2d0d928a 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 @@ -1,18 +1,18 @@ import { useApolloClient, useMutation } from "@apollo/client"; -import { Button, Checkbox, Form, Modal, notification, Space } from "antd"; +import { Button, Checkbox, Form, Modal, Space, notification } from "antd"; import _ from "lodash"; -import React, { useEffect, useState, useMemo } from "react"; +import React, { useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { INSERT_NEW_BILL } from "../../graphql/bills.queries"; +import { UPDATE_INVENTORY_LINES } from "../../graphql/inventory.queries"; import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries"; import { QUERY_JOB_LBR_ADJUSTMENTS, UPDATE_JOB, } from "../../graphql/jobs.queries"; import { MUTATION_MARK_RETURN_RECEIVED } from "../../graphql/parts-orders.queries"; -import { UPDATE_INVENTORY_LINES } from "../../graphql/inventory.queries"; import { insertAuditTrail } from "../../redux/application/application.actions"; import { toggleModalVisible } from "../../redux/modals/modals.actions"; import { selectBillEnterModal } from "../../redux/modals/modals.selectors"; @@ -20,15 +20,15 @@ import { selectBodyshop, selectCurrentUser, } from "../../redux/user/user.selectors"; -import confirmDialog from "../../utils/asyncConfirm"; import AuditTrailMapping from "../../utils/AuditTrailMappings"; -import BillFormContainer from "../bill-form/bill-form.container"; -import { CalculateBillTotal } from "../bill-form/bill-form.totals.utility"; -import { handleUpload } from "../documents-upload/documents-upload.utility"; -import { handleUpload as handleLocalUpload } from "../documents-local-upload/documents-local-upload.utility"; -import useLocalStorage from "../../utils/useLocalStorage"; import { GenerateDocument } from "../../utils/RenderTemplate"; import { TemplateList } from "../../utils/TemplateConstants"; +import confirmDialog from "../../utils/asyncConfirm"; +import useLocalStorage from "../../utils/useLocalStorage"; +import BillFormContainer from "../bill-form/bill-form.container"; +import { CalculateBillTotal } from "../bill-form/bill-form.totals.utility"; +import { handleUpload as handleLocalUpload } from "../documents-local-upload/documents-local-upload.utility"; +import { handleUpload } from "../documents-upload/documents-upload.utility"; const mapStateToProps = createStructuredSelector({ billEnterModal: selectBillEnterModal, @@ -126,6 +126,17 @@ function BillEnterModalContainer({ deductedfromlbr: deductedfromlbr, lbr_adjustment, joblineid: i.joblineid === "noline" ? null : i.joblineid, + applicable_taxes: { + federal: + (i.applicable_taxes && i.applicable_taxes.federal) || + false, + state: + (i.applicable_taxes && i.applicable_taxes.state) || + false, + local: + (i.applicable_taxes && i.applicable_taxes.local) || + false, + }, }; }), }, diff --git a/server/accounting/qbxml/qbxml-payables.js b/server/accounting/qbxml/qbxml-payables.js index 5bc99cf5f..6b9951500 100644 --- a/server/accounting/qbxml/qbxml-payables.js +++ b/server/accounting/qbxml/qbxml-payables.js @@ -133,7 +133,10 @@ const generateBillLine = (billLine, responsibilityCenters, jobClass) => { const findTaxCode = (billLine, taxcode) => { const { applicable_taxes: { local, state, federal }, - } = billLine; + } = + billLine.applicable_taxes === null + ? { applicable_taxes: { local: false, state: false, federal: false } } + : billLine; const t = taxcode.filter( (t) => !!t.local === !!local && From 5d2bdc7ee18ae266adcad6c9f04cc8fd53add7cb Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 15 Jun 2023 15:24:24 -0700 Subject: [PATCH 20/47] IO-2338 Selection Color Overrides nth-child color --- client/src/App/App.styles.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/App/App.styles.scss b/client/src/App/App.styles.scss index ddf87ac42..50e656895 100644 --- a/client/src/App/App.styles.scss +++ b/client/src/App/App.styles.scss @@ -148,6 +148,10 @@ background: #e7f3ff !important; } +.ant-table-tbody > tr.ant-table-row-selected > td { + background: #e6f7ff !important; +} + .job-line-manual { color: tomato; font-style: italic; From fee5bee569e8cb40314e4b346c3850eff771aac6 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 20 Jun 2023 10:03:49 -0700 Subject: [PATCH 21/47] IO-2340 CDK New Unsold Vehicle Option Exports with no Delivery Date or In-Service Date --- .../components/dms-post-form/dms-post-form.component.jsx | 7 +++++++ client/src/pages/dms/dms.container.jsx | 6 +++--- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + server/cdk/cdk-job-export.js | 8 ++++++-- 6 files changed, 19 insertions(+), 5 deletions(-) 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 c9043d050..e40b90286 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 @@ -11,6 +11,7 @@ import { Select, Space, Statistic, + Switch, Typography, } from "antd"; import Dinero from "dinero.js"; @@ -183,6 +184,12 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) { + + + )} diff --git a/client/src/pages/dms/dms.container.jsx b/client/src/pages/dms/dms.container.jsx index 9fcfd491e..75c26287b 100644 --- a/client/src/pages/dms/dms.container.jsx +++ b/client/src/pages/dms/dms.container.jsx @@ -13,7 +13,7 @@ import queryString from "query-string"; import React, { useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; -import { useHistory, useLocation, Link } from "react-router-dom"; +import { Link, useHistory, useLocation } from "react-router-dom"; import { createStructuredSelector } from "reselect"; import SocketIO from "socket.io-client"; import AlertComponent from "../../components/alert/alert.component"; @@ -22,6 +22,7 @@ import DmsCustomerSelector from "../../components/dms-customer-selector/dms-cust import DmsLogEvents from "../../components/dms-log-events/dms-log-events.component"; import DmsPostForm from "../../components/dms-post-form/dms-post-form.component"; import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component"; +import { OwnerNameDisplayFunction } from "../../components/owner-name-display/owner-name-display.component"; import { auth } from "../../firebase/firebase.utils"; import { QUERY_JOB_EXPORT_DMS } from "../../graphql/jobs.queries"; import { @@ -29,7 +30,6 @@ import { setSelectedHeader, } from "../../redux/application/application.actions"; import { selectBodyshop } from "../../redux/user/user.selectors"; -import { OwnerNameDisplayFunction } from "../../components/owner-name-display/owner-name-display.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -45,7 +45,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer); export const socket = SocketIO( process.env.NODE_ENV === "production" ? process.env.REACT_APP_AXIOS_BASE_API_URL - : window.location.origin, + : window.location.origin, //"http://localhost:4000" for dev testing, { path: "/ws", withCredentials: true, diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index b857ca7c8..9a1f09d9c 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1451,6 +1451,7 @@ "dms_make": "DMS Make", "dms_model": "DMS Model", "dms_wip_acctnumber": "Cost WIP DMS Acct #", + "dms_unsold": "New, Unsold Vehicle", "id": "DMS ID", "inservicedate": "In Service Date", "journal": "Journal #", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index ff3efbd30..52857b75f 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1451,6 +1451,7 @@ "dms_make": "", "dms_model": "", "dms_wip_acctnumber": "", + "dms_unsold": "", "id": "", "inservicedate": "", "journal": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index c8fc9ee4a..9105279ef 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1451,6 +1451,7 @@ "dms_make": "", "dms_model": "", "dms_wip_acctnumber": "", + "dms_unsold": "", "id": "", "inservicedate": "", "journal": "", diff --git a/server/cdk/cdk-job-export.js b/server/cdk/cdk-job-export.js index c20a899a1..117fc5bdc 100644 --- a/server/cdk/cdk-job-export.js +++ b/server/cdk/cdk-job-export.js @@ -717,7 +717,9 @@ async function InsertDmsVehicle(socket) { dealer: { dealerNumber: socket.JobData.bodyshop.cdk_dealerid, ...(socket.txEnvelope.inservicedate && { - inServiceDate: moment(socket.txEnvelope.inservicedate) + inServiceDate: socket.txEnvelope.dms_unsold === true + ? "" + : moment(socket.txEnvelope.inservicedate) //.tz(socket.JobData.bodyshop.timezone) .startOf("day") .toISOString(), @@ -726,7 +728,9 @@ async function InsertDmsVehicle(socket) { }, manufacturer: {}, vehicle: { - deliveryDate: moment() + deliveryDate: socket.txEnvelope.dms_unsold === true + ? "" + : moment() // .tz(socket.JobData.bodyshop.timezone) .format("YYYYMMDD"), licensePlateNo: From 4dd868130c70dbfe40ef8a1e33b33a07738b8378 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 21 Jun 2023 08:31:30 -0700 Subject: [PATCH 22/47] IO-2341 Jobs Schedule Completion Report --- 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 | 12 ++++++++++++ 4 files changed, 15 insertions(+) diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 9a1f09d9c..5a057c73e 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2568,6 +2568,7 @@ "job_costing_ro_ins_co": "Job Costing by RO Source", "jobs_completed_not_invoiced": "Jobs Completed not Invoiced", "jobs_invoiced_not_exported": "Jobs Invoiced not Exported", + "jobs_scheduled_completion": "Jobs Scheduled Completion", "jobs_reconcile": "Parts/Sublet/Labor Reconciliation", "lag_time": "Lag Time", "open_orders": "Open Orders by Date", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 52857b75f..244ccc21f 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2565,6 +2565,7 @@ "job_costing_ro_ins_co": "", "jobs_completed_not_invoiced": "", "jobs_invoiced_not_exported": "", + "jobs_scheduled_completion": "", "jobs_reconcile": "", "lag_time": "", "open_orders": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 9105279ef..98d10ef58 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2565,6 +2565,7 @@ "job_costing_ro_ins_co": "", "jobs_completed_not_invoiced": "", "jobs_invoiced_not_exported": "", + "jobs_scheduled_completion": "", "jobs_reconcile": "", "lag_time": "", "open_orders": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index debbfc57e..c07e375fa 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -1897,6 +1897,18 @@ export const TemplateList = (type, context) => { }, 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" From bd7d8068df926a65f97891311778b0b1fd8a08ab Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 22 Jun 2023 15:38:18 -0700 Subject: [PATCH 23/47] IO-2340 CDK New Unsold Vehicle adjustments --- .../dms-post-form/dms-post-form.component.jsx | 3 +- client/src/pages/dms/dms.container.jsx | 3 +- server/cdk/cdk-job-export.js | 48 +++++++++++-------- 3 files changed, 32 insertions(+), 22 deletions(-) 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 e40b90286..e1358e989 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 @@ -187,8 +187,9 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) { - + diff --git a/client/src/pages/dms/dms.container.jsx b/client/src/pages/dms/dms.container.jsx index 75c26287b..77c670e60 100644 --- a/client/src/pages/dms/dms.container.jsx +++ b/client/src/pages/dms/dms.container.jsx @@ -45,7 +45,8 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer); export const socket = SocketIO( process.env.NODE_ENV === "production" ? process.env.REACT_APP_AXIOS_BASE_API_URL - : window.location.origin, //"http://localhost:4000" for dev testing, + : window.location.origin, + // "http://localhost:4000", // for dev testing, { path: "/ws", withCredentials: true, diff --git a/server/cdk/cdk-job-export.js b/server/cdk/cdk-job-export.js index 117fc5bdc..5fee6b30d 100644 --- a/server/cdk/cdk-job-export.js +++ b/server/cdk/cdk-job-export.js @@ -717,22 +717,24 @@ async function InsertDmsVehicle(socket) { dealer: { dealerNumber: socket.JobData.bodyshop.cdk_dealerid, ...(socket.txEnvelope.inservicedate && { - inServiceDate: socket.txEnvelope.dms_unsold === true - ? "" - : moment(socket.txEnvelope.inservicedate) - //.tz(socket.JobData.bodyshop.timezone) - .startOf("day") - .toISOString(), + inServiceDate: + socket.txEnvelope.dms_unsold === true + ? "" + : moment(socket.txEnvelope.inservicedate) + //.tz(socket.JobData.bodyshop.timezone) + .startOf("day") + .toISOString(), }), vehicleId: socket.DMSVid.vehiclesVehId, }, manufacturer: {}, vehicle: { - deliveryDate: socket.txEnvelope.dms_unsold === true - ? "" - : moment() - // .tz(socket.JobData.bodyshop.timezone) - .format("YYYYMMDD"), + deliveryDate: + socket.txEnvelope.dms_unsold === true + ? "" + : moment() + // .tz(socket.JobData.bodyshop.timezone) + .format("YYYYMMDD"), licensePlateNo: socket.JobData.plate_no === null ? null @@ -864,19 +866,25 @@ async function UpdateDmsVehicle(socket) { ...socket.DMSVeh.dealer, ...((socket.txEnvelope.inservicedate || socket.DMSVeh.dealer.inServiceDate) && { - inServiceDate: moment( - socket.DMSVeh.dealer.inServiceDate || - socket.txEnvelope.inservicedate - ) - // .tz(socket.JobData.bodyshop.timezone) - .toISOString(), + inServiceDate: + socket.txEnvelope.dms_unsold === true + ? "" + : moment( + socket.DMSVeh.dealer.inServiceDate || + socket.txEnvelope.inservicedate + ) + // .tz(socket.JobData.bodyshop.timezone) + .toISOString(), }), }, vehicle: { ...socket.DMSVeh.vehicle, - deliveryDate: moment(socket.DMSVeh.vehicle.deliveryDate) - //.tz(socket.JobData.bodyshop.timezone) - .toISOString(), + deliveryDate: + socket.txEnvelope.dms_unsold === true + ? "" + : moment(socket.DMSVeh.vehicle.deliveryDate) + //.tz(socket.JobData.bodyshop.timezone) + .toISOString(), }, owners: ids, }, From 6de06e084bdab7383e0d51bbcac519652a8a036a Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 23 Jun 2023 08:53:14 -0700 Subject: [PATCH 24/47] IO-2342 QBD Owner Name with just LN Trim Removes extra space if there is just a OWNR_LN before the ACCT # --- server/accounting/qbxml/qbxml-receivables.js | 12 ++++++------ server/accounting/qbxml/qbxml-utils.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index e697e0985..629bb4dca 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -263,9 +263,9 @@ const generateInvoiceQbxml = ( BillAddress: { Addr1: jobs_by_pk.ownr_co_nm ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)}`, + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()}`, Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, @@ -275,9 +275,9 @@ const generateInvoiceQbxml = ( ShipAddress: { Addr1: jobs_by_pk.ownr_co_nm ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)}`, + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()}`, Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, diff --git a/server/accounting/qbxml/qbxml-utils.js b/server/accounting/qbxml/qbxml-utils.js index af59b3cf7..8909cbb2a 100644 --- a/server/accounting/qbxml/qbxml-utils.js +++ b/server/accounting/qbxml/qbxml-utils.js @@ -21,9 +21,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => { ? `${jobs_by_pk.ownr_co_nm.substring(0, 30)} #${ jobs_by_pk.owner.accountingid || "" }` - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}` + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()} #${jobs_by_pk.owner.accountingid || ""}` ) .trim() .replace(":", " "); @@ -39,9 +39,9 @@ exports.generateOwnerTier = (jobs_by_pk, isThreeTier, twotierpref) => { ? `${jobs_by_pk.ownr_co_nm.substring(0, 30)} #${ jobs_by_pk.owner.accountingid || "" }` - : `${`${jobs_by_pk.ownr_ln || ""} ${ - jobs_by_pk.ownr_fn || "" - }`.substring(0, 30)} #${jobs_by_pk.owner.accountingid || ""}` + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + .substring(0, 30) + .trim()} #${jobs_by_pk.owner.accountingid || ""}` ) .trim() .replace(":", " "); From 7581b8634efe3f1b819a5b7e049c31f195953147 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 27 Jun 2023 08:35:13 -0700 Subject: [PATCH 25/47] IO-2247 Scheduled Out Today --- .../scheduled-out-today.component.jsx | 210 ++++++++++++++++++ .../dashboard-grid.component.jsx | 20 +- client/src/translations/en_us/common.json | 3 +- client/src/translations/es/common.json | 3 +- client/src/translations/fr/common.json | 3 +- 5 files changed, 234 insertions(+), 5 deletions(-) create mode 100644 client/src/components/dashboard-components/scheduled-out-today/scheduled-out-today.component.jsx diff --git a/client/src/components/dashboard-components/scheduled-out-today/scheduled-out-today.component.jsx b/client/src/components/dashboard-components/scheduled-out-today/scheduled-out-today.component.jsx new file mode 100644 index 000000000..586e719ab --- /dev/null +++ b/client/src/components/dashboard-components/scheduled-out-today/scheduled-out-today.component.jsx @@ -0,0 +1,210 @@ +import { + BranchesOutlined, + ExclamationCircleFilled, + PauseCircleOutlined, +} from "@ant-design/icons"; +import { Card, Space, Table, Tooltip } from "antd"; +import moment from "moment"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { Link } from "react-router-dom"; +import ChatOpenButton from "../../chat-open-button/chat-open-button.component"; +import OwnerNameDisplay from "../../owner-name-display/owner-name-display.component"; +import DashboardRefreshRequired from "../refresh-required.component"; + +export default function DashboardScheduledOutToday({ data, ...cardProps }) { + const { t } = useTranslation(); + const [state, setState] = useState({ + sortedInfo: {}, + }); + if (!data) return null; + if (!data.scheduled_out_today) + return ; + + data.scheduled_out_today.forEach((item) => { + item.scheduled_completion= moment(item.scheduled_completion).format("hh:mm a") + }); + data.scheduled_out_today.sort(function (a, b) { + return new Date(a.scheduled_completion) - new Date(b.scheduled_completion); + }); + + const columns = [ + { + title: t("jobs.fields.ro_number"), + dataIndex: "ro_number", + key: "ro_number", + render: (text, record) => ( + e.stopPropagation()} + > + + {record.ro_number || t("general.labels.na")} + {record.production_vars && record.production_vars.alert ? ( + + ) : null} + {record.suspended && ( + + )} + {record.iouparent && ( + + + + )} + + + ), + }, + { + title: t("jobs.fields.owner"), + dataIndex: "owner", + key: "owner", + ellipsis: true, + responsive: ["md"], + render: (text, record) => { + return record.ownerid ? ( + e.stopPropagation()} + > + + + ) : ( + + + + ); + }, + }, + { + title: t("jobs.fields.ownr_ph1"), + dataIndex: "ownr_ph1", + key: "ownr_ph1", + ellipsis: true, + responsive: ["md"], + render: (text, record) => ( + + ), + }, + { + title: t("jobs.fields.ownr_ph2"), + dataIndex: "ownr_ph2", + key: "ownr_ph2", + ellipsis: true, + responsive: ["md"], + render: (text, record) => ( + + ), + }, + { + title: t("jobs.fields.ownr_ea"), + dataIndex: "ownr_ea", + key: "ownr_ea", + ellipsis: true, + responsive: ["md"], + render: (text, record) => ( + + ), + }, + { + title: t("jobs.fields.vehicle"), + dataIndex: "vehicle", + key: "vehicle", + ellipsis: true, + render: (text, record) => { + return record.vehicleid ? ( + e.stopPropagation()} + > + {`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${ + record.v_model_desc || "" + }`} + + ) : ( + {`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${ + record.v_model_desc || "" + }`} + ); + }, + }, + { + title: t("jobs.fields.ins_co_nm"), + dataIndex: "ins_co_nm", + key: "ins_co_nm", + ellipsis: true, + responsive: ["md"], + }, + { + title: t("jobs.fields.scheduled_completion"), + dataIndex: "scheduled_completion", + key: "scheduled_completion", + ellipsis: true, + responsive: ["md"], + }, + { + title: t("appointments.fields.alt_transport"), + dataIndex: "alt_transport", + key: "alt_transport", + ellipsis: true, + responsive: ["md"], + }, + ]; + + const handleTableChange = (sorter) => { + setState({ ...state, sortedInfo: sorter }); + }; + + return ( + +
+
+ + + ); +} + +export const DashboardScheduledOutTodayGql = ` + scheduled_out_today: jobs(where: { + date_invoiced: {_is_null: true}, + ro_number: {_is_null: false}, + voided: {_eq: false}, + scheduled_completion: {_gte: "${moment().startOf("day").toISOString()}", + _lte: "${moment().endOf("day").toISOString()}"}}) { + alt_transport + clm_no + jobid: id + ins_co_nm + iouparent + ownerid + ownr_co_nm + ownr_ea + ownr_fn + ownr_ln + ownr_ph1 + ownr_ph2 + production_vars + ro_number + scheduled_completion + suspended + v_make_desc + v_model_desc + v_model_yr + v_vin + vehicleid + + } +`; diff --git a/client/src/components/dashboard-grid/dashboard-grid.component.jsx b/client/src/components/dashboard-grid/dashboard-grid.component.jsx index d9d7cbf32..d24dd5641 100644 --- a/client/src/components/dashboard-grid/dashboard-grid.component.jsx +++ b/client/src/components/dashboard-grid/dashboard-grid.component.jsx @@ -39,7 +39,10 @@ import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; // /node_modules/react-resizable/css/styles.css import DashboardScheduledInToday, { DashboardScheduledInTodayGql, -} from "./../dashboard-components/scheduled-in-today/scheduled-in-today.component"; +} from "../dashboard-components/scheduled-in-today/scheduled-in-today.component"; +import DashboardScheduledOutToday, { + DashboardScheduledOutTodayGql, +} from "../dashboard-components/scheduled-out-today/scheduled-out-today.component"; import "./dashboard-grid.styles.scss"; import { GenerateDashboardData } from "./dashboard-grid.utils"; @@ -272,7 +275,9 @@ const componentList = { h: 2, }, ScheduleInToday: { - label: i18next.t("dashboard.titles.scheduledintoday", {date: moment().startOf("day").format("MM/DD/YYYY")}), + label: i18next.t("dashboard.titles.scheduledintoday", { + date: moment().startOf("day").format("MM/DD/YYYY"), + }), component: DashboardScheduledInToday, gqlFragment: DashboardScheduledInTodayGql, minW: 10, @@ -280,6 +285,17 @@ const componentList = { w: 10, h: 2, }, + ScheduleOutToday: { + label: i18next.t("dashboard.titles.scheduledouttoday", { + date: moment().startOf("day").format("MM/DD/YYYY"), + }), + component: DashboardScheduledOutToday, + gqlFragment: DashboardScheduledOutTodayGql, + minW: 10, + minH: 2, + w: 10, + h: 2, + }, }; const createDashboardQuery = (state) => { diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 50e516c47..0f98d2685 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -859,7 +859,8 @@ "productiondollars": "Total dollars in Production", "productionhours": "Total hours in Production", "projectedmonthlysales": "Projected Monthly Sales", - "scheduledintoday": "Sheduled In Today: {{date}}" + "scheduledintoday": "Sheduled In Today: {{date}}", + "scheduledouttoday": "Sheduled Out Today: {{date}}" } }, "dms": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 84538854e..306349835 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -859,7 +859,8 @@ "productiondollars": "", "productionhours": "", "projectedmonthlysales": "", - "scheduledintoday": "" + "scheduledintoday": "", + "scheduledouttoday": "" } }, "dms": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 34165ee38..475ddeb1d 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -859,7 +859,8 @@ "productiondollars": "", "productionhours": "", "projectedmonthlysales": "", - "scheduledintoday": "" + "scheduledintoday": "", + "scheduledouttoday": "" } }, "dms": { From 39aa21d9859203b06401eb7eae6e53f5294a3527 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 29 Jun 2023 09:58:20 -0700 Subject: [PATCH 26/47] IO-2342 Billing and Shipping Addr1 Trim --- server/accounting/qbxml/qbxml-receivables.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index 629bb4dca..d74509158 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -263,9 +263,9 @@ const generateInvoiceQbxml = ( BillAddress: { Addr1: jobs_by_pk.ownr_co_nm ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`}` .substring(0, 30) - .trim()}`, + .trim(), Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, @@ -275,9 +275,9 @@ const generateInvoiceQbxml = ( ShipAddress: { Addr1: jobs_by_pk.ownr_co_nm ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`}` .substring(0, 30) - .trim()}`, + .trim(), Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, From b967bb6d4ef81ade6877bef034efcd4b32604b7b Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 29 Jun 2023 10:45:52 -0700 Subject: [PATCH 27/47] IO-2342 Trim Comany Name after SubString --- server/accounting/qbxml/qbxml-receivables.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index d74509158..5489f859e 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -262,10 +262,10 @@ const generateInvoiceQbxml = ( RefNumber: jobs_by_pk.ro_number, BillAddress: { Addr1: jobs_by_pk.ownr_co_nm - ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`}` + ? jobs_by_pk.ownr_co_nm.substring(0, 30).trim() + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` .substring(0, 30) - .trim(), + .trim()}`, Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, @@ -274,10 +274,10 @@ const generateInvoiceQbxml = ( }, ShipAddress: { Addr1: jobs_by_pk.ownr_co_nm - ? jobs_by_pk.ownr_co_nm.substring(0, 30) - : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}`}` + ? jobs_by_pk.ownr_co_nm.substring(0, 30).trim() + : `${`${jobs_by_pk.ownr_ln || ""} ${jobs_by_pk.ownr_fn || ""}` .substring(0, 30) - .trim(), + .trim()}`, Addr2: jobs_by_pk.ownr_addr1, Addr3: jobs_by_pk.ownr_addr2, City: jobs_by_pk.ownr_city, From 27bf8d9ed69e5bea92989d116ee83f971b178bd2 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 6 Jul 2023 13:22:22 -0700 Subject: [PATCH 28/47] IO-2206 Payroll schema changes to assign lines to teams. --- hasura/metadata/tables.yaml | 10 ++++++++++ .../down.sql | 4 ++++ .../up.sql | 2 ++ .../down.sql | 1 + .../up.sql | 5 +++++ 5 files changed, 22 insertions(+) create mode 100644 hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/down.sql create mode 100644 hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/up.sql create mode 100644 hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/down.sql create mode 100644 hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/up.sql diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 111374fb5..d61ee8aaa 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -2092,6 +2092,13 @@ table: name: employee_team_members schema: public + - name: joblines + using: + foreign_key_constraint_on: + column: assigned_team + table: + name: joblines + schema: public insert_permissions: - role: user permission: @@ -2665,6 +2672,9 @@ name: joblines schema: public object_relationships: + - name: employee_team + using: + foreign_key_constraint_on: assigned_team - name: job using: foreign_key_constraint_on: jobid diff --git a/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/down.sql b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/down.sql new file mode 100644 index 000000000..61af19807 --- /dev/null +++ b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."joblines" add column "assigned_team" uuid +-- null; diff --git a/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/up.sql b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/up.sql new file mode 100644 index 000000000..0128442fe --- /dev/null +++ b/hasura/migrations/1688674667178_alter_table_public_joblines_add_column_assigned_team/up.sql @@ -0,0 +1,2 @@ +alter table "public"."joblines" add column "assigned_team" uuid + null; diff --git a/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/down.sql b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/down.sql new file mode 100644 index 000000000..651570671 --- /dev/null +++ b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/down.sql @@ -0,0 +1 @@ +alter table "public"."joblines" drop constraint "joblines_assigned_team_fkey"; diff --git a/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/up.sql b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/up.sql new file mode 100644 index 000000000..4740318f8 --- /dev/null +++ b/hasura/migrations/1688674763806_set_fk_public_joblines_assigned_team/up.sql @@ -0,0 +1,5 @@ +alter table "public"."joblines" + add constraint "joblines_assigned_team_fkey" + foreign key ("assigned_team") + references "public"."employee_teams" + ("id") on update restrict on delete restrict; From b02d4e0fdd44db914a8a32ed65ad59722892dc85 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 6 Jul 2023 13:51:23 -0700 Subject: [PATCH 29/47] IO-2206 Missed schema update. --- hasura/metadata/tables.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index d61ee8aaa..1ce055244 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -2736,6 +2736,7 @@ - alt_part_i - alt_partm - alt_partno + - assigned_team - bett_amt - bett_pctg - bett_tax @@ -2744,6 +2745,7 @@ - convertedtolbr - convertedtolbr_data - created_at + - critical - db_hrs - db_price - db_ref @@ -2803,6 +2805,7 @@ - alt_part_i - alt_partm - alt_partno + - assigned_team - bett_amt - bett_pctg - bett_tax @@ -2882,6 +2885,7 @@ - alt_part_i - alt_partm - alt_partno + - assigned_team - bett_amt - bett_pctg - bett_tax From af70c80e09433095db15d5ec8681f8167d4e9630 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 7 Jul 2023 09:54:19 -0700 Subject: [PATCH 30/47] IO-2337 Spread in billLines --- server/accounting/qbxml/qbxml-payables.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/accounting/qbxml/qbxml-payables.js b/server/accounting/qbxml/qbxml-payables.js index 6b9951500..26f0f2d8a 100644 --- a/server/accounting/qbxml/qbxml-payables.js +++ b/server/accounting/qbxml/qbxml-payables.js @@ -135,7 +135,10 @@ const findTaxCode = (billLine, taxcode) => { applicable_taxes: { local, state, federal }, } = billLine.applicable_taxes === null - ? { applicable_taxes: { local: false, state: false, federal: false } } + ? { + ...billLine, + applicable_taxes: { local: false, state: false, federal: false }, + } : billLine; const t = taxcode.filter( (t) => From 400dc79ed6962d5cfee33162c61d5d48d143a919 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 11 Jul 2023 09:10:26 -0700 Subject: [PATCH 31/47] IO-2349 Allow PBS AP Posting to WIP --- bodyshop_translations.babel | 252 ++++++++++++++++++ ...p-info.responsibilitycenters.component.jsx | 13 + client/src/translations/en_us/common.json | 15 +- client/src/translations/es/common.json | 9 +- client/src/translations/fr/common.json | 9 +- server/accounting/pbs/pbs-ap-allocations.js | 5 +- server/graphql-client/queries.js | 1 + 7 files changed, 292 insertions(+), 12 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index b52de475e..61233bd6e 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -4318,6 +4318,27 @@ dms + + appostingaccount + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + cashierid false @@ -6622,6 +6643,27 @@ + + void + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + @@ -14004,6 +14046,48 @@ + + scheduledintoday + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + scheduledouttoday + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + @@ -23844,6 +23928,27 @@ + + dms_unsold + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + dms_wip_acctnumber false @@ -37411,6 +37516,48 @@ + + markexported + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + markforreexport + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + new false @@ -37542,6 +37689,27 @@ + + markreexported + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + payment false @@ -39355,6 +39523,27 @@ + + mpi_final_repair_acct_sheet + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + paint_grid false @@ -40433,6 +40622,27 @@ jobs + + individual_job_note + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + parts_order false @@ -43276,6 +43486,27 @@ + + jobs_scheduled_completion + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + lag_time false @@ -44378,6 +44609,27 @@ + + estimators + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + ins_co_nm_filter false diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx index 9b7f0b0a6..d5d9b4af1 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -162,6 +162,19 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { )} + {bodyshop.pbs_serialnumber && ( + + + + + + diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index 1600d5082..05af1fba4 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -34,6 +34,7 @@ export const GET_LINE_TICKET_BY_PK = gql` id lbr_adjustments converted + status } joblines(where: { jobid: { _eq: $id }, removed: { _eq: false } }) { id From 9529335c968e6d30622f0aed4ab584e9bb97e477 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 13 Jul 2023 09:27:37 -0700 Subject: [PATCH 33/47] IO-2349 Change control number for AP to allow RO. --- bodyshop_translations.babel | 23 ++++++++++++++++++- ...p-info.responsibilitycenters.component.jsx | 13 +++++++++++ client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + server/accounting/pbs/pbs-ap-allocations.js | 5 +++- 6 files changed, 42 insertions(+), 2 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 61233bd6e..3b9297590 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +