mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
fix: financial statements.
This commit is contained in:
@@ -11,9 +11,9 @@ import BalanceSheetTable from './BalanceSheetTable';
|
||||
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import BalanceSheetActionsBar from './BalanceSheetActionsBar';
|
||||
import SettingsConnect from 'connectors/Settings.connect';
|
||||
|
||||
import withDashboard from 'containers/Dashboard/withDashboard';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
import withBalanceSheetActions from './withBalanceSheetActions';
|
||||
import withBalanceSheetDetail from './withBalanceSheetDetail';
|
||||
|
||||
@@ -40,14 +40,16 @@ function BalanceSheet({
|
||||
display_columns_by: '',
|
||||
none_zero: false,
|
||||
});
|
||||
const [refetch, setRefetch] = useState(false);
|
||||
|
||||
const fetchHook = useQuery(['balance-sheet', filter],
|
||||
(key, query) => { fetchBalanceSheet({ ...query }); });
|
||||
(key, query) => fetchBalanceSheet({ ...query }),
|
||||
{ manual: true });
|
||||
|
||||
// Handle fetch the data of balance sheet.
|
||||
const handleFetchData = useCallback(() => {
|
||||
fetchHook.refetch();
|
||||
}, [fetchHook]);
|
||||
setRefetch(true);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
changePageTitle('Balance Sheet');
|
||||
@@ -61,8 +63,17 @@ function BalanceSheet({
|
||||
to_date: moment(filter.to_date).format('YYYY-MM-DD'),
|
||||
};
|
||||
setFilter({ ..._filter });
|
||||
setRefetch(true);
|
||||
}, [setFilter]);
|
||||
|
||||
// Refetch sheet effect.
|
||||
useEffect(() => {
|
||||
if (refetch) {
|
||||
fetchHook.refetch({ force: true });
|
||||
setRefetch(false);
|
||||
}
|
||||
}, [refetch])
|
||||
|
||||
return (
|
||||
<DashboardInsider>
|
||||
<BalanceSheetActionsBar />
|
||||
@@ -92,6 +103,5 @@ export default compose(
|
||||
withBalanceSheetDetail(({ balanceSheetLoading }) => ({
|
||||
balanceSheetLoading,
|
||||
})),
|
||||
// BalanceSheetConnect,
|
||||
SettingsConnect,
|
||||
withSettings,
|
||||
)(BalanceSheet);
|
||||
Reference in New Issue
Block a user