mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +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'),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
closeDrawer('credit-note-detail-drawer');
|
||||
})
|
||||
.catch(
|
||||
({
|
||||
|
||||
@@ -11,6 +11,7 @@ export default function LockingTransactionsDialogContent({
|
||||
moduleName,
|
||||
isEnabled,
|
||||
}) {
|
||||
|
||||
return (
|
||||
<LockingTransactionsFormProvider
|
||||
isEnabled={isEnabled}
|
||||
|
||||
@@ -39,13 +39,13 @@ function LockingTransactionsForm({
|
||||
// Initial form values.
|
||||
const initialValues = React.useMemo(
|
||||
() => ({
|
||||
...(!isEnabled
|
||||
...(isEnabled
|
||||
? {
|
||||
...defaultInitialValues,
|
||||
...transformToForm(transactionLocking, defaultInitialValues),
|
||||
module: moduleName,
|
||||
}
|
||||
: {
|
||||
...transformToForm(transactionLocking, defaultInitialValues),
|
||||
...defaultInitialValues,
|
||||
module: moduleName,
|
||||
}),
|
||||
}),
|
||||
|
||||
@@ -25,8 +25,6 @@ function LockingTransactionsFormProvider({
|
||||
enabled: !!isEnabled,
|
||||
});
|
||||
|
||||
// const isEnabled = transactionLocking?.is_enabled;
|
||||
|
||||
// State provider.
|
||||
const provider = {
|
||||
dialogName,
|
||||
|
||||
@@ -23,14 +23,15 @@ function TransactionsLockingBodyJsx({
|
||||
// #withAlertsActions
|
||||
openAlert,
|
||||
}) {
|
||||
const {
|
||||
isTransactionLockingLoading,
|
||||
transactionLockingType,
|
||||
} = useTransactionsLockingContext();
|
||||
const { isTransactionLockingLoading, transactionLockingType } =
|
||||
useTransactionsLockingContext();
|
||||
|
||||
// Handle locking transactions.
|
||||
const handleLockingTransactions = (module) => {
|
||||
openDialog('locking-transactions', { module: module });
|
||||
const handleLockingTransactions = (module, {}, isEnabled) => {
|
||||
openDialog('locking-transactions', {
|
||||
isEnabled: isEnabled,
|
||||
module: module,
|
||||
});
|
||||
};
|
||||
// Handle unlocking transactions
|
||||
const handleUnlockTransactions = (module) => {
|
||||
@@ -49,6 +50,7 @@ function TransactionsLockingBodyJsx({
|
||||
transactionLockingType === 'partial' ? (
|
||||
<TransactionsLockingList
|
||||
onLock={handleLockingTransactions}
|
||||
onEditLock={handleLockingTransactions}
|
||||
onCancelLock={handleUnlockTransactions}
|
||||
onUnlockPartial={handleUnlockingPartial}
|
||||
onCancelUnlockPartial={handleCancelUnlockingPartail}
|
||||
|
||||
@@ -251,10 +251,10 @@ function TransactionsLockingItemActions() {
|
||||
} = useTransactionsLockingItemContext();
|
||||
|
||||
const handleLockClick = (event) => {
|
||||
safeInvoke(onLock, module, isEnabled, event);
|
||||
safeInvoke(onLock, module, event);
|
||||
};
|
||||
const handleEditBtn = (event) => {
|
||||
safeInvoke(onEditLock, module, event);
|
||||
safeInvoke(onEditLock, module, isEnabled, event);
|
||||
};
|
||||
const handleUnlockPartial = (event) => {
|
||||
safeInvoke(onUnlockPartial, module, event);
|
||||
@@ -401,7 +401,7 @@ export const TransLockingReason = styled.div`
|
||||
`;
|
||||
|
||||
const TransUnlockWrap = styled.div`
|
||||
padding-top: 10px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid #ddd;
|
||||
margin-top: 10px;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user