Merged in IO-2841-Non-Parts-in-jobline_status (pull request #1516)
IO-2841 Non-Parts listed in Jobline_Status Approved-by: Dave Richer
This commit is contained in:
@@ -26,6 +26,16 @@ export function JobDetailCardsPartsComponent({ loading, data, jobRO }) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { joblines_status } = data;
|
const { joblines_status } = data;
|
||||||
|
|
||||||
|
const filteredJobLines = data.joblines.filter(
|
||||||
|
(j) =>
|
||||||
|
j.part_type !== null &&
|
||||||
|
j.part_type !== "PAE" &&
|
||||||
|
j.part_type !== "PAS" &&
|
||||||
|
j.part_type !== "PASL" &&
|
||||||
|
j.part_qty !== 0 &&
|
||||||
|
j.act_price !== 0
|
||||||
|
);
|
||||||
|
//TODO: Correct jobline_statuses view by including the part_qty !== 0 and act_price !== 0
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: t("joblines.fields.line_desc"),
|
title: t("joblines.fields.line_desc"),
|
||||||
@@ -95,7 +105,7 @@ export function JobDetailCardsPartsComponent({ loading, data, jobRO }) {
|
|||||||
<div>
|
<div>
|
||||||
<CardTemplate loading={loading} title={t("jobs.labels.cards.parts")}>
|
<CardTemplate loading={loading} title={t("jobs.labels.cards.parts")}>
|
||||||
<PartsStatusPie joblines_status={joblines_status} />
|
<PartsStatusPie joblines_status={joblines_status} />
|
||||||
<Table key="id" columns={columns} dataSource={data ? data.joblines : []} />
|
<Table key="id" columns={columns} dataSource={filteredJobLines ? filteredJobLines : []} />
|
||||||
</CardTemplate>
|
</CardTemplate>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
10
hasura/migrations/1720712957502_run_sql_migration/down.sql
Normal file
10
hasura/migrations/1720712957502_run_sql_migration/down.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- CREATE OR REPLACE VIEW "public"."joblines_status" AS
|
||||||
|
-- SELECT j.jobid,
|
||||||
|
-- j.status,
|
||||||
|
-- count(1) AS count,
|
||||||
|
-- j.part_type
|
||||||
|
-- FROM joblines j
|
||||||
|
-- WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND (j.part_qty <> 0) AND (j.act_price <> 0) AND (j.removed IS FALSE))
|
||||||
|
-- GROUP BY j.jobid, j.status, j.part_type;
|
||||||
8
hasura/migrations/1720712957502_run_sql_migration/up.sql
Normal file
8
hasura/migrations/1720712957502_run_sql_migration/up.sql
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
CREATE OR REPLACE VIEW "public"."joblines_status" AS
|
||||||
|
SELECT j.jobid,
|
||||||
|
j.status,
|
||||||
|
count(1) AS count,
|
||||||
|
j.part_type
|
||||||
|
FROM joblines j
|
||||||
|
WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND (j.part_qty <> 0) AND (j.act_price <> 0) AND (j.removed IS FALSE))
|
||||||
|
GROUP BY j.jobid, j.status, j.part_type;
|
||||||
10
hasura/migrations/1720713022389_run_sql_migration/down.sql
Normal file
10
hasura/migrations/1720713022389_run_sql_migration/down.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- CREATE OR REPLACE VIEW "public"."joblines_status" AS
|
||||||
|
-- SELECT j.jobid,
|
||||||
|
-- j.status,
|
||||||
|
-- count(1) AS count,
|
||||||
|
-- j.part_type
|
||||||
|
-- FROM joblines j
|
||||||
|
-- WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND (j.part_qty <> (0)::numeric) AND (j.act_price <> (0)::numeric) AND (j.removed IS FALSE))
|
||||||
|
-- GROUP BY j.jobid, j.status, j.part_type;
|
||||||
8
hasura/migrations/1720713022389_run_sql_migration/up.sql
Normal file
8
hasura/migrations/1720713022389_run_sql_migration/up.sql
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
CREATE OR REPLACE VIEW "public"."joblines_status" AS
|
||||||
|
SELECT j.jobid,
|
||||||
|
j.status,
|
||||||
|
count(1) AS count,
|
||||||
|
j.part_type
|
||||||
|
FROM joblines j
|
||||||
|
WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND (j.part_qty <> (0)::numeric) AND (j.act_price <> (0)::numeric) AND (j.removed IS FALSE))
|
||||||
|
GROUP BY j.jobid, j.status, j.part_type;
|
||||||
Reference in New Issue
Block a user