mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix: BIG-148 items entries ordered by index.
This commit is contained in:
@@ -14,19 +14,12 @@ const PaymentMadeDetailContext = React.createContext();
|
||||
*/
|
||||
function PaymentMadeDetailProvider({ paymentMadeId, ...props }) {
|
||||
// Handle fetch specific payment made details.
|
||||
const { data: paymentMade, isLoading: isPaymentMadeLoading } =
|
||||
usePaymentMade(paymentMadeId, {
|
||||
const { data: paymentMade, isLoading: isPaymentMadeLoading } = usePaymentMade(
|
||||
paymentMadeId,
|
||||
{
|
||||
enabled: !!paymentMadeId,
|
||||
});
|
||||
|
||||
// Handle fetch specific payment made details.
|
||||
const {
|
||||
data: { entries: paymentEntries },
|
||||
isLoading: isPaymentLoading,
|
||||
} = usePaymentMadeEditPage(paymentMadeId, {
|
||||
enabled: !!paymentMadeId,
|
||||
});
|
||||
|
||||
},
|
||||
);
|
||||
// Handle fetch transaction by reference.
|
||||
const {
|
||||
data: { transactions },
|
||||
@@ -44,11 +37,9 @@ function PaymentMadeDetailProvider({ paymentMadeId, ...props }) {
|
||||
transactions,
|
||||
paymentMadeId,
|
||||
paymentMade,
|
||||
paymentEntries,
|
||||
};
|
||||
|
||||
const loading =
|
||||
isTransactionLoading || isPaymentMadeLoading || isPaymentLoading;
|
||||
const loading = isTransactionLoading || isPaymentMadeLoading;
|
||||
|
||||
return (
|
||||
<DrawerLoading loading={loading}>
|
||||
|
||||
@@ -12,18 +12,17 @@ import PaymentDrawerCls from './PaymentMadeDrawer.module.scss';
|
||||
* Payment made read-only details table.
|
||||
*/
|
||||
export default function PaymentMadeDetailTable() {
|
||||
|
||||
// Retrieve payment made entries columns.
|
||||
const columns = usePaymentMadeEntriesColumns();
|
||||
|
||||
// Payment made details context.
|
||||
const { paymentEntries } = usePaymentMadeDetailContext();
|
||||
const { paymentMade } = usePaymentMadeDetailContext();
|
||||
|
||||
return (
|
||||
<div className={clsx(PaymentDrawerCls.detail_panel_table)}>
|
||||
<DataTable
|
||||
columns={columns}
|
||||
data={paymentEntries}
|
||||
data={paymentMade.entries}
|
||||
className={'table-constrant'}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user