mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat: edit locking transactions.
This commit is contained in:
@@ -43,7 +43,6 @@ function ReconcileCreditNoteDeleteAlert({
|
|||||||
message: intl.get('reconcile_credit_note.alert.success_message'),
|
message: intl.get('reconcile_credit_note.alert.success_message'),
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
closeDrawer('credit-note-detail-drawer');
|
|
||||||
})
|
})
|
||||||
.catch(
|
.catch(
|
||||||
({
|
({
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export default function LockingTransactionsDialogContent({
|
|||||||
moduleName,
|
moduleName,
|
||||||
isEnabled,
|
isEnabled,
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LockingTransactionsFormProvider
|
<LockingTransactionsFormProvider
|
||||||
isEnabled={isEnabled}
|
isEnabled={isEnabled}
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ function LockingTransactionsForm({
|
|||||||
// Initial form values.
|
// Initial form values.
|
||||||
const initialValues = React.useMemo(
|
const initialValues = React.useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
...(!isEnabled
|
...(isEnabled
|
||||||
? {
|
? {
|
||||||
...defaultInitialValues,
|
...transformToForm(transactionLocking, defaultInitialValues),
|
||||||
module: moduleName,
|
module: moduleName,
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
...transformToForm(transactionLocking, defaultInitialValues),
|
...defaultInitialValues,
|
||||||
module: moduleName,
|
module: moduleName,
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ function LockingTransactionsFormProvider({
|
|||||||
enabled: !!isEnabled,
|
enabled: !!isEnabled,
|
||||||
});
|
});
|
||||||
|
|
||||||
// const isEnabled = transactionLocking?.is_enabled;
|
|
||||||
|
|
||||||
// State provider.
|
// State provider.
|
||||||
const provider = {
|
const provider = {
|
||||||
dialogName,
|
dialogName,
|
||||||
|
|||||||
@@ -23,14 +23,15 @@ function TransactionsLockingBodyJsx({
|
|||||||
// #withAlertsActions
|
// #withAlertsActions
|
||||||
openAlert,
|
openAlert,
|
||||||
}) {
|
}) {
|
||||||
const {
|
const { isTransactionLockingLoading, transactionLockingType } =
|
||||||
isTransactionLockingLoading,
|
useTransactionsLockingContext();
|
||||||
transactionLockingType,
|
|
||||||
} = useTransactionsLockingContext();
|
|
||||||
|
|
||||||
// Handle locking transactions.
|
// Handle locking transactions.
|
||||||
const handleLockingTransactions = (module) => {
|
const handleLockingTransactions = (module, {}, isEnabled) => {
|
||||||
openDialog('locking-transactions', { module: module });
|
openDialog('locking-transactions', {
|
||||||
|
isEnabled: isEnabled,
|
||||||
|
module: module,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
// Handle unlocking transactions
|
// Handle unlocking transactions
|
||||||
const handleUnlockTransactions = (module) => {
|
const handleUnlockTransactions = (module) => {
|
||||||
@@ -49,6 +50,7 @@ function TransactionsLockingBodyJsx({
|
|||||||
transactionLockingType === 'partial' ? (
|
transactionLockingType === 'partial' ? (
|
||||||
<TransactionsLockingList
|
<TransactionsLockingList
|
||||||
onLock={handleLockingTransactions}
|
onLock={handleLockingTransactions}
|
||||||
|
onEditLock={handleLockingTransactions}
|
||||||
onCancelLock={handleUnlockTransactions}
|
onCancelLock={handleUnlockTransactions}
|
||||||
onUnlockPartial={handleUnlockingPartial}
|
onUnlockPartial={handleUnlockingPartial}
|
||||||
onCancelUnlockPartial={handleCancelUnlockingPartail}
|
onCancelUnlockPartial={handleCancelUnlockingPartail}
|
||||||
|
|||||||
@@ -251,10 +251,10 @@ function TransactionsLockingItemActions() {
|
|||||||
} = useTransactionsLockingItemContext();
|
} = useTransactionsLockingItemContext();
|
||||||
|
|
||||||
const handleLockClick = (event) => {
|
const handleLockClick = (event) => {
|
||||||
safeInvoke(onLock, module, isEnabled, event);
|
safeInvoke(onLock, module, event);
|
||||||
};
|
};
|
||||||
const handleEditBtn = (event) => {
|
const handleEditBtn = (event) => {
|
||||||
safeInvoke(onEditLock, module, event);
|
safeInvoke(onEditLock, module, isEnabled, event);
|
||||||
};
|
};
|
||||||
const handleUnlockPartial = (event) => {
|
const handleUnlockPartial = (event) => {
|
||||||
safeInvoke(onUnlockPartial, module, event);
|
safeInvoke(onUnlockPartial, module, event);
|
||||||
|
|||||||
Reference in New Issue
Block a user