IO-2913 ADP Payroll Reports
Uses ADPPayroll Split Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
This commit is contained in:
@@ -34,28 +34,34 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const {
|
const {
|
||||||
treatments: { Enhanced_Payroll }
|
treatments: { Enhanced_Payroll, ADPPayroll }
|
||||||
} = useSplitTreatments({
|
} = useSplitTreatments({
|
||||||
attributes: {},
|
attributes: {},
|
||||||
names: ["Enhanced_Payroll"],
|
names: ["Enhanced_Payroll", "ADPPayroll"],
|
||||||
splitKey: bodyshop.imexshopid
|
splitKey: 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 =
|
const ReportsList = Object.keys(Templates)
|
||||||
Enhanced_Payroll.treatment === "on"
|
.map((key) => Templates[key])
|
||||||
? Object.keys(Templates)
|
.filter((temp) => {
|
||||||
.map((key) => {
|
const enhancedPayrollOn = Enhanced_Payroll.treatment === "on";
|
||||||
return Templates[key];
|
const adpPayrollOn = ADPPayroll.treatment === "on";
|
||||||
})
|
|
||||||
.filter((temp) => temp.enhanced_payroll === undefined || temp.enhanced_payroll === true)
|
if (enhancedPayrollOn && adpPayrollOn) {
|
||||||
: Object.keys(Templates)
|
return temp.enhanced_payroll !== false || temp.adp_payroll !== false;
|
||||||
.map((key) => {
|
}
|
||||||
return Templates[key];
|
if (enhancedPayrollOn) {
|
||||||
})
|
return temp.enhanced_payroll !== false && temp.adp_payroll !== true;
|
||||||
.filter((temp) => temp.enhanced_payroll === undefined || temp.enhanced_payroll === false);
|
}
|
||||||
|
if (adpPayrollOn) {
|
||||||
|
return temp.adp_payroll !== false && temp.enhanced_payroll !== true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return temp.enhanced_payroll !== true && temp.adp_payroll !== true;
|
||||||
|
});
|
||||||
|
|
||||||
const { open } = reportCenterModal;
|
const { open } = reportCenterModal;
|
||||||
|
|
||||||
@@ -104,7 +110,7 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
|||||||
to: values.to,
|
to: values.to,
|
||||||
subject: Templates[values.key]?.subject
|
subject: Templates[values.key]?.subject
|
||||||
},
|
},
|
||||||
values.sendbyexcel === "excel" ? "x" : values.sendby === "email" ? "e" : "p",
|
values.sendbytext === "text" ? values.sendbytext : values.sendbyexcel === "excel" ? "x" : values.sendby === "email" ? "e" : "p",
|
||||||
id
|
id
|
||||||
);
|
);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
@@ -291,7 +297,15 @@ export function ReportCenterModalComponent({ reportCenterModal, bodyshop }) {
|
|||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
if (reporttype !== "excel")
|
if (reporttype === "text")
|
||||||
|
return (
|
||||||
|
<Form.Item label={t("general.labels.sendby")} name="sendbytext" initialValue="text">
|
||||||
|
<Radio.Group>
|
||||||
|
<Radio value="text">{t("general.labels.text")}</Radio>
|
||||||
|
</Radio.Group>
|
||||||
|
</Form.Item>
|
||||||
|
);
|
||||||
|
if (reporttype !== "excel" || reporttype !== "text")
|
||||||
return (
|
return (
|
||||||
<Form.Item label={t("general.labels.sendby")} name="sendby" initialValue="print">
|
<Form.Item label={t("general.labels.sendby")} name="sendby" initialValue="print">
|
||||||
<Radio.Group>
|
<Radio.Group>
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ import { connect } from "react-redux";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import DatePickerRanges from "../../utils/DatePickerRanges";
|
import DatePickerRanges from "../../utils/DatePickerRanges";
|
||||||
|
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||||
|
import FeatureWrapper, { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
||||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||||
import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
||||||
import PhoneFormItem, { PhoneItemFormatterValidation } from "../form-items-formatted/phone-form-item.component";
|
import PhoneFormItem, { PhoneItemFormatterValidation } from "../form-items-formatted/phone-form-item.component";
|
||||||
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
|
||||||
import FeatureWrapper, { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
|
|
||||||
// TODO: Client Update, this might break
|
// TODO: Client Update, this might break
|
||||||
const timeZonesList = Intl.supportedValuesOf("timeZone");
|
const timeZonesList = Intl.supportedValuesOf("timeZone");
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
@@ -28,10 +28,10 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
treatments: { ClosingPeriod }
|
treatments: { ClosingPeriod, ADPPayroll }
|
||||||
} = useSplitTreatments({
|
} = useSplitTreatments({
|
||||||
attributes: {},
|
attributes: {},
|
||||||
names: ["ClosingPeriod"],
|
names: ["ClosingPeriod", "ADPPayroll"],
|
||||||
splitKey: bodyshop && bodyshop.imexshopid
|
splitKey: bodyshop && bodyshop.imexshopid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -98,7 +98,6 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
<Form.Item label={t("bodyshop.fields.email")} name="email">
|
<Form.Item label={t("bodyshop.fields.email")} name="email">
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("bodyshop.fields.phone")}
|
label={t("bodyshop.fields.phone")}
|
||||||
name="phone"
|
name="phone"
|
||||||
@@ -356,14 +355,22 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
<Select mode="tags" />
|
<Select mode="tags" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{ClosingPeriod.treatment === "on" && (
|
{ClosingPeriod.treatment === "on" && (
|
||||||
<>
|
<Form.Item
|
||||||
<Form.Item
|
name={["accountingconfig", "ClosingPeriod"]}
|
||||||
name={["accountingconfig", "ClosingPeriod"]}
|
label={t("bodyshop.fields.closingperiod")} //{t("reportcenter.labels.dates")}
|
||||||
label={t("bodyshop.fields.closingperiod")} //{t("reportcenter.labels.dates")}
|
>
|
||||||
>
|
<DatePicker.RangePicker format="MM/DD/YYYY" presets={DatePickerRanges} />
|
||||||
<DatePicker.RangePicker format="MM/DD/YYYY" presets={DatePickerRanges} />
|
</Form.Item>
|
||||||
</Form.Item>
|
)}
|
||||||
</>
|
{ADPPayroll.treatment === "on" && (
|
||||||
|
<Form.Item name={["accountingconfig", "companyCode"]} label={t("bodyshop.fields.companycode")}>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
{ADPPayroll.treatment === "on" && (
|
||||||
|
<Form.Item name={["accountingconfig", "batchID"]} label={t("bodyshop.fields.batchid")}>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</FeatureWrapper>
|
</FeatureWrapper>
|
||||||
|
|||||||
@@ -2927,6 +2927,8 @@
|
|||||||
"vendor": "Vendor"
|
"vendor": "Vendor"
|
||||||
},
|
},
|
||||||
"templates": {
|
"templates": {
|
||||||
|
"adp_payroll_flat": "ADP Payroll - Flat Rate",
|
||||||
|
"adp_payroll_straight": "ADP Payroll - Straight Time",
|
||||||
"anticipated_revenue": "Anticipated Revenue",
|
"anticipated_revenue": "Anticipated Revenue",
|
||||||
"ar_aging": "AR Aging",
|
"ar_aging": "AR Aging",
|
||||||
"attendance_detail": "Attendance (All Employees)",
|
"attendance_detail": "Attendance (All Employees)",
|
||||||
|
|||||||
@@ -2927,6 +2927,8 @@
|
|||||||
"vendor": ""
|
"vendor": ""
|
||||||
},
|
},
|
||||||
"templates": {
|
"templates": {
|
||||||
|
"adp_payroll_flat": "",
|
||||||
|
"adp_payroll_straight": "",
|
||||||
"anticipated_revenue": "",
|
"anticipated_revenue": "",
|
||||||
"ar_aging": "",
|
"ar_aging": "",
|
||||||
"attendance_detail": "",
|
"attendance_detail": "",
|
||||||
|
|||||||
@@ -2927,6 +2927,8 @@
|
|||||||
"vendor": ""
|
"vendor": ""
|
||||||
},
|
},
|
||||||
"templates": {
|
"templates": {
|
||||||
|
"adp_payroll_flat": "",
|
||||||
|
"adp_payroll_straight": "",
|
||||||
"anticipated_revenue": "",
|
"anticipated_revenue": "",
|
||||||
"ar_aging": "",
|
"ar_aging": "",
|
||||||
"attendance_detail": "",
|
"attendance_detail": "",
|
||||||
|
|||||||
@@ -2158,6 +2158,32 @@ export const TemplateList = (type, context) => {
|
|||||||
field: i18n.t("tasks.fields.created_at")
|
field: i18n.t("tasks.fields.created_at")
|
||||||
},
|
},
|
||||||
group: "jobs"
|
group: "jobs"
|
||||||
|
},
|
||||||
|
adp_payroll_flat: {
|
||||||
|
title: i18n.t("reportcenter.templates.adp_payroll_flat"),
|
||||||
|
subject: i18n.t("reportcenter.templates.adp_payroll_flat"),
|
||||||
|
key: "adp_payroll_flat",
|
||||||
|
reporttype: "text",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.timetickets"),
|
||||||
|
field: i18n.t("timetickets.fields.committed_at")
|
||||||
|
},
|
||||||
|
group: "payroll",
|
||||||
|
adp_payroll: true
|
||||||
|
},
|
||||||
|
adp_payroll_straight: {
|
||||||
|
title: i18n.t("reportcenter.templates.adp_payroll_straight"),
|
||||||
|
subject: i18n.t("reportcenter.templates.adp_payroll_straight"),
|
||||||
|
key: "adp_payroll_straight",
|
||||||
|
reporttype: "text",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.timetickets"),
|
||||||
|
field: i18n.t("timetickets.fields.date")
|
||||||
|
},
|
||||||
|
group: "payroll",
|
||||||
|
adp_payroll: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
|||||||
Reference in New Issue
Block a user