mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix(webapp): add validation to aging summary customize form
This commit is contained in:
@@ -36,19 +36,23 @@ export const getAPAgingSummaryQuerySchema = () => {
|
||||
.required()
|
||||
.integer()
|
||||
.positive()
|
||||
.label('agingBeforeDays'),
|
||||
.label('Aging days before')
|
||||
.min(1)
|
||||
.max(500),
|
||||
agingPeriods: Yup.number()
|
||||
.required()
|
||||
.integer()
|
||||
.positive()
|
||||
.label('agingPeriods'),
|
||||
.max(12)
|
||||
.min(1)
|
||||
.label('Aging periods'),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Parses the AP aging summary query state.
|
||||
* @param locationQuery
|
||||
* @returns
|
||||
* @param locationQuery
|
||||
* @returns
|
||||
*/
|
||||
const parseAPAgingSummaryQuery = (locationQuery) => {
|
||||
const defaultQuery = getDefaultAPAgingSummaryQuery();
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
// @ts-nocheck
|
||||
import React, { useMemo } from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import * as R from 'ramda';
|
||||
|
||||
import { If, FormattedMessage as T } from '@/components';
|
||||
import { useAPAgingSummaryContext } from './APAgingSummaryProvider';
|
||||
import { If } from '@/components';
|
||||
import FinancialLoadingBar from '../FinancialLoadingBar';
|
||||
import { useAPAgingSummaryContext } from './APAgingSummaryProvider';
|
||||
import { agingSummaryDynamicColumns } from '../AgingSummary/dynamicColumns';
|
||||
|
||||
/**
|
||||
@@ -19,54 +17,6 @@ export const useAPAgingSummaryColumns = () => {
|
||||
return agingSummaryDynamicColumns(table.columns, table.rows);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve AP aging summary columns.
|
||||
*/
|
||||
// export const useAPAgingSummaryColumns = () => {
|
||||
// const {
|
||||
// APAgingSummary: { tableRows, columns },
|
||||
// } = useAPAgingSummaryContext();
|
||||
|
||||
// const agingColumns = React.useMemo(() => {
|
||||
// return columns.map(
|
||||
// (agingColumn) =>
|
||||
// `${agingColumn.before_days} - ${
|
||||
// agingColumn.to_days || intl.get('and_over')
|
||||
// }`,
|
||||
// );
|
||||
// }, [columns]);
|
||||
|
||||
// return useMemo(
|
||||
// () => [
|
||||
// {
|
||||
// Header: <T id={'vendor_name'} />,
|
||||
// accessor: 'name',
|
||||
// className: 'vendor_name',
|
||||
// width: 240,
|
||||
// sticky: 'left',
|
||||
// textOverview: true,
|
||||
// },
|
||||
// {
|
||||
// Header: <T id={'current'} />,
|
||||
// accessor: 'current',
|
||||
// className: 'current',
|
||||
// width: getColumnWidth(tableRows, `current`, { minWidth: 120 }),
|
||||
// },
|
||||
// ...agingColumns.map((agingColumn, index) => ({
|
||||
// Header: agingColumn,
|
||||
// accessor: `aging-${index}`,
|
||||
// width: getColumnWidth(tableRows, `aging-${index}`, { minWidth: 120 }),
|
||||
// })),
|
||||
// {
|
||||
// Header: <T id={'total'} />,
|
||||
// accessor: 'total',
|
||||
// width: getColumnWidth(tableRows, 'total', { minWidth: 120 }),
|
||||
// },
|
||||
// ],
|
||||
// [tableRows, agingColumns],
|
||||
// );
|
||||
// };
|
||||
|
||||
/**
|
||||
* A/P aging summary sheet loading bar.
|
||||
*/
|
||||
|
||||
@@ -35,12 +35,16 @@ export const getARAgingSummaryQuerySchema = () => {
|
||||
.required()
|
||||
.integer()
|
||||
.positive()
|
||||
.label('agingDaysBefore'),
|
||||
.label('Aging days before')
|
||||
.min(1)
|
||||
.max(500),
|
||||
agingPeriods: Yup.number()
|
||||
.required()
|
||||
.integer()
|
||||
.positive()
|
||||
.label('agingPeriods'),
|
||||
.max(12)
|
||||
.min(1)
|
||||
.label('Aging periods'),
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user