IO-1914 Add manual inventory and edit.
This commit is contained in:
@@ -5736,6 +5736,27 @@
|
|||||||
<folder_node>
|
<folder_node>
|
||||||
<name>inventory</name>
|
<name>inventory</name>
|
||||||
<children>
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>delete</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>
|
<concept_node>
|
||||||
<name>list</name>
|
<name>list</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -17371,6 +17392,48 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>edit</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>new</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>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
@@ -17399,6 +17462,74 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>fields</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>comment</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>manualinvoicenumber</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>manualvendor</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>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
<name>labels</name>
|
<name>labels</name>
|
||||||
<children>
|
<children>
|
||||||
@@ -17423,6 +17554,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>deleteconfirm</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>
|
<concept_node>
|
||||||
<name>frombillinvoicenumber</name>
|
<name>frombillinvoicenumber</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -17533,6 +17685,27 @@
|
|||||||
<folder_node>
|
<folder_node>
|
||||||
<name>successes</name>
|
<name>successes</name>
|
||||||
<children>
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>deleted</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>
|
<concept_node>
|
||||||
<name>inserted</name>
|
<name>inserted</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -17554,6 +17727,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>updated</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>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
</children>
|
</children>
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
import { DeleteFilled } from "@ant-design/icons";
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, notification, Popconfirm } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { DELETE_INVENTORY_LINE } from "../../graphql/inventory.queries";
|
||||||
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
|
|
||||||
|
export default function InventoryLineDelete({
|
||||||
|
inventoryline,
|
||||||
|
disabled,
|
||||||
|
refetch,
|
||||||
|
}) {
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [deleteInventoryLine] = useMutation(DELETE_INVENTORY_LINE);
|
||||||
|
|
||||||
|
const handleDelete = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
const result = await deleteInventoryLine({
|
||||||
|
variables: { lineId: inventoryline.id },
|
||||||
|
// update(cache, { errors }) {
|
||||||
|
// cache.modify({
|
||||||
|
// fields: {
|
||||||
|
// inventory(existingInventory, { readField }) {
|
||||||
|
// console.log(existingInventory);
|
||||||
|
// return existingInventory.filter(
|
||||||
|
// (invRef) => inventoryline.id !== readField("id", invRef)
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!!!result.errors) {
|
||||||
|
notification["success"]({ message: t("inventory.successes.deleted") });
|
||||||
|
} else {
|
||||||
|
//Check if it's an fkey violation.
|
||||||
|
|
||||||
|
notification["error"]({
|
||||||
|
message: t("bills.errors.deleting", {
|
||||||
|
error: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (refetch) refetch();
|
||||||
|
setLoading(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<RbacWrapper action="inventory:delete" noauth={<></>}>
|
||||||
|
<Popconfirm
|
||||||
|
disabled={disabled || inventoryline.consumedbybillid}
|
||||||
|
onConfirm={handleDelete}
|
||||||
|
title={t("inventory.labels.deleteconfirm")}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
disabled={disabled || inventoryline.consumedbybillid}
|
||||||
|
loading={loading}
|
||||||
|
>
|
||||||
|
<DeleteFilled />
|
||||||
|
</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
</RbacWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { EditFilled, SyncOutlined, FileAddFilled } from "@ant-design/icons";
|
||||||
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@@ -6,18 +6,28 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import InventoryBillRo from "../inventory-bill-ro/inventory-bill-ro.component";
|
import InventoryBillRo from "../inventory-bill-ro/inventory-bill-ro.component";
|
||||||
|
import InventoryLineDelete from "../inventory-line-delete/inventory-line-delete.component";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
setInventoryUpsertContext: (context) =>
|
||||||
|
dispatch(setModalContext({ context: context, modal: "inventoryUpsert" })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
export function JobsList({
|
||||||
|
bodyshop,
|
||||||
|
refetch,
|
||||||
|
loading,
|
||||||
|
jobs,
|
||||||
|
total,
|
||||||
|
setInventoryUpsertContext,
|
||||||
|
}) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const { page, sortcolumn, sortorder } = search;
|
const { page, sortcolumn, sortorder } = search;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -31,6 +41,15 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
|
|
||||||
sorter: true, //(a, b) => alphaSort(a.line_desc, b.line_desc),
|
sorter: true, //(a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
sortOrder: sortcolumn === "line_desc" && sortorder,
|
sortOrder: sortcolumn === "line_desc" && sortorder,
|
||||||
|
render: (text, record) =>
|
||||||
|
record.billline?.bill?.job ? (
|
||||||
|
<div>
|
||||||
|
<div>{text}</div>
|
||||||
|
<strong>{`(${record.billline?.bill?.job?.v_model_yr} ${record.billline?.bill?.job?.v_make_desc} ${record.billline?.bill?.job?.v_model_desc})`}</strong>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
text
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("inventory.labels.frombillinvoicenumber"),
|
title: t("inventory.labels.frombillinvoicenumber"),
|
||||||
@@ -40,7 +59,12 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
//sorter: true, // (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
//sorter: true, // (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||||
|
|
||||||
//sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
//sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
||||||
render: (text, record) => record.billline?.bill?.invoice_number,
|
render: (text, record) =>
|
||||||
|
(
|
||||||
|
(record.billline?.bill?.invoice_number || "") +
|
||||||
|
" " +
|
||||||
|
(record.manualinvoicenumber || "")
|
||||||
|
).trim(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("inventory.labels.fromvendor"),
|
title: t("inventory.labels.fromvendor"),
|
||||||
@@ -50,7 +74,12 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
//sorter: true, // (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
//sorter: true, // (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||||
|
|
||||||
//sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
//sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
||||||
render: (text, record) => record.billline?.bill?.vendor?.name,
|
render: (text, record) =>
|
||||||
|
(
|
||||||
|
(record.billline?.bill?.vendor?.name || "") +
|
||||||
|
" " +
|
||||||
|
(record.manualvendor || "")
|
||||||
|
).trim(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.actual_price"),
|
title: t("billlines.fields.actual_price"),
|
||||||
@@ -70,6 +99,11 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
<CurrencyFormatter>{record.actual_cost}</CurrencyFormatter>
|
<CurrencyFormatter>{record.actual_cost}</CurrencyFormatter>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("inventory.fields.comment"),
|
||||||
|
dataIndex: "comment",
|
||||||
|
key: "comment",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("inventory.labels.consumedbyjob"),
|
title: t("inventory.labels.consumedbyjob"),
|
||||||
dataIndex: "consumedbyjob",
|
dataIndex: "consumedbyjob",
|
||||||
@@ -85,6 +119,30 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
<InventoryBillRo inventoryline={record} />
|
<InventoryBillRo inventoryline={record} />
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("general.labels.actions"),
|
||||||
|
dataIndex: "actions",
|
||||||
|
key: "actions",
|
||||||
|
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => (
|
||||||
|
<Space wrap>
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setInventoryUpsertContext({
|
||||||
|
actions: { refetch: refetch },
|
||||||
|
context: {
|
||||||
|
existingInventory: record,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<EditFilled />
|
||||||
|
</Button>
|
||||||
|
<InventoryLineDelete inventoryline={record} refetch={refetch} />
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
@@ -113,7 +171,16 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setInventoryUpsertContext({
|
||||||
|
actions: { refetch: refetch },
|
||||||
|
context: {},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FileAddFilled />
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (search.showall) delete search.showall;
|
if (search.showall) delete search.showall;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import {
|
|||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import InventoryListPaginated from "./inventory-list.component";
|
import InventoryListPaginated from "./inventory-list.component";
|
||||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//bodyshop: selectBodyshop,
|
//bodyshop: selectBodyshop,
|
||||||
@@ -52,15 +51,13 @@ export function InventoryList({ setBreadcrumbs, setSelectedHeader }) {
|
|||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="jobs:list-all">
|
<InventoryListPaginated
|
||||||
<InventoryListPaginated
|
refetch={refetch}
|
||||||
refetch={refetch}
|
loading={loading}
|
||||||
loading={loading}
|
searchParams={searchParams}
|
||||||
searchParams={searchParams}
|
total={data ? data.search_inventory_aggregate.aggregate.count : 0}
|
||||||
total={data ? data.search_inventory_aggregate.aggregate.count : 0}
|
jobs={data ? data.search_inventory : []}
|
||||||
jobs={data ? data.search_inventory : []}
|
/>
|
||||||
/>
|
|
||||||
</RbacWrapper>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
import { Form, Input, Space } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectInventoryUpsert } from "../../redux/modals/modals.selectors";
|
||||||
|
import FormItemCurrency from "../form-items-formatted/currency-form-item.component";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
inventoryUpsertModal: selectInventoryUpsert,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(NoteUpsertModalComponent);
|
||||||
|
|
||||||
|
export function NoteUpsertModalComponent({ form, inventoryUpsertModal }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { existingInventory } = inventoryUpsertModal.context;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Space wrap>
|
||||||
|
<Form.Item
|
||||||
|
label={t("billlines.fields.line_desc")}
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
name="line_desc"
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label={t("inventory.fields.comment")} name="comment">
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
{!existingInventory && (
|
||||||
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={t("inventory.fields.manualinvoicenumber")}
|
||||||
|
name="manualinvoicenumber"
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("inventory.fields.manualvendor")}
|
||||||
|
name="manualvendor"
|
||||||
|
>
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
label={t("billlines.fields.actual_cost")}
|
||||||
|
name="actual_cost"
|
||||||
|
>
|
||||||
|
<FormItemCurrency />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
label={t("billlines.fields.actual_price")}
|
||||||
|
name="actual_price"
|
||||||
|
>
|
||||||
|
<FormItemCurrency />
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Form, Modal, notification } from "antd";
|
||||||
|
import React, { useEffect } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import {
|
||||||
|
INSERT_INVENTORY_LINE,
|
||||||
|
UPDATE_INVENTORY_LINE,
|
||||||
|
} from "../../graphql/inventory.queries";
|
||||||
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
|
import { selectInventoryUpsert } from "../../redux/modals/modals.selectors";
|
||||||
|
import {
|
||||||
|
selectBodyshop,
|
||||||
|
selectCurrentUser,
|
||||||
|
} from "../../redux/user/user.selectors";
|
||||||
|
import InventoryUpsertModal from "./inventory-upsert-modal.component";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
currentUser: selectCurrentUser,
|
||||||
|
inventoryUpsertModal: selectInventoryUpsert,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
toggleModalVisible: () => dispatch(toggleModalVisible("inventoryUpsert")),
|
||||||
|
});
|
||||||
|
|
||||||
|
export function InventoryUpsertModalContainer({
|
||||||
|
currentUser,
|
||||||
|
bodyshop,
|
||||||
|
inventoryUpsertModal,
|
||||||
|
toggleModalVisible,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [insertInventory] = useMutation(INSERT_INVENTORY_LINE);
|
||||||
|
const [updateInventoryLine] = useMutation(UPDATE_INVENTORY_LINE);
|
||||||
|
|
||||||
|
const { visible, context, actions } = inventoryUpsertModal;
|
||||||
|
const { existingInventory } = context;
|
||||||
|
const { refetch } = actions;
|
||||||
|
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
//Required to prevent infinite looping.
|
||||||
|
if (existingInventory && visible) {
|
||||||
|
form.setFieldsValue(existingInventory);
|
||||||
|
} else if (!existingInventory && visible) {
|
||||||
|
form.resetFields();
|
||||||
|
}
|
||||||
|
}, [existingInventory, form, visible]);
|
||||||
|
|
||||||
|
const handleFinish = async (formValues) => {
|
||||||
|
const values = formValues;
|
||||||
|
|
||||||
|
if (existingInventory) {
|
||||||
|
logImEXEvent("inventory_update");
|
||||||
|
|
||||||
|
updateInventoryLine({
|
||||||
|
variables: {
|
||||||
|
inventoryId: existingInventory.id,
|
||||||
|
inventoryItem: values,
|
||||||
|
},
|
||||||
|
}).then((r) => {
|
||||||
|
notification["success"]({
|
||||||
|
message: t("inventory.successes.updated"),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// if (refetch) refetch();
|
||||||
|
toggleModalVisible();
|
||||||
|
} else {
|
||||||
|
logImEXEvent("inventory_insert");
|
||||||
|
|
||||||
|
await insertInventory({
|
||||||
|
variables: {
|
||||||
|
inventoryItem: { shopid: bodyshop.id, ...values },
|
||||||
|
},
|
||||||
|
update(cache, { data }) {
|
||||||
|
cache.modify({
|
||||||
|
fields: {
|
||||||
|
inventory(existingInv) {
|
||||||
|
return [...existingInv, data.insert_inventory_one];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (refetch) refetch();
|
||||||
|
form.resetFields();
|
||||||
|
toggleModalVisible();
|
||||||
|
notification["success"]({
|
||||||
|
message: t("inventory.successes.inserted"),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title={
|
||||||
|
existingInventory
|
||||||
|
? t("inventory.actions.edit")
|
||||||
|
: t("inventory.actions.new")
|
||||||
|
}
|
||||||
|
visible={visible}
|
||||||
|
okText={t("general.actions.save")}
|
||||||
|
onOk={() => {
|
||||||
|
form.submit();
|
||||||
|
}}
|
||||||
|
onCancel={() => {
|
||||||
|
toggleModalVisible();
|
||||||
|
}}
|
||||||
|
destroyOnClose
|
||||||
|
>
|
||||||
|
<Form form={form} onFinish={handleFinish} layout="vertical">
|
||||||
|
<InventoryUpsertModal form={form} />
|
||||||
|
</Form>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(InventoryUpsertModalContainer);
|
||||||
@@ -68,5 +68,6 @@ const ret = {
|
|||||||
"users:editaccess": 4,
|
"users:editaccess": 4,
|
||||||
|
|
||||||
"inventory:list": 1,
|
"inventory:list": 1,
|
||||||
|
"inventory:delete": 2,
|
||||||
};
|
};
|
||||||
export default ret;
|
export default ret;
|
||||||
|
|||||||
@@ -3,9 +3,28 @@ import React from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
export default function ShopInfoRbacComponent({ form }) {
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
const { t } = useTranslation();
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ShopInfoRbacComponent);
|
||||||
|
|
||||||
|
export function ShopInfoRbacComponent({ form, bodyshop }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { Simple_Inventory } = useTreatments(
|
||||||
|
["Simple_Inventory"],
|
||||||
|
{},
|
||||||
|
bodyshop && bodyshop.imexshopid
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="shop:rbac">
|
<RbacWrapper action="shop:rbac">
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
@@ -633,18 +652,34 @@ export default function ShopInfoRbacComponent({ form }) {
|
|||||||
>
|
>
|
||||||
<InputNumber />
|
<InputNumber />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
{Simple_Inventory.treatment === "on" && (
|
||||||
label={t("bodyshop.fields.rbac.inventory.list")}
|
<>
|
||||||
rules={[
|
<Form.Item
|
||||||
{
|
label={t("bodyshop.fields.rbac.inventory.list")}
|
||||||
required: true,
|
rules={[
|
||||||
//message: t("general.validation.required"),
|
{
|
||||||
},
|
required: true,
|
||||||
]}
|
//message: t("general.validation.required"),
|
||||||
name={["md_rbac", "inventory:list"]}
|
},
|
||||||
>
|
]}
|
||||||
<InputNumber />
|
name={["md_rbac", "inventory:list"]}
|
||||||
</Form.Item>
|
>
|
||||||
|
<InputNumber />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.rbac.inventory.delete")}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
name={["md_rbac", "inventory:delete"]}
|
||||||
|
>
|
||||||
|
<InputNumber />
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ export const QUERY_OUTSTANDING_INVENTORY = gql`
|
|||||||
quantity
|
quantity
|
||||||
billlineid
|
billlineid
|
||||||
line_desc
|
line_desc
|
||||||
|
comment
|
||||||
|
manualinvoicenumber
|
||||||
|
manualvendor
|
||||||
|
consumedbybillid
|
||||||
billline {
|
billline {
|
||||||
bill {
|
bill {
|
||||||
invoice_number
|
invoice_number
|
||||||
@@ -83,6 +87,10 @@ export const QUERY_INVENTORY_PAGINATED = gql`
|
|||||||
line_desc
|
line_desc
|
||||||
actual_price
|
actual_price
|
||||||
actual_cost
|
actual_cost
|
||||||
|
comment
|
||||||
|
manualinvoicenumber
|
||||||
|
manualvendor
|
||||||
|
consumedbybillid
|
||||||
bill {
|
bill {
|
||||||
id
|
id
|
||||||
invoice_number
|
invoice_number
|
||||||
@@ -96,6 +104,12 @@ export const QUERY_INVENTORY_PAGINATED = gql`
|
|||||||
bill {
|
bill {
|
||||||
id
|
id
|
||||||
invoice_number
|
invoice_number
|
||||||
|
job {
|
||||||
|
id
|
||||||
|
v_make_desc
|
||||||
|
v_model_desc
|
||||||
|
v_model_yr
|
||||||
|
}
|
||||||
vendor {
|
vendor {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@@ -113,3 +127,55 @@ export const QUERY_INVENTORY_PAGINATED = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const DELETE_INVENTORY_LINE = gql`
|
||||||
|
mutation DELETE_INVENTORY_LINE($lineId: uuid!) {
|
||||||
|
delete_inventory_by_pk(id: $lineId) {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const INSERT_INVENTORY_LINE = gql`
|
||||||
|
mutation INSERT_INVENTORY_LINE($inventoryItem: inventory_insert_input!) {
|
||||||
|
insert_inventory_one(object: $inventoryItem) {
|
||||||
|
id
|
||||||
|
line_desc
|
||||||
|
consumedbybillid
|
||||||
|
billlineid
|
||||||
|
actual_price
|
||||||
|
actual_cost
|
||||||
|
comment
|
||||||
|
manualinvoicenumber
|
||||||
|
manualvendor
|
||||||
|
bill {
|
||||||
|
invoice_number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const UPDATE_INVENTORY_LINE = gql`
|
||||||
|
mutation UPDATE_INVENTORY_LINE(
|
||||||
|
$inventoryId: uuid!
|
||||||
|
$inventoryItem: inventory_set_input!
|
||||||
|
) {
|
||||||
|
update_inventory_by_pk(
|
||||||
|
pk_columns: { id: $inventoryId }
|
||||||
|
_set: $inventoryItem
|
||||||
|
) {
|
||||||
|
id
|
||||||
|
line_desc
|
||||||
|
consumedbybillid
|
||||||
|
billlineid
|
||||||
|
actual_price
|
||||||
|
actual_cost
|
||||||
|
comment
|
||||||
|
manualinvoicenumber
|
||||||
|
manualvendor
|
||||||
|
bill {
|
||||||
|
invoice_number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
setSelectedHeader,
|
setSelectedHeader,
|
||||||
} from "../../redux/application/application.actions";
|
} from "../../redux/application/application.actions";
|
||||||
import InventoryList from "../../components/inventory-list/inventory-list.container";
|
import InventoryList from "../../components/inventory-list/inventory-list.container";
|
||||||
|
import InventoryUpsertModalContainer from "../../components/inventory-upsert-modal/inventory-upsert-modal.container";
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
setBreadcrumbs: (breadcrumbs) => dispatch(setBreadcrumbs(breadcrumbs)),
|
||||||
@@ -24,6 +25,7 @@ export function InventoryPage({ setBreadcrumbs, setSelectedHeader }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<RbacWrapper action="inventory:list">
|
<RbacWrapper action="inventory:list">
|
||||||
|
<InventoryUpsertModalContainer />
|
||||||
<InventoryList />
|
<InventoryList />
|
||||||
</RbacWrapper>
|
</RbacWrapper>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const INITIAL_STATE = {
|
|||||||
reportCenter: { ...baseModal },
|
reportCenter: { ...baseModal },
|
||||||
partsReceive: { ...baseModal },
|
partsReceive: { ...baseModal },
|
||||||
contractFinder: { ...baseModal },
|
contractFinder: { ...baseModal },
|
||||||
|
inventoryUpsert: { ...baseModal },
|
||||||
ca_bc_eftTableConvert: { ...baseModal },
|
ca_bc_eftTableConvert: { ...baseModal },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,10 @@ export const selectContractFinder = createSelector(
|
|||||||
[selectModals],
|
[selectModals],
|
||||||
(modals) => modals.contractFinder
|
(modals) => modals.contractFinder
|
||||||
);
|
);
|
||||||
|
export const selectInventoryUpsert = createSelector(
|
||||||
|
[selectModals],
|
||||||
|
(modals) => modals.inventoryUpsert
|
||||||
|
);
|
||||||
|
|
||||||
export const selectCaBcEtfTableConvert = createSelector(
|
export const selectCaBcEtfTableConvert = createSelector(
|
||||||
[selectModals],
|
[selectModals],
|
||||||
|
|||||||
@@ -355,6 +355,7 @@
|
|||||||
"page": "Employees -> List"
|
"page": "Employees -> List"
|
||||||
},
|
},
|
||||||
"inventory": {
|
"inventory": {
|
||||||
|
"delete": "Inventory -> Delete",
|
||||||
"list": "Inventory -> List"
|
"list": "Inventory -> List"
|
||||||
},
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
@@ -1079,13 +1080,21 @@
|
|||||||
"actions": {
|
"actions": {
|
||||||
"addtoinventory": "Add to Inventory",
|
"addtoinventory": "Add to Inventory",
|
||||||
"addtoro": "Add to RO",
|
"addtoro": "Add to RO",
|
||||||
"consumefrominventory": "Consume from Inventory?"
|
"consumefrominventory": "Consume from Inventory?",
|
||||||
|
"edit": "Edit Inventory LIne",
|
||||||
|
"new": "New Inventory Line"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"inserting": "Error inserting inventory item. {{error}}"
|
"inserting": "Error inserting inventory item. {{error}}"
|
||||||
},
|
},
|
||||||
|
"fields": {
|
||||||
|
"comment": "Comment",
|
||||||
|
"manualinvoicenumber": "Invoice Number",
|
||||||
|
"manualvendor": "Vendor"
|
||||||
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"consumedbyjob": "Consumed by Job",
|
"consumedbyjob": "Consumed by Job",
|
||||||
|
"deleteconfirm": "Are you sure you want to delete this from inventory? The associated bill will not be modified or deleted. ",
|
||||||
"frombillinvoicenumber": "Original Bill Invoice Number",
|
"frombillinvoicenumber": "Original Bill Invoice Number",
|
||||||
"fromvendor": "Original Bill Vendor",
|
"fromvendor": "Original Bill Vendor",
|
||||||
"inventory": "Inventory",
|
"inventory": "Inventory",
|
||||||
@@ -1093,7 +1102,9 @@
|
|||||||
"showavailable": "Show Only Available Inventory"
|
"showavailable": "Show Only Available Inventory"
|
||||||
},
|
},
|
||||||
"successes": {
|
"successes": {
|
||||||
"inserted": "Added line to inventory."
|
"deleted": "Inventory lined deleted.",
|
||||||
|
"inserted": "Added line to inventory.",
|
||||||
|
"updated": "Inventory line updated."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"joblines": {
|
"joblines": {
|
||||||
|
|||||||
@@ -355,6 +355,7 @@
|
|||||||
"page": ""
|
"page": ""
|
||||||
},
|
},
|
||||||
"inventory": {
|
"inventory": {
|
||||||
|
"delete": "",
|
||||||
"list": ""
|
"list": ""
|
||||||
},
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
@@ -1079,13 +1080,21 @@
|
|||||||
"actions": {
|
"actions": {
|
||||||
"addtoinventory": "",
|
"addtoinventory": "",
|
||||||
"addtoro": "",
|
"addtoro": "",
|
||||||
"consumefrominventory": ""
|
"consumefrominventory": "",
|
||||||
|
"edit": "",
|
||||||
|
"new": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"inserting": ""
|
"inserting": ""
|
||||||
},
|
},
|
||||||
|
"fields": {
|
||||||
|
"comment": "",
|
||||||
|
"manualinvoicenumber": "",
|
||||||
|
"manualvendor": ""
|
||||||
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"consumedbyjob": "",
|
"consumedbyjob": "",
|
||||||
|
"deleteconfirm": "",
|
||||||
"frombillinvoicenumber": "",
|
"frombillinvoicenumber": "",
|
||||||
"fromvendor": "",
|
"fromvendor": "",
|
||||||
"inventory": "",
|
"inventory": "",
|
||||||
@@ -1093,7 +1102,9 @@
|
|||||||
"showavailable": ""
|
"showavailable": ""
|
||||||
},
|
},
|
||||||
"successes": {
|
"successes": {
|
||||||
"inserted": ""
|
"deleted": "",
|
||||||
|
"inserted": "",
|
||||||
|
"updated": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"joblines": {
|
"joblines": {
|
||||||
|
|||||||
@@ -355,6 +355,7 @@
|
|||||||
"page": ""
|
"page": ""
|
||||||
},
|
},
|
||||||
"inventory": {
|
"inventory": {
|
||||||
|
"delete": "",
|
||||||
"list": ""
|
"list": ""
|
||||||
},
|
},
|
||||||
"jobs": {
|
"jobs": {
|
||||||
@@ -1079,13 +1080,21 @@
|
|||||||
"actions": {
|
"actions": {
|
||||||
"addtoinventory": "",
|
"addtoinventory": "",
|
||||||
"addtoro": "",
|
"addtoro": "",
|
||||||
"consumefrominventory": ""
|
"consumefrominventory": "",
|
||||||
|
"edit": "",
|
||||||
|
"new": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"inserting": ""
|
"inserting": ""
|
||||||
},
|
},
|
||||||
|
"fields": {
|
||||||
|
"comment": "",
|
||||||
|
"manualinvoicenumber": "",
|
||||||
|
"manualvendor": ""
|
||||||
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"consumedbyjob": "",
|
"consumedbyjob": "",
|
||||||
|
"deleteconfirm": "",
|
||||||
"frombillinvoicenumber": "",
|
"frombillinvoicenumber": "",
|
||||||
"fromvendor": "",
|
"fromvendor": "",
|
||||||
"inventory": "",
|
"inventory": "",
|
||||||
@@ -1093,7 +1102,9 @@
|
|||||||
"showavailable": ""
|
"showavailable": ""
|
||||||
},
|
},
|
||||||
"successes": {
|
"successes": {
|
||||||
"inserted": ""
|
"deleted": "",
|
||||||
|
"inserted": "",
|
||||||
|
"updated": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"joblines": {
|
"joblines": {
|
||||||
|
|||||||
@@ -2166,11 +2166,14 @@
|
|||||||
- actual_cost
|
- actual_cost
|
||||||
- actual_price
|
- actual_price
|
||||||
- billlineid
|
- billlineid
|
||||||
|
- comment
|
||||||
- consumedbybillid
|
- consumedbybillid
|
||||||
- created_at
|
- created_at
|
||||||
- id
|
- id
|
||||||
- joblineid
|
- joblineid
|
||||||
- line_desc
|
- line_desc
|
||||||
|
- manualinvoicenumber
|
||||||
|
- manualvendor
|
||||||
- quantity
|
- quantity
|
||||||
- shopid
|
- shopid
|
||||||
- updated_at
|
- updated_at
|
||||||
@@ -2182,11 +2185,14 @@
|
|||||||
- actual_cost
|
- actual_cost
|
||||||
- actual_price
|
- actual_price
|
||||||
- billlineid
|
- billlineid
|
||||||
|
- comment
|
||||||
- consumedbybillid
|
- consumedbybillid
|
||||||
- created_at
|
- created_at
|
||||||
- id
|
- id
|
||||||
- joblineid
|
- joblineid
|
||||||
- line_desc
|
- line_desc
|
||||||
|
- manualinvoicenumber
|
||||||
|
- manualvendor
|
||||||
- quantity
|
- quantity
|
||||||
- shopid
|
- shopid
|
||||||
- updated_at
|
- updated_at
|
||||||
@@ -2207,11 +2213,14 @@
|
|||||||
- actual_cost
|
- actual_cost
|
||||||
- actual_price
|
- actual_price
|
||||||
- billlineid
|
- billlineid
|
||||||
|
- comment
|
||||||
- consumedbybillid
|
- consumedbybillid
|
||||||
- created_at
|
- created_at
|
||||||
- id
|
- id
|
||||||
- joblineid
|
- joblineid
|
||||||
- line_desc
|
- line_desc
|
||||||
|
- manualinvoicenumber
|
||||||
|
- manualvendor
|
||||||
- quantity
|
- quantity
|
||||||
- shopid
|
- shopid
|
||||||
- updated_at
|
- updated_at
|
||||||
@@ -2225,6 +2234,18 @@
|
|||||||
- active:
|
- active:
|
||||||
_eq: true
|
_eq: true
|
||||||
check: null
|
check: null
|
||||||
|
delete_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
filter:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
- table:
|
- table:
|
||||||
schema: public
|
schema: public
|
||||||
name: ioevents
|
name: ioevents
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."inventory" add column "manualinvoicenumber" text
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."inventory" add column "manualinvoicenumber" text
|
||||||
|
null;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."inventory" add column "comment" text
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."inventory" add column "comment" text
|
||||||
|
null;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."inventory" add column "manualvendor" text
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."inventory" add column "manualvendor" text
|
||||||
|
null;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "public"."inventory" ALTER COLUMN "quantity" drop default;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
alter table "public"."inventory" alter column "quantity" set default '1';
|
||||||
Reference in New Issue
Block a user