Added invoice totals + high level reconciliation on PLI jobs tab. BOD-26
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { Button, Descriptions, Table } from "antd";
|
||||
import { Button, Descriptions, Table, Checkbox } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Link } from "react-router-dom";
|
||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import { DateFormatter } from "../../utils/DateFormatter";
|
||||
import { alphaSort } from "../../utils/sorters";
|
||||
import { SyncOutlined } from "@ant-design/icons";
|
||||
|
||||
export default function InvoicesListTableComponent({
|
||||
loading,
|
||||
invoices,
|
||||
selectedInvoice,
|
||||
handleOnRowClick,
|
||||
refetch,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -65,8 +67,7 @@ export default function InvoicesListTableComponent({
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
<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>
|
||||
),
|
||||
@@ -120,24 +121,74 @@ export default function InvoicesListTableComponent({
|
||||
state.sortedInfo.columnKey === "cost_center" &&
|
||||
state.sortedInfo.order,
|
||||
},
|
||||
{
|
||||
title: t("invoicelines.fields.federal_tax_applicable"),
|
||||
dataIndex: "applicable_taxes.federal",
|
||||
key: "applicable_taxes.federal",
|
||||
render: (text, record) => (
|
||||
<Checkbox
|
||||
disabled
|
||||
checked={
|
||||
(record.applicable_taxes && record.applicable_taxes.federal) ||
|
||||
false
|
||||
}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("invoicelines.fields.state_tax_applicable"),
|
||||
dataIndex: "applicable_taxes.state",
|
||||
key: "applicable_taxes.state",
|
||||
render: (text, record) => (
|
||||
<Checkbox
|
||||
disabled
|
||||
checked={
|
||||
(record.applicable_taxes && record.applicable_taxes.state) ||
|
||||
false
|
||||
}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: t("invoicelines.fields.local_tax_applicable"),
|
||||
dataIndex: "applicable_taxes.local",
|
||||
key: "applicable_taxes.local",
|
||||
render: (text, record) => (
|
||||
<Checkbox
|
||||
disabled
|
||||
checked={
|
||||
(record.applicable_taxes && record.applicable_taxes.local) ||
|
||||
false
|
||||
}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Descriptions title="User Info">
|
||||
<Descriptions.Item label="UserName">Zhou Maomao</Descriptions.Item>
|
||||
<Descriptions.Item label="Telephone">1810000000</Descriptions.Item>
|
||||
<Descriptions.Item label="Live">Hangzhou, Zhejiang</Descriptions.Item>
|
||||
<Descriptions.Item label="Remark">empty</Descriptions.Item>
|
||||
<Descriptions.Item label="Address">
|
||||
No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
|
||||
<Descriptions
|
||||
title={`${t("invoices.fields.invoice_number")} ${
|
||||
record.invoice_number
|
||||
}`}>
|
||||
<Descriptions.Item label={t("invoices.fields.federal_tax_rate")}>
|
||||
{record.federal_tax_rate || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("invoices.fields.state_tax_rate")}>
|
||||
{record.state_tax_rate || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("invoices.fields.local_tax_rate")}>
|
||||
{record.local_tax_rate || ""}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={t("invoices.fields.is_credit_memo")}>
|
||||
<Checkbox disabled checked={record.is_credit_memo || false} />
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<Table
|
||||
size="small"
|
||||
size='small'
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns.map((item) => ({ ...item }))}
|
||||
rowKey="id"
|
||||
rowKey='id'
|
||||
dataSource={record.invoicelines}
|
||||
/>
|
||||
</div>
|
||||
@@ -147,11 +198,18 @@ export default function InvoicesListTableComponent({
|
||||
return (
|
||||
<Table
|
||||
loading={loading}
|
||||
size="small"
|
||||
size='small'
|
||||
title={() => (
|
||||
<div>
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
expandedRowRender={rowExpander}
|
||||
pagination={{ position: "top", defaultPageSize: 25 }}
|
||||
columns={columns.map((item) => ({ ...item }))}
|
||||
rowKey="id"
|
||||
rowKey='id'
|
||||
dataSource={invoices}
|
||||
onChange={handleTableChange}
|
||||
expandable={{
|
||||
|
||||
Reference in New Issue
Block a user