Further refinement on jobs detail screen on header. BOD-155

This commit is contained in:
Patrick Fic
2020-06-11 16:29:55 -07:00
parent 4e5c305f95
commit 230b45847a
18 changed files with 319 additions and 305 deletions

View File

@@ -8,3 +8,17 @@
flex: 1;
}
}
.imex-flex-row {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
&__grow {
flex: 1;
}
&__margin {
margin: 0.2rem 0.2rem;
}
}

View File

@@ -2,7 +2,7 @@ import { Tag, Popover } from "antd";
import React from "react";
import Barcode from "react-barcode";
import { useTranslation } from "react-i18next";
export default function BarcodePopupComponent({ value }) {
export default function BarcodePopupComponent({ value, children }) {
const { t } = useTranslation();
return (
<div>
@@ -10,12 +10,11 @@ export default function BarcodePopupComponent({ value }) {
content={
<Barcode
value={value}
background="transparent"
background='transparent'
displayValue={false}
/>
}
>
<Tag>{t("general.labels.barcode")}</Tag>
}>
{children ? children : <Tag>{t("general.labels.barcode")}</Tag>}
</Popover>
</div>
);

View File

@@ -266,7 +266,7 @@ function Header({
{currentUser.displayName || t("general.labels.unknown")}
</div>
}>
<Menu.Item onClick={() => signOutStart()}>
<Menu.Item danger onClick={() => signOutStart()}>
{t("user.actions.signout")}
</Menu.Item>
<Menu.Item>

View File

@@ -1,5 +1,5 @@
import { SyncOutlined } from "@ant-design/icons";
import { Button, Checkbox, Descriptions, Table } from "antd";
import { Button, Checkbox, Descriptions, Table, Input, Typography } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -12,22 +12,29 @@ import { alphaSort } from "../../utils/sorters";
const mapDispatchToProps = (dispatch) => ({
setPartsOrderContext: (context) =>
dispatch(setModalContext({ context: context, modal: "partsOrder" })),
setInvoiceEnterContext: (context) =>
dispatch(setModalContext({ context: context, modal: "invoiceEnter" })),
setReconciliationContext: (context) =>
dispatch(setModalContext({ context: context, modal: "reconciliation" })),
});
export function InvoicesListTableComponent({
job,
loading,
invoices,
invoicesQuery,
selectedInvoice,
handleOnRowClick,
refetch,
setPartsOrderContext,
setInvoiceEnterContext,
setReconciliationContext,
}) {
const { t } = useTranslation();
const [state, setState] = useState({
sortedInfo: {},
});
const invoices = invoicesQuery.data ? invoicesQuery.data.invoices : [];
const { refetch } = invoicesQuery;
const columns = [
{
title: t("invoices.fields.vendorname"),
@@ -51,7 +58,6 @@ export function InvoicesListTableComponent({
title: t("invoices.fields.date"),
dataIndex: "date",
key: "date",
sorter: (a, b) => a.date - b.date,
sortOrder:
state.sortedInfo.columnKey === "date" && state.sortedInfo.order,
@@ -61,7 +67,6 @@ export function InvoicesListTableComponent({
title: t("invoices.fields.total"),
dataIndex: "total",
key: "total",
sorter: (a, b) => a.total - b.total,
sortOrder:
state.sortedInfo.columnKey === "total" && state.sortedInfo.order,
@@ -212,27 +217,25 @@ export function InvoicesListTableComponent({
return (
<div>
<Descriptions
title={`${t("invoices.fields.invoice_number")} ${
record.invoice_number
}`}>
<Typography.Title level={3}>{`${t("invoices.fields.invoice_number")} ${
record.invoice_number
}`}</Typography.Title>
<Descriptions>
<Descriptions.Item label={t("invoices.fields.federal_tax_rate")}>
{record.federal_tax_rate || ""}
{`${record.federal_tax_rate}%` || ""}
</Descriptions.Item>
<Descriptions.Item label={t("invoices.fields.state_tax_rate")}>
{record.state_tax_rate || ""}
{`${record.state_tax_rate}%` || ""}
</Descriptions.Item>
<Descriptions.Item label={t("invoices.fields.local_tax_rate")}>
{record.local_tax_rate || ""}
</Descriptions.Item>
<Descriptions.Item label={t("invoices.fields.is_credit_memo")}>
<Checkbox disabled checked={record.is_credit_memo || false} />
{`${record.local_tax_rate}%` || ""}
</Descriptions.Item>
</Descriptions>
<Table
size='small'
scroll={{ x: "50%", y: "40rem" }}
pagination={{ position: "top", defaultPageSize: 25 }}
columns={columns.map((item) => ({ ...item }))}
columns={columns}
rowKey='id'
dataSource={record.invoicelines}
/>
@@ -245,12 +248,45 @@ export function InvoicesListTableComponent({
loading={loading}
size='small'
title={() => (
<div>
<div className='imex-table-header'>
<Button onClick={() => refetch()}>
<SyncOutlined />
</Button>
<Button
onClick={() => {
setInvoiceEnterContext({
actions: { refetch: invoicesQuery.refetch },
context: {
job,
},
});
}}>
{t("jobs.actions.postInvoices")}
</Button>
<Button
onClick={() => {
setReconciliationContext({
actions: { refetch: invoicesQuery.refetch },
context: {
job,
invoices:
(invoicesQuery.data && invoicesQuery.data.invoices) || [],
},
});
}}>
{t("jobs.actions.reconcile")}
</Button>{" "}
<div className='imex-table-header__search'>
<Input.Search
placeholder={t("general.labels.search")}
onChange={(e) => {
e.preventDefault();
}}
/>
</div>
</div>
)}
scroll={{ x: "50%", y: "40rem" }}
expandedRowRender={rowExpander}
pagination={{ position: "top", defaultPageSize: 25 }}
columns={columns}

View File

@@ -2,7 +2,7 @@ import {
EditFilled,
FileImageFilled,
PrinterFilled,
ShoppingFilled,
ShoppingFilled
} from "@ant-design/icons";
import { useQuery } from "@apollo/react-hooks";
import { Button, PageHeader, Tag } from "antd";

View File

@@ -1,12 +1,17 @@
import React from "react";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import { Statistic, Descriptions } from "antd";
import { useTranslation } from "react-i18next";
import { Statistic } from "antd";
import Dinero from "dinero.js";
import React from "react";
import { useTranslation } from "react-i18next";
import AlertComponent from "../alert/alert.component";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import "./job-invoices-total.styles.scss";
export default function JobInvoiceTotals({ loading, invoices, jobTotals }) {
const { t } = useTranslation();
if (loading) return <LoadingSkeleton />;
if (!!!jobTotals)
return (
<AlertComponent type='error' message={t("jobs.errors.nofinancial")} />
);
const totals = JSON.parse(jobTotals);
let invoiceTotals = Dinero({ amount: 0 });
@@ -24,44 +29,26 @@ export default function JobInvoiceTotals({ loading, invoices, jobTotals }) {
const discrepancy = Dinero(totals.parts.parts.total).subtract(invoiceTotals);
return (
<div>
<Descriptions
bordered
size='small'
column={1}
title={t("jobs.labels.partssubletstotal")}>
<Descriptions.Item label={t("jobs.labels.partstotal")}>
<Statistic
value={Dinero(totals.parts.parts.total).toFormat()}
suffix={`(${Dinero(
totals.parts.parts.subtotal
).toFormat()} ± ${Dinero(
totals.parts.parts.adjustments
).toFormat()})`}
/>
</Descriptions.Item>
<Descriptions.Item label={t("jobs.labels.subletstotal")}>
<Statistic
value={Dinero(totals.parts.sublets.total).toFormat()}
suffix={`(${Dinero(
totals.parts.sublets.subtotal
).toFormat()} ± ${Dinero(
totals.parts.sublets.adjustments
).toFormat()})`}
/>
</Descriptions.Item>
<Descriptions.Item label={t("invoices.labels.retailtotal")}>
<Statistic value={invoiceTotals.toFormat()} />
</Descriptions.Item>
<Descriptions.Item label={t("invoices.labels.discrepancy")}>
<Statistic
valueStyle={{
color: discrepancy.getAmount === 0 ? "green" : "red",
}}
value={discrepancy.toFormat()}
/>
</Descriptions.Item>
</Descriptions>
<div className='job-invoices-totals-container'>
<Statistic
title={t("jobs.labels.partstotal")}
value={Dinero(totals.parts.parts.total).toFormat()}
/>
<Statistic
title={t("jobs.labels.subletstotal")}
value={Dinero(totals.parts.sublets.total).toFormat()}
/>
<Statistic
title={t("invoices.labels.retailtotal")}
value={invoiceTotals.toFormat()}
/>
<Statistic
title={t("invoices.labels.discrepancy")}
valueStyle={{
color: discrepancy.getAmount === 0 ? "green" : "red",
}}
value={discrepancy.toFormat()}
/>
</div>
);
}

View File

@@ -0,0 +1,7 @@
.job-invoices-totals-container {
margin: 0rem 2rem;
display: flex;
flex-direction: column;
justify-content: space-evenly;
flex-wrap: wrap;
}

View File

@@ -1,12 +1,12 @@
import { Col, Descriptions, Row, Statistic } from "antd";
import { Statistic } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import { CalculateJob } from "./job-totals.utility";
import "./job-totals-table.styles.scss";
import { CalculateJob } from "./job-totals.utility";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser

View File

@@ -1,9 +1,9 @@
import { Col, Divider, Form, Input, InputNumber, Row } from "antd";
import { Col, Form, Input, Row } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import JobTotalsTable from "../job-totals-table/job-totals-table.component";
import FormRow from "../layout-form-row/layout-form-row.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
export default function JobsDetailFinancials({ job }) {
const { t } = useTranslation();

View File

@@ -6,18 +6,19 @@ import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { Link, useHistory } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import { setModalContext } from "../../redux/modals/modals.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import AddToProduction from "./jobs-detail-header-actions.addtoproduction.util";
import DuplicateJob from "./jobs-detail-header-actions.duplicate.util";
import { setModalContext } from "../../redux/modals/modals.actions";
import JobsDetaiLheaderCsi from "./jobs-detail-header-actions.csi.component";
import DuplicateJob from "./jobs-detail-header-actions.duplicate.util";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
setScheduleContext: (context) =>
dispatch(setModalContext({ context: context, modal: "schedule" })),
setInvoiceEnterContext: (context) =>
dispatch(setModalContext({ context: context, modal: "invoiceEnter" })),
});
@@ -26,35 +27,47 @@ export function JobsDetailHeaderActions({
job,
bodyshop,
refetch,
setScheduleContext,
setInvoiceEnterContext,
}) {
const { t } = useTranslation();
const client = useApolloClient();
const history = useHistory();
const statusmenu = (
<Menu key="popovermenu">
<Menu.Item key="cccontract">
<Menu key='popovermenu'>
<Menu.Item
onClick={() => {
setScheduleContext({
actions: { refetch: refetch },
context: {
jobId: job.id,
job: job,
},
});
}}>
{t("jobs.actions.schedule")}
</Menu.Item>
<Menu.Item key='cccontract'>
<Link
to={{
pathname: "/manage/courtesycars/contracts/new",
state: { jobId: job.id },
}}
>
}}>
{t("menus.jobsactions.newcccontract")}
</Link>
</Menu.Item>
<Menu.Item
key="addtoproduction"
key='addtoproduction'
disabled={!!!job.converted || !!job.inproduction}
onClick={() => AddToProduction(client, job.id, refetch)}
>
onClick={() => AddToProduction(client, job.id, refetch)}>
{t("jobs.actions.addtoproduction")}
</Menu.Item>
<Menu.Item key="duplicatejob">
<Menu.Item key='duplicatejob'>
<Popconfirm
title={t("jobs.labels.duplicateconfirm")}
okText="Yes"
cancelText="No"
okText='Yes'
cancelText='No'
onClick={(e) => e.stopPropagation()}
onConfirm={() =>
DuplicateJob(
@@ -66,13 +79,12 @@ export function JobsDetailHeaderActions({
}
)
}
getPopupContainer={(trigger) => trigger.parentNode}
>
getPopupContainer={(trigger) => trigger.parentNode}>
{t("menus.jobsactions.duplicate")}
</Popconfirm>
</Menu.Item>
<Menu.Item
key="postinvoices"
key='postinvoices'
onClick={() => {
setInvoiceEnterContext({
actions: { refetch: refetch },
@@ -80,16 +92,14 @@ export function JobsDetailHeaderActions({
job: job,
},
});
}}
>
}}>
{t("jobs.actions.postInvoices")}
</Menu.Item>
<Menu.Item key="closejob">
<Menu.Item key='closejob'>
<Link
to={{
pathname: `/manage/jobs/${job.id}/close`,
}}
>
}}>
{t("menus.jobsactions.closejob")}
</Link>
</Menu.Item>
@@ -97,7 +107,11 @@ export function JobsDetailHeaderActions({
</Menu>
);
return (
<Dropdown overlay={statusmenu} trigger={["click"]} key="changestatus">
<Dropdown
className='imex-flex-row__margin'
overlay={statusmenu}
trigger={["click"]}
key='changestatus'>
<Button>
{t("general.labels.actions")} <DownCircleFilled />
</Button>

View File

@@ -1,7 +1,5 @@
import { DownCircleFilled, PrinterFilled } from "@ant-design/icons";
import {
Avatar,
Badge,
Button,
Checkbox,
Descriptions,
@@ -9,7 +7,7 @@ import {
Menu,
notification,
PageHeader,
Tag,
Tag
} from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -17,20 +15,19 @@ import Moment from "react-moment";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import CarImage from "../../assets/car.svg";
import { setModalContext } from "../../redux/modals/modals.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import BarcodePopup from "../barcode-popup/barcode-popup.component";
import JobsDetailHeaderActions from "../jobs-detail-header-actions/jobs-detail-header-actions.component";
import OwnerTagPopoverComponent from "../owner-tag-popover/owner-tag-popover.component";
import VehicleTagPopoverComponent from "../vehicle-tag-popover/vehicle-tag-popover.component";
import JobsDetailHeaderActions from "../jobs-detail-header-actions/jobs-detail-header-actions.component";
import { setModalContext } from "../../redux/modals/modals.actions";
import "./jobs-detail-header.styles.scss";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
setScheduleContext: (context) =>
dispatch(setModalContext({ context: context, modal: "schedule" })),
setPrintCenterContext: (context) =>
dispatch(setModalContext({ context: context, modal: "printCenter" })),
});
@@ -46,143 +43,124 @@ export function JobsDetailHeader({
}) {
const { t } = useTranslation();
const tombstoneTitle = (
<div>
<Avatar size="large" alt="Vehicle Image" src={CarImage} />
{job.ro_number
? `${t("jobs.fields.ro_number")} ${job.ro_number}`
: `EST-${job.est_number}`}
</div>
);
const statusmenu = (
<Menu
onClick={(e) => {
updateJobStatus(e.key);
}}
>
}}>
{bodyshop.md_ro_statuses.statuses.map((item) => (
<Menu.Item key={item}>{item}</Menu.Item>
))}
</Menu>
);
const menuExtra = [
<Dropdown overlay={statusmenu} trigger={["click"]} key="changestatus">
<Button>
{t("jobs.actions.changestatus")} <DownCircleFilled />
</Button>
</Dropdown>,
<Button
onClick={() => {
setPrintCenterContext({
actions: { refetch: refetch },
context: {
id: job.id,
type: "job",
},
});
}}
key="printing"
>
<PrinterFilled />
{t("jobs.actions.printCenter")}
</Button>,
<Badge key="schedule" count={job.appointments_aggregate.aggregate.count}>
const menuExtra = (
<div className='imex-flex-row'>
<Dropdown
className='imex-flex-row__margin'
overlay={statusmenu}
trigger={["click"]}
key='changestatus'>
<Button>
{t("jobs.actions.changestatus")} <DownCircleFilled />
</Button>
</Dropdown>
<Button
//TODO Enabled logic based on status.
className='imex-flex-row__margin'
onClick={() => {
setScheduleContext({
setPrintCenterContext({
actions: { refetch: refetch },
context: {
jobId: job.id,
job: job,
id: job.id,
type: "job",
},
});
}}
>
{t("jobs.actions.schedule")}
key='printing'>
<PrinterFilled />
{t("jobs.actions.printCenter")}
</Button>
</Badge>,
<Button
key="convert"
type="dashed"
disabled={job.converted}
onClick={() => {
mutationConvertJob({
variables: { jobId: job.id },
}).then((r) => {
refetch();
<Button
key='convert'
className='imex-flex-row__margin'
type='danger'
style={{ display: job.converted ? "none" : "" }}
disabled={job.converted}
onClick={() => {
mutationConvertJob({
variables: { jobId: job.id },
}).then((r) => {
refetch();
notification["success"]({
message: t("jobs.successes.converted"),
notification["success"]({
message: t("jobs.successes.converted"),
});
});
});
}}
>
{t("jobs.actions.convert")}
</Button>,
<JobsDetailHeaderActions key="actions" job={job} refetch={refetch} />,
<Button type="primary" key="submit" htmlType="submit">
{t("general.actions.save")}
</Button>,
];
}}>
{t("jobs.actions.convert")}
</Button>
<JobsDetailHeaderActions key='actions' job={job} refetch={refetch} />
<Button
type='primary'
className='imex-flex-row__margin'
key='submit'
htmlType='submit'>
{t("general.actions.save")}
</Button>
</div>
);
return (
<PageHeader
style={{
border: "1px solid rgb(235, 237, 240)",
}}
title={tombstoneTitle}
//subTitle={tombstoneSubtitle}
tags={
<span key="job-status">
{job.status ? <Tag color="blue">{job.status}</Tag> : null}
{job.inproduction ? (
<Tag color="#f50">{t("jobs.labels.inproduction")}</Tag>
) : null}
<OwnerTagPopoverComponent job={job} />
<VehicleTagPopoverComponent job={job} />
<BarcodePopup value={job.id} />
</span>
title={
job.ro_number
? `${t("jobs.fields.ro_number")} ${job.ro_number}`
: `${t("jobs.fields.est_number")} ${job.est_number}`
}
extra={menuExtra}
>
<Descriptions size="small" column={5}>
<Descriptions.Item key="total" label={t("jobs.fields.repairtotal")}>
subTitle={job.status}
tags={[
<OwnerTagPopoverComponent key='owner' job={job} />,
<VehicleTagPopoverComponent key='vehicle' job={job} />,
<Tag
color='#f50'
key='production'
style={{ display: job.inproduction ? "" : "none" }}>
{t("jobs.labels.inproduction")}
</Tag>,
]}
extra={menuExtra}>
<Descriptions size='small' column={5}>
<Descriptions.Item key='total' label={t("jobs.fields.repairtotal")}>
<CurrencyFormatter>{job.clm_total}</CurrencyFormatter>
</Descriptions.Item>
<Descriptions.Item
key="custowing"
label={t("jobs.fields.customerowing")}
>
key='custowing'
label={t("jobs.fields.customerowing")}>
<CurrencyFormatter>{job.owner_owing}</CurrencyFormatter>
</Descriptions.Item>
<Descriptions.Item
key="scp"
label={t("jobs.fields.specialcoveragepolicy")}
>
key='scp'
label={t("jobs.fields.specialcoveragepolicy")}>
<Checkbox checked={job.special_coverage_policy} />
</Descriptions.Item>
<Descriptions.Item
key="sched_comp"
label={t("jobs.fields.scheduled_completion")}
>
key='sched_comp'
label={t("jobs.fields.scheduled_completion")}>
{job.scheduled_completion ? (
<Moment format="MM/DD/YYYY">{job.scheduled_completion}</Moment>
<Moment format='MM/DD/YYYY'>{job.scheduled_completion}</Moment>
) : null}
</Descriptions.Item>
<Descriptions.Item key="servicecar" label={t("jobs.fields.servicecar")}>
<Descriptions.Item key='servicecar' label={t("jobs.fields.servicecar")}>
{job.cccontracts &&
job.cccontracts.map((item) => (
<Link
key={item.id}
to={`/manage/courtesycars/contracts/${item.id}`}
>
to={`/manage/courtesycars/contracts/${item.id}`}>
<div>{`${item.agreementnumber} - ${item.start} - ${item.scheduledreturn}`}</div>
</Link>
))}

View File

@@ -0,0 +1,8 @@
.jobs-title-container {
display: block;
}
.jobs-subtitle-tags {
display: flex;
flex-wrap: wrap;
}

View File

@@ -1,76 +1,57 @@
import { Button } from "antd";
import { Col, Row } from "antd";
import React from "react";
import { connect } from "react-redux";
import { setModalContext } from "../../redux/modals/modals.actions";
import AlertComponent from "../alert/alert.component";
import InvoicesListTableComponent from "../invoices-list-table/invoices-list-table.component";
import JobInvoicesTotalsComponent from "../job-invoices-total/job-invoices-total.component";
import { useTranslation } from "react-i18next";
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
import PartsOrderModal from "../parts-order-modal/parts-order-modal.container";
const tableCol = {
xs: {
span: 24,
},
md: {
span: 20,
},
};
const mapDispatchToProps = (dispatch) => ({
setInvoiceEnterContext: (context) =>
dispatch(setModalContext({ context: context, modal: "invoiceEnter" })),
setReconciliationContext: (context) =>
dispatch(setModalContext({ context: context, modal: "reconciliation" })),
});
const totalsCol = {
xs: {
span: 24,
},
md: {
span: 4,
},
};
export function JobsDetailPliComponent({
setInvoiceEnterContext,
setReconciliationContext,
export default function JobsDetailPliComponent({
job,
invoicesQuery,
handleOnRowClick,
selectedInvoice,
}) {
const { t } = useTranslation();
return (
<div>
<PartsOrderModalContainer />
<Button
onClick={() => {
setInvoiceEnterContext({
actions: { refetch: invoicesQuery.refetch || null },
context: {
job,
},
});
}}>
{t("jobs.actions.postInvoices")}
</Button>
<Button
onClick={() => {
setReconciliationContext({
actions: { refetch: invoicesQuery.refetch },
context: {
job,
invoices: invoicesQuery.data && invoicesQuery.data.invoices,
},
});
}}>
{t("jobs.actions.reconcile")}
</Button>
<PartsOrderModal />
{invoicesQuery.error ? (
<AlertComponent message={invoicesQuery.error.message} type='error' />
) : null}
<JobInvoicesTotalsComponent
invoices={invoicesQuery.data ? invoicesQuery.data.invoices : null}
loading={invoicesQuery.loading}
jobTotals={job.job_totals}
/>
<InvoicesListTableComponent
job={job}
loading={invoicesQuery.loading}
handleOnRowClick={handleOnRowClick}
selectedInvoice={selectedInvoice}
invoices={invoicesQuery.data ? invoicesQuery.data.invoices : null}
refetch={invoicesQuery.refetch}
/>
<Row>
<Col {...tableCol}>
<InvoicesListTableComponent
job={job}
loading={invoicesQuery.loading}
handleOnRowClick={handleOnRowClick}
selectedInvoice={selectedInvoice}
invoicesQuery={invoicesQuery}
/>
</Col>
<Col {...totalsCol}>
<JobInvoicesTotalsComponent
invoices={invoicesQuery.data ? invoicesQuery.data.invoices : []}
loading={invoicesQuery.loading}
jobTotals={job.job_totals}
/>
</Col>
</Row>
</div>
);
}
export default connect(null, mapDispatchToProps)(JobsDetailPliComponent);

View File

@@ -1,9 +1,9 @@
import React from "react";
import { useQuery } from "@apollo/react-hooks";
import JobsDetailPliComponent from "./jobs-detail-pli.component";
import { QUERY_INVOICES_BY_JOBID } from "../../graphql/invoices.queries";
import { useHistory, useLocation } from "react-router-dom";
import queryString from "query-string";
import React from "react";
import { useHistory, useLocation } from "react-router-dom";
import { QUERY_INVOICES_BY_JOBID } from "../../graphql/invoices.queries";
import JobsDetailPliComponent from "./jobs-detail-pli.component";
export default function JobsDetailPliContainer({ job }) {
const invoicesQuery = useQuery(QUERY_INVOICES_BY_JOBID, {

View File

@@ -13,19 +13,16 @@ export default function OwnerTagPopoverComponent({ job }) {
title={t("owners.labels.fromclaim")}
size='small'
column={1}>
<Descriptions.Item
key='1'
label={t("jobs.fields.owner")}>{`${job.ownr_fn ||
""} ${job.ownr_ln || ""} ${job.ownr_co_nm ||
""}`}</Descriptions.Item>
<Descriptions.Item key='1' label={t("jobs.fields.owner")}>{`${
job.ownr_fn || ""
} ${job.ownr_ln || ""} ${job.ownr_co_nm || ""}`}</Descriptions.Item>
<Descriptions.Item key='2' label={t("jobs.fields.ownr_ph1")}>
<PhoneFormatter>{job.ownr_ph1 || ""}</PhoneFormatter>
</Descriptions.Item>
<Descriptions.Item key='3' label={t("owners.fields.address")}>
{`${job.ownr_addr1 || ""} ${job.ownr_addr2 ||
""} ${job.ownr_city || ""} ${job.ownr_st ||
""} ${job.ownr_zip || ""} ${job.ownr_ctry ||
""} ${job.ownr_city || ""}`}
{`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
job.ownr_city || ""
} ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
</Descriptions.Item>
<Descriptions.Item key='4' label={t("owners.fields.ownr_ea")}>
{job.ownr_ea || ""}
@@ -40,17 +37,20 @@ export default function OwnerTagPopoverComponent({ job }) {
title={t("owners.labels.fromowner")}
size='small'
column={1}>
<Descriptions.Item key='1' label={t("jobs.fields.owner")}>{`${job
.owner.ownr_fn || ""} ${job.owner.ownr_ln || ""} ${job.owner
.ownr_co_nm || ""}`}</Descriptions.Item>
<Descriptions.Item key='1' label={t("jobs.fields.owner")}>{`${
job.owner.ownr_fn || ""
} ${job.owner.ownr_ln || ""} ${
job.owner.ownr_co_nm || ""
}`}</Descriptions.Item>
<Descriptions.Item key='2' label={t("jobs.fields.ownr_ph1")}>
<PhoneFormatter>{job.owner.ownr_ph1 || ""}</PhoneFormatter>
</Descriptions.Item>
<Descriptions.Item key='3' label={t("owners.fields.address")}>
{`${job.owner.ownr_addr1 || ""} ${job.owner.ownr_addr2 ||
""} ${job.owner.ownr_city || ""} ${job.owner.ownr_st ||
""} ${job.owner.ownr_zip || ""} ${job.owner.ownr_ctry ||
""} ${job.owner.ownr_city || ""}`}
{`${job.owner.ownr_addr1 || ""} ${job.owner.ownr_addr2 || ""} ${
job.owner.ownr_city || ""
} ${job.owner.ownr_st || ""} ${job.owner.ownr_zip || ""} ${
job.owner.ownr_ctry || ""
} `}
</Descriptions.Item>
<Descriptions.Item key='4' label={t("owners.fields.ownr_ea")}>
{job.owner.ownr_ea || ""}

View File

@@ -11,22 +11,21 @@ export default function VehicleTagPopoverComponent({ job }) {
<Col span={12}>
<Descriptions
title={t("owners.labels.fromclaim")}
size="small"
column={1}
>
<Descriptions.Item key="1" label={t("jobs.fields.vehicle")}>
size='small'
column={1}>
<Descriptions.Item key='1' label={t("jobs.fields.vehicle")}>
{`${job.v_model_yr || t("general.labels.na")}
${job.v_make_desc || t("general.labels.na")}
${job.v_model_desc || t("general.labels.na")}`}
</Descriptions.Item>
<Descriptions.Item key="2" label={t("vehicles.fields.plate_no")}>
<Descriptions.Item key='2' label={t("vehicles.fields.plate_no")}>
{`${job.plate_no || t("general.labels.na")}`}
</Descriptions.Item>
<Descriptions.Item key="3" label={t("vehicles.fields.plate_st")}>
<Descriptions.Item key='3' label={t("vehicles.fields.plate_st")}>
{`${job.plate_st || t("general.labels.na")}`}
</Descriptions.Item>
<Descriptions.Item key="4" label={t("vehicles.fields.v_vin")}>
<Descriptions.Item key='4' label={t("vehicles.fields.v_vin")}>
{`${job.v_vin || t("general.labels.na")}`}
</Descriptions.Item>
</Descriptions>
@@ -34,22 +33,21 @@ export default function VehicleTagPopoverComponent({ job }) {
<Col span={12}>
<Descriptions
title={t("owners.labels.fromowner")}
size="small"
column={1}
>
<Descriptions.Item key="1" label={t("jobs.fields.vehicle")}>
size='small'
column={1}>
<Descriptions.Item key='1' label={t("jobs.fields.vehicle")}>
{`${job.vehicle.v_model_yr || t("general.labels.na")}
${job.vehicle.v_make_desc || t("general.labels.na")}
${job.vehicle.v_model_desc || t("general.labels.na")}`}
</Descriptions.Item>
<Descriptions.Item key="2" label={t("vehicles.fields.plate_no")}>
<Descriptions.Item key='2' label={t("vehicles.fields.plate_no")}>
{`${job.vehicle.plate_no || t("general.labels.na")}`}
</Descriptions.Item>
<Descriptions.Item key="3" label={t("vehicles.fields.plate_st")}>
<Descriptions.Item key='3' label={t("vehicles.fields.plate_st")}>
{`${job.vehicle.plate_st || t("general.labels.na")}`}
</Descriptions.Item>
<Descriptions.Item key="4" label={t("vehicles.fields.v_vin")}>
<Descriptions.Item key='4' label={t("vehicles.fields.v_vin")}>
{`${job.vehicle.v_vin || t("general.labels.na")}`}
</Descriptions.Item>
</Descriptions>
@@ -62,23 +60,21 @@ export default function VehicleTagPopoverComponent({ job }) {
);
return (
<Popover placement="bottom" content={content}>
<Tag color="green">
<Popover placement='bottom' content={content}>
<Tag color='green'>
{job.vehicleid ? (
<Link to={`/manage/vehicles/${job.vehicleid}`}>
{`${job.v_model_yr || t("general.labels.na")}
${job.v_make_desc || t("general.labels.na")}
${job.v_model_desc || t("general.labels.na")} |
${job.plate_no || t("general.labels.na")} |
${job.v_vin || t("general.labels.na")}`}
{`${job.v_model_yr || ""}
${job.v_make_desc || ""}
${job.v_model_desc || ""} |
${job.plate_no || ""}`}
</Link>
) : (
<span>
{`${job.v_model_yr || t("general.labels.na")}
${job.v_make_desc || t("general.labels.na")}
${job.v_model_desc || t("general.labels.na")} |
${job.plate_no || t("general.labels.na")} |
${job.v_vin || t("general.labels.na")}`}
{`${job.v_model_yr || ""}
${job.v_make_desc || ""}
${job.v_model_desc || ""} |
${job.plate_no || ""}`}
</span>
)}
</Tag>

View File

@@ -249,7 +249,6 @@ export const GET_JOB_BY_PK = gql`
date_exported
status
owner_owing
joblines {
id
unq_seq
@@ -277,11 +276,6 @@ export const GET_JOB_BY_PK = gql`
scheduledreturn
agreementnumber
}
appointments_aggregate {
aggregate {
count
}
}
cieca_ttl
}
}

View File

@@ -573,7 +573,7 @@
"est_ct_fn": "Appraiser First Name",
"est_ct_ln": "Appraiser Last Name",
"est_ea": "Appraiser Email",
"est_number": "Estimate Number",
"est_number": "Estimate #",
"est_ph1": "Appraiser Phone #",
"federal_tax_payable": "Federal Tax Payable",
"ins_addr1": "Insurance Co. Address",