feat(balancesheet): balance sheet comparisons.

This commit is contained in:
elforjani13
2022-01-25 20:12:13 +02:00
parent 354d1e8f75
commit 735803f1a5

View File

@@ -13,40 +13,7 @@ import { Row, Col, FieldHint } from '../../../components';
export default function BalanceSheetHeaderComparisonPanal() { export default function BalanceSheetHeaderComparisonPanal() {
return ( return (
<BalanceSheetComparisonWrap> <BalanceSheetComparisonWrap>
{/*------------ Percentage -----------*/} {/**----------- Previous Year -----------*/}
<Row>
<Col xs={3}>
<FastField name={'percentage_of_column'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.percentage_of_column'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
<Col xs={3}>
<FastField name={'percentage_of_row'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'balance_sheet.percentage_of_row'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</Col>
</Row>
{/*------------ Previous Year -----------*/}
<Row>
<Col xs={3}>
<FastField name={'previous_year'} type={'checkbox'}> <FastField name={'previous_year'} type={'checkbox'}>
{({ field }) => ( {({ field }) => (
<FormGroup labelInfo={<FieldHint />}> <FormGroup labelInfo={<FieldHint />}>
@@ -59,7 +26,7 @@ export default function BalanceSheetHeaderComparisonPanal() {
</FormGroup> </FormGroup>
)} )}
</FastField> </FastField>
</Col> <Row>
<Col xs={3}> <Col xs={3}>
<FastField name={'previous_year_amount_change'} type={'checkbox'}> <FastField name={'previous_year_amount_change'} type={'checkbox'}>
{({ field }) => ( {({ field }) => (
@@ -90,8 +57,6 @@ export default function BalanceSheetHeaderComparisonPanal() {
</Col> </Col>
</Row> </Row>
{/*------------ Previous Period -----------*/} {/*------------ Previous Period -----------*/}
<Row>
<Col xs={3}>
<FastField name={'previous_period'} type={'checkbox'}> <FastField name={'previous_period'} type={'checkbox'}>
{({ field }) => ( {({ field }) => (
<FormGroup labelInfo={<FieldHint />}> <FormGroup labelInfo={<FieldHint />}>
@@ -104,7 +69,7 @@ export default function BalanceSheetHeaderComparisonPanal() {
</FormGroup> </FormGroup>
)} )}
</FastField> </FastField>
</Col> <Row>
<Col xs={3}> <Col xs={3}>
<FastField name={'previous_period_amount_change'} type={'checkbox'}> <FastField name={'previous_period_amount_change'} type={'checkbox'}>
{({ field }) => ( {({ field }) => (
@@ -137,24 +102,48 @@ export default function BalanceSheetHeaderComparisonPanal() {
</FastField> </FastField>
</Col> </Col>
</Row> </Row>
{/**----------- % of Column -----------*/}
<FastField name={'previous_period_percentage_change'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'profit_loss_sheet.percentage_of_column'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
{/**----------- % of Row -----------*/}
<FastField name={'previous_period_percentage_change'} type={'checkbox'}>
{({ field }) => (
<FormGroup labelInfo={<FieldHint />}>
<Checkbox
inline={true}
small={true}
label={<T id={'profit_loss_sheet.percentage_of_row'} />}
{...field}
/>
</FormGroup>
)}
</FastField>
</BalanceSheetComparisonWrap> </BalanceSheetComparisonWrap>
); );
} }
const BalanceSheetComparisonWrap = styled.div` const BalanceSheetComparisonWrap = styled.div`
.row { .row {
display: flex; margin-left: 0.15rem;
flex-wrap: nowrap;
margin-left: -0.3rem;
margin-right: -0.3rem;
.col { .col {
padding-left: 0.3rem; min-width: 150px;
padding-right: 0.3rem; max-width: 190px;
}
}
.bp3-form-group { .bp3-form-group {
margin-bottom: 0; margin-bottom: 3px;
} /* margin-bottom: 0; */
}
} }
`; `;