Merge branch 'feature/Cash-flow' of https://github.com/bigcapitalhq/client into feature/Cash-flow

This commit is contained in:
a.bouhuolia
2021-10-30 16:17:45 +02:00
5 changed files with 16 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -20,6 +20,10 @@ const commonInvalidateQueries = (queryClient) => {
// Invalidate financial reports. // Invalidate financial reports.
queryClient.invalidateQueries(t.FINANCIAL_REPORT); queryClient.invalidateQueries(t.FINANCIAL_REPORT);
// Invalidate the cashflow transactions.
queryClient.invalidateQueries(t.CASH_FLOW_TRANSACTIONS);
queryClient.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
// Invalidate the settings. // Invalidate the settings.
queryClient.invalidateQueries([t.SETTING, t.SETTING_RECEIPTS]); queryClient.invalidateQueries([t.SETTING, t.SETTING_RECEIPTS]);
}; };