Added joblines to repair data. Field migrations to conform to cieca standards for joblines
This commit is contained in:
@@ -462,6 +462,121 @@
|
||||
</folder_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>joblines</name>
|
||||
<children>
|
||||
<folder_node>
|
||||
<name>fields</name>
|
||||
<children>
|
||||
<concept_node>
|
||||
<name>act_price</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>db_price</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>line_desc</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>part_type</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>unq_seq</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
</children>
|
||||
</folder_node>
|
||||
<folder_node>
|
||||
<name>jobs</name>
|
||||
<children>
|
||||
|
||||
@@ -1,33 +1,69 @@
|
||||
import React, { useState } from "react";
|
||||
import { Table } from "antd";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
|
||||
export default function JobLinesComponent({ loading, joblines }) {
|
||||
export default function JobLinesComponent({ job }) {
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
filteredInfo: { text: "" }
|
||||
});
|
||||
const { t } = useTranslation();
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: "Line #",
|
||||
dataIndex: "line_ind",
|
||||
key: "line_ind",
|
||||
title: t("joblines.fields.unq_seq"),
|
||||
dataIndex: "unq_seq",
|
||||
key: "unq_seq",
|
||||
// onFilter: (value, record) => record.ro_number.includes(value),
|
||||
// filteredValue: state.filteredInfo.text || null,
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order,
|
||||
ellipsis: true
|
||||
state.sortedInfo.columnKey === "unq_seq" && state.sortedInfo.order
|
||||
//ellipsis: true
|
||||
},
|
||||
{
|
||||
title: "Description",
|
||||
title: t("joblines.fields.line_desc"),
|
||||
dataIndex: "line_desc",
|
||||
key: "line_desc",
|
||||
sorter: (a, b) => alphaSort(a, b),
|
||||
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.part_type"),
|
||||
dataIndex: "part_type",
|
||||
key: "part_type",
|
||||
sorter: (a, b) => alphaSort(a.part_type, b.part_type),
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "part_type" && state.sortedInfo.order,
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.db_price"),
|
||||
dataIndex: "db_price",
|
||||
key: "db_price",
|
||||
sorter: (a, b) => a.db_price - b.db_price,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "db_price" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
render: (text, record) => (
|
||||
<CurrencyFormatter>{record.db_price}</CurrencyFormatter>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t("joblines.fields.act_price"),
|
||||
dataIndex: "act_price",
|
||||
key: "act_price",
|
||||
sorter: (a, b) => a.act_price - b.act_price,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order,
|
||||
ellipsis: true,
|
||||
render: (text, record) => (
|
||||
<CurrencyFormatter>{record.act_price}</CurrencyFormatter>
|
||||
)
|
||||
}
|
||||
];
|
||||
|
||||
@@ -39,14 +75,13 @@ export default function JobLinesComponent({ loading, joblines }) {
|
||||
// const { value } = event.target;
|
||||
// setState({ ...state, filterinfo: { text: [value] } });
|
||||
// };
|
||||
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
size='small'
|
||||
pagination={{ position: "bottom" }}
|
||||
columns={columns.map(item => ({ ...item }))}
|
||||
rowKey='id'
|
||||
dataSource={joblines}
|
||||
dataSource={job.joblines}
|
||||
onChange={handleTableChange}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import JobLinesComponent from "./job-lines.component";
|
||||
import { useQuery } from "@apollo/react-hooks";
|
||||
import AlertComponent from "../../components/alert/alert.component";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
|
||||
import { GET_JOB_LINES_BY_PK } from "../../graphql/jobs-lines.queries";
|
||||
|
||||
@@ -16,3 +16,4 @@ export default function JobLinesContainer({ jobId }) {
|
||||
<JobLinesComponent loading={loading} joblines={data ? data.joblines : null} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -159,6 +159,23 @@ export const GET_JOB_BY_PK = gql`
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
}
|
||||
|
||||
joblines{
|
||||
id
|
||||
unq_seq
|
||||
line_ind
|
||||
line_desc
|
||||
part_type
|
||||
oem_partno
|
||||
db_price
|
||||
act_price
|
||||
part_qty
|
||||
mod_lbr_ty
|
||||
db_hrs
|
||||
mod_lb_hrs
|
||||
lbr_op
|
||||
lbr_amt
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -7,7 +7,8 @@ import {
|
||||
FaRegStickyNote,
|
||||
FaShieldAlt
|
||||
} from "react-icons/fa";
|
||||
import JobLinesContainer from "../../components/job-lines/job-lines.container.component";
|
||||
//import JobLinesContainer from "../../components/job-lines/job-lines.container";
|
||||
import JobsLines from '../../components/job-lines/job-lines.component'
|
||||
import JobsDetailClaims from "../../components/jobs-detail-claims/jobs-detail-claims.component";
|
||||
import JobsDetailFinancials from "../../components/jobs-detail-financial/jobs-detail-financial.component";
|
||||
import JobsDetailHeader from "../../components/jobs-detail-header/jobs-detail-header.component";
|
||||
@@ -94,7 +95,7 @@ export default function JobsDetailPage({
|
||||
}
|
||||
key="repairdata"
|
||||
>
|
||||
<JobLinesContainer jobId={job.id} />
|
||||
<JobsLines job={job} />
|
||||
</Tabs.TabPane>
|
||||
|
||||
<Tabs.TabPane
|
||||
|
||||
@@ -37,6 +37,15 @@
|
||||
"unsavedchanges": "You have unsaved changes."
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"fields": {
|
||||
"act_price": "Actual Price",
|
||||
"db_price": "Database Price",
|
||||
"line_desc": "Line Description",
|
||||
"part_type": "Part Type",
|
||||
"unq_seq": "Seq #"
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"actions": {
|
||||
"addDocuments": "Add Job Documents",
|
||||
|
||||
@@ -37,6 +37,15 @@
|
||||
"unsavedchanges": "Usted tiene cambios no guardados."
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"fields": {
|
||||
"act_price": "Precio actual",
|
||||
"db_price": "Precio de base de datos",
|
||||
"line_desc": "Descripción de línea",
|
||||
"part_type": "Tipo de parte",
|
||||
"unq_seq": "Seq #"
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"actions": {
|
||||
"addDocuments": "Agregar documentos de trabajo",
|
||||
|
||||
@@ -37,6 +37,15 @@
|
||||
"unsavedchanges": "Vous avez des changements non enregistrés."
|
||||
}
|
||||
},
|
||||
"joblines": {
|
||||
"fields": {
|
||||
"act_price": "Prix actuel",
|
||||
"db_price": "Prix de la base de données",
|
||||
"line_desc": "Description de la ligne",
|
||||
"part_type": "Type de pièce",
|
||||
"unq_seq": "Seq #"
|
||||
}
|
||||
},
|
||||
"jobs": {
|
||||
"actions": {
|
||||
"addDocuments": "Ajouter des documents de travail",
|
||||
|
||||
1
hasura/migrations/1580356194265_alter_line_ref/down.yaml
Normal file
1
hasura/migrations/1580356194265_alter_line_ref/down.yaml
Normal file
@@ -0,0 +1 @@
|
||||
[]
|
||||
7
hasura/migrations/1580356194265_alter_line_ref/up.yaml
Normal file
7
hasura/migrations/1580356194265_alter_line_ref/up.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
- args:
|
||||
cascade: true
|
||||
sql: "ALTER TABLE joblines ALTER COLUMN line_ref DROP DEFAULT;\r\nALTER TABLE
|
||||
joblines\r\n ALTER line_ref TYPE numeric USING CASE WHEN true THEN 0 ELSE
|
||||
0 END;\r\n \r\n ALTER\r\n TABLE joblines ALTER COLUMN line_ref
|
||||
SET DEFAULT 0;"
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."joblines" ALTER COLUMN "line_ref" SET DEFAULT 0;
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."joblines"."line_ref" IS E'null'
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
sql: ALTER TABLE "public"."joblines" ALTER COLUMN "line_ref" DROP DEFAULT;
|
||||
type: run_sql
|
||||
- args:
|
||||
sql: COMMENT ON COLUMN "public"."joblines"."line_ref" IS E''
|
||||
type: run_sql
|
||||
Reference in New Issue
Block a user