mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 14:50:32 +00:00
feat(trial balance sheet): branch multi select.
This commit is contained in:
@@ -8,6 +8,7 @@ import { Tabs, Tab, Button, Intent } from '@blueprintjs/core';
|
|||||||
|
|
||||||
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
|
import FinancialStatementHeader from 'containers/FinancialStatements/FinancialStatementHeader';
|
||||||
import TrialBalanceSheetHeaderGeneralPanel from './TrialBalanceSheetHeaderGeneralPanel';
|
import TrialBalanceSheetHeaderGeneralPanel from './TrialBalanceSheetHeaderGeneralPanel';
|
||||||
|
import TrialBalanceSheetHeaderDimensionsPanel from './TrialBalanceSheetHeaderDimensionsPanel';
|
||||||
|
|
||||||
import withTrialBalance from './withTrialBalance';
|
import withTrialBalance from './withTrialBalance';
|
||||||
import withTrialBalanceActions from './withTrialBalanceActions';
|
import withTrialBalanceActions from './withTrialBalanceActions';
|
||||||
@@ -41,6 +42,7 @@ function TrialBalanceSheetHeader({
|
|||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
fromDate: moment().toDate(),
|
fromDate: moment().toDate(),
|
||||||
toDate: moment().toDate(),
|
toDate: moment().toDate(),
|
||||||
|
branchesIds: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Initial values.
|
// Initial values.
|
||||||
@@ -49,6 +51,7 @@ function TrialBalanceSheetHeader({
|
|||||||
...pageFilter,
|
...pageFilter,
|
||||||
fromDate: moment(pageFilter.fromDate).toDate(),
|
fromDate: moment(pageFilter.fromDate).toDate(),
|
||||||
toDate: moment(pageFilter.toDate).toDate(),
|
toDate: moment(pageFilter.toDate).toDate(),
|
||||||
|
branchesIds: [],
|
||||||
},
|
},
|
||||||
defaultValues,
|
defaultValues,
|
||||||
);
|
);
|
||||||
@@ -59,10 +62,14 @@ function TrialBalanceSheetHeader({
|
|||||||
toggleFilterDrawer(false);
|
toggleFilterDrawer(false);
|
||||||
};
|
};
|
||||||
// Handle drawer close action.
|
// Handle drawer close action.
|
||||||
const handleDrawerClose = () => { toggleFilterDrawer(false); };
|
const handleDrawerClose = () => {
|
||||||
|
toggleFilterDrawer(false);
|
||||||
|
};
|
||||||
|
|
||||||
// Handle cancel button click.
|
// Handle cancel button click.
|
||||||
const handleCancelClick = () => { toggleFilterDrawer(false); };
|
const handleCancelClick = () => {
|
||||||
|
toggleFilterDrawer(false);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialStatementHeader
|
<FinancialStatementHeader
|
||||||
@@ -81,6 +88,11 @@ function TrialBalanceSheetHeader({
|
|||||||
title={<T id={'general'} />}
|
title={<T id={'general'} />}
|
||||||
panel={<TrialBalanceSheetHeaderGeneralPanel />}
|
panel={<TrialBalanceSheetHeaderGeneralPanel />}
|
||||||
/>
|
/>
|
||||||
|
<Tab
|
||||||
|
id="dimensions"
|
||||||
|
title={<T id={'dimensions'} />}
|
||||||
|
panel={<TrialBalanceSheetHeaderDimensionsPanel />}
|
||||||
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|
||||||
<div class="financial-header-drawer__footer">
|
<div class="financial-header-drawer__footer">
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import intl from 'react-intl-universal';
|
||||||
|
import { FormGroup, Classes } from '@blueprintjs/core';
|
||||||
|
import { BranchMultiSelect, Row, Col } from 'components';
|
||||||
|
import { useBranches } from 'hooks/query';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* trial balance sheet header dismension panel.
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export default function TrialBalanceSheetHeaderDimensionsPanel() {
|
||||||
|
// Fetches the branches list.
|
||||||
|
const { isLoading: isBranchesLoading, data: branches } = useBranches();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Row>
|
||||||
|
<Col xs={4}>
|
||||||
|
<FormGroup
|
||||||
|
label={intl.get('branches_multi_select.label')}
|
||||||
|
className={Classes.FILL}
|
||||||
|
>
|
||||||
|
<BranchMultiSelect name={'branchesIds'} branches={branches} />
|
||||||
|
</FormGroup>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user