mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
fix: BIG-132 AR/AP aging summary report filter by none transactions/zero contacts.
This commit is contained in:
@@ -17,7 +17,7 @@ import withAPAgingSummaryActions from './withAPAgingSummaryActions';
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
* AP aging summary report.
|
||||
* A/P aging summary report.
|
||||
*/
|
||||
function APAgingSummary({
|
||||
// #withSettings
|
||||
@@ -28,9 +28,10 @@ function APAgingSummary({
|
||||
}) {
|
||||
const [filter, setFilter] = useState({
|
||||
asDate: moment().endOf('day').format('YYYY-MM-DD'),
|
||||
agingBeforeDays: 30,
|
||||
agingDaysBefore: 30,
|
||||
agingPeriods: 3,
|
||||
vendorsIds: [],
|
||||
filterByOption: 'without-zero-balance',
|
||||
});
|
||||
|
||||
// Handle filter submit.
|
||||
|
||||
@@ -49,6 +49,7 @@ function APAgingSummaryHeader({
|
||||
agingDaysBefore: 30,
|
||||
agingPeriods: 3,
|
||||
vendorsIds: [],
|
||||
filterByOption: 'without-zero-balance',
|
||||
};
|
||||
// Formik initial values.
|
||||
const initialValues = transformToForm(pageFilter, defaultValues);
|
||||
@@ -61,10 +62,14 @@ function APAgingSummaryHeader({
|
||||
};
|
||||
|
||||
// Handle cancel button click.
|
||||
const handleCancelClick = () => { toggleFilterDrawerDisplay(false); };
|
||||
const handleCancelClick = () => {
|
||||
toggleFilterDrawerDisplay(false);
|
||||
};
|
||||
|
||||
// Handle the drawer closing.
|
||||
const handleDrawerClose = () => { toggleFilterDrawerDisplay(false); };
|
||||
const handleDrawerClose = () => {
|
||||
toggleFilterDrawerDisplay(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<FinancialStatementHeader
|
||||
|
||||
@@ -17,6 +17,8 @@ import {
|
||||
FieldHint,
|
||||
} from 'components';
|
||||
import { useAPAgingSummaryGeneralContext } from './APAgingSummaryGeneralProvider';
|
||||
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||
import { filterVendorsOptions } from './constants';
|
||||
import {
|
||||
momentFormatter,
|
||||
tansformDateValue,
|
||||
@@ -90,6 +92,15 @@ export default function APAgingSummaryHeaderGeneralContent() {
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col xs={5}>
|
||||
<FinancialStatementsFilter
|
||||
items={filterVendorsOptions}
|
||||
label={<T id={'AP_aging_summary.filter_options.label'} />}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col xs={5}>
|
||||
<Field name={'vendorsIds'}>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useMemo, createContext, useContext } from 'react';
|
||||
|
||||
import FinancialReportPage from '../FinancialReportPage';
|
||||
import { useAPAgingSummaryReport, useVendors } from 'hooks/query';
|
||||
import { useAPAgingSummaryReport } from '../../../hooks/query';
|
||||
import { transformFilterFormToQuery } from '../common';
|
||||
|
||||
const APAgingSummaryContext = createContext();
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const filterVendorsOptions = [
|
||||
{
|
||||
key: 'all-vendors',
|
||||
name: intl.get('AP_aging_summary.filter_vendors.all_vendors'),
|
||||
hint: intl.get('AP_aging_summary.filter_vendors.all_vendors.hint'),
|
||||
},
|
||||
{
|
||||
key: 'without-zero-balance',
|
||||
name: intl.get('AP_aging_summary.filter_vendors.without_zero_balance'),
|
||||
hint: intl.get('AP_aging_summary.filter_vendors.without_zero_balance.hint'),
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user