IO-1914 WIP Inventory.
This commit is contained in:
@@ -98,7 +98,7 @@ export function BillFormComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vendorId === bodyshop.inhousevendorid) {
|
if (vendorId === bodyshop.inhousevendorid && !billEdit) {
|
||||||
loadInventory();
|
loadInventory();
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
|
|||||||
@@ -68,11 +68,11 @@ export function BillFormContainer({
|
|||||||
returnData={returnData}
|
returnData={returnData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!billEdit && Simple_Inventory.treatment === "on" && (
|
{Simple_Inventory.treatment === "on" && (
|
||||||
<BillInventoryTable
|
<BillInventoryTable
|
||||||
form={form}
|
form={form}
|
||||||
inventoryLoading={inventoryLoading}
|
inventoryLoading={inventoryLoading}
|
||||||
inventoryData={inventoryData}
|
inventoryData={billEdit ? [] : inventoryData}
|
||||||
billEdit={billEdit}
|
billEdit={billEdit}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -94,7 +94,11 @@ export function BilllineAddInventory({ bodyshop, billline, disabled, jobid }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip title={t("inventory.actions.addtoinventory")}>
|
<Tooltip title={t("inventory.actions.addtoinventory")}>
|
||||||
<Button loading={loading} disabled={disabled} onClick={addToInventory}>
|
<Button
|
||||||
|
loading={loading}
|
||||||
|
disabled={disabled || billline.inventories.length > 0}
|
||||||
|
onClick={addToInventory}
|
||||||
|
>
|
||||||
<FileAddFilled />
|
<FileAddFilled />
|
||||||
</Button>
|
</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import Icon, {
|
import Icon, {
|
||||||
BankFilled,
|
BankFilled,
|
||||||
BarChartOutlined,
|
BarChartOutlined,
|
||||||
@@ -83,6 +84,12 @@ function Header({
|
|||||||
setReportCenterContext,
|
setReportCenterContext,
|
||||||
recentItems,
|
recentItems,
|
||||||
}) {
|
}) {
|
||||||
|
const { Simple_Inventory } = useTreatments(
|
||||||
|
["Simple_Inventory"],
|
||||||
|
{},
|
||||||
|
bodyshop && bodyshop.imexshopid
|
||||||
|
);
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -199,13 +206,19 @@ function Header({
|
|||||||
>
|
>
|
||||||
{t("menus.header.enterbills")}
|
{t("menus.header.enterbills")}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Divider key="div4" />
|
{Simple_Inventory.treatment === "on" && (
|
||||||
<Menu.Item
|
<>
|
||||||
key="inventory"
|
<Menu.Divider key="div4" />
|
||||||
icon={<Icon component={FaFileInvoiceDollar} />}
|
<Menu.Item
|
||||||
>
|
key="inventory"
|
||||||
<Link to="/manage/inventory">{t("menus.header.inventory")}</Link>
|
icon={<Icon component={FaFileInvoiceDollar} />}
|
||||||
</Menu.Item>
|
>
|
||||||
|
<Link to="/manage/inventory">
|
||||||
|
{t("menus.header.inventory")}
|
||||||
|
</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Menu.Divider key="div7" />
|
<Menu.Divider key="div7" />
|
||||||
<Menu.Item key="allpayments" icon={<BankFilled />}>
|
<Menu.Item key="allpayments" icon={<BankFilled />}>
|
||||||
<Link to="/manage/payments">{t("menus.header.allpayments")}</Link>
|
<Link to="/manage/payments">{t("menus.header.allpayments")}</Link>
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
import { Button, Card, Input, Space, Table, Typography } from "antd";
|
||||||
import _ from "lodash";
|
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
import { useHistory, useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
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 StartChatButton from "../chat-open-button/chat-open-button.component";
|
|
||||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -21,7 +18,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
|
|
||||||
export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const { page, sortcolumn, sortorder, invfilters } = search;
|
const { page, sortcolumn, sortorder } = search;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|||||||
@@ -152,6 +152,10 @@ export const QUERY_BILL_BY_PK = gql`
|
|||||||
state_tax_rate
|
state_tax_rate
|
||||||
federal_tax_rate
|
federal_tax_rate
|
||||||
isinhouse
|
isinhouse
|
||||||
|
inventories {
|
||||||
|
id
|
||||||
|
line_desc
|
||||||
|
}
|
||||||
vendor {
|
vendor {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@@ -165,6 +169,9 @@ export const QUERY_BILL_BY_PK = gql`
|
|||||||
cost_center
|
cost_center
|
||||||
quantity
|
quantity
|
||||||
joblineid
|
joblineid
|
||||||
|
inventories {
|
||||||
|
id
|
||||||
|
}
|
||||||
jobline {
|
jobline {
|
||||||
oem_partno
|
oem_partno
|
||||||
part_type
|
part_type
|
||||||
|
|||||||
Reference in New Issue
Block a user