Added invoice search + reformatted invoices page BOD-123

This commit is contained in:
Patrick Fic
2020-07-28 15:59:09 -07:00
parent 64e02bf8cb
commit d708ac9226
12 changed files with 476 additions and 196 deletions

View File

@@ -94,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
@@ -119,7 +120,8 @@ export function InvoicesListTableComponent({
isReturn: true,
},
})
}>
}
>
{t("invoices.actions.return")}
</Button>
</div>
@@ -243,11 +245,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>
@@ -261,37 +263,45 @@ export function InvoicesListTableComponent({
</Typography.Title>
<Table
loading={loading}
size='small'
size="small"
title={() => (
<div className='imex-table-header'>
<div className="imex-table-header">
<Button onClick={() => refetch()}>
<SyncOutlined />
</Button>
<Button
onClick={() => {
setInvoiceEnterContext({
actions: { refetch: invoicesQuery.refetch },
context: {
job,
},
});
}}>
{t("jobs.actions.postInvoices")}
</Button>
<Button
onClick={() => {
setReconciliationContext({
actions: { refetch: invoicesQuery.refetch },
context: {
job,
invoices:
(invoicesQuery.data && invoicesQuery.data.invoices) || [],
},
});
}}>
{t("jobs.actions.reconcile")}
</Button>{" "}
<div className='imex-table-header__search'>
{job ? (
<div>
<Button
onClick={() => {
setInvoiceEnterContext({
actions: { refetch: invoicesQuery.refetch },
context: {
job,
},
});
}}
>
{t("jobs.actions.postInvoices")}
</Button>
<Button
onClick={() => {
setReconciliationContext({
actions: { refetch: invoicesQuery.refetch },
context: {
job,
invoices:
(invoicesQuery.data && invoicesQuery.data.invoices) ||
[],
},
});
}}
>
{t("jobs.actions.reconcile")}
</Button>
</div>
) : null}
<div className="imex-table-header__search">
<Input.Search
placeholder={t("general.labels.search")}
onChange={(e) => {
@@ -305,7 +315,7 @@ export function InvoicesListTableComponent({
expandedRowRender={rowExpander}
pagination={{ position: "top", defaultPageSize: 25 }}
columns={columns}
rowKey='id'
rowKey="id"
dataSource={invoices}
onChange={handleTableChange}
expandable={{