IO-2206 Enhanced Payroll Reports
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Card, Col, Input, Row, Space, Typography } from "antd";
|
import { Card, Col, Input, Row, Space, Typography } from "antd";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
@@ -23,8 +24,13 @@ 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 { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
|
|
||||||
const JobsReportsList =
|
const Templates =
|
||||||
bodyshop.cdk_dealerid === null && bodyshop.pbs_serialnumber === null
|
bodyshop.cdk_dealerid === null && bodyshop.pbs_serialnumber === null
|
||||||
? Object.keys(tempList)
|
? Object.keys(tempList)
|
||||||
.map((key) => {
|
.map((key) => {
|
||||||
@@ -51,6 +57,16 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
|
|||||||
bodyshop.region_config.includes(Object.keys(temp.regions)) ===
|
bodyshop.region_config.includes(Object.keys(temp.regions)) ===
|
||||||
true)
|
true)
|
||||||
);
|
);
|
||||||
|
const JobsReportsList =
|
||||||
|
Enhanced_Payroll.treatment === "on"
|
||||||
|
? Object.keys(Templates).map((key) => {
|
||||||
|
return Templates[key];
|
||||||
|
})
|
||||||
|
: Object.keys(Templates)
|
||||||
|
.map((key) => {
|
||||||
|
return Templates[key];
|
||||||
|
})
|
||||||
|
.filter((temp) => temp.enhanced_payroll !== true);
|
||||||
|
|
||||||
const filteredJobsReportsList =
|
const filteredJobsReportsList =
|
||||||
search !== ""
|
search !== ""
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useLazyQuery } from "@apollo/client";
|
import { useLazyQuery } from "@apollo/client";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
@@ -19,6 +20,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { QUERY_ACTIVE_EMPLOYEES } from "../../graphql/employees.queries";
|
import { QUERY_ACTIVE_EMPLOYEES } from "../../graphql/employees.queries";
|
||||||
import { QUERY_ALL_VENDORS } from "../../graphql/vendors.queries";
|
import { QUERY_ALL_VENDORS } from "../../graphql/vendors.queries";
|
||||||
import { selectReportCenter } from "../../redux/modals/modals.selectors";
|
import { selectReportCenter } from "../../redux/modals/modals.selectors";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import DatePIckerRanges from "../../utils/DatePickerRanges";
|
import DatePIckerRanges from "../../utils/DatePickerRanges";
|
||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
@@ -27,6 +29,7 @@ import VendorSearchSelect from "../vendor-search-select/vendor-search-select.com
|
|||||||
import "./report-center-modal.styles.scss";
|
import "./report-center-modal.styles.scss";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
reportCenterModal: selectReportCenter,
|
reportCenterModal: selectReportCenter,
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
@@ -36,16 +39,26 @@ export default connect(
|
|||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(ReportCenterModalComponent);
|
)(ReportCenterModalComponent);
|
||||||
|
|
||||||
export function ReportCenterModalComponent({ reportCenterModal }) {
|
export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const Templates = TemplateList("report_center");
|
const Templates = TemplateList("report_center");
|
||||||
const ReportsList = Object.keys(Templates).map((key) => {
|
const ReportsList =
|
||||||
return Templates[key];
|
Enhanced_Payroll.treatment === "on"
|
||||||
});
|
? Object.keys(Templates).map((key) => {
|
||||||
|
return Templates[key];
|
||||||
|
})
|
||||||
|
: Object.keys(Templates).map((key) => {
|
||||||
|
return Templates[key];
|
||||||
|
}).filter((temp) => temp.enhanced_payroll !== true);
|
||||||
const { visible } = reportCenterModal;
|
const { visible } = reportCenterModal;
|
||||||
|
|
||||||
const [callVendorQuery, { data: vendorData, called: vendorCalled }] =
|
const [callVendorQuery, { data: vendorData, called: vendorCalled }] =
|
||||||
|
|||||||
@@ -612,6 +612,7 @@
|
|||||||
"laborrates": "Labor Rates",
|
"laborrates": "Labor Rates",
|
||||||
"licensing": "Licensing",
|
"licensing": "Licensing",
|
||||||
"md_tasks_presets": "Tasks Presets",
|
"md_tasks_presets": "Tasks Presets",
|
||||||
|
"md_parts_scan": "Parts Scan Rules",
|
||||||
"md_to_emails": "Preset To Emails",
|
"md_to_emails": "Preset To Emails",
|
||||||
"md_to_emails_emails": "Emails",
|
"md_to_emails_emails": "Emails",
|
||||||
"messagingpresets": "Messaging Presets",
|
"messagingpresets": "Messaging Presets",
|
||||||
@@ -2335,6 +2336,7 @@
|
|||||||
"appointment_confirmation": "Appointment Confirmation",
|
"appointment_confirmation": "Appointment Confirmation",
|
||||||
"appointment_reminder": "Appointment Reminder",
|
"appointment_reminder": "Appointment Reminder",
|
||||||
"casl_authorization": "CASL Authorization",
|
"casl_authorization": "CASL Authorization",
|
||||||
|
"committed_timetickets_ro": "Committed Time Tickets",
|
||||||
"coversheet_landscape": "Coversheet (Landscape)",
|
"coversheet_landscape": "Coversheet (Landscape)",
|
||||||
"coversheet_portrait": "Coversheet Portrait",
|
"coversheet_portrait": "Coversheet Portrait",
|
||||||
"csi_invitation": "CSI Invitation",
|
"csi_invitation": "CSI Invitation",
|
||||||
@@ -2406,7 +2408,8 @@
|
|||||||
"worksheet_sorted_by_operation": "Worksheet by Operation",
|
"worksheet_sorted_by_operation": "Worksheet by Operation",
|
||||||
"worksheet_sorted_by_operation_no_hours": "Worksheet by Operation (No Hours)",
|
"worksheet_sorted_by_operation_no_hours": "Worksheet by Operation (No Hours)",
|
||||||
"worksheet_sorted_by_operation_part_type": "Worksheet by Operation & Part Type",
|
"worksheet_sorted_by_operation_part_type": "Worksheet by Operation & Part Type",
|
||||||
"worksheet_sorted_by_operation_type": "Worksheet by Operation Type"
|
"worksheet_sorted_by_operation_type": "Worksheet by Operation Type",
|
||||||
|
"worksheet_sorted_by_team": "Worksheet by Team"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"groups": {
|
"groups": {
|
||||||
@@ -2553,6 +2556,9 @@
|
|||||||
"attendance_detail": "Attendance (All Employees)",
|
"attendance_detail": "Attendance (All Employees)",
|
||||||
"attendance_employee": "Employee Attendance",
|
"attendance_employee": "Employee Attendance",
|
||||||
"attendance_summary": "Attendance Summary (All Employees)",
|
"attendance_summary": "Attendance Summary (All Employees)",
|
||||||
|
"committed_timetickets": "Committed Time Tickets",
|
||||||
|
"committed_timetickets_employee": "Committed Employee Time Tickets",
|
||||||
|
"committed_timetickets_summary": "Committed Time Tickets Summary",
|
||||||
"credits_not_received_date": "Credits not Received by Date",
|
"credits_not_received_date": "Credits not Received by Date",
|
||||||
"credits_not_received_date_vendorid": "Credits not Received by Vendor",
|
"credits_not_received_date_vendorid": "Credits not Received by Vendor",
|
||||||
"csi": "CSI Responses",
|
"csi": "CSI Responses",
|
||||||
@@ -2651,6 +2657,8 @@
|
|||||||
"timetickets_summary": "Time Tickets Summary",
|
"timetickets_summary": "Time Tickets Summary",
|
||||||
"unclaimed_hrs": "Unflagged Hours",
|
"unclaimed_hrs": "Unflagged Hours",
|
||||||
"void_ros": "Void ROs",
|
"void_ros": "Void ROs",
|
||||||
|
"work_in_progress_committed_labour": "Work in Progress - Committed Labor",
|
||||||
|
"work_in_progress_jobs": "Work in Progress - Jobs",
|
||||||
"work_in_progress_labour": "Work in Progress - Labor",
|
"work_in_progress_labour": "Work in Progress - Labor",
|
||||||
"work_in_progress_payables": "Work in Progress - Payables"
|
"work_in_progress_payables": "Work in Progress - Payables"
|
||||||
}
|
}
|
||||||
@@ -2756,6 +2764,7 @@
|
|||||||
"clockoff": "Clock Off",
|
"clockoff": "Clock Off",
|
||||||
"clockon": "Clocked In",
|
"clockon": "Clocked In",
|
||||||
"committed": "Committed",
|
"committed": "Committed",
|
||||||
|
"committed_at": "Committed At",
|
||||||
"cost_center": "Cost Center",
|
"cost_center": "Cost Center",
|
||||||
"date": "Ticket Date",
|
"date": "Ticket Date",
|
||||||
"efficiency": "Efficiency",
|
"efficiency": "Efficiency",
|
||||||
|
|||||||
@@ -611,6 +611,7 @@
|
|||||||
"jobstatuses": "",
|
"jobstatuses": "",
|
||||||
"laborrates": "",
|
"laborrates": "",
|
||||||
"licensing": "",
|
"licensing": "",
|
||||||
|
"md_parts_scan": "",
|
||||||
"md_tasks_presets": "",
|
"md_tasks_presets": "",
|
||||||
"md_to_emails": "",
|
"md_to_emails": "",
|
||||||
"md_to_emails_emails": "",
|
"md_to_emails_emails": "",
|
||||||
@@ -2335,6 +2336,7 @@
|
|||||||
"appointment_confirmation": "",
|
"appointment_confirmation": "",
|
||||||
"appointment_reminder": "",
|
"appointment_reminder": "",
|
||||||
"casl_authorization": "",
|
"casl_authorization": "",
|
||||||
|
"committed_timetickets_ro": "",
|
||||||
"coversheet_landscape": "",
|
"coversheet_landscape": "",
|
||||||
"coversheet_portrait": "",
|
"coversheet_portrait": "",
|
||||||
"csi_invitation": "",
|
"csi_invitation": "",
|
||||||
@@ -2406,7 +2408,8 @@
|
|||||||
"worksheet_sorted_by_operation": "",
|
"worksheet_sorted_by_operation": "",
|
||||||
"worksheet_sorted_by_operation_no_hours": "",
|
"worksheet_sorted_by_operation_no_hours": "",
|
||||||
"worksheet_sorted_by_operation_part_type": "",
|
"worksheet_sorted_by_operation_part_type": "",
|
||||||
"worksheet_sorted_by_operation_type": ""
|
"worksheet_sorted_by_operation_type": "",
|
||||||
|
"worksheet_sorted_by_team": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"groups": {
|
"groups": {
|
||||||
@@ -2553,6 +2556,9 @@
|
|||||||
"attendance_detail": "",
|
"attendance_detail": "",
|
||||||
"attendance_employee": "",
|
"attendance_employee": "",
|
||||||
"attendance_summary": "",
|
"attendance_summary": "",
|
||||||
|
"committed_timetickets": "",
|
||||||
|
"committed_timetickets_employee": "",
|
||||||
|
"committed_timetickets_summary": "",
|
||||||
"credits_not_received_date": "",
|
"credits_not_received_date": "",
|
||||||
"credits_not_received_date_vendorid": "",
|
"credits_not_received_date_vendorid": "",
|
||||||
"csi": "",
|
"csi": "",
|
||||||
@@ -2651,6 +2657,8 @@
|
|||||||
"timetickets_summary": "",
|
"timetickets_summary": "",
|
||||||
"unclaimed_hrs": "",
|
"unclaimed_hrs": "",
|
||||||
"void_ros": "",
|
"void_ros": "",
|
||||||
|
"work_in_progress_committed_labour": "",
|
||||||
|
"work_in_progress_jobs": "",
|
||||||
"work_in_progress_labour": "",
|
"work_in_progress_labour": "",
|
||||||
"work_in_progress_payables": ""
|
"work_in_progress_payables": ""
|
||||||
}
|
}
|
||||||
@@ -2756,6 +2764,7 @@
|
|||||||
"clockoff": "",
|
"clockoff": "",
|
||||||
"clockon": "",
|
"clockon": "",
|
||||||
"committed": "",
|
"committed": "",
|
||||||
|
"committed_at": "",
|
||||||
"cost_center": "",
|
"cost_center": "",
|
||||||
"date": "",
|
"date": "",
|
||||||
"efficiency": "",
|
"efficiency": "",
|
||||||
|
|||||||
@@ -611,6 +611,7 @@
|
|||||||
"jobstatuses": "",
|
"jobstatuses": "",
|
||||||
"laborrates": "",
|
"laborrates": "",
|
||||||
"licensing": "",
|
"licensing": "",
|
||||||
|
"md_parts_scan": "",
|
||||||
"md_tasks_presets": "",
|
"md_tasks_presets": "",
|
||||||
"md_to_emails": "",
|
"md_to_emails": "",
|
||||||
"md_to_emails_emails": "",
|
"md_to_emails_emails": "",
|
||||||
@@ -2335,6 +2336,7 @@
|
|||||||
"appointment_confirmation": "",
|
"appointment_confirmation": "",
|
||||||
"appointment_reminder": "",
|
"appointment_reminder": "",
|
||||||
"casl_authorization": "",
|
"casl_authorization": "",
|
||||||
|
"committed_timetickets_ro": "",
|
||||||
"coversheet_landscape": "",
|
"coversheet_landscape": "",
|
||||||
"coversheet_portrait": "",
|
"coversheet_portrait": "",
|
||||||
"csi_invitation": "",
|
"csi_invitation": "",
|
||||||
@@ -2406,7 +2408,8 @@
|
|||||||
"worksheet_sorted_by_operation": "",
|
"worksheet_sorted_by_operation": "",
|
||||||
"worksheet_sorted_by_operation_no_hours": "",
|
"worksheet_sorted_by_operation_no_hours": "",
|
||||||
"worksheet_sorted_by_operation_part_type": "",
|
"worksheet_sorted_by_operation_part_type": "",
|
||||||
"worksheet_sorted_by_operation_type": ""
|
"worksheet_sorted_by_operation_type": "",
|
||||||
|
"worksheet_sorted_by_team": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"groups": {
|
"groups": {
|
||||||
@@ -2553,6 +2556,9 @@
|
|||||||
"attendance_detail": "",
|
"attendance_detail": "",
|
||||||
"attendance_employee": "",
|
"attendance_employee": "",
|
||||||
"attendance_summary": "",
|
"attendance_summary": "",
|
||||||
|
"committed_timetickets": "",
|
||||||
|
"committed_timetickets_employee": "",
|
||||||
|
"committed_timetickets_summary": "",
|
||||||
"credits_not_received_date": "",
|
"credits_not_received_date": "",
|
||||||
"credits_not_received_date_vendorid": "",
|
"credits_not_received_date_vendorid": "",
|
||||||
"csi": "",
|
"csi": "",
|
||||||
@@ -2651,6 +2657,8 @@
|
|||||||
"timetickets_summary": "",
|
"timetickets_summary": "",
|
||||||
"unclaimed_hrs": "",
|
"unclaimed_hrs": "",
|
||||||
"void_ros": "",
|
"void_ros": "",
|
||||||
|
"work_in_progress_committed_labour": "",
|
||||||
|
"work_in_progress_jobs": "",
|
||||||
"work_in_progress_labour": "",
|
"work_in_progress_labour": "",
|
||||||
"work_in_progress_payables": ""
|
"work_in_progress_payables": ""
|
||||||
}
|
}
|
||||||
@@ -2756,6 +2764,7 @@
|
|||||||
"clockoff": "",
|
"clockoff": "",
|
||||||
"clockon": "",
|
"clockon": "",
|
||||||
"committed": "",
|
"committed": "",
|
||||||
|
"committed_at": "",
|
||||||
"cost_center": "",
|
"cost_center": "",
|
||||||
"date": "",
|
"date": "",
|
||||||
"efficiency": "",
|
"efficiency": "",
|
||||||
|
|||||||
@@ -514,6 +514,24 @@ export const TemplateList = (type, context) => {
|
|||||||
group: "financial",
|
group: "financial",
|
||||||
dms: true,
|
dms: true,
|
||||||
},
|
},
|
||||||
|
worksheet_sorted_by_team: {
|
||||||
|
title: i18n.t("printcenter.jobs.worksheet_sorted_by_team"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("printcenter.jobs.worksheet_sorted_by_team"),
|
||||||
|
key: "worksheet_sorted_by_team",
|
||||||
|
disabled: false,
|
||||||
|
group: "worksheet",
|
||||||
|
enhanced_payroll: true,
|
||||||
|
},
|
||||||
|
committed_timetickets_ro: {
|
||||||
|
title: i18n.t("printcenter.jobs.committed_timetickets_ro"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("printcenter.jobs.commited_timetickets_ro"),
|
||||||
|
key: "committed_timetickets_ro",
|
||||||
|
disabled: false,
|
||||||
|
group: "financial",
|
||||||
|
enhanced_payroll: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
...(!type || type === "job_special"
|
...(!type || type === "job_special"
|
||||||
@@ -1569,6 +1587,20 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "jobs",
|
group: "jobs",
|
||||||
},
|
},
|
||||||
|
work_in_progress_committed_labour: {
|
||||||
|
title: i18n.t("reportcenter.templates.work_in_progress_committed_labour"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("reportcenter.templates.work_in_progress_committed_labour"),
|
||||||
|
key: "work_in_progress_committed_labour",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.date_open"),
|
||||||
|
},
|
||||||
|
group: "jobs",
|
||||||
|
enhanced_payroll: true,
|
||||||
|
},
|
||||||
work_in_progress_payables: {
|
work_in_progress_payables: {
|
||||||
title: i18n.t("reportcenter.templates.work_in_progress_payables"),
|
title: i18n.t("reportcenter.templates.work_in_progress_payables"),
|
||||||
description: "",
|
description: "",
|
||||||
@@ -1925,6 +1957,40 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "jobs",
|
group: "jobs",
|
||||||
},
|
},
|
||||||
|
committed_timetickets: {
|
||||||
|
title: i18n.t("reportcenter.templates.committed_timetickets"),
|
||||||
|
subject: i18n.t("reportcenter.templates.committed_timetickets"),
|
||||||
|
key: "committed_timetickets",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.timetickets"),
|
||||||
|
field: i18n.t("timetickets.fields.committed_at"),
|
||||||
|
},
|
||||||
|
group: "payroll",
|
||||||
|
enhanced_payroll: true,
|
||||||
|
},
|
||||||
|
committed_timetickets_employee: {
|
||||||
|
title: i18n.t("reportcenter.templates.committed_timetickets_employee"),
|
||||||
|
subject: i18n.t("reportcenter.templates.committed_timetickets_employee"),
|
||||||
|
key: "committed_timetickets_employee",
|
||||||
|
idtype: "employee",
|
||||||
|
disabled: false,
|
||||||
|
group: "payroll",
|
||||||
|
enhanced_payroll: true,
|
||||||
|
},
|
||||||
|
committed_timetickets_summary: {
|
||||||
|
title: i18n.t("reportcenter.templates.committed_timetickets_summary"),
|
||||||
|
subject: i18n.t("reportcenter.templates.committed_timetickets_summary"),
|
||||||
|
key: "committed_timetickets_summary",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.timetickets"),
|
||||||
|
field: i18n.t("timetickets.fields.committed_at"),
|
||||||
|
},
|
||||||
|
group: "payroll",
|
||||||
|
enhanced_payroll: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
...(!type || type === "courtesycarcontract"
|
...(!type || type === "courtesycarcontract"
|
||||||
|
|||||||
Reference in New Issue
Block a user