diff --git a/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx
index 92e875f99..a567918f5 100644
--- a/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx
+++ b/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx
@@ -26,6 +26,16 @@ export function JobDetailCardsPartsComponent({ loading, data, jobRO }) {
const { t } = useTranslation();
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 = [
{
title: t("joblines.fields.line_desc"),
@@ -95,7 +105,7 @@ export function JobDetailCardsPartsComponent({ loading, data, jobRO }) {
);
diff --git a/hasura/migrations/1720712957502_run_sql_migration/down.sql b/hasura/migrations/1720712957502_run_sql_migration/down.sql
new file mode 100644
index 000000000..25f6a61a9
--- /dev/null
+++ b/hasura/migrations/1720712957502_run_sql_migration/down.sql
@@ -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;
diff --git a/hasura/migrations/1720712957502_run_sql_migration/up.sql b/hasura/migrations/1720712957502_run_sql_migration/up.sql
new file mode 100644
index 000000000..8ffd417d5
--- /dev/null
+++ b/hasura/migrations/1720712957502_run_sql_migration/up.sql
@@ -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;
diff --git a/hasura/migrations/1720713022389_run_sql_migration/down.sql b/hasura/migrations/1720713022389_run_sql_migration/down.sql
new file mode 100644
index 000000000..6e9bfe3ec
--- /dev/null
+++ b/hasura/migrations/1720713022389_run_sql_migration/down.sql
@@ -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;
diff --git a/hasura/migrations/1720713022389_run_sql_migration/up.sql b/hasura/migrations/1720713022389_run_sql_migration/up.sql
new file mode 100644
index 000000000..109db1e8e
--- /dev/null
+++ b/hasura/migrations/1720713022389_run_sql_migration/up.sql
@@ -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;