mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
- fix: store children accounts with Redux store.
- fix: store expense payment date with transactions. - fix: Total assets, liabilities and equity on balance sheet. - tweaks: dashboard content and sidebar style. - fix: reset form with contact list on journal entry form. - feat: Add hints to filter accounts in financial statements.
This commit is contained in:
@@ -21,12 +21,14 @@ function Customer({
|
||||
const { id } = useParams();
|
||||
const history = useHistory();
|
||||
|
||||
const fetchCustomers = useQuery('customers-list', () =>
|
||||
// Handle fetch customers data table
|
||||
const fetchCustomers = useQuery('customers-table', () =>
|
||||
requestFetchCustomers({}),
|
||||
);
|
||||
|
||||
const fetchCustomerDatails = useQuery(id && ['customer-detail', id], () =>
|
||||
// Handle fetch customer details.
|
||||
const fetchCustomer= useQuery(['customer', id], () =>
|
||||
requestFetchCustomers(),
|
||||
{ enabled: !!id },
|
||||
);
|
||||
|
||||
const handleFormSubmit = useCallback(
|
||||
@@ -42,7 +44,7 @@ function Customer({
|
||||
|
||||
return (
|
||||
<DashboardInsider
|
||||
loading={fetchCustomerDatails.isFetching || fetchCustomers.isFetching}
|
||||
loading={fetchCustomer.isFetching || fetchCustomers.isFetching}
|
||||
name={'customer-form'}
|
||||
>
|
||||
<CustomerForm
|
||||
|
||||
@@ -45,16 +45,16 @@ const CustomerActionsBar = ({
|
||||
history.push('/customers/new');
|
||||
}, [history]);
|
||||
|
||||
const filterDropdown = FilterDropdown({
|
||||
fields: resourceFields,
|
||||
onFilterChange: (filterConditions) => {
|
||||
setFilterCount(filterConditions.length || 0);
|
||||
addCustomersTableQueries({
|
||||
filter_roles: filterConditions || '',
|
||||
});
|
||||
onFilterChanged && onFilterChanged(filterConditions);
|
||||
},
|
||||
});
|
||||
// const filterDropdown = FilterDropdown({
|
||||
// fields: resourceFields,
|
||||
// onFilterChange: (filterConditions) => {
|
||||
// setFilterCount(filterConditions.length || 0);
|
||||
// addCustomersTableQueries({
|
||||
// filter_roles: filterConditions || '',
|
||||
// });
|
||||
// onFilterChanged && onFilterChanged(filterConditions);
|
||||
// },
|
||||
// });
|
||||
|
||||
const hasSelectedRows = useMemo(() => selectedRows.length > 0, [
|
||||
selectedRows,
|
||||
@@ -75,7 +75,7 @@ const CustomerActionsBar = ({
|
||||
/>
|
||||
<NavbarDivider />
|
||||
<Popover
|
||||
content={filterDropdown}
|
||||
// content={filterDropdown}
|
||||
interactionKind={PopoverInteractionKind.CLICK}
|
||||
position={Position.BOTTOM_LEFT}
|
||||
>
|
||||
@@ -101,7 +101,6 @@ const CustomerActionsBar = ({
|
||||
onClick={handleBulkDelete}
|
||||
/>
|
||||
</If>
|
||||
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
icon={<Icon icon="file-import-16" iconSize={16} />}
|
||||
@@ -120,13 +119,12 @@ const CustomerActionsBar = ({
|
||||
const mapStateToProps = (state, props) => ({
|
||||
resourceName: 'customers',
|
||||
});
|
||||
|
||||
const withCustomersActionsBar = connect(mapStateToProps);
|
||||
|
||||
export default compose(
|
||||
withCustomersActionsBar,
|
||||
withCustomersActions,
|
||||
withResourceDetail(({ resourceFields }) => ({
|
||||
resourceFields,
|
||||
})),
|
||||
withCustomersActions,
|
||||
)(CustomerActionsBar);
|
||||
|
||||
@@ -3,25 +3,20 @@ import * as Yup from 'yup';
|
||||
import { useFormik } from 'formik';
|
||||
import {
|
||||
FormGroup,
|
||||
MenuItem,
|
||||
Intent,
|
||||
InputGroup,
|
||||
Button,
|
||||
Classes,
|
||||
Checkbox,
|
||||
} from '@blueprintjs/core';
|
||||
import { Row, Col } from 'react-grid-system';
|
||||
import { FormattedMessage as T, useIntl } from 'react-intl';
|
||||
import { queryCache, useQuery } from 'react-query';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { pick } from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import AppToaster from 'components/AppToaster';
|
||||
import ErrorMessage from 'components/ErrorMessage';
|
||||
|
||||
import CustomersTabs from 'containers/Customers/CustomersTabs';
|
||||
import RadioCustomer from 'containers/Customers/RadioCustomer';
|
||||
import CustomerTypeRadioField from 'containers/Customers/CustomerTypeRadioField';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
import withCustomerDetail from 'containers/Customers/withCustomerDetail';
|
||||
@@ -51,6 +46,7 @@ function CustomerForm({
|
||||
// #withMediaActions
|
||||
requestSubmitMedia,
|
||||
requestDeleteMedia,
|
||||
|
||||
//#Props
|
||||
onFormSubmit,
|
||||
onCancelForm,
|
||||
@@ -258,7 +254,7 @@ function CustomerForm({
|
||||
<div className={'customer-form'}>
|
||||
<form onSubmit={formik.handleSubmit}>
|
||||
<div className={'customer-form__primary-section'}>
|
||||
<RadioCustomer
|
||||
<CustomerTypeRadioField
|
||||
selectedValue={formik.values.customer_type}
|
||||
onChange={handleCustomerTypeCahange}
|
||||
className={'form-group--customer-type'}
|
||||
@@ -440,4 +436,5 @@ export default compose(
|
||||
})),
|
||||
withDashboardActions,
|
||||
withCustomersActions,
|
||||
withMediaActions,
|
||||
)(CustomerForm);
|
||||
|
||||
Reference in New Issue
Block a user