Added filteringa nd sorting on reporting screen. RPS-36

This commit is contained in:
Patrick Fic
2020-10-29 15:47:50 -07:00
parent 3fa78b383d
commit 0bb53bd1be

View File

@@ -11,6 +11,8 @@ import {
selectReportLoading,
selectScorecard,
} from "../../../redux/reporting/reporting.selectors";
import { alphaSort } from "../../../util/sorters";
import moment from "moment";
const { ipcRenderer } = window;
@@ -41,21 +43,34 @@ export function ReportingJobsListMolecule({
{text}
</Link>
),
sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
},
{
title: "Close Date",
dataIndex: "close_date",
key: "close_date",
render: (text, record) => moment(record.close_date).format("MM/DD/yyyy"),
defaultSortOrder: "ascend",
sorter: (a, b) =>
moment(a.close_date).unix() - moment(b.close_date).unix(),
},
{
title: "Ins Co.",
dataIndex: "ins_co_nm",
key: "ins_co_nm",
sorter: (a, b) => alphaSort(a.ins_co_nm, b.ins_co_nm),
},
{
title: "First Name",
dataIndex: "ownr_fn",
key: "ownr_fn",
sorter: (a, b) => alphaSort(a.ownr_fn, b.ownr_fn),
},
{
title: "Last Name",
dataIndex: "ownr_ln",
key: "ownr_ln",
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
},
{
title: "Vehicle",
@@ -72,12 +87,14 @@ export function ReportingJobsListMolecule({
title: "Database Price Sum",
dataIndex: "dbPriceSum",
key: "dbPriceSum",
sorter: (a, b) => a.dbPriceSum.getAmount() - b.dbPriceSum.getAmount(),
render: (text, record) => record.dbPriceSum.toFormat(),
},
{
title: "Actual Price Sum ",
dataIndex: "actPriceSum",
key: "actPriceSum",
sorter: (a, b) => a.actPriceSum.getAmount() - b.actPriceSum.getAmount(),
render: (text, record) => record.actPriceSum.toFormat(),
},
{
@@ -104,7 +121,7 @@ export function ReportingJobsListMolecule({
color: record.jobRpsPc > record.jobTarget ? "seagreen" : "tomato",
}}
>
{`${(record.jobRpsPc * 100).toFixed(1)}% / ${(
{`${(record.jobRpsPc * 100 || 0).toFixed(1)}% / ${(
record.jobTarget * 100
).toFixed(1)}%`}
</span>
@@ -163,7 +180,6 @@ export function ReportingJobsListMolecule({
{scoreCard && scoreCard.allJobsSumDbPrice.toFormat()}
</Table.Summary.Cell>
<Table.Summary.Cell index={6}>
{" "}
{scoreCard && scoreCard.allJobsSumActPrice.toFormat()}
</Table.Summary.Cell>
<Table.Summary.Cell index={7}></Table.Summary.Cell>