mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
feat: add reconcile credit transactions table.
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { useCreditNote, useRefundCreditNote } from 'hooks/query';
|
||||
import {
|
||||
useCreditNote,
|
||||
useRefundCreditNote,
|
||||
useReconcileCreditNotes,
|
||||
} from 'hooks/query';
|
||||
import { DrawerHeaderContent, DrawerLoading } from 'components';
|
||||
|
||||
const CreditNoteDetailDrawerContext = React.createContext();
|
||||
@@ -26,16 +30,33 @@ function CreditNoteDetailDrawerProvider({ creditNoteId, ...props }) {
|
||||
enabled: !!creditNoteId,
|
||||
});
|
||||
|
||||
// Handle fetch refund credit note.
|
||||
const {
|
||||
data: reconcileCreditNotes,
|
||||
isFetching: isReconcileCreditNoteFetching,
|
||||
isLoading: isReconcileCreditNoteLoading,
|
||||
} = useReconcileCreditNotes(creditNoteId, {
|
||||
enabled: !!creditNoteId,
|
||||
});
|
||||
|
||||
const provider = {
|
||||
creditNote,
|
||||
refundCreditNote,
|
||||
reconcileCreditNotes,
|
||||
|
||||
isRefundCreditNoteLoading,
|
||||
isRefundCreditNoteFetching,
|
||||
creditNoteId,
|
||||
};
|
||||
|
||||
return (
|
||||
<DrawerLoading loading={isCreditNoteLoading || isRefundCreditNoteLoading}>
|
||||
<DrawerLoading
|
||||
loading={
|
||||
isCreditNoteLoading ||
|
||||
isRefundCreditNoteLoading ||
|
||||
isReconcileCreditNoteLoading
|
||||
}
|
||||
>
|
||||
<DrawerHeaderContent
|
||||
name="credit-note-detail-drawer"
|
||||
title={intl.get('credit_note.drawer_credit_note_detail')}
|
||||
|
||||
Reference in New Issue
Block a user