From 4ca686126aaf8b3903f8183b14b42d9faf56b5ea Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 15 Jul 2024 16:53:48 -0700 Subject: [PATCH 1/7] IO-2843 State Tax for QBO_USA and Region CA_ Signed-off-by: Allan Carr --- server/accounting/qb-receivables-lines.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 69818343e..e2437dca1 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -632,7 +632,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes } } - //QB USA with GST + //QB USA with GST and PST //This was required for the No. 1 Collision Group. if ( bodyshop.accountingconfig && @@ -651,6 +651,17 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes Qty: 1 } }); + InvoiceLineAdd.push({ + DetailType: "SalesItemLineDetail", + Amount: Dinero(jobs_by_pk.job_totals.totals.state_tax).toFormat(DineroQbFormat), + SalesItemLineDetail: { + ...(jobs_by_pk.class ? { ClassRef: { value: classes[jobs_by_pk.class] } } : {}), + ItemRef: { + value: items[bodyshop.md_responsibility_centers.taxes.state.accountitem] + }, + Qty: 1 + } + }); } } else { //Handle insurance profile adjustments From 26e164b4d13b5e4ba78c503e13e905f238f97c48 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Wed, 17 Jul 2024 12:22:31 -0400 Subject: [PATCH 2/7] - misc updates / clear stage Signed-off-by: Dave Richer --- client/src/App/App.jsx | 61 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx index 4b80fb38e..ecbb5a904 100644 --- a/client/src/App/App.jsx +++ b/client/src/App/App.jsx @@ -1,7 +1,7 @@ import { useSplitClient } from "@splitsoftware/splitio-react"; import { Button, Result } from "antd"; import LogRocket from "logrocket"; -import React, { lazy, Suspense, useEffect, useState } from "react"; +import React, { lazy, Suspense, useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { Route, Routes } from "react-router-dom"; @@ -9,7 +9,7 @@ import { createStructuredSelector } from "reselect"; import DocumentEditorContainer from "../components/document-editor/document-editor.container"; import ErrorBoundary from "../components/error-boundary/error-boundary.component"; -//Component Imports +// 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"; @@ -28,15 +28,16 @@ import { ProductFruits } from "react-product-fruits"; const ResetPassword = lazy(() => import("../pages/reset-password/reset-password.component")); const ManagePage = lazy(() => import("../pages/manage/manage.page.container")); const SignInPage = lazy(() => import("../pages/sign-in/sign-in.page")); - const CsiPage = lazy(() => import("../pages/csi/csi.container.page")); const MobilePaymentContainer = lazy(() => import("../pages/mobile-payment/mobile-payment.container")); + const mapStateToProps = createStructuredSelector({ currentUser: selectCurrentUser, online: selectOnline, bodyshop: selectBodyshop, currentEula: selectCurrentEula }); + const mapDispatchToProps = (dispatch) => ({ checkUserSession: () => dispatch(checkUserSession()), setOnline: (isOnline) => dispatch(setOnline(isOnline)) @@ -47,6 +48,23 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline const [listenersAdded, setListenersAdded] = useState(false); const { t } = useTranslation(); + const workspaceCode = useMemo( + () => + InstanceRenderMgr({ + imex: null, + rome: "9BkbEseqNqxw8jUH", + promanager: "aoJoEifvezYI0Z0P" + }), + [] + ); + + const workspaceLogin = useMemo( + () => ({ + email: currentUser.email, + username: currentUser.email + }), + [currentUser.email] + ); useEffect(() => { if (!navigator.onLine) { setOnline(false); @@ -55,16 +73,12 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline checkUserSession(); }, [checkUserSession, setOnline]); - //const b = Grid.useBreakpoint(); - // console.log("Breakpoints:", b); - - // Associate event listeners, memoize to prevent multiple listeners being added useEffect(() => { - const offlineListener = (e) => { + const offlineListener = () => { setOnline(false); }; - const onlineListener = (e) => { + const onlineListener = () => { setOnline(true); }; @@ -98,7 +112,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline InstanceRenderMgr({ imex: "gvfvfw/bodyshopapp", rome: "rome-online/rome-online", - promanager: "" //TODO:AIO Add in log rocket for promanager instances. + promanager: "" // TODO: AIO Add in log rocket for promanager instances. }) ); } @@ -111,30 +125,25 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline handleBeta(); - if (!online) + if (!online) { return ( { - window.location.reload(); - }} - > + } /> ); + } if (currentEula && !currentUser.eulaIsAccepted) { return ; } - // Any route that is not assigned and matched will default to the Landing Page component return ( } > - + {currentUser && currentUser.email && ( + + )} Date: Wed, 17 Jul 2024 14:15:38 -0700 Subject: [PATCH 3/7] IO-2845 Payments Grouped by Payment Type Signed-off-by: Allan Carr --- client/src/translations/en_us/common.json | 3 ++- client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + client/src/utils/TemplateConstants.js | 11 +++++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 6b76a6ed0..b46f3c553 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2920,7 +2920,8 @@ "parts_not_recieved_vendor": "Parts Not Received by Vendor", "parts_received_not_scheduled": "Parts Received for Jobs Not Scheduled", "payments_by_date": "Payments by Date", - "payments_by_date_type": "Payments by Date and Type", + "payments_by_date_payment": "Payments by Date and Payment Type", + "payments_by_date_type": "Payments by Date and Customer Type", "production_by_category": "Production by Category", "production_by_category_one": "Production filtered by Category", "production_by_csr": "Production by CSR", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 48d6f107d..6c2b46890 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2920,6 +2920,7 @@ "parts_not_recieved_vendor": "", "parts_received_not_scheduled": "", "payments_by_date": "", + "payments_by_date_payment": "", "payments_by_date_type": "", "production_by_category": "", "production_by_category_one": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 3fd409e2a..8003cf969 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2920,6 +2920,7 @@ "parts_not_recieved_vendor": "", "parts_received_not_scheduled": "", "payments_by_date": "", + "payments_by_date_payment": "", "payments_by_date_type": "", "production_by_category": "", "production_by_category_one": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 8fda63504..2aa482fb6 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -1194,6 +1194,17 @@ export const TemplateList = (type, context) => { }, group: "customers" }, + payments_by_date_payment: { + title: i18n.t("reportcenter.templates.payments_by_date_payment"), + subject: i18n.t("reportcenter.templates.payments_by_date_payment"), + key: "payments_by_date_payment", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.payments"), + field: i18n.t("payments.fields.date") + }, + group: "customers" + }, schedule: { title: i18n.t("reportcenter.templates.schedule"), subject: i18n.t("reportcenter.templates.schedule"), From a059c2b5a875fad2fc886b79444ca761fb8aa62b Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 19 Jul 2024 08:41:12 -0700 Subject: [PATCH 4/7] IO-2847 Employee Rate Filter Signed-off-by: Allan Carr --- .../components/shop-employees/shop-employees-list.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/shop-employees/shop-employees-list.component.jsx b/client/src/components/shop-employees/shop-employees-list.component.jsx index 2add19f34..d6b41bad2 100644 --- a/client/src/components/shop-employees/shop-employees-list.component.jsx +++ b/client/src/components/shop-employees/shop-employees-list.component.jsx @@ -63,7 +63,7 @@ export default function ShopEmployeesListComponent({ loading, employees }) { value: false } ], - onFilter: (value, record) => value === record.flate_rate, + onFilter: (value, record) => value === record.flat_rate, render: (text, record) => record.flat_rate ? t("employees.labels.flat_rate") : t("employees.labels.straight_time") }, From 72a2366abe53451304118d78032d07cf3aab4bfa Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 19 Jul 2024 13:18:10 -0400 Subject: [PATCH 5/7] - Improve product fruits wrapper for extra checks Signed-off-by: Dave Richer --- client/src/App/App.jsx | 16 ++------------- client/src/App/ProductFruitsWrapper.jsx | 27 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 client/src/App/ProductFruitsWrapper.jsx diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx index 4b80fb38e..88d32a870 100644 --- a/client/src/App/App.jsx +++ b/client/src/App/App.jsx @@ -23,7 +23,7 @@ import "./App.styles.scss"; import handleBeta from "../utils/betaHandler"; import Eula from "../components/eula/eula.component"; import InstanceRenderMgr from "../utils/instanceRenderMgr"; -import { ProductFruits } from "react-product-fruits"; +import ProductFruitsWrapper from "./ProductFruitsWrapper.jsx"; const ResetPassword = lazy(() => import("../pages/reset-password/reset-password.component")); const ManagePage = lazy(() => import("../pages/manage/manage.page.container")); @@ -147,19 +147,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline /> } > - + { + return ( + currentUser?.authorized === true && + currentUser?.email && ( + + ) + ); +}); + +export default ProductFruitsWrapper; From 5e94b1a71e862a4f26a64ac4a18b229f6dcdc9a7 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 19 Jul 2024 15:50:09 -0400 Subject: [PATCH 6/7] - Improve product fruits wrapper for extra checks Signed-off-by: Dave Richer --- client/src/App/App.jsx | 9 ++++++++- client/src/App/ProductFruitsWrapper.jsx | 10 +++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx index 1864bd623..441359097 100644 --- a/client/src/App/App.jsx +++ b/client/src/App/App.jsx @@ -142,7 +142,14 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline /> } > - + { +const ProductFruitsWrapper = React.memo(({ currentUser, workspaceCode }) => { return ( + workspaceCode && currentUser?.authorized === true && currentUser?.email && ( Date: Fri, 19 Jul 2024 16:01:40 -0400 Subject: [PATCH 7/7] - Add Prop Types to ProductFruitsWrapper.jsx Signed-off-by: Dave Richer --- client/src/App/ProductFruitsWrapper.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/src/App/ProductFruitsWrapper.jsx b/client/src/App/ProductFruitsWrapper.jsx index 4f6ca5dc8..2d3cfbac7 100644 --- a/client/src/App/ProductFruitsWrapper.jsx +++ b/client/src/App/ProductFruitsWrapper.jsx @@ -1,5 +1,6 @@ import React from "react"; import { ProductFruits } from "react-product-fruits"; +import PropTypes from "prop-types"; const ProductFruitsWrapper = React.memo(({ currentUser, workspaceCode }) => { return ( @@ -21,3 +22,11 @@ const ProductFruitsWrapper = React.memo(({ currentUser, workspaceCode }) => { }); export default ProductFruitsWrapper; + +ProductFruitsWrapper.propTypes = { + currentUser: PropTypes.shape({ + authorized: PropTypes.bool, + email: PropTypes.string + }).isRequired, + workspaceCode: PropTypes.string.isRequired +};