mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
BIG-3: add filtering non-zero items.
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
import FinancialAccountsFilter from '../FinancialAccountsFilter';
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Balance sheet header - General panal.
|
* Balance sheet header - General panal.
|
||||||
@@ -12,7 +12,7 @@ export default function BalanceSheetHeaderGeneralTab({}) {
|
|||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
<SelectDisplayColumnsBy />
|
<SelectDisplayColumnsBy />
|
||||||
<FinancialAccountsFilter
|
<FinancialStatementsFilter
|
||||||
initialSelectedItem={'all-accounts'}
|
initialSelectedItem={'all-accounts'}
|
||||||
/>
|
/>
|
||||||
<RadiosAccountingBasis key={'basis'} />
|
<RadiosAccountingBasis key={'basis'} />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import FinancialAccountsFilter from '../FinancialAccountsFilter';
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ export default function CashFlowStatementHeaderGeneralPanel() {
|
|||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
<SelectDisplayColumnsBy />
|
<SelectDisplayColumnsBy />
|
||||||
<FinancialAccountsFilter initialSelectedItem={'all-accounts'} />
|
<FinancialStatementsFilter initialSelectedItem={'all-accounts'} />
|
||||||
<RadiosAccountingBasis key={'basis'} />
|
<RadiosAccountingBasis key={'basis'} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { Classes, FormGroup, Position, Checkbox } from '@blueprintjs/core';
|
|||||||
import { ContactsMultiSelect, FormattedMessage as T } from 'components';
|
import { ContactsMultiSelect, FormattedMessage as T } from 'components';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Row, Col, FieldHint } from 'components';
|
import { Row, Col, FieldHint } from 'components';
|
||||||
|
import { filterCustomersOptions } from '../common';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
momentFormatter,
|
momentFormatter,
|
||||||
tansformDateValue,
|
tansformDateValue,
|
||||||
@@ -12,6 +14,7 @@ import {
|
|||||||
handleDateChange,
|
handleDateChange,
|
||||||
} from 'utils';
|
} from 'utils';
|
||||||
import { useCustomersBalanceSummaryGeneralContext } from './CustomersBalanceSummaryGeneralProvider';
|
import { useCustomersBalanceSummaryGeneralContext } from './CustomersBalanceSummaryGeneralProvider';
|
||||||
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Customers balance header - General panel - Content
|
* Customers balance header - General panel - Content
|
||||||
@@ -65,6 +68,12 @@ export default function CustomersBalanceSummaryGeneralPanelContent() {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
<FinancialStatementsFilter
|
||||||
|
items={filterCustomersOptions}
|
||||||
|
label={<T id={'customers.label_filter_customers'} />}
|
||||||
|
initialSelectedItem={'all-customers'}
|
||||||
|
/>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
<Field name={'customersIds'}>
|
<Field name={'customersIds'}>
|
||||||
@@ -80,7 +89,7 @@ export default function CustomersBalanceSummaryGeneralPanelContent() {
|
|||||||
<ContactsMultiSelect
|
<ContactsMultiSelect
|
||||||
items={customers}
|
items={customers}
|
||||||
onItemSelect={(contacts) => {
|
onItemSelect={(contacts) => {
|
||||||
const customersIds = contacts.map(contact => contact.id);
|
const customersIds = contacts.map((contact) => contact.id);
|
||||||
setFieldValue('customersIds', customersIds);
|
setFieldValue('customersIds', customersIds);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ function CustomersBalanceSummaryHeader({
|
|||||||
// #withCustomersBalanceSummaryActions
|
// #withCustomersBalanceSummaryActions
|
||||||
toggleCustomerBalanceFilterDrawer,
|
toggleCustomerBalanceFilterDrawer,
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
// validation schema.
|
// validation schema.
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
asDate: Yup.date().required().label('asDate'),
|
asDate: Yup.date().required().label('asDate'),
|
||||||
@@ -34,15 +33,20 @@ function CustomersBalanceSummaryHeader({
|
|||||||
|
|
||||||
// Default form values.
|
// Default form values.
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
|
...pageFilter,
|
||||||
asDate: moment().toDate(),
|
asDate: moment().toDate(),
|
||||||
customersIds: [],
|
customersIds: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Filter form initial values.
|
// Filter form initial values.
|
||||||
const initialValues = transformToForm({
|
const initialValues = transformToForm(
|
||||||
...pageFilter,
|
{
|
||||||
asDate: moment(pageFilter.asDate).toDate(),
|
...defaultValues,
|
||||||
}, defaultValues);
|
...pageFilter,
|
||||||
|
asDate: moment(pageFilter.asDate).toDate(),
|
||||||
|
},
|
||||||
|
defaultValues,
|
||||||
|
);
|
||||||
|
|
||||||
// handle form submit.
|
// handle form submit.
|
||||||
const handleSubmit = (values, { setSubmitting }) => {
|
const handleSubmit = (values, { setSubmitting }) => {
|
||||||
|
|||||||
@@ -30,22 +30,25 @@ function CustomersTransactionsHeader({
|
|||||||
}) {
|
}) {
|
||||||
// Default form values.
|
// Default form values.
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
|
...pageFilter,
|
||||||
fromDate: moment().toDate(),
|
fromDate: moment().toDate(),
|
||||||
toDate: moment().toDate(),
|
toDate: moment().toDate(),
|
||||||
customersIds: [],
|
customersIds: [],
|
||||||
};
|
};
|
||||||
// Initial form values.
|
// Initial form values.
|
||||||
const initialValues = transformToForm({
|
const initialValues = transformToForm(
|
||||||
...pageFilter,
|
{
|
||||||
fromDate: moment(pageFilter.fromDate).toDate(),
|
...defaultValues,
|
||||||
toDate: moment(pageFilter.toDate).toDate(),
|
...pageFilter,
|
||||||
}, defaultValues);
|
fromDate: moment(pageFilter.fromDate).toDate(),
|
||||||
|
toDate: moment(pageFilter.toDate).toDate(),
|
||||||
|
},
|
||||||
|
defaultValues,
|
||||||
|
);
|
||||||
|
|
||||||
// Validation schema.
|
// Validation schema.
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
fromDate: Yup.date()
|
fromDate: Yup.date().required().label(intl.get('fromDate')),
|
||||||
.required()
|
|
||||||
.label(intl.get('fromDate')),
|
|
||||||
toDate: Yup.date()
|
toDate: Yup.date()
|
||||||
.min(Yup.ref('fromDate'))
|
.min(Yup.ref('fromDate'))
|
||||||
.required()
|
.required()
|
||||||
@@ -59,7 +62,9 @@ function CustomersTransactionsHeader({
|
|||||||
setSubmitting(false);
|
setSubmitting(false);
|
||||||
};
|
};
|
||||||
// Handle drawer close action.
|
// Handle drawer close action.
|
||||||
const handleDrawerClose = () => { toggleFilterDrawer(false); };
|
const handleDrawerClose = () => {
|
||||||
|
toggleFilterDrawer(false);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialStatementHeader
|
<FinancialStatementHeader
|
||||||
|
|||||||
@@ -3,12 +3,15 @@ import classNames from 'classnames';
|
|||||||
import { Field } from 'formik';
|
import { Field } from 'formik';
|
||||||
import { Classes, FormGroup } from '@blueprintjs/core';
|
import { Classes, FormGroup } from '@blueprintjs/core';
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
import {
|
import {
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
ContactsMultiSelect,
|
ContactsMultiSelect,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
} from '../../../components';
|
} from '../../../components';
|
||||||
|
import { filterCustomersOptions } from '../common';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CustomersTransactionsGeneralPanelProvider,
|
CustomersTransactionsGeneralPanelProvider,
|
||||||
useCustomersTransactionsGeneralPanelContext,
|
useCustomersTransactionsGeneralPanelContext,
|
||||||
@@ -34,7 +37,11 @@ function CustomersTransactionsHeaderGeneralPanelContent() {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
|
<FinancialStatementsFilter
|
||||||
|
items={filterCustomersOptions}
|
||||||
|
label={<T id={'customers.label_filter_customers'} />}
|
||||||
|
initialSelectedItem={'all-customers'}
|
||||||
|
/>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
<Field name={'customersIds'}>
|
<Field name={'customersIds'}>
|
||||||
|
|||||||
@@ -15,14 +15,18 @@ import { Col, Row, ListSelect, MODIFIER } from 'components';
|
|||||||
import { filterAccountsOptions } from './common';
|
import { filterAccountsOptions } from './common';
|
||||||
|
|
||||||
|
|
||||||
export default function FinancialAccountsFilter({ ...restProps }) {
|
export default function FinancialStatementsFilter({
|
||||||
|
items = filterAccountsOptions,
|
||||||
|
label = <T id={'filter_accounts'} />,
|
||||||
|
...restProps
|
||||||
|
}) {
|
||||||
const SUBMENU_POPOVER_MODIFIERS = {
|
const SUBMENU_POPOVER_MODIFIERS = {
|
||||||
flip: { boundariesElement: 'viewport', padding: 20 },
|
flip: { boundariesElement: 'viewport', padding: 20 },
|
||||||
offset: { offset: '0, 10' },
|
offset: { offset: '0, 10' },
|
||||||
preventOverflow: { boundariesElement: 'viewport', padding: 40 },
|
preventOverflow: { boundariesElement: 'viewport', padding: 40 },
|
||||||
};
|
};
|
||||||
|
|
||||||
const filterAccountRenderer = (item, { handleClick, modifiers, query }) => {
|
const filterRenderer = (item, { handleClick, modifiers, query }) => {
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
interactionKind={PopoverInteractionKind.HOVER}
|
interactionKind={PopoverInteractionKind.HOVER}
|
||||||
@@ -44,13 +48,13 @@ export default function FinancialAccountsFilter({ ...restProps }) {
|
|||||||
<FastField name={'accountsFilter'}>
|
<FastField name={'accountsFilter'}>
|
||||||
{({ form: { setFieldValue }, field: { value } }) => (
|
{({ form: { setFieldValue }, field: { value } }) => (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
label={<T id={'filter_accounts'} />}
|
label={label}
|
||||||
className="form-group--select-list bp3-fill"
|
className="form-group--select-list bp3-fill"
|
||||||
inline={false}
|
inline={false}
|
||||||
>
|
>
|
||||||
<ListSelect
|
<ListSelect
|
||||||
items={filterAccountsOptions}
|
items={items}
|
||||||
itemRenderer={filterAccountRenderer}
|
itemRenderer={filterRenderer}
|
||||||
popoverProps={{ minimal: true }}
|
popoverProps={{ minimal: true }}
|
||||||
filterable={false}
|
filterable={false}
|
||||||
selectedItem={value}
|
selectedItem={value}
|
||||||
@@ -7,7 +7,7 @@ import { AccountsMultiSelect, Row, Col } from 'components';
|
|||||||
|
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
import FinancialAccountsFilter from '../FinancialAccountsFilter';
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
import { GLHeaderGeneralPanelProvider } from './GLHeaderGeneralPaneProvider';
|
import { GLHeaderGeneralPanelProvider } from './GLHeaderGeneralPaneProvider';
|
||||||
|
|
||||||
import { filterAccountsOptions } from './common';
|
import { filterAccountsOptions } from './common';
|
||||||
@@ -33,7 +33,7 @@ function GLHeaderGeneralPaneContent() {
|
|||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
<FinancialAccountsFilter
|
<FinancialStatementsFilter
|
||||||
items={filterAccountsOptions}
|
items={filterAccountsOptions}
|
||||||
initialSelectedItem={'all-accounts'}
|
initialSelectedItem={'all-accounts'}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -33,12 +33,14 @@ function InventoryValuationHeader({
|
|||||||
|
|
||||||
// Default values.
|
// Default values.
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
|
...pageFilter,
|
||||||
asDate: moment().toDate(),
|
asDate: moment().toDate(),
|
||||||
itemsIds: [],
|
itemsIds: [],
|
||||||
};
|
};
|
||||||
// Initial values.
|
// Initial values.
|
||||||
const initialValues = transformToForm({
|
const initialValues = transformToForm({
|
||||||
...pageFilter,
|
...pageFilter,
|
||||||
|
...defaultValues,
|
||||||
asDate: moment(pageFilter.asDate).toDate(),
|
asDate: moment(pageFilter.asDate).toDate(),
|
||||||
}, defaultValues);
|
}, defaultValues);
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import {
|
|||||||
Col,
|
Col,
|
||||||
FieldHint,
|
FieldHint,
|
||||||
} from '../../../components';
|
} from '../../../components';
|
||||||
|
import { filterInventoryValuationOptions } from '../common';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
momentFormatter,
|
momentFormatter,
|
||||||
tansformDateValue,
|
tansformDateValue,
|
||||||
@@ -21,6 +23,7 @@ import {
|
|||||||
InventoryValuationGeneralPanelProvider,
|
InventoryValuationGeneralPanelProvider,
|
||||||
useInventoryValuationGeneralPanelContext,
|
useInventoryValuationGeneralPanelContext,
|
||||||
} from './InventoryValuationHeaderGeneralPanelProvider';
|
} from './InventoryValuationHeaderGeneralPanelProvider';
|
||||||
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inventory valuation - Drawer Header - General panel.
|
* Inventory valuation - Drawer Header - General panel.
|
||||||
@@ -66,6 +69,11 @@ function InventoryValuationHeaderGeneralPanelContent() {
|
|||||||
</FastField>
|
</FastField>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
<FinancialStatementsFilter
|
||||||
|
items={filterInventoryValuationOptions}
|
||||||
|
label={<T id={'items.label_filter_items'} />}
|
||||||
|
initialSelectedItem={'all-items'}
|
||||||
|
/>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
import SelectDisplayColumnsBy from '../SelectDisplayColumnsBy';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
import FinancialAccountsFilter from '../FinancialAccountsFilter';
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Profit/Loss sheet - Drawer header - General panel.
|
* Profit/Loss sheet - Drawer header - General panel.
|
||||||
@@ -13,7 +13,7 @@ export default function ProfitLossSheetHeaderGeneralPane({}) {
|
|||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
<SelectDisplayColumnsBy />
|
<SelectDisplayColumnsBy />
|
||||||
<FinancialAccountsFilter initialSelectedItem={'all-accounts'} />
|
<FinancialStatementsFilter initialSelectedItem={'all-accounts'} />
|
||||||
<RadiosAccountingBasis key={'basis'} />
|
<RadiosAccountingBasis key={'basis'} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import {
|
|||||||
} from '../../../components';
|
} from '../../../components';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
import { filterItemsOptions } from '../common';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
PurchasesByItemsGeneralPanelProvider,
|
PurchasesByItemsGeneralPanelProvider,
|
||||||
@@ -35,6 +37,11 @@ function PurchasesByItemsGeneralPanelContent() {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
|
<FinancialStatementsFilter
|
||||||
|
items={filterItemsOptions}
|
||||||
|
label={<T id={'items.label_filter_items'} />}
|
||||||
|
initialSelectedItem={'all-items'}
|
||||||
|
/>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={4}>
|
<Col xs={4}>
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ function PurchasesByItemsHeader({
|
|||||||
// Initial form values.
|
// Initial form values.
|
||||||
const initialValues = transformToForm(
|
const initialValues = transformToForm(
|
||||||
{
|
{
|
||||||
|
...defaultValues,
|
||||||
...pageFilter,
|
...pageFilter,
|
||||||
fromDate: moment(pageFilter.fromDate).toDate(),
|
fromDate: moment(pageFilter.fromDate).toDate(),
|
||||||
toDate: moment(pageFilter.toDate).toDate(),
|
toDate: moment(pageFilter.toDate).toDate(),
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ import React from 'react';
|
|||||||
import { FormGroup, Classes } from '@blueprintjs/core';
|
import { FormGroup, Classes } from '@blueprintjs/core';
|
||||||
import { Field } from 'formik';
|
import { Field } from 'formik';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { get } from 'lodash';
|
import { filterItemsOptions } from '../common';
|
||||||
|
|
||||||
import { Row, Col, ItemsMultiSelect, FormattedMessage as T } from 'components';
|
import { Row, Col, ItemsMultiSelect, FormattedMessage as T } from 'components';
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
import {
|
import {
|
||||||
SalesByItemGeneralPanelProvider,
|
SalesByItemGeneralPanelProvider,
|
||||||
useSalesByItemsGeneralPanelContext,
|
useSalesByItemsGeneralPanelContext,
|
||||||
@@ -32,6 +33,12 @@ function SalesByItemsHeaderGeneralPanelContent() {
|
|||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
|
|
||||||
|
<FinancialStatementsFilter
|
||||||
|
items={filterItemsOptions}
|
||||||
|
label={<T id={'items.label_filter_items'} />}
|
||||||
|
initialSelectedItem={'all-items'}
|
||||||
|
/>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={4}>
|
<Col xs={4}>
|
||||||
<Field name={'itemsIds'}>
|
<Field name={'itemsIds'}>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
import FinancialStatementDateRange from 'containers/FinancialStatements/FinancialStatementDateRange';
|
||||||
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
import RadiosAccountingBasis from '../RadiosAccountingBasis';
|
||||||
import FinancialAccountsFilter from '../FinancialAccountsFilter';
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trial balance sheet - Drawer header - General panel.
|
* Trial balance sheet - Drawer header - General panel.
|
||||||
@@ -12,7 +12,7 @@ export default function TrialBalanceSheetHeaderGeneralPanel({
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
<FinancialAccountsFilter initialSelectedItem={'all-accounts'} />
|
<FinancialStatementsFilter initialSelectedItem={'all-accounts'} />
|
||||||
<RadiosAccountingBasis />
|
<RadiosAccountingBasis />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -33,14 +33,20 @@ function VendorsBalanceSummaryHeader({
|
|||||||
|
|
||||||
// filter form initial values.
|
// filter form initial values.
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
|
...pageFilter,
|
||||||
asDate: moment().toDate(),
|
asDate: moment().toDate(),
|
||||||
vendorsIds: [],
|
vendorsIds: [],
|
||||||
};
|
};
|
||||||
// Initial form values.
|
// Initial form values.
|
||||||
const initialValues = transformToForm({
|
const initialValues = transformToForm(
|
||||||
...pageFilter,
|
{
|
||||||
asDate: moment(pageFilter.asDate).toDate(),
|
...defaultValues,
|
||||||
}, defaultValues);
|
|
||||||
|
...pageFilter,
|
||||||
|
asDate: moment(pageFilter.asDate).toDate(),
|
||||||
|
},
|
||||||
|
defaultValues,
|
||||||
|
);
|
||||||
|
|
||||||
// handle form submit.
|
// handle form submit.
|
||||||
const handleSubmit = (values, { setSubmitting }) => {
|
const handleSubmit = (values, { setSubmitting }) => {
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import {
|
|||||||
FieldHint,
|
FieldHint,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
} from '../../../components';
|
} from '../../../components';
|
||||||
|
import { filterVendorsOptions } from '../common';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
momentFormatter,
|
momentFormatter,
|
||||||
tansformDateValue,
|
tansformDateValue,
|
||||||
@@ -18,6 +20,7 @@ import {
|
|||||||
handleDateChange,
|
handleDateChange,
|
||||||
} from 'utils';
|
} from 'utils';
|
||||||
import { useVendorsBalanceSummaryGeneralPanelContext } from './VendorsBalanceSummaryHeaderGeneralProvider';
|
import { useVendorsBalanceSummaryGeneralPanelContext } from './VendorsBalanceSummaryHeaderGeneralProvider';
|
||||||
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vendors balance header - General panel - Content.
|
* Vendors balance header - General panel - Content.
|
||||||
@@ -71,6 +74,12 @@ export default function VendorsBalanceSummaryHeaderGeneralContent() {
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
<FinancialStatementsFilter
|
||||||
|
items={filterVendorsOptions}
|
||||||
|
label={<T id={'vendors.label_filter_vendors'} />}
|
||||||
|
initialSelectedItem={'all-vendors'}
|
||||||
|
/>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={4}>
|
<Col xs={4}>
|
||||||
<Field name={'vendorsIds'}>
|
<Field name={'vendorsIds'}>
|
||||||
|
|||||||
@@ -31,23 +31,26 @@ function VendorsTransactionsHeader({
|
|||||||
}) {
|
}) {
|
||||||
// Default form values.
|
// Default form values.
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
|
...pageFilter,
|
||||||
fromDate: moment().toDate(),
|
fromDate: moment().toDate(),
|
||||||
toDate: moment().toDate(),
|
toDate: moment().toDate(),
|
||||||
vendorsIds: [],
|
vendorsIds: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
// Initial form values.
|
// Initial form values.
|
||||||
const initialValues = transformToForm({
|
const initialValues = transformToForm(
|
||||||
...pageFilter,
|
{
|
||||||
fromDate: moment(pageFilter.fromDate).toDate(),
|
...defaultValues,
|
||||||
toDate: moment(pageFilter.toDate).toDate(),
|
...pageFilter,
|
||||||
}, defaultValues);
|
fromDate: moment(pageFilter.fromDate).toDate(),
|
||||||
|
toDate: moment(pageFilter.toDate).toDate(),
|
||||||
|
},
|
||||||
|
defaultValues,
|
||||||
|
);
|
||||||
|
|
||||||
// Validation schema.
|
// Validation schema.
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
fromDate: Yup.date()
|
fromDate: Yup.date().required().label(intl.get('fromDate')),
|
||||||
.required()
|
|
||||||
.label(intl.get('fromDate')),
|
|
||||||
toDate: Yup.date()
|
toDate: Yup.date()
|
||||||
.min(Yup.ref('fromDate'))
|
.min(Yup.ref('fromDate'))
|
||||||
.required()
|
.required()
|
||||||
@@ -62,7 +65,9 @@ function VendorsTransactionsHeader({
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Handle drawer close action.
|
// Handle drawer close action.
|
||||||
const handleDrawerClose = () => { toggleFilterDrawer(false); };
|
const handleDrawerClose = () => {
|
||||||
|
toggleFilterDrawer(false);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FinancialStatementHeader
|
<FinancialStatementHeader
|
||||||
|
|||||||
@@ -4,12 +4,16 @@ import classNames from 'classnames';
|
|||||||
import { Classes, FormGroup } from '@blueprintjs/core';
|
import { Classes, FormGroup } from '@blueprintjs/core';
|
||||||
|
|
||||||
import FinancialStatementDateRange from '../FinancialStatementDateRange';
|
import FinancialStatementDateRange from '../FinancialStatementDateRange';
|
||||||
|
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Row,
|
Row,
|
||||||
Col,
|
Col,
|
||||||
ContactsMultiSelect,
|
ContactsMultiSelect,
|
||||||
FormattedMessage as T,
|
FormattedMessage as T,
|
||||||
} from '../../../components';
|
} from '../../../components';
|
||||||
|
import { filterVendorsOptions } from '../common';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
VendorsTransactionsGeneralPanelProvider,
|
VendorsTransactionsGeneralPanelProvider,
|
||||||
useVendorsTransactionsGeneralPanelContext,
|
useVendorsTransactionsGeneralPanelContext,
|
||||||
@@ -35,7 +39,11 @@ function VendorsTransactionsHeaderGeneralPanelContent() {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FinancialStatementDateRange />
|
<FinancialStatementDateRange />
|
||||||
|
<FinancialStatementsFilter
|
||||||
|
items={filterVendorsOptions}
|
||||||
|
label={<T id={'vendors.label_filter_vendors'} />}
|
||||||
|
initialSelectedItem={'all-vendors'}
|
||||||
|
/>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={5}>
|
<Col xs={5}>
|
||||||
<Field name={'vendorsIds'}>
|
<Field name={'vendorsIds'}>
|
||||||
|
|||||||
@@ -65,8 +65,83 @@ export const filterAccountsOptions = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const filterItemsOptions = [
|
||||||
|
{
|
||||||
|
key: 'all-items',
|
||||||
|
name: intl.get('all_items'),
|
||||||
|
hint: intl.get('items.option_all_items.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'with-transactions',
|
||||||
|
name: intl.get('items.option_with_transactions'),
|
||||||
|
hint: intl.get('items.option_with_transactions.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'with-only-active',
|
||||||
|
name: intl.get('items.option.only_active'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const filterCustomersOptions = [
|
||||||
|
{
|
||||||
|
key: 'all-customers',
|
||||||
|
name: intl.get('all_customers'),
|
||||||
|
hint: intl.get('customers.option_all_customers.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'without-zero-balance',
|
||||||
|
name: intl.get('customers.option_without_zero_balance'),
|
||||||
|
hint: intl.get('customers.option_without_zero_balance.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'with-transactions',
|
||||||
|
name: intl.get('customers.option_with_transactions'),
|
||||||
|
hint: intl.get('customers.option_with_transactions.hint'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const filterVendorsOptions = [
|
||||||
|
{
|
||||||
|
key: 'all-vendors',
|
||||||
|
name: intl.get('all_vendors'),
|
||||||
|
hint: intl.get('vendors.option_all_vendors.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'without-zero-balance',
|
||||||
|
name: intl.get('vendors.option_without_zero_balance'),
|
||||||
|
hint: intl.get('vendors.option_without_zero_balance.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'with-transactions',
|
||||||
|
name: intl.get('vendors.option_with_transactions'),
|
||||||
|
hint: intl.get('vendors.option_with_transactions.hint'),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const filterInventoryValuationOptions = [
|
||||||
|
{
|
||||||
|
key: 'all-items',
|
||||||
|
name: intl.get('all_items'),
|
||||||
|
hint: intl.get('items.option_all_items.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'with-transactions',
|
||||||
|
name: intl.get('items.option_with_transactions'),
|
||||||
|
hint: intl.get('items.option_with_transactions.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'without-zero-balance',
|
||||||
|
name: intl.get('items.option_without_zero_balance'),
|
||||||
|
hint: intl.get('items.option_without_zero_balance.hint'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'with-only-active',
|
||||||
|
name: intl.get('items.option.only_active'),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Associate display columns by and type properties to query object.
|
* Associate display columns by and type properties to query object.
|
||||||
*/
|
*/
|
||||||
export const transformDisplayColumnsType = (form) => {
|
export const transformDisplayColumnsType = (form) => {
|
||||||
const columnType = displayColumnsByOptions.find(
|
const columnType = displayColumnsByOptions.find(
|
||||||
@@ -87,15 +162,13 @@ const setNoneZeroTransactions = (form) => {
|
|||||||
...form,
|
...form,
|
||||||
noneZero: form.accountsFilter === 'without-zero-balance',
|
noneZero: form.accountsFilter === 'without-zero-balance',
|
||||||
noneTransactions: form.accountsFilter === 'with-transactions',
|
noneTransactions: form.accountsFilter === 'with-transactions',
|
||||||
|
onlyActive: form.accountsFilter === 'with-only-active',
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
export const transformAccountsFilter = (form) => {
|
export const transformAccountsFilter = (form) => {
|
||||||
return R.compose(
|
return R.compose(R.omit(['accountsFilter']), setNoneZeroTransactions)(form);
|
||||||
R.omit(['accountsFilter']),
|
};
|
||||||
setNoneZeroTransactions,
|
|
||||||
)(form)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform filter form to http query.
|
* Transform filter form to http query.
|
||||||
|
|||||||
@@ -1369,7 +1369,34 @@
|
|||||||
"filter.enter_date": "أدخل تاريخ",
|
"filter.enter_date": "أدخل تاريخ",
|
||||||
"filter.value": "قيمة",
|
"filter.value": "قيمة",
|
||||||
"payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!.",
|
"payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!.",
|
||||||
"estimate.delete.error.estimate_converted_to_invoice":"لا يمكن حذف عملية عرض اسعار الذي تم تحويلها إلي فاتورة بيع."
|
"estimate.delete.error.estimate_converted_to_invoice":"لا يمكن حذف عملية عرض اسعار الذي تم تحويلها إلي فاتورة بيع.",
|
||||||
|
|
||||||
|
"items.option.only_active": "Only active",
|
||||||
|
"items.option_all_items.hint": "جميع الاصناف ، بما في ذلك تلك الاصناف لديها رصيد صفر.",
|
||||||
|
"items.option_with_transactions": "الاصناف مع معاملات",
|
||||||
|
"items.option_with_transactions.hint": "قم بتضمين الاصناف التي لها معاملات في فترة التاريخ المحددة فقط.",
|
||||||
|
"items.option_without_zero_balance": "الاصناف ذات رصيد صفر",
|
||||||
|
"items.option_without_zero_balance.hint": "قم بتضمين الاصناف واستبعاد تلك التي لديها رصيد صفري.",
|
||||||
|
"items.label_filter_items": "تصفية الاصناف",
|
||||||
|
|
||||||
|
"customers.option_all_customers.hint":"All customers, including that ones have zero-balance.",
|
||||||
|
"customers.option_without_zero_balance": "Customers without zero-balance",
|
||||||
|
"customers.option_without_zero_balance.hint":"Include customers and exclude that ones have zero-balance.",
|
||||||
|
"customers.option_with_transactions": "Customers with transactions",
|
||||||
|
"customers.option_with_transactions.hint": "Include customers that onces have transactions on the given date period only.",
|
||||||
|
"customers.label_filter_customers": "Filter customers",
|
||||||
|
|
||||||
|
|
||||||
|
"vendors.option_all_vendors.hint":"All vendors, including that ones have zero-balance.",
|
||||||
|
"vendors.label_filter_vendors": "Filter Vendors",
|
||||||
|
"vendors.option_without_zero_balance": "Vendors without zero-balance",
|
||||||
|
"vendors.option_without_zero_balance.hint":"Include vendors and exclude that ones have zero-balance.",
|
||||||
|
"vendors.option_with_transactions": "Vendors with transactions",
|
||||||
|
"vendors.option_with_transactions.hint": "Include vendors that onces have transactions on the given date period only."
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -619,7 +619,6 @@
|
|||||||
"contact_us_technical_support": "Contact us - Technical Support",
|
"contact_us_technical_support": "Contact us - Technical Support",
|
||||||
"organization_details": "Organization details",
|
"organization_details": "Organization details",
|
||||||
"financial_starting_date": "Financial starting date ",
|
"financial_starting_date": "Financial starting date ",
|
||||||
|
|
||||||
"save_continue": "Save & Continue",
|
"save_continue": "Save & Continue",
|
||||||
"organization_register": "Organization Register",
|
"organization_register": "Organization Register",
|
||||||
"fiscal_year_": "Fiscal year",
|
"fiscal_year_": "Fiscal year",
|
||||||
@@ -1058,7 +1057,6 @@
|
|||||||
"products_you_buy_and_or_sell": "<strong> Inventory :</strong> Products you buy and/or sell and that you track quantities of.",
|
"products_you_buy_and_or_sell": "<strong> Inventory :</strong> Products you buy and/or sell and that you track quantities of.",
|
||||||
"products_you_buy_and_or_sell_but_don_t_need": "<strong> Non-Inventory:</strong> Products you buy and/or sell but don’t need to (or can’t) track quantities of, for example, nuts and bolts used in an installation.",
|
"products_you_buy_and_or_sell_but_don_t_need": "<strong> Non-Inventory:</strong> Products you buy and/or sell but don’t need to (or can’t) track quantities of, for example, nuts and bolts used in an installation.",
|
||||||
"there_is_no_items_in_the_table_yet": "There is no items in the table yet.",
|
"there_is_no_items_in_the_table_yet": "There is no items in the table yet.",
|
||||||
|
|
||||||
"mr": "Mr.",
|
"mr": "Mr.",
|
||||||
"mrs": "Mrs.",
|
"mrs": "Mrs.",
|
||||||
"ms": "Ms.",
|
"ms": "Ms.",
|
||||||
@@ -1112,7 +1110,6 @@
|
|||||||
"Initializing": "Initializing",
|
"Initializing": "Initializing",
|
||||||
"Getting started": "Getting started",
|
"Getting started": "Getting started",
|
||||||
"Congratulations": "Congratulations",
|
"Congratulations": "Congratulations",
|
||||||
|
|
||||||
"manual_journal_number": "Manual journal {number}",
|
"manual_journal_number": "Manual journal {number}",
|
||||||
"conditions_and_terms": "Conditions and terms",
|
"conditions_and_terms": "Conditions and terms",
|
||||||
"allocate_landed_coast": "Allocate landed cost",
|
"allocate_landed_coast": "Allocate landed cost",
|
||||||
@@ -1342,5 +1339,26 @@
|
|||||||
"filter.enter_date": "Enter date",
|
"filter.enter_date": "Enter date",
|
||||||
"filter.value": "Value",
|
"filter.value": "Value",
|
||||||
"payment_made.empty_status.title": "The organization doesn't pay to vendors, yet!",
|
"payment_made.empty_status.title": "The organization doesn't pay to vendors, yet!",
|
||||||
"estimate.delete.error.estimate_converted_to_invoice":"Could not delete sale estimate that converted to invoice"
|
"estimate.delete.error.estimate_converted_to_invoice": "Could not delete sale estimate that converted to invoice",
|
||||||
}
|
"items.option.only_active": "Only active",
|
||||||
|
"items.option_all_items.hint": "All items, including that ones have zero-balance.",
|
||||||
|
"items.option_with_transactions": "Items with transactions",
|
||||||
|
"items.option_without_zero_balance": "Items without zero-balance",
|
||||||
|
"items.option_without_zero_balance.hint": "Include items and exclude that ones have zero-balance.",
|
||||||
|
"items.option_with_transactions.hint": "Include items that onces have transactions on the given date period only.",
|
||||||
|
"items.label_filter_items": "Filter items",
|
||||||
|
"customers.option_all_customers.hint":"All customers, including that ones have zero-balance.",
|
||||||
|
"customers.label_filter_customers": "Filter customers",
|
||||||
|
"customers.option_without_zero_balance": "Customers without zero-balance",
|
||||||
|
"customers.option_without_zero_balance.hint":"Include customers and exclude that ones have zero-balance.",
|
||||||
|
"customers.option_with_transactions": "Customers with transactions",
|
||||||
|
"customers.option_with_transactions.hint": "Include customers that onces have transactions on the given date period only.",
|
||||||
|
"vendors.option_all_vendors.hint":"All vendors, including that ones have zero-balance.",
|
||||||
|
"vendors.label_filter_vendors": "Filter Vendors",
|
||||||
|
"vendors.option_without_zero_balance": "Vendors without zero-balance",
|
||||||
|
"vendors.option_without_zero_balance.hint":"Include vendors and exclude that ones have zero-balance.",
|
||||||
|
"vendors.option_with_transactions": "Vendors with transactions",
|
||||||
|
"vendors.option_with_transactions.hint": "Include vendors that onces have transactions on the given date period only."
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -32,7 +32,8 @@
|
|||||||
.financial-statement--balance-summary {
|
.financial-statement--balance-summary {
|
||||||
.financial-header-drawer {
|
.financial-header-drawer {
|
||||||
.bp3-drawer {
|
.bp3-drawer {
|
||||||
max-height: 350px;
|
// max-height: 350px;
|
||||||
|
max-height: 415px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,7 +84,8 @@
|
|||||||
.financial-statement--transactions {
|
.financial-statement--transactions {
|
||||||
.financial-header-drawer {
|
.financial-header-drawer {
|
||||||
.bp3-drawer {
|
.bp3-drawer {
|
||||||
max-height: 350px;
|
// max-height: 350px;
|
||||||
|
max-height: 415px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
padding-bottom: 0.4rem;
|
padding-bottom: 0.4rem;
|
||||||
}
|
}
|
||||||
.tr.row_type--total .td {
|
.tr.row_type--total .td {
|
||||||
border-top: 1px solid #BBB;
|
border-top: 1px solid #bbb;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
border-bottom: 3px double #000;
|
border-bottom: 3px double #000;
|
||||||
}
|
}
|
||||||
@@ -29,21 +29,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.financial-statement--sales-by-items,
|
.financial-statement--sales-by-items,
|
||||||
.financial-statement--purchases-by-items{
|
.financial-statement--purchases-by-items {
|
||||||
|
.financial-header-drawer {
|
||||||
.financial-header-drawer{
|
.bp3-drawer {
|
||||||
.bp3-drawer{
|
// max-height: 400px;
|
||||||
max-height: 400px;
|
max-height: 415px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.financial-statement--inventory-valuation {
|
||||||
.financial-statement--inventory-valuation{
|
.financial-header-drawer {
|
||||||
|
.bp3-drawer {
|
||||||
.financial-header-drawer{
|
|
||||||
.bp3-drawer{
|
|
||||||
max-height: 350px;
|
max-height: 350px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user