mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
fix(webapp): filter by customers, vendors and items in reports do not work
This commit is contained in:
@@ -1,10 +1,28 @@
|
||||
// @ts-nocheck
|
||||
import moment from 'moment';
|
||||
import * as Yup from 'yup';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
export const getDefaultSalesByItemsQuery = () => {
|
||||
return {
|
||||
fromDate: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
||||
filterByOption: 'with-transactions',
|
||||
};
|
||||
/**
|
||||
* Retrieves the validation schema.
|
||||
* @returns {Yup}
|
||||
*/
|
||||
export const getSalesByItemsQueryShema = () => {
|
||||
return Yup.object().shape({
|
||||
fromDate: Yup.date().required().label(intl.get('from_date')),
|
||||
toDate: Yup.date()
|
||||
.min(Yup.ref('fromDate'))
|
||||
.required()
|
||||
.label(intl.get('to_date')),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves the default query.
|
||||
*/
|
||||
export const getDefaultSalesByItemsQuery = () => ({
|
||||
fromDate: moment().startOf('year').format('YYYY-MM-DD'),
|
||||
toDate: moment().endOf('year').format('YYYY-MM-DD'),
|
||||
filterByOption: 'with-transactions',
|
||||
itemsIds: [],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user