mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
fix(webapp): filter by customers, vendors and items in reports do not work
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import moment from 'moment';
|
||||
import * as Yup from 'yup';
|
||||
import { castArray } from 'lodash';
|
||||
|
||||
import { useAppQueryString } from '@/hooks';
|
||||
@@ -26,15 +27,25 @@ export const filterAccountsOptions = [
|
||||
/**
|
||||
* Retrieves the default general ledger query.
|
||||
*/
|
||||
export const getDefaultGeneralLedgerQuery = () => {
|
||||
return {
|
||||
fromDate: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
||||
basis: 'accrual',
|
||||
filterByOption: 'with-transactions',
|
||||
branchesIds: [],
|
||||
accountsIds: [],
|
||||
};
|
||||
export const getDefaultGeneralLedgerQuery = () => ({
|
||||
fromDate: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
||||
basis: 'accrual',
|
||||
filterByOption: 'with-transactions',
|
||||
branchesIds: [],
|
||||
accountsIds: [],
|
||||
});
|
||||
|
||||
/**
|
||||
* Retrieves the validation schema of general ledger.
|
||||
* @returns {Yup}
|
||||
*/
|
||||
export const getGeneralLedgerQuerySchema = () => {
|
||||
return Yup.object().shape({
|
||||
dateRange: Yup.string().optional(),
|
||||
fromDate: Yup.date().required(),
|
||||
toDate: Yup.date().min(Yup.ref('fromDate')).required(),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user