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 c3bc99333..6d1d1a03d 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
@@ -119,33 +119,35 @@ export function DmsPostForm({ bodyshop, socket, job }) {
-
-
-
-
-
-
-
+ {bodyshop.cdk_dealerid && (
+
+
+
+
+
+
+
-
-
-
+
+
+
+ )}
+
{(fields, { add, remove }) => {
diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx
index 9b52c3460..24d310a61 100644
--- a/client/src/components/header/header.component.jsx
+++ b/client/src/components/header/header.component.jsx
@@ -46,12 +46,16 @@ import {
} from "../../redux/application/application.selectors";
import { setModalContext } from "../../redux/modals/modals.actions";
import { signOutStart } from "../../redux/user/user.actions";
-import { selectCurrentUser } from "../../redux/user/user.selectors";
+import {
+ selectBodyshop,
+ selectCurrentUser,
+} from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
recentItems: selectRecentItems,
selectedHeader: selectSelectedHeader,
+ bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
@@ -69,6 +73,7 @@ const mapDispatchToProps = (dispatch) => ({
function Header({
handleMenuClick,
currentUser,
+ bodyshop,
selectedHeader,
signOutStart,
setBillEnterContext,
@@ -77,6 +82,7 @@ function Header({
setReportCenterContext,
recentItems,
}) {
+ console.log("🚀 ~ file: header.component.jsx ~ line 85 ~ bodyshop", bodyshop);
const { t } = useTranslation();
return (
@@ -237,16 +243,26 @@ function Header({
{t("menus.header.accounting-receivables")}
-
-
- {t("menus.header.accounting-payables")}
-
-
-
-
- {t("menus.header.accounting-payments")}
-
-
+ {!(
+ (bodyshop && bodyshop.cdk_dealerid) ||
+ (bodyshop && bodyshop.pbs_serialnumber)
+ ) && (
+
+
+ {t("menus.header.accounting-payables")}
+
+
+ )}
+ {!(
+ (bodyshop && bodyshop.cdk_dealerid) ||
+ (bodyshop && bodyshop.pbs_serialnumber)
+ ) && (
+
+
+ {t("menus.header.accounting-payments")}
+
+
+ )}
{t("menus.header.export-logs")}
diff --git a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx
index ede82520d..6d766f9e6 100644
--- a/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx
+++ b/client/src/components/jobs-close-auto-allocate/jobs-close-auto-allocate.component.jsx
@@ -61,7 +61,7 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
);
};
- const overlay = bodyshop.cdk_dealerid && (
+ const overlay = (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
);
- return bodyshop.cdk_dealerid ? (
+ return bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? (
diff --git a/client/src/components/production-board-filters/production-board-filters.component.jsx b/client/src/components/production-board-filters/production-board-filters.component.jsx
index 394ab6096..6fac184fc 100644
--- a/client/src/components/production-board-filters/production-board-filters.component.jsx
+++ b/client/src/components/production-board-filters/production-board-filters.component.jsx
@@ -1,4 +1,4 @@
-import { Input, PageHeader, Space, Spin } from "antd";
+import { Input, Space, Spin } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
diff --git a/client/src/pages/dms/dms.container.jsx b/client/src/pages/dms/dms.container.jsx
index c21373b8b..223c4e231 100644
--- a/client/src/pages/dms/dms.container.jsx
+++ b/client/src/pages/dms/dms.container.jsx
@@ -120,7 +120,11 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
if (loading) return ;
if (error) return ;
- if (!jobId || !bodyshop.cdk_dealerid || !(data && data.jobs_by_pk))
+ if (
+ !jobId ||
+ !(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) ||
+ !(data && data.jobs_by_pk)
+ )
return ;
return (
diff --git a/client/src/pages/jobs-close/jobs-close.component.jsx b/client/src/pages/jobs-close/jobs-close.component.jsx
index 67c42affc..50ccae32e 100644
--- a/client/src/pages/jobs-close/jobs-close.component.jsx
+++ b/client/src/pages/jobs-close/jobs-close.component.jsx
@@ -208,7 +208,7 @@ export function JobsCloseComponent({ job, bodyshop, jobRO }) {
>
- {bodyshop.cdk_dealerid && (
+ {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
)}
- {bodyshop.cdk_dealerid && (
+ {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
{
//END CDK
//PBS
+ socket.on("pbs-calculate-allocations", async (jobid, callback) => {
+ const allocations = await CdkCalculateAllocations(socket, jobid);
+ createLogEvent(socket, "DEBUG", `Allocations calculated.`);
+ createLogEvent(
+ socket,
+ "TRACE",
+ `Allocations calculated. ${JSON.stringify(allocations, null, 2)}`
+ );
+
+ callback(allocations);
+ });
socket.on("pbs-export-job", (jobid) => {
PbsExportJob(socket, jobid);
});
diff --git a/yarn.lock b/yarn.lock
index 8b162ab87..f2b53d122 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -646,6 +646,13 @@ axios@^0.21.4:
dependencies:
follow-redirects "^1.14.0"
+axios@^0.24.0:
+ version "0.24.0"
+ resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6"
+ integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==
+ dependencies:
+ follow-redirects "^1.14.4"
+
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
@@ -1743,6 +1750,11 @@ follow-redirects@^1.14.0:
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379"
integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==
+follow-redirects@^1.14.4:
+ version "1.14.5"
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381"
+ integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==
+
forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"