Merged in release/2024-04-12 (pull request #1413)

Release/2024 04 12

Approved-by: Dave Richer
This commit is contained in:
Allan Carr
2024-04-12 17:08:21 +00:00
committed by Dave Richer
24 changed files with 232 additions and 97 deletions

View File

@@ -45,6 +45,7 @@ export function BillDetailEditReturn({
actions: {}, actions: {},
context: { context: {
jobId: data.bills_by_pk.jobid, jobId: data.bills_by_pk.jobid,
job: data.bills_by_pk.job,
vendorId: data.bills_by_pk.vendorid, vendorId: data.bills_by_pk.vendorid,
returnFromBill: data.bills_by_pk.id, returnFromBill: data.bills_by_pk.id,
invoiceNumber: data.bills_by_pk.invoice_number, invoiceNumber: data.bills_by_pk.invoice_number,

View File

@@ -60,7 +60,7 @@ export function BillsListTableComponent({
)} )}
<BillDeleteButton bill={record} jobid={job.id} /> <BillDeleteButton bill={record} jobid={job.id} />
<BillDetailEditReturnComponent <BillDetailEditReturnComponent
data={{ bills_by_pk: { ...record, jobid: job.id } }} data={{ bills_by_pk: { ...record, jobid: job.id, job: job } }}
disabled={ disabled={
record.is_credit_memo || record.is_credit_memo ||
record.vendorid === bodyshop.inhousevendorid || record.vendorid === bodyshop.inhousevendorid ||

View File

@@ -1,8 +1,8 @@
import React, { useState } from "react";
import { Button, Form, InputNumber, Popover } from "antd";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { useTranslation } from "react-i18next";
import { CalculatorFilled } from "@ant-design/icons"; import { CalculatorFilled } from "@ant-design/icons";
import { Button, Form, InputNumber, Popover, Space } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function CABCpvrtCalculator({ disabled, form }) { export default function CABCpvrtCalculator({ disabled, form }) {
const [visibility, setVisibility] = useState(false); const [visibility, setVisibility] = useState(false);
@@ -26,10 +26,14 @@ export default function CABCpvrtCalculator({ disabled, form }) {
<Form.Item name="days" label={t("jobs.labels.ca_bc_pvrt.days")}> <Form.Item name="days" label={t("jobs.labels.ca_bc_pvrt.days")}>
<InputNumber precision={0} min={0} /> <InputNumber precision={0} min={0} />
</Form.Item> </Form.Item>
<Button type="primary" htmlType="submit"> <div style={{ display: "flex", justifyContent: "flex-end" }}>
{t("general.actions.calculate")} <Space>
</Button> <Button type="primary" htmlType="submit">
<Button onClick={() => setVisibility(false)}>Close</Button> {t("general.actions.calculate")}
</Button>
<Button onClick={() => setVisibility(false)}>Close</Button>
</Space>
</div>
</Form> </Form>
</div> </div>
); );

View File

@@ -10,11 +10,15 @@ import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel
import CourtesyCarReadiness from "../courtesy-car-readiness-select/courtesy-car-readiness-select.component"; import CourtesyCarReadiness from "../courtesy-car-readiness-select/courtesy-car-readiness-select.component";
import CourtesyCarStatus from "../courtesy-car-status-select/courtesy-car-status-select.component"; import CourtesyCarStatus from "../courtesy-car-status-select/courtesy-car-status-select.component";
import FormDatePicker from "../form-date-picker/form-date-picker.component"; import FormDatePicker from "../form-date-picker/form-date-picker.component";
//import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component"; import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component";
export default function CourtesyCarCreateFormComponent({ form, saveLoading }) { export default function CourtesyCarCreateFormComponent({
form,
saveLoading,
newCC,
}) {
const { t } = useTranslation(); const { t } = useTranslation();
const client = useApolloClient(); const client = useApolloClient();
@@ -33,7 +37,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
} }
/> />
{/* <FormFieldsChanged form={form} /> */} {newCC ? null : <FormFieldsChanged form={form} />}
<LayoutFormRow header={t("courtesycars.labels.vehicle")}> <LayoutFormRow header={t("courtesycars.labels.vehicle")}>
<Form.Item <Form.Item
label={t("courtesycars.fields.year")} label={t("courtesycars.fields.year")}

View File

@@ -1,5 +1,5 @@
import { useQuery } from "@apollo/client"; import { useQuery } from "@apollo/client";
import { Col, Divider, Row, Skeleton, Space, Timeline, Typography } from "antd"; import { Col, Row, Skeleton, Timeline, Typography } from "antd";
import React from "react"; import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
@@ -31,15 +31,27 @@ export default function JobLinesExpander({ jobline, jobid }) {
{data.parts_order_lines.length > 0 ? ( {data.parts_order_lines.length > 0 ? (
data.parts_order_lines.map((line) => ( data.parts_order_lines.map((line) => (
<Timeline.Item key={line.id}> <Timeline.Item key={line.id}>
<Space split={<Divider type="vertical" />} wrap> <Row wrap>
<Link <Col span={4}>
to={`/manage/jobs/${jobid}?partsorderid=${line.parts_order.id}`} <Link
> to={`/manage/jobs/${jobid}?partsorderid=${line.parts_order.id}`}
{line.parts_order.order_number} >
</Link> {line.parts_order.order_number}
<DateFormatter>{line.parts_order.order_date}</DateFormatter> </Link>
{line.parts_order.vendor.name} </Col>
</Space> <Col span={4}>
<DateFormatter>{line.parts_order.order_date}</DateFormatter>
</Col>
<Col span={4}>{line.parts_order.vendor.name}</Col>
{line.backordered_eta ? (
<Col span={4}>
<span>
{`${t("parts_orders.fields.backordered_eta")}: `}
<DateFormatter>{line.backordered_eta}</DateFormatter>
</span>
</Col>
) : null}
</Row>
</Timeline.Item> </Timeline.Item>
)) ))
) : ( ) : (
@@ -71,7 +83,7 @@ export default function JobLinesExpander({ jobline, jobid }) {
</Col> </Col>
<Col span={4}> <Col span={4}>
<span> <span>
{`${t("billlines.fields.actual_cost")}: `} {`${t("billlines.fields.actual_cost")}: `}
<CurrencyFormatter>{line.actual_cost}</CurrencyFormatter> <CurrencyFormatter>{line.actual_cost}</CurrencyFormatter>
</span> </span>
</Col> </Col>
@@ -84,7 +96,7 @@ export default function JobLinesExpander({ jobline, jobid }) {
)) ))
) : ( ) : (
<Timeline.Item> <Timeline.Item>
{t("parts_orders.labels.notyetordered")} {t("bills.labels.nobilllines")}
</Timeline.Item> </Timeline.Item>
)} )}
</Timeline> </Timeline>

View File

@@ -1,17 +1,17 @@
import { DeleteFilled, WarningFilled, DownOutlined } from "@ant-design/icons"; import { DeleteFilled, DownOutlined, WarningFilled } from "@ant-design/icons";
import { useTreatments } from "@splitsoftware/splitio-react"; import { useTreatments } from "@splitsoftware/splitio-react";
import { import {
Checkbox,
Divider, Divider,
Dropdown,
Form, Form,
Input, Input,
InputNumber, InputNumber,
Menu,
Radio, Radio,
Select,
Space, Space,
Tag, Tag,
Select,
Menu,
Dropdown,
Checkbox,
} from "antd"; } from "antd";
import React from "react"; import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@@ -255,7 +255,7 @@ export function PartsOrderModalComponent({
}, },
]} ]}
> >
<InputNumber /> <InputNumber min={1} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t("parts_orders.fields.act_price")} label={t("parts_orders.fields.act_price")}

View File

@@ -7,10 +7,12 @@ import { createStructuredSelector } from "reselect";
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
import { setModalContext } from "../../redux/modals/modals.actions"; import { setModalContext } from "../../redux/modals/modals.actions";
import { selectPayment } from "../../redux/modals/modals.selectors";
import { selectCurrentUser } from "../../redux/user/user.selectors"; import { selectCurrentUser } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({ const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser, currentUser: selectCurrentUser,
paymentModal: selectPayment,
}); });
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({
@@ -24,6 +26,7 @@ const PaymentMarkForExportButton = ({
refetch, refetch,
setPaymentContext, setPaymentContext,
currentUser, currentUser,
paymentModal,
}) => { }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [insertExportLog, { loading: exportLogLoading }] = const [insertExportLog, { loading: exportLogLoading }] =
@@ -65,16 +68,22 @@ const PaymentMarkForExportButton = ({
refetch, refetch,
}, },
context: { context: {
...paymentModal.context,
...payment, ...payment,
exportedat: today, exportedat: today,
}, },
}); });
if (refetch) if (refetch) {
refetch( if (paymentModal.context.refetchRequiresContext) {
paymentUpdateResponse && refetch(
paymentUpdateResponse.data.update_payments.returning[0] paymentUpdateResponse &&
); paymentUpdateResponse.data.update_payments.returning[0]
);
} else {
refetch();
}
}
} else { } else {
notification["error"]({ notification["error"]({
message: t("payments.errors.exporting", { message: t("payments.errors.exporting", {

View File

@@ -1,5 +1,4 @@
import { useMutation } from "@apollo/client"; import { useMutation } from "@apollo/client";
import { Button, Form, Modal, notification, Space } from "antd"; import { Button, Form, Modal, notification, Space } from "antd";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@@ -97,16 +96,21 @@ function PaymentModalContainer({
}); });
if (!!!updatedPayment.errors) { if (!!!updatedPayment.errors) {
notification["success"]({ message: t("payments.successes.payment") }); notification["success"]({ message: t("payments.successes.paymentupdate") });
} else { } else {
notification["error"]({ message: t("payments.errors.payment") }); notification["error"]({ message: t("payments.errors.paymentupdate") });
} }
} }
if (actions.refetch) if (actions.refetch) {
actions.refetch( if (context.refetchRequiresContext) {
updatedPayment && updatedPayment.data.update_payments.returning[0] actions.refetch(
); updatedPayment && updatedPayment.data.update_payments.returning[0]
);
} else {
actions.refetch();
}
}
if (enterAgain) { if (enterAgain) {
const prev = form.getFieldsValue(["date"]); const prev = form.getFieldsValue(["date"]);
@@ -159,7 +163,7 @@ function PaymentModalContainer({
}} }}
afterClose={() => form.resetFields()} afterClose={() => form.resetFields()}
footer={ footer={
<span> <Space>
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button> <Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
<Button loading={loading} onClick={() => form.submit()}> <Button loading={loading} onClick={() => form.submit()}>
{t("general.actions.save")} {t("general.actions.save")}
@@ -175,7 +179,7 @@ function PaymentModalContainer({
{t("general.actions.saveandnew")} {t("general.actions.saveandnew")}
</Button> </Button>
)} )}
</span> </Space>
} }
> >
{!context || (context && !context.id) ? null : ( {!context || (context && !context.id) ? null : (

View File

@@ -3,15 +3,25 @@ import { Button, notification } from "antd";
import React from "react"; import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; import { UPDATE_PAYMENT } from "../../graphql/payments.queries";
import { setModalContext } from "../../redux/modals/modals.actions"; import { setModalContext } from "../../redux/modals/modals.actions";
import { selectPayment } from "../../redux/modals/modals.selectors";
const mapStateToProps = createStructuredSelector({
paymentModal: selectPayment,
});
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({
setPaymentContext: (context) => setPaymentContext: (context) =>
dispatch(setModalContext({ context: context, modal: "payment" })), dispatch(setModalContext({ context: context, modal: "payment" })),
}); });
const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => { const PaymentReexportButton = ({
paymentModal,
payment,
refetch,
setPaymentContext,
}) => {
const { t } = useTranslation(); const { t } = useTranslation();
const [updatePayment, { loading }] = useMutation(UPDATE_PAYMENT); const [updatePayment, { loading }] = useMutation(UPDATE_PAYMENT);
@@ -35,15 +45,21 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
refetch, refetch,
}, },
context: { context: {
...paymentModal.context,
...payment, ...payment,
exportedat: null, exportedat: null,
}, },
}); });
if (refetch) if (refetch) {
refetch( if (paymentModal.context.refetchRequiresContext) {
paymentUpdateResponse && refetch(
paymentUpdateResponse.data.update_payments.returning[0] paymentUpdateResponse &&
); paymentUpdateResponse.data.update_payments.returning[0]
);
} else {
refetch();
}
}
} else { } else {
notification["error"]({ notification["error"]({
message: t("payments.errors.exporting", { message: t("payments.errors.exporting", {
@@ -64,4 +80,7 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
); );
}; };
export default connect(null, mapDispatchToProps)(PaymentReexportButton); export default connect(
mapStateToProps,
mapDispatchToProps
)(PaymentReexportButton);

View File

@@ -14,11 +14,11 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
import CurrencyFormatter from "../../utils/CurrencyFormatter"; import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter"; import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter";
import { TemplateList } from "../../utils/TemplateConstants"; import { TemplateList } from "../../utils/TemplateConstants";
import { pageLimit } from "../../utils/config";
import { alphaSort } from "../../utils/sorters"; import { alphaSort } from "../../utils/sorters";
import CaBcEtfTableModalContainer from "../ca-bc-etf-table-modal/ca-bc-etf-table-modal.container"; import CaBcEtfTableModalContainer from "../ca-bc-etf-table-modal/ca-bc-etf-table-modal.container";
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component"; import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component"; import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
import {pageLimit} from "../../utils/config";
const mapStateToProps = createStructuredSelector({ const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser //currentUser: selectCurrentUser
@@ -184,7 +184,10 @@ export function PaymentsListPaginated({
} }
: refetch, : refetch,
}, },
context: apolloResults ? apolloResults : record, context: {
...(apolloResults ? apolloResults : record),
refetchRequiresContext: true,
},
}); });
}} }}
> >

View File

@@ -6,6 +6,7 @@ import {
notification, notification,
Popover, Popover,
Radio, Radio,
Space,
} from "antd"; } from "antd";
import React, { useState } from "react"; import React, { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
@@ -115,10 +116,16 @@ export function PrintCenterJobsLabels({ bodyshop, jobId }) {
> >
<InputNumber min={1} precision={0} max={99} /> <InputNumber min={1} precision={0} max={99} />
</Form.Item> </Form.Item>
<Button type="primary" loading={loading} onClick={handleOk}> <div style={{ display: "flex", justifyContent: "flex-end" }}>
{t("general.actions.print")} <Space>
</Button> <Button type="primary" loading={loading} onClick={handleOk}>
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button> {t("general.actions.print")}
</Button>
<Button onClick={handleCancel}>
{t("general.actions.cancel")}
</Button>
</Space>
</div>
</Form> </Form>
</Card> </Card>
); );

View File

@@ -1,5 +1,5 @@
import Icon from "@ant-design/icons"; import Icon from "@ant-design/icons";
import { Popover } from "antd"; import { Popover, Space } from "antd";
import _ from "lodash"; import _ from "lodash";
import moment from "moment"; import moment from "moment";
import React, { useMemo } from "react"; import React, { useMemo } from "react";
@@ -69,19 +69,22 @@ export function ScheduleCalendarHeaderComponent({
{loadData && loadData.allJobsOut ? ( {loadData && loadData.allJobsOut ? (
loadData.allJobsOut.map((j) => ( loadData.allJobsOut.map((j) => (
<tr key={j.id}> <tr key={j.id}>
<td> <td style={{ padding: "2.5px" }}>
<Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link> <Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link> (
{j.status})
</td> </td>
<td> <td style={{ padding: "2.5px" }}>
<OwnerNameDisplay ownerObject={j} /> <OwnerNameDisplay ownerObject={j} />
</td> </td>
<td> <td style={{ padding: "2.5px" }}>
{`(${( {`(${j.labhrs.aggregate.sum.mod_lb_hrs.toFixed(
1
)}/${j.larhrs.aggregate.sum.mod_lb_hrs.toFixed(1)}/${(
j.labhrs.aggregate.sum.mod_lb_hrs + j.labhrs.aggregate.sum.mod_lb_hrs +
j.larhrs.aggregate.sum.mod_lb_hrs j.larhrs.aggregate.sum.mod_lb_hrs
).toFixed(1)} ${t("general.labels.hours")})`} ).toFixed(1)} ${t("general.labels.hours")})`}
</td> </td>
<td> <td style={{ padding: "2.5px" }}>
<DateTimeFormatter> <DateTimeFormatter>
{j.scheduled_completion} {j.scheduled_completion}
</DateTimeFormatter> </DateTimeFormatter>
@@ -90,7 +93,9 @@ export function ScheduleCalendarHeaderComponent({
)) ))
) : ( ) : (
<tr> <tr>
<td>{t("appointments.labels.nocompletingjobs")}</td> <td style={{ padding: "2.5px" }}>
{t("appointments.labels.nocompletingjobs")}
</td>
</tr> </tr>
)} )}
</tbody> </tbody>
@@ -105,27 +110,30 @@ export function ScheduleCalendarHeaderComponent({
{loadData && loadData.allJobsIn ? ( {loadData && loadData.allJobsIn ? (
loadData.allJobsIn.map((j) => ( loadData.allJobsIn.map((j) => (
<tr key={j.id}> <tr key={j.id}>
<td> <td style={{ padding: "2.5px" }}>
<Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link> <Link to={`/manage/jobs/${j.id}`}>{j.ro_number}</Link>
{j.status}
</td> </td>
<td> <td style={{ padding: "2.5px" }}>
<OwnerNameDisplay ownerObject={j} /> <OwnerNameDisplay ownerObject={j} />
</td> </td>
<td> <td style={{ padding: "2.5px" }}>
{`(${( {`(${j.labhrs.aggregate.sum.mod_lb_hrs.toFixed(
1
)}/${j.larhrs.aggregate.sum.mod_lb_hrs.toFixed(1)}/${(
j.labhrs.aggregate.sum.mod_lb_hrs + j.labhrs.aggregate.sum.mod_lb_hrs +
j.larhrs.aggregate.sum.mod_lb_hrs j.larhrs.aggregate.sum.mod_lb_hrs
).toFixed(1)} ${t("general.labels.hours")})`} ).toFixed(1)} ${t("general.labels.hours")})`}
</td> </td>
<td> <td style={{ padding: "2.5px" }}>
<DateTimeFormatter>{j.scheduled_in}</DateTimeFormatter> <DateTimeFormatter>{j.scheduled_in}</DateTimeFormatter>
</td> </td>
</tr> </tr>
)) ))
) : ( ) : (
<tr> <tr>
<td>{t("appointments.labels.noarrivingjobs")}</td> <td style={{ padding: "2.5px" }}>
{t("appointments.labels.noarrivingjobs")}
</td>
</tr> </tr>
)} )}
</tbody> </tbody>
@@ -136,25 +144,32 @@ export function ScheduleCalendarHeaderComponent({
const LoadComponent = loadData ? ( const LoadComponent = loadData ? (
<div> <div>
<div className="imex-flex-row imex-flex-row__flex-space-around"> <div className="imex-flex-row imex-flex-row__flex-space-around">
<Popover <Space>
placement={"bottom"} <Popover
content={jobsInPopup} placement={"bottom"}
trigger="hover" content={jobsInPopup}
title={t("appointments.labels.arrivingjobs")} trigger="hover"
> title={t("appointments.labels.arrivingjobs")}
<Icon component={MdFileDownload} style={{ color: "green" }} /> >
{(loadData.allHoursIn || 0) && loadData.allHoursIn.toFixed(2)} <Icon component={MdFileDownload} style={{ color: "green" }} />
</Popover> {(loadData.allHoursInBody || 0) &&
<Popover loadData.allHoursInBody.toFixed(1)}
placement={"bottom"} /
content={jobsOutPopup} {(loadData.allHoursInRefinish || 0) &&
trigger="hover" loadData.allHoursInRefinish.toFixed(1)}
title={t("appointments.labels.completingjobs")} /{(loadData.allHoursIn || 0) && loadData.allHoursIn.toFixed(1)}
> </Popover>
<Icon component={MdFileUpload} style={{ color: "red" }} /> <Popover
{(loadData.allHoursOut || 0) && loadData.allHoursOut.toFixed(2)} placement={"bottom"}
</Popover> content={jobsOutPopup}
<ScheduleCalendarHeaderGraph loadData={loadData} /> trigger="hover"
title={t("appointments.labels.completingjobs")}
>
<Icon component={MdFileUpload} style={{ color: "red" }} />
{(loadData.allHoursOut || 0) && loadData.allHoursOut.toFixed(1)}
</Popover>
<ScheduleCalendarHeaderGraph loadData={loadData} />
</Space>
</div> </div>
<div> <div>
<ul style={{ listStyleType: "none", columns: "2 auto", padding: 0 }}> <ul style={{ listStyleType: "none", columns: "2 auto", padding: 0 }}>

View File

@@ -46,7 +46,7 @@ export const QUERY_AVAILABLE_CC = gql`
`; `;
export const CHECK_CC_FLEET_NUMBER = gql` export const CHECK_CC_FLEET_NUMBER = gql`
query CHECK_VENDOR_NAME($name: String!) { query CHECK_CC_FLEET_NUMBER($name: String!) {
courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) { courtesycars_aggregate(where: { fleetnumber: { _ilike: $name } }) {
aggregate { aggregate {
count count

View File

@@ -172,6 +172,12 @@ export const UPDATE_JOB_LINE = gql`
id id
notes notes
mod_lbr_ty mod_lbr_ty
mod_lb_hrs
part_type
op_code_desc
prt_dsmk_m
prt_dsmk_p
tax_part
part_qty part_qty
db_price db_price
act_price act_price

View File

@@ -2205,6 +2205,8 @@ export const GET_JOB_LINE_ORDERS = gql`
parts_order_lines(where: { job_line_id: { _eq: $joblineid } }) { parts_order_lines(where: { job_line_id: { _eq: $joblineid } }) {
id id
act_price act_price
backordered_eta
backordered_on
parts_order { parts_order {
id id
order_date order_date

View File

@@ -241,7 +241,7 @@ export function BillsListPage({
extra={ extra={
<Space wrap> <Space wrap>
{search.search && ( {search.search && (
<> <Space align="center">
<Typography.Title level={4}> <Typography.Title level={4}>
{t("general.labels.searchresults", { search: search.search })} {t("general.labels.searchresults", { search: search.search })}
</Typography.Title> </Typography.Title>
@@ -254,7 +254,7 @@ export function BillsListPage({
> >
{t("general.actions.clear")} {t("general.actions.clear")}
</Button> </Button>
</> </Space>
)} )}
<Button onClick={() => refetch()}> <Button onClick={() => refetch()}>
<SyncOutlined /> <SyncOutlined />

View File

@@ -76,7 +76,11 @@ export function CourtesyCarCreateContainer({
onFinish={handleFinish} onFinish={handleFinish}
layout="vertical" layout="vertical"
> >
<CourtesyCarFormComponent form={form} saveLoading={loading} /> <CourtesyCarFormComponent
form={form}
saveLoading={loading}
newCC={true}
/>
</Form> </Form>
</RbacWrapper> </RbacWrapper>
); );

View File

@@ -131,7 +131,12 @@ export function* calculateScheduleLoad({ payload: end }) {
(load[itemDate].allHoursIn || 0) + (load[itemDate].allHoursIn || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs + item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs; item.larhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].allHoursInBody =
(load[itemDate].allHoursInBody || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].allHoursInRefinish =
(load[itemDate].allHoursInRefinish || 0) +
item.larhrs.aggregate.sum.mod_lb_hrs;
//If the job hasn't already arrived, add it to the jobs in list. //If the job hasn't already arrived, add it to the jobs in list.
// Make sure it also hasn't already been completed, or isn't an in and out job. // Make sure it also hasn't already been completed, or isn't an in and out job.
//This prevents the duplicate counting. //This prevents the duplicate counting.
@@ -142,6 +147,12 @@ export function* calculateScheduleLoad({ payload: end }) {
(load[itemDate].hoursIn || 0) + (load[itemDate].hoursIn || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs + item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs; item.larhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].hoursInBody =
(load[itemDate].hoursInBody || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].hoursInRefinish =
(load[itemDate].hoursInRefinish || 0) +
item.larhrs.aggregate.sum.mod_lb_hrs;
} }
} else { } else {
load[itemDate] = { load[itemDate] = {
@@ -152,10 +163,18 @@ export function* calculateScheduleLoad({ payload: end }) {
allHoursIn: allHoursIn:
item.labhrs.aggregate.sum.mod_lb_hrs + item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs, item.larhrs.aggregate.sum.mod_lb_hrs,
allHoursInBody: item.labhrs.aggregate.sum.mod_lb_hrs,
allHoursInRefinish: item.larhrs.aggregate.sum.mod_lb_hrs,
hoursIn: AddJobForSchedulingCalc hoursIn: AddJobForSchedulingCalc
? item.labhrs.aggregate.sum.mod_lb_hrs + ? item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs item.larhrs.aggregate.sum.mod_lb_hrs
: 0, : 0,
hoursInBody: AddJobForSchedulingCalc
? item.labhrs.aggregate.sum.mod_lb_hrs
: 0,
hoursInRefinish: AddJobForSchedulingCalc
? item.larhrs.aggregate.sum.mod_lb_hrs
: 0,
}; };
} }
}); });
@@ -179,6 +198,12 @@ export function* calculateScheduleLoad({ payload: end }) {
(load[itemDate].allHoursOut || 0) + (load[itemDate].allHoursOut || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs + item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs; item.larhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].allHoursOutBody =
(load[itemDate].allHoursOutBody || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].allHoursOutRefinish =
(load[itemDate].allHoursOutRefinish || 0) +
item.larhrs.aggregate.sum.mod_lb_hrs;
//Add only the jobs that are still in production to get rid of. //Add only the jobs that are still in production to get rid of.
//If it's not in production, we'd subtract unnecessarily. //If it's not in production, we'd subtract unnecessarily.
load[itemDate].allJobsOut.push(item); load[itemDate].allJobsOut.push(item);
@@ -189,6 +214,12 @@ export function* calculateScheduleLoad({ payload: end }) {
(load[itemDate].hoursOut || 0) + (load[itemDate].hoursOut || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs + item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs; item.larhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].hoursOutBody =
(load[itemDate].hoursOutBody || 0) +
item.labhrs.aggregate.sum.mod_lb_hrs;
load[itemDate].hoursOutRefinish =
(load[itemDate].hoursOutRefinish || 0) +
item.larhrs.aggregate.sum.mod_lb_hrs;
} }
} else { } else {
load[itemDate] = { load[itemDate] = {
@@ -201,6 +232,8 @@ export function* calculateScheduleLoad({ payload: end }) {
allHoursOut: allHoursOut:
item.labhrs.aggregate.sum.mod_lb_hrs + item.labhrs.aggregate.sum.mod_lb_hrs +
item.larhrs.aggregate.sum.mod_lb_hrs, item.larhrs.aggregate.sum.mod_lb_hrs,
allHoursOutBody: item.labhrs.aggregate.sum.mod_lb_hrs,
allHoursOutRefinish: item.larhrs.aggregate.sum.mod_lb_hrs,
}; };
} }
}); });

View File

@@ -217,8 +217,9 @@
"markexported": "Mark Exported", "markexported": "Mark Exported",
"markforreexport": "Mark for Re-export", "markforreexport": "Mark for Re-export",
"new": "New Bill", "new": "New Bill",
"nobilllines": "This part has not yet been recieved.",
"noneselected": "No bill selected.", "noneselected": "No bill selected.",
"onlycmforinvoiced": "Only credit memos can be entered for any Job that has been invoiced, exported, or voided.", "onlycmforinvoiced": "Only credit memos can be entered for any Job that has been invoiced, exported, or voided.",
"printlabels": "Print Labels", "printlabels": "Print Labels",
"retailtotal": "Bills Retail Total", "retailtotal": "Bills Retail Total",
"savewithdiscrepancy": "You are about to save this bill with a discrepancy. The system will continue to use the calculated amount using the bill lines. Press cancel to return to the bill.", "savewithdiscrepancy": "You are about to save this bill with a discrepancy. The system will continue to use the calculated amount using the bill lines. Press cancel to return to the bill.",
@@ -2332,6 +2333,7 @@
"markexported": "Payment(s) marked exported.", "markexported": "Payment(s) marked exported.",
"markreexported": "Payment marked for re-export successfully", "markreexported": "Payment marked for re-export successfully",
"payment": "Payment created successfully. ", "payment": "Payment created successfully. ",
"paymentupdate": "Payment updated successfully. ",
"stripe": "Credit card transaction charged successfully." "stripe": "Credit card transaction charged successfully."
} }
}, },

View File

@@ -2331,6 +2331,7 @@
"markexported": "", "markexported": "",
"markreexported": "", "markreexported": "",
"payment": "", "payment": "",
"paymentupdate": "",
"stripe": "" "stripe": ""
} }
}, },

View File

@@ -2331,6 +2331,7 @@
"markexported": "", "markexported": "",
"markreexported": "", "markreexported": "",
"payment": "", "payment": "",
"paymentupdate": "",
"stripe": "" "stripe": ""
} }
}, },

View File

@@ -969,6 +969,7 @@
- md_rbac - md_rbac
- md_referral_sources - md_referral_sources
- md_responsibility_centers - md_responsibility_centers
- md_ro_guard
- md_ro_statuses - md_ro_statuses
- md_tasks_presets - md_tasks_presets
- md_to_emails - md_to_emails
@@ -1068,6 +1069,7 @@
- md_rbac - md_rbac
- md_referral_sources - md_referral_sources
- md_responsibility_centers - md_responsibility_centers
- md_ro_guard
- md_ro_statuses - md_ro_statuses
- md_tasks_presets - md_tasks_presets
- md_to_emails - md_to_emails

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."bodyshops" add column "md_ro_guard" jsonb
-- null default jsonb_build_object();

View File

@@ -0,0 +1,2 @@
alter table "public"."bodyshops" add column "md_ro_guard" jsonb
null default jsonb_build_object();