mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
fix: BIG-132 AR/AP aging summary report filter by none transactions/zero contacts.
This commit is contained in:
@@ -32,6 +32,7 @@ function ReceivableAgingSummarySheet({
|
||||
agingDaysBefore: 30,
|
||||
agingPeriods: 3,
|
||||
customersIds: [],
|
||||
filterByOption: 'without-zero-balance',
|
||||
});
|
||||
|
||||
// Handle filter submit.
|
||||
|
||||
@@ -27,6 +27,7 @@ function ARAgingSummaryHeader({
|
||||
// #withARAgingSummary
|
||||
isFilterDrawerOpen,
|
||||
}) {
|
||||
// Validation schema.
|
||||
const validationSchema = Yup.object().shape({
|
||||
asDate: Yup.date().required().label('asDate'),
|
||||
agingDaysBefore: Yup.number()
|
||||
@@ -46,6 +47,7 @@ function ARAgingSummaryHeader({
|
||||
agingDaysBefore: 30,
|
||||
agingPeriods: 3,
|
||||
customersIds: [],
|
||||
filterByOption: 'without-zero-balance',
|
||||
};
|
||||
// Initial values.
|
||||
const initialValues = transformToForm(
|
||||
@@ -67,7 +69,6 @@ function ARAgingSummaryHeader({
|
||||
const handleCancelClick = () => {
|
||||
toggleFilterDrawerDisplay(false);
|
||||
};
|
||||
|
||||
// Handle the drawer close.
|
||||
const handleDrawerClose = () => {
|
||||
toggleFilterDrawerDisplay(false);
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
} from '@blueprintjs/core';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import FinancialStatementsFilter from '../FinancialStatementsFilter';
|
||||
import {
|
||||
FormattedMessage as T,
|
||||
ContactsMultiSelect,
|
||||
@@ -19,6 +20,7 @@ import {
|
||||
} from 'components';
|
||||
import { momentFormatter } from 'utils';
|
||||
import { useARAgingSummaryGeneralContext } from './ARAgingSummaryGeneralProvider';
|
||||
import { filterCustomersOptions } from './constants';
|
||||
|
||||
/**
|
||||
* AR Aging Summary - Drawer Header - General Fields.
|
||||
@@ -96,6 +98,16 @@ export default function ARAgingSummaryHeaderGeneralContent() {
|
||||
</FastField>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col xs={5}>
|
||||
<FinancialStatementsFilter
|
||||
items={filterCustomersOptions}
|
||||
label={<T id={'AR_aging_summary.filter_options.label'} />}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row>
|
||||
<Col xs={5}>
|
||||
<Field name="customersIds">
|
||||
|
||||
@@ -9,7 +9,7 @@ const ARAgingSummaryContext = createContext();
|
||||
* A/R aging summary provider.
|
||||
*/
|
||||
function ARAgingSummaryProvider({ filter, ...props }) {
|
||||
// Transformes the filter from to the Url query.
|
||||
// Transformes the filter from to the url query.
|
||||
const query = useMemo(() => transformFilterFormToQuery(filter), [filter]);
|
||||
|
||||
// A/R aging summary sheet context.
|
||||
|
||||
@@ -13,8 +13,6 @@ export default function ReceivableAgingSummaryTable({
|
||||
// #ownProps
|
||||
organizationName,
|
||||
}) {
|
||||
|
||||
|
||||
// AR aging summary report context.
|
||||
const { ARAgingSummary, isARAgingLoading } = useARAgingSummaryContext();
|
||||
|
||||
@@ -23,10 +21,6 @@ export default function ReceivableAgingSummaryTable({
|
||||
|
||||
const rowClassNames = (row) => [`row-type--${row.original.rowType}`];
|
||||
|
||||
const handleFetchData = useCallback((...args) => {
|
||||
// onFetchData && onFetchData(...args);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<FinancialSheet
|
||||
companyName={organizationName}
|
||||
@@ -40,7 +34,6 @@ export default function ReceivableAgingSummaryTable({
|
||||
columns={columns}
|
||||
data={ARAgingSummary.tableRows}
|
||||
rowClassNames={rowClassNames}
|
||||
onFetchData={handleFetchData}
|
||||
noInitialFetch={true}
|
||||
sticky={true}
|
||||
/>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const filterCustomersOptions = [
|
||||
{
|
||||
key: 'all-customers',
|
||||
name: intl.get('AR_aging_summary.filter_customers.all_customers'),
|
||||
hint: intl.get('AR_aging_summary.filter_customers.all_customers.hint'),
|
||||
},
|
||||
{
|
||||
key: 'without-zero-balance',
|
||||
name: intl.get('AR_aging_summary.filter_customers.without_zero_balance'),
|
||||
hint: intl.get(
|
||||
'AR_aging_summary.filter_customers.without_zero_balance.hint',
|
||||
),
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user