Shift employee cost centers to follow DMS standard.
This commit is contained in:
@@ -36,6 +36,7 @@ import FormDatePicker from "../form-date-picker/form-date-picker.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 ShopEmployeeAddVacation from "./shop-employees-add-vacation.component";
|
import ShopEmployeeAddVacation from "./shop-employees-add-vacation.component";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -56,7 +57,11 @@ export function ShopEmployeesFormComponent({ bodyshop }) {
|
|||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
});
|
});
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data && data.employees_by_pk) form.setFieldsValue(data.employees_by_pk);
|
if (data && data.employees_by_pk) form.setFieldsValue(data.employees_by_pk);
|
||||||
@@ -362,7 +367,7 @@ export function ShopEmployeesFormComponent({ bodyshop }) {
|
|||||||
{t("timetickets.labels.shift")}
|
{t("timetickets.labels.shift")}
|
||||||
</Select.Option>
|
</Select.Option>
|
||||||
|
|
||||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||||
? CiecaSelect(false, true)
|
? CiecaSelect(false, true)
|
||||||
: bodyshop.md_responsibility_centers.costs.map(
|
: bodyshop.md_responsibility_centers.costs.map(
|
||||||
(c) => (
|
(c) => (
|
||||||
|
|||||||
@@ -143,14 +143,6 @@ export function ShopInfoTaskPresets({ bodyshop, form }) {
|
|||||||
{t("joblines.fields.lbr_types.LAM")}
|
{t("joblines.fields.lbr_types.LAM")}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={4}>
|
|
||||||
<Checkbox
|
|
||||||
value="LAM"
|
|
||||||
style={{ lineHeight: "32px" }}
|
|
||||||
>
|
|
||||||
{t("joblines.fields.lbr_types.LAM")}
|
|
||||||
</Checkbox>
|
|
||||||
</Col>
|
|
||||||
<Col span={4}>
|
<Col span={4}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
value="LAR"
|
value="LAR"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
|||||||
import JobSearchSelect from "../job-search-select/job-search-select.component";
|
import JobSearchSelect from "../job-search-select/job-search-select.component";
|
||||||
import JobsDetailLaborContainer from "../jobs-detail-labor/jobs-detail-labor.container";
|
import JobsDetailLaborContainer from "../jobs-detail-labor/jobs-detail-labor.container";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -16,6 +17,11 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
|
|
||||||
export function TechClockInComponent({ form, bodyshop, technician }) {
|
export function TechClockInComponent({ form, bodyshop, technician }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const emps = bodyshop.employees.filter((e) => e.id === technician.id)[0];
|
const emps = bodyshop.employees.filter((e) => e.id === technician.id)[0];
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -53,7 +59,7 @@ export function TechClockInComponent({ form, bodyshop, technician }) {
|
|||||||
<Select.Option key={item.cost_center} value={item.cost_center}>
|
<Select.Option key={item.cost_center} value={item.cost_center}>
|
||||||
{item.cost_center === "timetickets.labels.shift"
|
{item.cost_center === "timetickets.labels.shift"
|
||||||
? t(item.cost_center)
|
? t(item.cost_center)
|
||||||
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||||
? t(
|
? t(
|
||||||
`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`
|
`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import TechClockInComponent from "./tech-job-clock-in-form.component";
|
|||||||
import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
|
import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
technician: selectTechnician,
|
technician: selectTechnician,
|
||||||
@@ -26,9 +27,10 @@ export function TechClockInContainer({
|
|||||||
technician,
|
technician,
|
||||||
bodyshop,
|
bodyshop,
|
||||||
}) {
|
}) {
|
||||||
console.log(
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
"🚀 ~ file: tech-job-clock-in-form.container.jsx:29 ~ technician:",
|
["Enhanced_Payroll"],
|
||||||
technician
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
);
|
);
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
@@ -56,7 +58,7 @@ export function TechClockInContainer({
|
|||||||
jobid: values.jobid,
|
jobid: values.jobid,
|
||||||
cost_center: values.cost_center,
|
cost_center: values.cost_center,
|
||||||
ciecacode:
|
ciecacode:
|
||||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === 'on'
|
||||||
? values.cost_center
|
? values.cost_center
|
||||||
: Object.keys(
|
: Object.keys(
|
||||||
bodyshop.md_responsibility_centers.defaults.costs
|
bodyshop.md_responsibility_centers.defaults.costs
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
|||||||
import { CalculateAllocationsTotals } from "../labor-allocations-table/labor-allocations-table.utility";
|
import { CalculateAllocationsTotals } from "../labor-allocations-table/labor-allocations-table.utility";
|
||||||
import TechJobClockoutDelete from "../tech-job-clock-out-delete/tech-job-clock-out-delete.component";
|
import TechJobClockoutDelete from "../tech-job-clock-out-delete/tech-job-clock-out-delete.component";
|
||||||
import { LaborAllocationContainer } from "../time-ticket-modal/time-ticket-modal.component";
|
import { LaborAllocationContainer } from "../time-ticket-modal/time-ticket-modal.component";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -43,6 +44,12 @@ export function TechClockOffButton({
|
|||||||
const [updateTimeticket] = useMutation(UPDATE_TIME_TICKET);
|
const [updateTimeticket] = useMutation(UPDATE_TIME_TICKET);
|
||||||
const [updateJobStatus] = useMutation(UPDATE_JOB_STATUS);
|
const [updateJobStatus] = useMutation(UPDATE_JOB_STATUS);
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
|
|
||||||
const { queryLoading, data: lineTicketData } = useQuery(
|
const { queryLoading, data: lineTicketData } = useQuery(
|
||||||
GET_LINE_TICKET_BY_PK,
|
GET_LINE_TICKET_BY_PK,
|
||||||
{
|
{
|
||||||
@@ -76,7 +83,9 @@ export function TechClockOffButton({
|
|||||||
?.rate,
|
?.rate,
|
||||||
flat_rate: emps && emps.flat_rate,
|
flat_rate: emps && emps.flat_rate,
|
||||||
ciecacode:
|
ciecacode:
|
||||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
bodyshop.cdk_dealerid ||
|
||||||
|
bodyshop.pbs_serialnumber ||
|
||||||
|
Enhanced_Payroll.treatment === "on"
|
||||||
? values.cost_center
|
? values.cost_center
|
||||||
: Object.keys(
|
: Object.keys(
|
||||||
bodyshop.md_responsibility_centers.defaults.costs
|
bodyshop.md_responsibility_centers.defaults.costs
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
|||||||
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
import TimeTicketList from "../time-ticket-list/time-ticket-list.component";
|
import TimeTicketList from "../time-ticket-list/time-ticket-list.component";
|
||||||
import TimeTicketCalculatorComponent from "../time-ticket-calculator/time-ticket-calculator.component";
|
import TimeTicketCalculatorComponent from "../time-ticket-calculator/time-ticket-calculator.component";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -41,6 +42,11 @@ export function TimeTicketModalComponent({
|
|||||||
employeeSelectDisabled,
|
employeeSelectDisabled,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const [loadLineTicketData, { called, loading, data: lineTicketData }] =
|
const [loadLineTicketData, { called, loading, data: lineTicketData }] =
|
||||||
useLazyQuery(GET_LINE_TICKET_BY_PK, {
|
useLazyQuery(GET_LINE_TICKET_BY_PK, {
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
@@ -58,7 +64,7 @@ export function TimeTicketModalComponent({
|
|||||||
<Select.Option key={item.cost_center} value={item.cost_center}>
|
<Select.Option key={item.cost_center} value={item.cost_center}>
|
||||||
{item.cost_center === "timetickets.labels.shift"
|
{item.cost_center === "timetickets.labels.shift"
|
||||||
? t(item.cost_center)
|
? t(item.cost_center)
|
||||||
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === 'on'
|
||||||
? t(
|
? t(
|
||||||
`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`
|
`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { selectTimeTicket } from "../../redux/modals/modals.selectors";
|
|||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import TimeTicketModalComponent from "./time-ticket-modal.component";
|
import TimeTicketModalComponent from "./time-ticket-modal.component";
|
||||||
import TimeTicketsCommitToggleComponent from "../time-tickets-commit-toggle/time-tickets-commit-toggle.component";
|
import TimeTicketsCommitToggleComponent from "../time-tickets-commit-toggle/time-tickets-commit-toggle.component";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
timeTicketModal: selectTimeTicket,
|
timeTicketModal: selectTimeTicket,
|
||||||
@@ -35,7 +36,11 @@ export function TimeTicketModalContainer({
|
|||||||
const [enterAgain, setEnterAgain] = useState(false);
|
const [enterAgain, setEnterAgain] = useState(false);
|
||||||
const [insertTicket] = useMutation(INSERT_NEW_TIME_TICKET);
|
const [insertTicket] = useMutation(INSERT_NEW_TIME_TICKET);
|
||||||
const [updateTicket] = useMutation(UPDATE_TIME_TICKET);
|
const [updateTicket] = useMutation(UPDATE_TIME_TICKET);
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const { data: EmployeeAutoCompleteData } = useQuery(QUERY_ACTIVE_EMPLOYEES, {
|
const { data: EmployeeAutoCompleteData } = useQuery(QUERY_ACTIVE_EMPLOYEES, {
|
||||||
skip: !timeTicketModal.visible,
|
skip: !timeTicketModal.visible,
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
@@ -147,7 +152,7 @@ export function TimeTicketModalContainer({
|
|||||||
if (!!changedFields.cost_center && !!EmployeeAutoCompleteData) {
|
if (!!changedFields.cost_center && !!EmployeeAutoCompleteData) {
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
ciecacode:
|
ciecacode:
|
||||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatments === 'on'
|
||||||
? changedFields.cost_center
|
? changedFields.cost_center
|
||||||
: Object.keys(
|
: Object.keys(
|
||||||
bodyshop.md_responsibility_centers.defaults.costs
|
bodyshop.md_responsibility_centers.defaults.costs
|
||||||
|
|||||||
Reference in New Issue
Block a user