diff --git a/client/src/containers/Purchases/Bill/BillActionsBar.js b/client/src/containers/Purchases/Bill/BillActionsBar.js index dad1c4f2b..720f265bf 100644 --- a/client/src/containers/Purchases/Bill/BillActionsBar.js +++ b/client/src/containers/Purchases/Bill/BillActionsBar.js @@ -38,13 +38,12 @@ function BillActionsBar({ //#withBillActions addBillsTableQueries, - + changeBillView, // #own Porps onFilterChanged, selectedRows = [], }) { const history = useHistory(); - const { path } = useRouteMatch(); const [filterCount, setFilterCount] = useState(0); const { formatMessage } = useIntl(); @@ -52,6 +51,17 @@ function BillActionsBar({ history.push('/bills/new'); }, [history]); + const hasSelectedRows = useMemo(() => selectedRows.length > 0, [ + selectedRows, + ]); + + const handleTabChange = (viewId) => { + changeBillView(viewId.id || -1); + addBillsTableQueries({ + custom_view_id: viewId.id || null, + }); + }; + // const FilterDropdown = FilterDropdown({ // initialCondition: { // fieldKey: '', @@ -67,14 +77,14 @@ function BillActionsBar({ // }, // }); - const hasSelectedRows = useMemo(() => selectedRows.length > 0, [ - selectedRows, - ]); - return ( - +