Various samll bugfixes.

This commit is contained in:
Patrick Fic
2020-09-16 12:36:31 -07:00
parent 223cf35244
commit 2e99a2eee2
11 changed files with 89 additions and 38 deletions

View File

@@ -1,12 +1,15 @@
import React from "react";
import { PrinterFilled } from "@ant-design/icons";
import { useTranslation } from "react-i18next";
export default function JobChecklistTemplateItem({
templateKey,
renderTemplate,
}) {
const { t } = useTranslation();
return (
<div>
{templateKey}
{t(`printcenter.jobs.${templateKey}`)}
<PrinterFilled onClick={() => renderTemplate(templateKey)} />
</div>
);

View File

@@ -38,17 +38,17 @@ export default function JobsAvailableComponent({
};
const columns = [
{
title: t("jobs.fields.cieca_id"),
dataIndex: "cieca_id",
key: "cieca_id",
//width: "8%",
// onFilter: (value, record) => record.ro_number.includes(value),
// filteredValue: state.filteredInfo.text || null,
sorter: (a, b) => alphaSort(a, b),
sortOrder:
state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order,
},
// {
// title: t("jobs.fields.cieca_id"),
// dataIndex: "cieca_id",
// key: "cieca_id",
// //width: "8%",
// // onFilter: (value, record) => record.ro_number.includes(value),
// // filteredValue: state.filteredInfo.text || null,
// sorter: (a, b) => alphaSort(a, b),
// sortOrder:
// state.sortedInfo.columnKey === "cieca_id" && state.sortedInfo.order,
// },
{
title: t("jobs.fields.owner"),
dataIndex: "ownr_name",
@@ -78,6 +78,16 @@ export default function JobsAvailableComponent({
//width: "12%",
//ellipsis: true
},
{
title: t("jobs.fields.ins_co_nm"),
dataIndex: "ins_co_nm",
key: "ins_co_nm",
sorter: (a, b) => alphaSort(a.ins_co_nm, b.ins_co_nm),
sortOrder:
state.sortedInfo.columnKey === "ins_co_nm" && state.sortedInfo.order,
//width: "12%",
//ellipsis: true
},
{
title: t("jobs.fields.clm_total"),
dataIndex: "clm_amt",

View File

@@ -50,7 +50,14 @@ export function JobsCloseLines({ bodyshop, joblines }) {
>
<ReadOnlyFormItem type="currency" />
</Form.Item>
<Form.Item
span={2}
label={t("joblines.fields.op_code_desc")}
key={`${index}op_code_desc`}
name={[field.name, "op_code_desc"]}
>
<ReadOnlyFormItem />
</Form.Item>
<Form.Item
span={2}
label={t("joblines.fields.mod_lbr_ty")}

View File

@@ -52,8 +52,9 @@ export function LaborAllocationsTable({ joblines, timetickets, bodyshop }) {
<Col span={6}>
<strong
style={{
color: Math.round(t.total - t.claimed) > 0 ? "green" : "red",
}}>
color: t.total - t.claimed > 0 ? "green" : "red",
}}
>
{(t.total - t.claimed).toFixed(2)}
</strong>
</Col>

View File

@@ -11,20 +11,21 @@ export default function OwnerTagPopoverComponent({ job }) {
<Col span={12}>
<Descriptions
title={t("owners.labels.fromclaim")}
size='small'
column={1}>
<Descriptions.Item key='1' label={t("jobs.fields.owner")}>{`${
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='2' label={t("jobs.fields.ownr_ph1")}>
<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")}>
<Descriptions.Item key="3" label={t("owners.fields.address")}>
{`${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")}>
<Descriptions.Item key="4" label={t("owners.fields.ownr_ea")}>
{job.ownr_ea || ""}
{
//TODO Should add an email formatter.
@@ -35,24 +36,25 @@ export default function OwnerTagPopoverComponent({ job }) {
<Col span={12}>
<Descriptions
title={t("owners.labels.fromowner")}
size='small'
column={1}>
<Descriptions.Item key='1' label={t("jobs.fields.owner")}>{`${
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='2' label={t("jobs.fields.ownr_ph1")}>
<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")}>
<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 || ""
} `}
</Descriptions.Item>
<Descriptions.Item key='4' label={t("owners.fields.ownr_ea")}>
<Descriptions.Item key="4" label={t("owners.fields.ownr_ea")}>
{job.owner.ownr_ea || ""}
{
//TODO Should add an email formatter.
@@ -68,11 +70,13 @@ export default function OwnerTagPopoverComponent({ job }) {
);
return (
<Popover placement='bottom' content={content}>
<Tag color='cyan'>
{job.owner
? `${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln || ""}`
: t("jobs.errors.noowner")}
<Popover placement="bottom" content={content}>
<Tag color="cyan">
<Link to={`/manage/owners/${job.owner.id}`}>
{job.owner
? `${job.ownr_co_nm || ""}${job.ownr_fn || ""} ${job.ownr_ln || ""}`
: t("jobs.errors.noowner")}
</Link>
</Tag>
</Popover>
);