mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +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 TrialBalanceSheetHeaderGeneralPanel from './TrialBalanceSheetHeaderGeneralPanel';
|
||||
import TrialBalanceSheetHeaderDimensionsPanel from './TrialBalanceSheetHeaderDimensionsPanel';
|
||||
|
||||
import withTrialBalance from './withTrialBalance';
|
||||
import withTrialBalanceActions from './withTrialBalanceActions';
|
||||
@@ -41,6 +42,7 @@ function TrialBalanceSheetHeader({
|
||||
const defaultValues = {
|
||||
fromDate: moment().toDate(),
|
||||
toDate: moment().toDate(),
|
||||
branchesIds: [],
|
||||
};
|
||||
|
||||
// Initial values.
|
||||
@@ -49,6 +51,7 @@ function TrialBalanceSheetHeader({
|
||||
...pageFilter,
|
||||
fromDate: moment(pageFilter.fromDate).toDate(),
|
||||
toDate: moment(pageFilter.toDate).toDate(),
|
||||
branchesIds: [],
|
||||
},
|
||||
defaultValues,
|
||||
);
|
||||
@@ -59,10 +62,14 @@ function TrialBalanceSheetHeader({
|
||||
toggleFilterDrawer(false);
|
||||
};
|
||||
// Handle drawer close action.
|
||||
const handleDrawerClose = () => { toggleFilterDrawer(false); };
|
||||
const handleDrawerClose = () => {
|
||||
toggleFilterDrawer(false);
|
||||
};
|
||||
|
||||
// Handle cancel button click.
|
||||
const handleCancelClick = () => { toggleFilterDrawer(false); };
|
||||
const handleCancelClick = () => {
|
||||
toggleFilterDrawer(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<FinancialStatementHeader
|
||||
@@ -81,6 +88,11 @@ function TrialBalanceSheetHeader({
|
||||
title={<T id={'general'} />}
|
||||
panel={<TrialBalanceSheetHeaderGeneralPanel />}
|
||||
/>
|
||||
<Tab
|
||||
id="dimensions"
|
||||
title={<T id={'dimensions'} />}
|
||||
panel={<TrialBalanceSheetHeaderDimensionsPanel />}
|
||||
/>
|
||||
</Tabs>
|
||||
|
||||
<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