mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat(refund credit):add exchange rate muted & branch.
This commit is contained in:
@@ -5,6 +5,7 @@ import { pick } from 'lodash';
|
||||
import {
|
||||
useAccounts,
|
||||
useCreditNote,
|
||||
useBranches,
|
||||
useCreateRefundCreditNote,
|
||||
} from 'hooks/query';
|
||||
|
||||
@@ -24,6 +25,14 @@ function RefundCreditNoteFormProvider({ creditNoteId, dialogName, ...props }) {
|
||||
enabled: !!creditNoteId,
|
||||
},
|
||||
);
|
||||
|
||||
// Fetches the branches list.
|
||||
const {
|
||||
data: branches,
|
||||
isLoading: isBranchesLoading,
|
||||
isSuccess: isBranchesSuccess,
|
||||
} = useBranches();
|
||||
|
||||
// Create and edit credit note mutations.
|
||||
const { mutateAsync: createRefundCreditNoteMutate } =
|
||||
useCreateRefundCreditNote();
|
||||
@@ -35,12 +44,17 @@ function RefundCreditNoteFormProvider({ creditNoteId, dialogName, ...props }) {
|
||||
amount: creditNote.credits_remaining,
|
||||
},
|
||||
accounts,
|
||||
branches,
|
||||
dialogName,
|
||||
isBranchesSuccess,
|
||||
|
||||
createRefundCreditNoteMutate,
|
||||
};
|
||||
|
||||
return (
|
||||
<DialogContent isLoading={isAccountsLoading || isCreditNoteLoading}>
|
||||
<DialogContent
|
||||
isLoading={isAccountsLoading || isCreditNoteLoading || isBranchesLoading}
|
||||
>
|
||||
<RefundCreditNoteContext.Provider value={provider} {...props} />
|
||||
</DialogContent>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user