feat: fix Money in & out dialog.

This commit is contained in:
elforjani13
2021-10-28 14:39:54 +02:00
parent b0f1584b04
commit 4b96ba76f5
4 changed files with 12 additions and 10 deletions

View File

@@ -7,7 +7,6 @@ export const addMoneyIn = [
},
{
name: intl.get('cash_flow.other_income'),
type: 'OTHER_INCOME',
value: 'other_income',
},
{

View File

@@ -43,15 +43,17 @@ function AccountTransactionsActionsBar({
// Handle money in form
const handleMoneyInFormTransaction = (account) => {
openDialog('money-in', {
account_type: account,
account_id: accountId,
account_type: account.value,
account_name: account.name,
});
};
// Handle money out form
const handlMoneyOutFormTransaction = (account) => {
openDialog('money-out', {
account_type: account,
account_id: accountId,
account_type: account.value,
account_name: account.name,
});
};
// Refresh cashflow infinity transactions hook.

View File

@@ -12,15 +12,15 @@ const MoneyInDialogContent = React.lazy(() => import('./MoneyInDialogContent'));
*/
function MoneyInDialog({
dialogName,
payload = { account_type: null, account_id: null },
payload = { account_type: null, account_id: null, account_name: '' },
isOpen,
}) {
console.log(payload, 'EE');
return (
<Dialog
name={dialogName}
title={intl.get('cash_flow_transaction.money_in', {
value: payload.account_type?.name,
value: payload.account_name,
})}
isOpen={isOpen}
canEscapeJeyClose={true}
@@ -31,7 +31,7 @@ function MoneyInDialog({
<MoneyInDialogContent
dialogName={dialogName}
accountId={payload.account_id}
accountType={payload.account_type?.value}
accountType={payload.account_type}
/>
</DialogSuspense>
</Dialog>

View File

@@ -13,14 +13,15 @@ const MoneyOutDialogContent = React.lazy(() =>
*/
function MoneyOutDialog({
dialogName,
payload = { account_type: null, account_id: null },
payload = { account_type: null, account_id: null, account_name: '' },
isOpen,
}) {
return (
<Dialog
name={dialogName}
title={intl.get('cash_flow_transaction.money_out', {
value: payload.account_type?.name,
value: payload.account_name,
})}
isOpen={isOpen}
canEscapeJeyClose={true}
@@ -31,7 +32,7 @@ function MoneyOutDialog({
<MoneyOutDialogContent
dialogName={dialogName}
accountId={payload.account_id}
accountType={payload.account_type?.value}
accountType={payload.account_type}
/>
</DialogSuspense>
</Dialog>