@@ -215,10 +215,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
>
|
>
|
||||||
<CourtesyCarStatus />
|
<CourtesyCarStatus />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item label={t("courtesycars.fields.readiness")} name="readiness">
|
||||||
label={t("courtesycars.fields.readiness")}
|
|
||||||
name="readiness"
|
|
||||||
>
|
|
||||||
<CourtesyCarReadiness />
|
<CourtesyCarReadiness />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<div>
|
<div>
|
||||||
@@ -235,8 +232,9 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
>
|
>
|
||||||
{() => {
|
{() => {
|
||||||
const nextservicekm = form.getFieldValue("nextservicekm");
|
const nextservicekm = form.getFieldValue("nextservicekm");
|
||||||
const mileageOver =
|
const mileageOver = nextservicekm
|
||||||
nextservicekm && nextservicekm <= form.getFieldValue("mileage");
|
? nextservicekm <= form.getFieldValue("mileage")
|
||||||
|
: false;
|
||||||
if (mileageOver)
|
if (mileageOver)
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" style={{ color: "tomato" }}>
|
<Space direction="vertical" style={{ color: "tomato" }}>
|
||||||
|
|||||||
@@ -73,10 +73,10 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
const { nextservicedate, nextservicekm, mileage } = record;
|
const { nextservicedate, nextservicekm, mileage } = record;
|
||||||
|
|
||||||
const mileageOver = nextservicekm <= mileage;
|
const mileageOver = nextservicekm ? nextservicekm <= mileage : false;
|
||||||
|
|
||||||
const dueForService =
|
const dueForService =
|
||||||
nextservicedate && dayjs(nextservicedate).isBefore(dayjs());
|
nextservicedate && dayjs(nextservicedate).end('day').isSameOrBefore(dayjs());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
|
|||||||
@@ -221,6 +221,11 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
<VehicleVinDisplay>
|
<VehicleVinDisplay>
|
||||||
{`${job.v_vin || t("general.labels.na")}`}
|
{`${job.v_vin || t("general.labels.na")}`}
|
||||||
</VehicleVinDisplay>
|
</VehicleVinDisplay>
|
||||||
|
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
||||||
|
job.v_vin.length !== 17 ? (
|
||||||
|
<WarningFilled style={{ color: "tomato", marginLeft: ".3rem" }} />
|
||||||
|
) : null
|
||||||
|
) : null}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel label={t("jobs.fields.regie_number")}>
|
<DataLabel label={t("jobs.fields.regie_number")}>
|
||||||
{job.regie_number || t("general.labels.na")}
|
{job.regie_number || t("general.labels.na")}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export function ProductionColumnsComponent({
|
|||||||
columnState,
|
columnState,
|
||||||
technician,
|
technician,
|
||||||
bodyshop,
|
bodyshop,
|
||||||
|
data,
|
||||||
tableState,
|
tableState,
|
||||||
}) {
|
}) {
|
||||||
const [columns, setColumns] = columnState;
|
const [columns, setColumns] = columnState;
|
||||||
@@ -36,6 +37,7 @@ export function ProductionColumnsComponent({
|
|||||||
bodyshop,
|
bodyshop,
|
||||||
technician,
|
technician,
|
||||||
state: tableState,
|
state: tableState,
|
||||||
|
data,
|
||||||
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
||||||
}).filter((i) => i.key === e.key),
|
}).filter((i) => i.key === e.key),
|
||||||
]);
|
]);
|
||||||
@@ -44,6 +46,7 @@ export function ProductionColumnsComponent({
|
|||||||
const columnKeys = columns.map((i) => i.key);
|
const columnKeys = columns.map((i) => i.key);
|
||||||
const cols = dataSource({
|
const cols = dataSource({
|
||||||
technician,
|
technician,
|
||||||
|
data,
|
||||||
state: tableState,
|
state: tableState,
|
||||||
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PauseCircleOutlined, BranchesOutlined } from "@ant-design/icons";
|
import { BranchesOutlined, PauseCircleOutlined } from "@ant-design/icons";
|
||||||
import { Space, Tooltip } from "antd";
|
import { Space, Tooltip } from "antd";
|
||||||
import i18n from "i18next";
|
import i18n from "i18next";
|
||||||
import dayjs from "../../utils/day";
|
import dayjs from "../../utils/day";
|
||||||
@@ -6,6 +6,7 @@ import { Link } from "react-router-dom";
|
|||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { TimeFormatter } from "../../utils/DateFormatter";
|
import { TimeFormatter } from "../../utils/DateFormatter";
|
||||||
import PhoneFormatter from "../../utils/PhoneFormatter";
|
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||||
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
import { alphaSort, dateSort, statusSort } from "../../utils/sorters";
|
import { alphaSort, dateSort, statusSort } from "../../utils/sorters";
|
||||||
import JobAltTransportChange from "../job-at-change/job-at-change.component";
|
import JobAltTransportChange from "../job-at-change/job-at-change.component";
|
||||||
import JobPartsQueueCount from "../job-parts-queue-count/job-parts-queue-count.component";
|
import JobPartsQueueCount from "../job-parts-queue-count/job-parts-queue-count.component";
|
||||||
@@ -25,7 +26,7 @@ import ProductionListColumnCategory from "./production-list-columns.status.categ
|
|||||||
import ProductionListColumnStatus from "./production-list-columns.status.component";
|
import ProductionListColumnStatus from "./production-list-columns.status.component";
|
||||||
import ProductionlistColumnTouchTime from "./prodution-list-columns.touchtime.component";
|
import ProductionlistColumnTouchTime from "./prodution-list-columns.touchtime.component";
|
||||||
|
|
||||||
const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
const r = ({ technician, state, activeStatuses, data, bodyshop }) => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
title: i18n.t("jobs.actions.viewdetail"),
|
title: i18n.t("jobs.actions.viewdetail"),
|
||||||
@@ -536,6 +537,36 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
<JobPartsQueueCount parts={record.joblines_status} record={record} />
|
<JobPartsQueueCount parts={record.joblines_status} record={record} />
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: i18n.t("jobs.labels.estimator"),
|
||||||
|
dataIndex: "estimator",
|
||||||
|
key: "estimator",
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.est_ct_fn || ""} ${a.est_ct_ln || ""}`.trim(),
|
||||||
|
`${b.est_ct_fn || ""} ${b.est_ct_ln || ""}`.trim()
|
||||||
|
),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "estimator" && state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(data &&
|
||||||
|
data
|
||||||
|
.map((j) => `${j.est_ct_fn || ""} ${j.est_ct_ln || ""}`.trim())
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "N/A",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) =>
|
||||||
|
value.includes(
|
||||||
|
`${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim()
|
||||||
|
),
|
||||||
|
render: (text, record) =>
|
||||||
|
`${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim(),
|
||||||
|
},
|
||||||
|
|
||||||
//Added as a place holder for St Claude. Not implemented as it requires another join for a field used by only 1 client.
|
//Added as a place holder for St Claude. Not implemented as it requires another join for a field used by only 1 client.
|
||||||
// {
|
// {
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export function ProductionListTable({
|
|||||||
technician,
|
technician,
|
||||||
currentUser,
|
currentUser,
|
||||||
state,
|
state,
|
||||||
|
data,
|
||||||
setColumns,
|
setColumns,
|
||||||
setState,
|
setState,
|
||||||
}) {
|
}) {
|
||||||
@@ -41,6 +42,7 @@ export function ProductionListTable({
|
|||||||
bodyshop,
|
bodyshop,
|
||||||
technician,
|
technician,
|
||||||
state,
|
state,
|
||||||
|
data: data,
|
||||||
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
||||||
}).find((e) => e.key === k.key),
|
}).find((e) => e.key === k.key),
|
||||||
width: k.width,
|
width: k.width,
|
||||||
@@ -95,6 +97,7 @@ export function ProductionListTable({
|
|||||||
...ProductionListColumns({
|
...ProductionListColumns({
|
||||||
technician,
|
technician,
|
||||||
state,
|
state,
|
||||||
|
data: data,
|
||||||
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
||||||
}).find((e) => e.key === k.key),
|
}).find((e) => e.key === k.key),
|
||||||
width: k.width,
|
width: k.width,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {SyncOutlined} from "@ant-design/icons";
|
import {SyncOutlined} from "@ant-design/icons";
|
||||||
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
import {useSplitTreatments} from "@splitsoftware/splitio-react";
|
||||||
import {Button, Dropdown, Input, Space, Statistic, Table,} from "antd";
|
import {Button, Dropdown, Input, Space, Statistic, Table} from "antd";
|
||||||
import {PageHeader} from "@ant-design/pro-layout";
|
import {PageHeader} from "@ant-design/pro-layout";
|
||||||
import React, {useMemo, useState} from "react";
|
import React, {useEffect, useMemo, useState} from "react";
|
||||||
import ReactDragListView from "react-drag-listview";
|
import ReactDragListView from "react-drag-listview";
|
||||||
import {useTranslation} from "react-i18next";
|
import {useTranslation} from "react-i18next";
|
||||||
import {connect} from "react-redux";
|
import {connect} from "react-redux";
|
||||||
@@ -66,6 +66,7 @@ export function ProductionListTable({loading, data, refetch, bodyshop, technicia
|
|||||||
bodyshop,
|
bodyshop,
|
||||||
technician,
|
technician,
|
||||||
state,
|
state,
|
||||||
|
data,
|
||||||
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
||||||
}).find((e) => e.key === k.key),
|
}).find((e) => e.key === k.key),
|
||||||
width: k.width ?? 100,
|
width: k.width ?? 100,
|
||||||
@@ -74,6 +75,34 @@ export function ProductionListTable({loading, data, refetch, bodyshop, technicia
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const newColumns =
|
||||||
|
(state &&
|
||||||
|
matchingColumnConfig &&
|
||||||
|
matchingColumnConfig.columns.columnKeys.map((k) => {
|
||||||
|
return {
|
||||||
|
...ProductionListColumns({
|
||||||
|
bodyshop,
|
||||||
|
technician,
|
||||||
|
state,
|
||||||
|
data: data,
|
||||||
|
activeStatuses: bodyshop.md_ro_statuses.active_statuses,
|
||||||
|
}).find((e) => e.key === k.key),
|
||||||
|
width: k.width ?? 100,
|
||||||
|
};
|
||||||
|
})) ||
|
||||||
|
[];
|
||||||
|
setColumns(newColumns);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [
|
||||||
|
//state,
|
||||||
|
matchingColumnConfig,
|
||||||
|
bodyshop,
|
||||||
|
technician,
|
||||||
|
data,
|
||||||
|
]); //State removed from dependency array as it causes race condition when removing columns from table view and is not needed.
|
||||||
|
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({
|
setState({
|
||||||
...state,
|
...state,
|
||||||
@@ -89,10 +118,11 @@ export function ProductionListTable({loading, data, refetch, bodyshop, technicia
|
|||||||
setColumns(columnsCopy);
|
setColumns(columnsCopy);
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeColumn = (e) => {
|
const removeColumn = (e) => {
|
||||||
const {key} = e;
|
const { key } = e;
|
||||||
setColumns(columns.filter((i) => i.key !== key));
|
const newColumns = columns.filter((i) => i.key !== key);
|
||||||
};
|
setColumns(newColumns);
|
||||||
|
};
|
||||||
|
|
||||||
const handleResize =
|
const handleResize =
|
||||||
(index) =>
|
(index) =>
|
||||||
@@ -221,6 +251,7 @@ export function ProductionListTable({loading, data, refetch, bodyshop, technicia
|
|||||||
<ProductionListColumnsAdd
|
<ProductionListColumnsAdd
|
||||||
columnState={[columns, setColumns]}
|
columnState={[columns, setColumns]}
|
||||||
tableState={state}
|
tableState={state}
|
||||||
|
data={data}
|
||||||
/>
|
/>
|
||||||
<ProductionListSaveConfigButton
|
<ProductionListSaveConfigButton
|
||||||
columns={columns}
|
columns={columns}
|
||||||
@@ -231,6 +262,7 @@ export function ProductionListTable({loading, data, refetch, bodyshop, technicia
|
|||||||
state={state}
|
state={state}
|
||||||
setState={setState}
|
setState={setState}
|
||||||
setColumns={setColumns}
|
setColumns={setColumns}
|
||||||
|
data={data}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
|
|||||||
@@ -364,6 +364,8 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
|
|||||||
employee_refinish
|
employee_refinish
|
||||||
employee_prep
|
employee_prep
|
||||||
employee_csr
|
employee_csr
|
||||||
|
est_ct_fn
|
||||||
|
est_ct_ln
|
||||||
suspended
|
suspended
|
||||||
date_repairstarted
|
date_repairstarted
|
||||||
joblines_status {
|
joblines_status {
|
||||||
|
|||||||
@@ -2023,24 +2023,24 @@
|
|||||||
- active:
|
- active:
|
||||||
_eq: true
|
_eq: true
|
||||||
columns:
|
columns:
|
||||||
- labor_rates
|
|
||||||
- percentage
|
|
||||||
- created_at
|
- created_at
|
||||||
- updated_at
|
|
||||||
- employeeid
|
- employeeid
|
||||||
- id
|
- id
|
||||||
|
- labor_rates
|
||||||
|
- percentage
|
||||||
- teamid
|
- teamid
|
||||||
|
- updated_at
|
||||||
select_permissions:
|
select_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
columns:
|
columns:
|
||||||
- labor_rates
|
|
||||||
- percentage
|
|
||||||
- created_at
|
- created_at
|
||||||
- updated_at
|
|
||||||
- employeeid
|
- employeeid
|
||||||
- id
|
- id
|
||||||
|
- labor_rates
|
||||||
|
- percentage
|
||||||
- teamid
|
- teamid
|
||||||
|
- updated_at
|
||||||
filter:
|
filter:
|
||||||
employee_team:
|
employee_team:
|
||||||
bodyshop:
|
bodyshop:
|
||||||
@@ -2055,13 +2055,13 @@
|
|||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
columns:
|
columns:
|
||||||
- labor_rates
|
|
||||||
- percentage
|
|
||||||
- created_at
|
- created_at
|
||||||
- updated_at
|
|
||||||
- employeeid
|
- employeeid
|
||||||
- id
|
- id
|
||||||
|
- labor_rates
|
||||||
|
- percentage
|
||||||
- teamid
|
- teamid
|
||||||
|
- updated_at
|
||||||
filter:
|
filter:
|
||||||
employee_team:
|
employee_team:
|
||||||
bodyshop:
|
bodyshop:
|
||||||
@@ -2123,21 +2123,23 @@
|
|||||||
_eq: true
|
_eq: true
|
||||||
columns:
|
columns:
|
||||||
- active
|
- active
|
||||||
- name
|
|
||||||
- created_at
|
|
||||||
- updated_at
|
|
||||||
- bodyshopid
|
- bodyshopid
|
||||||
|
- created_at
|
||||||
- id
|
- id
|
||||||
|
- max_load
|
||||||
|
- name
|
||||||
|
- updated_at
|
||||||
select_permissions:
|
select_permissions:
|
||||||
- role: user
|
- role: user
|
||||||
permission:
|
permission:
|
||||||
columns:
|
columns:
|
||||||
- active
|
- active
|
||||||
- name
|
|
||||||
- created_at
|
|
||||||
- updated_at
|
|
||||||
- bodyshopid
|
- bodyshopid
|
||||||
|
- created_at
|
||||||
- id
|
- id
|
||||||
|
- max_load
|
||||||
|
- name
|
||||||
|
- updated_at
|
||||||
filter:
|
filter:
|
||||||
bodyshop:
|
bodyshop:
|
||||||
associations:
|
associations:
|
||||||
@@ -2153,6 +2155,7 @@
|
|||||||
columns:
|
columns:
|
||||||
- active
|
- active
|
||||||
- bodyshopid
|
- bodyshopid
|
||||||
|
- max_load
|
||||||
- name
|
- name
|
||||||
- updated_at
|
- updated_at
|
||||||
filter:
|
filter:
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."employee_team_members" add column "max_load" numeric
|
||||||
|
-- not null default '10000';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."employee_team_members" add column "max_load" numeric
|
||||||
|
not null default '10000';
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
alter table "public"."employee_team_members" alter column "max_load" set default '10000'::numeric;
|
||||||
|
alter table "public"."employee_team_members" alter column "max_load" drop not null;
|
||||||
|
alter table "public"."employee_team_members" add column "max_load" numeric;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
alter table "public"."employee_team_members" drop column "max_load" cascade;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."employee_teams" add column "max_load" numeric
|
||||||
|
-- not null default '10000';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."employee_teams" add column "max_load" numeric
|
||||||
|
not null default '10000';
|
||||||
@@ -132,6 +132,7 @@ exports.payment_refund = async (req, res) => {
|
|||||||
exports.generate_payment_url = async (req, res) => {
|
exports.generate_payment_url = async (req, res) => {
|
||||||
logger.log("intellipay-payment-url", "DEBUG", req.user?.email, null, null);
|
logger.log("intellipay-payment-url", "DEBUG", req.user?.email, null, null);
|
||||||
const shopCredentials = await getShopCredentials(req.body.bodyshop);
|
const shopCredentials = await getShopCredentials(req.body.bodyshop);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const options = {
|
const options = {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -139,7 +140,12 @@ exports.generate_payment_url = async (req, res) => {
|
|||||||
//TODO: Move these to environment variables/database.
|
//TODO: Move these to environment variables/database.
|
||||||
data: qs.stringify({
|
data: qs.stringify({
|
||||||
...shopCredentials,
|
...shopCredentials,
|
||||||
...req.body,
|
//...req.body,
|
||||||
|
amount: Dinero({ amount: Math.round(req.body.amount * 100) }).toFormat(
|
||||||
|
"0.00"
|
||||||
|
),
|
||||||
|
account: req.body.account,
|
||||||
|
invoice: req.body.invoice,
|
||||||
createshorturl: true,
|
createshorturl: true,
|
||||||
//The postback URL is set at the CP teller global terminal settings page.
|
//The postback URL is set at the CP teller global terminal settings page.
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user