IO-2315 DMS Posting Sheet

Restrict to DMS setups only
This commit is contained in:
Allan Carr
2023-06-01 20:32:30 -07:00
parent de62e994bd
commit cbf5d268ea
2 changed files with 29 additions and 11 deletions

View File

@@ -23,17 +23,34 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
const { id: jobId, job } = printCenterModal.context; const { id: jobId, job } = printCenterModal.context;
const tempList = TemplateList("job", {}); const tempList = TemplateList("job", {});
const { t } = useTranslation(); const { t } = useTranslation();
const JobsReportsList = Object.keys(tempList)
.map((key) => { const JobsReportsList =
return tempList[key]; bodyshop.cdk_dealerid === null && bodyshop.pbs_serialnumber === null
}) ? Object.keys(tempList)
.filter( .map((key) => {
(temp) => return tempList[key];
!temp.regions || })
(temp.regions && temp.regions[bodyshop.region_config]) || .filter(
(temp.regions && (temp) =>
bodyshop.region_config.includes(Object.keys(temp.regions)) === true) (!temp.regions ||
); (temp.regions && temp.regions[bodyshop.region_config]) ||
(temp.regions &&
bodyshop.region_config.includes(Object.keys(temp.regions)) ===
true)) &&
(!temp.dms || temp.dms === false)
)
: Object.keys(tempList)
.map((key) => {
return tempList[key];
})
.filter(
(temp) =>
!temp.regions ||
(temp.regions && temp.regions[bodyshop.region_config]) ||
(temp.regions &&
bodyshop.region_config.includes(Object.keys(temp.regions)) ===
true)
);
const filteredJobsReportsList = const filteredJobsReportsList =
search !== "" search !== ""

View File

@@ -512,6 +512,7 @@ export const TemplateList = (type, context) => {
key: "dms_posting_sheet", key: "dms_posting_sheet",
disabled: false, disabled: false,
group: "financial", group: "financial",
dms: true,
}, },
} }
: {}), : {}),