IO-2206 Enhanced Payroll Reports

This commit is contained in:
Allan Carr
2023-08-16 12:12:22 -07:00
parent ad7ff62b56
commit 3f43ff05d0
6 changed files with 130 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
import { useTreatments } from "@splitsoftware/splitio-react";
import { Card, Col, Input, Row, Space, Typography } from "antd";
import _ from "lodash";
import React, { useState } from "react";
@@ -23,8 +24,13 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
const { id: jobId, job } = printCenterModal.context;
const tempList = TemplateList("job", {});
const { t } = useTranslation();
const { Enhanced_Payroll } = useTreatments(
["Enhanced_Payroll"],
{},
bodyshop.imexshopid
);
const JobsReportsList =
const Templates =
bodyshop.cdk_dealerid === null && bodyshop.pbs_serialnumber === null
? Object.keys(tempList)
.map((key) => {
@@ -51,6 +57,16 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
bodyshop.region_config.includes(Object.keys(temp.regions)) ===
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 =
search !== ""

View File

@@ -1,4 +1,5 @@
import { useLazyQuery } from "@apollo/client";
import { useTreatments } from "@splitsoftware/splitio-react";
import {
Button,
Card,
@@ -19,6 +20,7 @@ import { createStructuredSelector } from "reselect";
import { QUERY_ACTIVE_EMPLOYEES } from "../../graphql/employees.queries";
import { QUERY_ALL_VENDORS } from "../../graphql/vendors.queries";
import { selectReportCenter } from "../../redux/modals/modals.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import DatePIckerRanges from "../../utils/DatePickerRanges";
import { GenerateDocument } from "../../utils/RenderTemplate";
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";
const mapStateToProps = createStructuredSelector({
reportCenterModal: selectReportCenter,
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
@@ -36,16 +39,26 @@ export default connect(
mapDispatchToProps
)(ReportCenterModalComponent);
export function ReportCenterModalComponent({ reportCenterModal }) {
export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
const [form] = Form.useForm();
const [search, setSearch] = useState("");
const { Enhanced_Payroll } = useTreatments(
["Enhanced_Payroll"],
{},
bodyshop.imexshopid
);
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
const Templates = TemplateList("report_center");
const ReportsList = Object.keys(Templates).map((key) => {
return Templates[key];
});
const ReportsList =
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 [callVendorQuery, { data: vendorData, called: vendorCalled }] =

View File

@@ -612,6 +612,7 @@
"laborrates": "Labor Rates",
"licensing": "Licensing",
"md_tasks_presets": "Tasks Presets",
"md_parts_scan": "Parts Scan Rules",
"md_to_emails": "Preset To Emails",
"md_to_emails_emails": "Emails",
"messagingpresets": "Messaging Presets",
@@ -2335,6 +2336,7 @@
"appointment_confirmation": "Appointment Confirmation",
"appointment_reminder": "Appointment Reminder",
"casl_authorization": "CASL Authorization",
"committed_timetickets_ro": "Committed Time Tickets",
"coversheet_landscape": "Coversheet (Landscape)",
"coversheet_portrait": "Coversheet Portrait",
"csi_invitation": "CSI Invitation",
@@ -2406,7 +2408,8 @@
"worksheet_sorted_by_operation": "Worksheet by Operation",
"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_type": "Worksheet by Operation Type"
"worksheet_sorted_by_operation_type": "Worksheet by Operation Type",
"worksheet_sorted_by_team": "Worksheet by Team"
},
"labels": {
"groups": {
@@ -2553,6 +2556,9 @@
"attendance_detail": "Attendance (All Employees)",
"attendance_employee": "Employee Attendance",
"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_vendorid": "Credits not Received by Vendor",
"csi": "CSI Responses",
@@ -2651,6 +2657,8 @@
"timetickets_summary": "Time Tickets Summary",
"unclaimed_hrs": "Unflagged Hours",
"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_payables": "Work in Progress - Payables"
}
@@ -2756,6 +2764,7 @@
"clockoff": "Clock Off",
"clockon": "Clocked In",
"committed": "Committed",
"committed_at": "Committed At",
"cost_center": "Cost Center",
"date": "Ticket Date",
"efficiency": "Efficiency",

View File

@@ -611,6 +611,7 @@
"jobstatuses": "",
"laborrates": "",
"licensing": "",
"md_parts_scan": "",
"md_tasks_presets": "",
"md_to_emails": "",
"md_to_emails_emails": "",
@@ -2335,6 +2336,7 @@
"appointment_confirmation": "",
"appointment_reminder": "",
"casl_authorization": "",
"committed_timetickets_ro": "",
"coversheet_landscape": "",
"coversheet_portrait": "",
"csi_invitation": "",
@@ -2406,7 +2408,8 @@
"worksheet_sorted_by_operation": "",
"worksheet_sorted_by_operation_no_hours": "",
"worksheet_sorted_by_operation_part_type": "",
"worksheet_sorted_by_operation_type": ""
"worksheet_sorted_by_operation_type": "",
"worksheet_sorted_by_team": ""
},
"labels": {
"groups": {
@@ -2553,6 +2556,9 @@
"attendance_detail": "",
"attendance_employee": "",
"attendance_summary": "",
"committed_timetickets": "",
"committed_timetickets_employee": "",
"committed_timetickets_summary": "",
"credits_not_received_date": "",
"credits_not_received_date_vendorid": "",
"csi": "",
@@ -2651,6 +2657,8 @@
"timetickets_summary": "",
"unclaimed_hrs": "",
"void_ros": "",
"work_in_progress_committed_labour": "",
"work_in_progress_jobs": "",
"work_in_progress_labour": "",
"work_in_progress_payables": ""
}
@@ -2756,6 +2764,7 @@
"clockoff": "",
"clockon": "",
"committed": "",
"committed_at": "",
"cost_center": "",
"date": "",
"efficiency": "",

View File

@@ -611,6 +611,7 @@
"jobstatuses": "",
"laborrates": "",
"licensing": "",
"md_parts_scan": "",
"md_tasks_presets": "",
"md_to_emails": "",
"md_to_emails_emails": "",
@@ -2335,6 +2336,7 @@
"appointment_confirmation": "",
"appointment_reminder": "",
"casl_authorization": "",
"committed_timetickets_ro": "",
"coversheet_landscape": "",
"coversheet_portrait": "",
"csi_invitation": "",
@@ -2406,7 +2408,8 @@
"worksheet_sorted_by_operation": "",
"worksheet_sorted_by_operation_no_hours": "",
"worksheet_sorted_by_operation_part_type": "",
"worksheet_sorted_by_operation_type": ""
"worksheet_sorted_by_operation_type": "",
"worksheet_sorted_by_team": ""
},
"labels": {
"groups": {
@@ -2553,6 +2556,9 @@
"attendance_detail": "",
"attendance_employee": "",
"attendance_summary": "",
"committed_timetickets": "",
"committed_timetickets_employee": "",
"committed_timetickets_summary": "",
"credits_not_received_date": "",
"credits_not_received_date_vendorid": "",
"csi": "",
@@ -2651,6 +2657,8 @@
"timetickets_summary": "",
"unclaimed_hrs": "",
"void_ros": "",
"work_in_progress_committed_labour": "",
"work_in_progress_jobs": "",
"work_in_progress_labour": "",
"work_in_progress_payables": ""
}
@@ -2756,6 +2764,7 @@
"clockoff": "",
"clockon": "",
"committed": "",
"committed_at": "",
"cost_center": "",
"date": "",
"efficiency": "",

View File

@@ -514,6 +514,24 @@ export const TemplateList = (type, context) => {
group: "financial",
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"
@@ -1569,6 +1587,20 @@ export const TemplateList = (type, context) => {
},
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: {
title: i18n.t("reportcenter.templates.work_in_progress_payables"),
description: "",
@@ -1925,6 +1957,40 @@ export const TemplateList = (type, context) => {
},
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"