mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
feat: add payment transaction & style
This commit is contained in:
@@ -8,7 +8,7 @@ import { DrawerMainTabs } from 'components';
|
|||||||
import BillDetailTab from './BillDetailTab';
|
import BillDetailTab from './BillDetailTab';
|
||||||
import LocatedLandedCostTable from './LocatedLandedCostTable';
|
import LocatedLandedCostTable from './LocatedLandedCostTable';
|
||||||
import JournalEntriesTable from '../../JournalEntriesTable/JournalEntriesTable';
|
import JournalEntriesTable from '../../JournalEntriesTable/JournalEntriesTable';
|
||||||
import BillPaymentTransactionTable from './BillPaymentTransactionTable';
|
import BillPaymentTransactionTable from './BillPaymentTransactions/BillPaymentTransactionTable';
|
||||||
import { useBillDrawerContext } from './BillDrawerProvider';
|
import { useBillDrawerContext } from './BillDrawerProvider';
|
||||||
|
|
||||||
import BillDrawerCls from 'style/components/Drawers/BillDrawer.module.scss';
|
import BillDrawerCls from 'style/components/Drawers/BillDrawer.module.scss';
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { DataTable, Card } from 'components';
|
import { DataTable, Card } from 'components';
|
||||||
|
|
||||||
import { useBillPaymentTransactionsColumns } from './utils';
|
import 'style/pages/PaymentTransactions/List.scss';
|
||||||
import { useBillDrawerContext } from './BillDrawerProvider';
|
|
||||||
|
import { useBillPaymentTransactionsColumns } from './components';
|
||||||
|
import { useBillDrawerContext } from '../BillDrawerProvider';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bill payment transactions datatable.
|
* Bill payment transactions datatable.
|
||||||
@@ -24,6 +26,7 @@ export default function BillPaymentTransactionTable() {
|
|||||||
loading={isPaymentTransactionsLoading}
|
loading={isPaymentTransactionsLoading}
|
||||||
headerLoading={isPaymentTransactionsLoading}
|
headerLoading={isPaymentTransactionsLoading}
|
||||||
progressBarLoading={isPaymentTransactionFetching}
|
progressBarLoading={isPaymentTransactionFetching}
|
||||||
|
className={'payment-transactions'}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
|
|
||||||
|
import clsx from 'classnames';
|
||||||
|
import { CLASSES } from '../../../../common/classes';
|
||||||
|
import { FormatDateCell } from '../../../../components';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve bill payment transactions table columns.
|
||||||
|
*/
|
||||||
|
export const useBillPaymentTransactionsColumns = () => {
|
||||||
|
return React.useMemo(
|
||||||
|
() => [
|
||||||
|
{
|
||||||
|
id: 'date',
|
||||||
|
Header: intl.get('payment_date'),
|
||||||
|
accessor: 'date',
|
||||||
|
Cell: FormatDateCell,
|
||||||
|
width: 110,
|
||||||
|
className: 'date',
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'amount',
|
||||||
|
Header: intl.get('amount'),
|
||||||
|
accessor: 'amount',
|
||||||
|
// accessor: 'formatted_amount',
|
||||||
|
align: 'right',
|
||||||
|
width: 100,
|
||||||
|
className: clsx(CLASSES.FONT_BOLD),
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'payment_number',
|
||||||
|
Header: intl.get('payment_no'),
|
||||||
|
accessor: 'payment_number',
|
||||||
|
width: 100,
|
||||||
|
className: 'payment_number',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'reference',
|
||||||
|
Header: intl.get('reference_no'),
|
||||||
|
accessor: 'reference',
|
||||||
|
width: 90,
|
||||||
|
className: 'reference',
|
||||||
|
clickable: true,
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
|
|
||||||
import clsx from 'classnames';
|
import { FormatNumberCell } from '../../../components';
|
||||||
import { CLASSES } from '../../../common/classes';
|
|
||||||
import { FormatNumberCell, FormatDateCell } from '../../../components';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve bill readonly details entries table columns.
|
* Retrieve bill readonly details entries table columns.
|
||||||
@@ -51,49 +49,3 @@ export const useBillReadonlyEntriesTableColumns = () =>
|
|||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve bill payment transactions table columns.
|
|
||||||
*/
|
|
||||||
export const useBillPaymentTransactionsColumns = () => {
|
|
||||||
return React.useMemo(
|
|
||||||
() => [
|
|
||||||
{
|
|
||||||
id: 'date',
|
|
||||||
Header: intl.get('payment_date'),
|
|
||||||
accessor: 'date',
|
|
||||||
Cell: FormatDateCell,
|
|
||||||
width: 110,
|
|
||||||
className: 'date',
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'amount',
|
|
||||||
Header: intl.get('amount'),
|
|
||||||
accessor: 'amount',
|
|
||||||
// accessor: 'formatted_amount',
|
|
||||||
align: 'right',
|
|
||||||
width: 100,
|
|
||||||
className: clsx(CLASSES.FONT_BOLD),
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'payment_number',
|
|
||||||
Header: intl.get('payment_no'),
|
|
||||||
accessor: 'payment_number',
|
|
||||||
width: 100,
|
|
||||||
className: 'payment_number',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'reference',
|
|
||||||
Header: intl.get('reference_no'),
|
|
||||||
accessor: 'reference',
|
|
||||||
width: 90,
|
|
||||||
className: 'reference',
|
|
||||||
clickable: true,
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[],
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import clsx from 'classnames';
|
|||||||
import { DrawerMainTabs } from 'components';
|
import { DrawerMainTabs } from 'components';
|
||||||
|
|
||||||
import JournalEntriesTable from '../../JournalEntriesTable/JournalEntriesTable';
|
import JournalEntriesTable from '../../JournalEntriesTable/JournalEntriesTable';
|
||||||
import InvoicePaymentTransactionsTable from './InvoicePaymentTransactionsTable';
|
import InvoicePaymentTransactionsTable from './InvoicePaymentTransactions/InvoicePaymentTransactionsTable';
|
||||||
import InvoiceDetailTab from './InvoiceDetailTab';
|
import InvoiceDetailTab from './InvoiceDetailTab';
|
||||||
import { useInvoiceDetailDrawerContext } from './InvoiceDetailDrawerProvider';
|
import { useInvoiceDetailDrawerContext } from './InvoiceDetailDrawerProvider';
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { DataTable, Card } from 'components';
|
import { DataTable, Card } from 'components';
|
||||||
|
|
||||||
import { useInvoicePaymentTransactionsColumns } from './utils';
|
import 'style/pages/PaymentTransactions/List.scss';
|
||||||
import { useInvoiceDetailDrawerContext } from './InvoiceDetailDrawerProvider';
|
|
||||||
|
import { useInvoicePaymentTransactionsColumns } from './components';
|
||||||
|
import { useInvoiceDetailDrawerContext } from '../InvoiceDetailDrawerProvider';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice payment transactions datatable.
|
* Invoice payment transactions datatable.
|
||||||
@@ -23,6 +25,7 @@ export default function InvoicePaymentTransactionsTable() {
|
|||||||
loading={isPaymentTransactionLoading}
|
loading={isPaymentTransactionLoading}
|
||||||
headerLoading={isPaymentTransactionLoading}
|
headerLoading={isPaymentTransactionLoading}
|
||||||
progressBarLoading={isPaymentTransactionFetching}
|
progressBarLoading={isPaymentTransactionFetching}
|
||||||
|
className={'payment-transactions'}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
|
|
||||||
|
import clsx from 'classnames';
|
||||||
|
import { CLASSES } from '../../../../common/classes';
|
||||||
|
import { FormattedMessage as T, FormatDateCell } from '../../../../components';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve invoice payment transactions table columns.
|
||||||
|
*/
|
||||||
|
export const useInvoicePaymentTransactionsColumns = () => {
|
||||||
|
return React.useMemo(
|
||||||
|
() => [
|
||||||
|
{
|
||||||
|
id: 'date',
|
||||||
|
Header: intl.get('payment_date'),
|
||||||
|
accessor: 'date',
|
||||||
|
Cell: FormatDateCell,
|
||||||
|
width: 110,
|
||||||
|
className: 'date',
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'amount',
|
||||||
|
Header: intl.get('amount'),
|
||||||
|
accessor: 'amount',
|
||||||
|
// accessor: 'formatted_amount',
|
||||||
|
align: 'right',
|
||||||
|
width: 120,
|
||||||
|
className: clsx(CLASSES.FONT_BOLD),
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'payment_receive_no.',
|
||||||
|
Header: intl.get('payment_no'),
|
||||||
|
accessor: 'payment_receive_no',
|
||||||
|
width: 100,
|
||||||
|
className: 'payment_receive_no',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'reference_no',
|
||||||
|
Header: intl.get('reference_no'),
|
||||||
|
accessor: 'reference_no',
|
||||||
|
width: 90,
|
||||||
|
className: 'reference_no',
|
||||||
|
clickable: true,
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -107,48 +107,3 @@ export const BadDebtMenuItem = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve invoice payment transactions table columns.
|
|
||||||
*/
|
|
||||||
export const useInvoicePaymentTransactionsColumns = () => {
|
|
||||||
return React.useMemo(
|
|
||||||
() => [
|
|
||||||
{
|
|
||||||
id: 'date',
|
|
||||||
Header: intl.get('payment_date'),
|
|
||||||
accessor: 'date',
|
|
||||||
Cell: FormatDateCell,
|
|
||||||
width: 110,
|
|
||||||
className: 'date',
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'amount',
|
|
||||||
Header: intl.get('amount'),
|
|
||||||
accessor: 'amount',
|
|
||||||
// accessor: 'formatted_amount',
|
|
||||||
align: 'right',
|
|
||||||
width: 120,
|
|
||||||
className: clsx(CLASSES.FONT_BOLD),
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'payment_receive_no.',
|
|
||||||
Header: intl.get('payment_no'),
|
|
||||||
accessor: 'payment_receive_no',
|
|
||||||
width: 100,
|
|
||||||
className: 'payment_receive_no',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 'reference_no',
|
|
||||||
Header: intl.get('reference_no'),
|
|
||||||
accessor: 'reference_no',
|
|
||||||
width: 90,
|
|
||||||
className: 'reference_no',
|
|
||||||
clickable: true,
|
|
||||||
textOverview: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[],
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default function BillPaymentTransactions() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="payment-transactions">
|
<div className="item-drawer__table">
|
||||||
<Card>
|
<Card>
|
||||||
<DataTable
|
<DataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default function EstimatePaymentTransactions() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="payment-transactions">
|
<div className="item-drawer__table">
|
||||||
<Card>
|
<Card>
|
||||||
<DataTable
|
<DataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default function InvoicePaymentTransactionsTable() {
|
|||||||
id: 'invoice_no',
|
id: 'invoice_no',
|
||||||
Header: intl.get('invoice_no__'),
|
Header: intl.get('invoice_no__'),
|
||||||
accessor: 'invoice_no',
|
accessor: 'invoice_no',
|
||||||
width: 100,
|
width: 240,
|
||||||
className: 'invoice_no',
|
className: 'invoice_no',
|
||||||
textOverview: true,
|
textOverview: true,
|
||||||
},
|
},
|
||||||
@@ -31,7 +31,7 @@ export default function InvoicePaymentTransactionsTable() {
|
|||||||
id: 'customer',
|
id: 'customer',
|
||||||
Header: intl.get('customer_name'),
|
Header: intl.get('customer_name'),
|
||||||
accessor: 'customer.display_name',
|
accessor: 'customer.display_name',
|
||||||
width: 180,
|
width: 140,
|
||||||
className: 'customer_id',
|
className: 'customer_id',
|
||||||
clickable: true,
|
clickable: true,
|
||||||
textOverview: true,
|
textOverview: true,
|
||||||
@@ -40,7 +40,7 @@ export default function InvoicePaymentTransactionsTable() {
|
|||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
Header: intl.get('reference_no'),
|
Header: intl.get('reference_no'),
|
||||||
accessor: 'reference_no',
|
accessor: 'reference_no',
|
||||||
width: 90,
|
width: 140,
|
||||||
className: 'reference_no',
|
className: 'reference_no',
|
||||||
textOverview: true,
|
textOverview: true,
|
||||||
},
|
},
|
||||||
@@ -68,7 +68,7 @@ export default function InvoicePaymentTransactionsTable() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="payment-transactions">
|
<div className="item-drawer__table">
|
||||||
<Card>
|
<Card>
|
||||||
<DataTable
|
<DataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export default function ReceiptPaymentTransactions() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="payment-transactions">
|
<div className="item-drawer__table">
|
||||||
<Card>
|
<Card>
|
||||||
<DataTable
|
<DataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Tab } from '@blueprintjs/core';
|
import { Tab } from '@blueprintjs/core';
|
||||||
import { DrawerMainTabs } from 'components';
|
import { DrawerMainTabs, FormattedMessage as T } from 'components';
|
||||||
import InvoicePaymentTransactionsTable from './InvoicePaymentTransactionsDataTable';
|
import InvoicePaymentTransactionsTable from './InvoicePaymentTransactionsDataTable';
|
||||||
import EstimatePaymentTransactionsTable from './EstimatePaymentTransactionsDataTable';
|
import EstimatePaymentTransactionsTable from './EstimatePaymentTransactionsDataTable';
|
||||||
import ReceiptPaymentTransactionsTable from './ReceiptPaymentTransactionsDataTable';
|
import ReceiptPaymentTransactionsTable from './ReceiptPaymentTransactionsDataTable';
|
||||||
@@ -13,17 +13,18 @@ export const ItemPaymentTransactions = () => {
|
|||||||
<DrawerMainTabs>
|
<DrawerMainTabs>
|
||||||
<Tab
|
<Tab
|
||||||
id={'invoice'}
|
id={'invoice'}
|
||||||
title={'Invoice'}
|
title={<T id={'invoice'} />}
|
||||||
panel={<InvoicePaymentTransactionsTable />}
|
panel={<InvoicePaymentTransactionsTable />}
|
||||||
/>
|
/>
|
||||||
<Tab
|
<Tab
|
||||||
id={'estiamte'}
|
id={'estiamte'}
|
||||||
title={'Estimate'}
|
title={'Estimate'}
|
||||||
|
title={<T id={'estimate_'} />}
|
||||||
panel={<EstimatePaymentTransactionsTable />}
|
panel={<EstimatePaymentTransactionsTable />}
|
||||||
/>
|
/>
|
||||||
<Tab
|
<Tab
|
||||||
id={'receipt'}
|
id={'receipt'}
|
||||||
title={'Receipt'}
|
title={<T id={'receipt_'} />}
|
||||||
panel={<ReceiptPaymentTransactionsTable />}
|
panel={<ReceiptPaymentTransactionsTable />}
|
||||||
/>
|
/>
|
||||||
<Tab
|
<Tab
|
||||||
@@ -34,7 +35,3 @@ export const ItemPaymentTransactions = () => {
|
|||||||
</DrawerMainTabs>
|
</DrawerMainTabs>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
|
||||||
/* <ItemSwitchMenuItem onChange={handleSwitch} /> */
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -38,9 +38,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.payment-transactions {
|
&__table {
|
||||||
.card {
|
.card {
|
||||||
padding: 0 !important;
|
padding: 12px 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
.tbody,
|
||||||
|
.thead {
|
||||||
|
.tr .th {
|
||||||
|
padding: 8px 8px;
|
||||||
|
background-color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
border-top: 1px solid #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tbody {
|
||||||
|
.tr .td {
|
||||||
|
border-bottom: 0;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/style/pages/PaymentTransactions/List.scss
Normal file
23
src/style/pages/PaymentTransactions/List.scss
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.payment-transactions {
|
||||||
|
padding: 12px;
|
||||||
|
|
||||||
|
.table {
|
||||||
|
.tbody,
|
||||||
|
.thead {
|
||||||
|
.tr .th {
|
||||||
|
padding: 8px 8px;
|
||||||
|
background-color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
border-bottom: 1px solid #000;
|
||||||
|
border-top: 1px solid #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tbody {
|
||||||
|
.tr .td {
|
||||||
|
border-bottom: 0;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user