mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
fix: bugs in financial statements.
This commit is contained in:
@@ -34,7 +34,6 @@ function ProfitLossSheet({
|
||||
from_date: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
to_date: moment().endOf('year').format('YYYY-MM-DD'),
|
||||
});
|
||||
const [refetch, setRefetch] = useState(false);
|
||||
|
||||
// Change page title of the dashboard.
|
||||
useEffect(() => {
|
||||
@@ -54,20 +53,13 @@ function ProfitLossSheet({
|
||||
to_date: moment(filter.to_date).format('YYYY-MM-DD'),
|
||||
};
|
||||
setFilter(_filter);
|
||||
setRefetch(true);
|
||||
fetchHook.refetch({ force: true });
|
||||
}, []);
|
||||
|
||||
// Handle fetch data of profit/loss sheet table.
|
||||
const handleFetchData = useCallback(() => {
|
||||
setRefetch(true);
|
||||
}, [fetchHook]);
|
||||
|
||||
useEffect(() => {
|
||||
if (refetch) {
|
||||
fetchHook.refetch({ force: true });
|
||||
setRefetch(false);
|
||||
}
|
||||
}, [fetchHook, refetch]);
|
||||
fetchHook.refetch({ force: true });
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<DashboardInsider>
|
||||
|
||||
Reference in New Issue
Block a user