WIP: Feature JournalNumber dialog / Fix: ItemCategory & EditMakeJournal & Expenses

This commit is contained in:
elforjani3
2020-10-19 19:53:10 +02:00
parent 00ba1bb75e
commit d804007596
12 changed files with 413 additions and 94 deletions

View File

@@ -8,6 +8,7 @@ import DashboardInsider from 'components/Dashboard/DashboardInsider';
import withAccountsActions from 'containers/Accounts/withAccountsActions';
import withExpensesActions from 'containers/Expenses/withExpensesActions';
import withCurrenciesActions from 'containers/Currencies/withCurrenciesActions';
import withCustomersActions from 'containers/Customers/withCustomersActions';
import { compose } from 'utils';
@@ -21,6 +22,9 @@ function Expenses({
// #wihtCurrenciesActions
requestFetchCurrencies,
// #withCustomersActions
requestFetchCustomers,
}) {
const history = useHistory();
const { id } = useParams();
@@ -38,6 +42,12 @@ function Expenses({
const fetchCurrencies = useQuery('currencies', () =>
requestFetchCurrencies(),
);
// Handle fetch customers data table or list
const fetchCustomers = useQuery('customers-table', () =>
requestFetchCustomers({}),
);
const handleFormSubmit = useCallback(
(payload) => {
payload.redirect && history.push('/expenses-list');
@@ -54,7 +64,8 @@ function Expenses({
loading={
fetchExpense.isFetching ||
fetchAccounts.isFetching ||
fetchCurrencies.isFetching
fetchCurrencies.isFetching ||
fetchCustomers.isFetching
}
name={'expense-form'}
>
@@ -71,4 +82,5 @@ export default compose(
withAccountsActions,
withCurrenciesActions,
withExpensesActions,
withCustomersActions,
)(Expenses);