Added parts backorder + receiving for orders BOD-159
This commit is contained in:
@@ -8,6 +8,8 @@ import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { DateFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import queryString from "query-string";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setPartsOrderContext: (context) =>
|
||||
@@ -22,7 +24,6 @@ export function InvoicesListTableComponent({
|
||||
job,
|
||||
loading,
|
||||
invoicesQuery,
|
||||
selectedInvoice,
|
||||
handleOnRowClick,
|
||||
setPartsOrderContext,
|
||||
setInvoiceEnterContext,
|
||||
@@ -32,6 +33,8 @@ export function InvoicesListTableComponent({
|
||||
const [state, setState] = useState({
|
||||
sortedInfo: {},
|
||||
});
|
||||
const search = queryString.parse(useLocation().search);
|
||||
const selectedInvoice = search.invoiceid;
|
||||
|
||||
const invoices = invoicesQuery.data ? invoicesQuery.data.invoices : [];
|
||||
const { refetch } = invoicesQuery;
|
||||
@@ -91,7 +94,8 @@ export function InvoicesListTableComponent({
|
||||
render: (text, record) => (
|
||||
<div>
|
||||
<Link
|
||||
to={`/manage/invoices?invoiceid=${record.id}&vendorid=${record.vendorid}`}>
|
||||
to={`/manage/invoices?invoiceid=${record.id}&vendorid=${record.vendorid}`}
|
||||
>
|
||||
<Button>{t("invoices.actions.edit")}</Button>
|
||||
</Link>
|
||||
<Button
|
||||
@@ -116,7 +120,8 @@ export function InvoicesListTableComponent({
|
||||
isReturn: true,
|
||||
},
|
||||
})
|
||||
}>
|
||||
}
|
||||
>
|
||||
{t("invoices.actions.return")}
|
||||
</Button>
|
||||
</div>
|
||||
@@ -232,11 +237,11 @@ export function InvoicesListTableComponent({
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Table
|
||||
size='small'
|
||||
size="small"
|
||||
scroll={{ x: "50%", y: "40rem" }}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey='id'
|
||||
rowKey="id"
|
||||
dataSource={record.invoicelines}
|
||||
/>
|
||||
</div>
|
||||
@@ -246,9 +251,9 @@ export function InvoicesListTableComponent({
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
size='small'
|
||||
size="small"
|
||||
title={() => (
|
||||
<div className='imex-table-header'>
|
||||
<div className="imex-table-header">
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
@@ -260,7 +265,8 @@ export function InvoicesListTableComponent({
|
||||
job,
|
||||
},
|
||||
});
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.postInvoices")}
|
||||
</Button>
|
||||
<Button
|
||||
@@ -273,10 +279,11 @@ export function InvoicesListTableComponent({
|
||||
(invoicesQuery.data && invoicesQuery.data.invoices) || [],
|
||||
},
|
||||
});
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.reconcile")}
|
||||
</Button>{" "}
|
||||
<div className='imex-table-header__search'>
|
||||
<div className="imex-table-header__search">
|
||||
<Input.Search
|
||||
placeholder={t("general.labels.search")}
|
||||
onChange={(e) => {
|
||||
@@ -290,7 +297,7 @@ export function InvoicesListTableComponent({
|
||||
expandedRowRender={rowExpander}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns}
|
||||
rowKey='id'
|
||||
rowKey="id"
|
||||
dataSource={invoices}
|
||||
onChange={handleTableChange}
|
||||
expandable={{
|
||||
|
||||
Reference in New Issue
Block a user