mirror of
https://github.com/frappe/books.git
synced 2025-01-24 23:58:27 +00:00
Refactored filter fields
This commit is contained in:
parent
776f12c2d1
commit
d652ee800d
@ -1,5 +1,6 @@
|
|||||||
import ExportWizard from '../../src/components/ExportWizard';
|
import ExportWizard from '../../src/components/ExportWizard';
|
||||||
import { generateGstr1Json } from '../../accounting/gst';
|
import { generateGstr1Json } from '../../accounting/gst';
|
||||||
|
import { DateTime } from 'luxon';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
filterFields: [
|
filterFields: [
|
||||||
@ -30,6 +31,7 @@ export default {
|
|||||||
size: 'small',
|
size: 'small',
|
||||||
placeholder: 'From Date',
|
placeholder: 'From Date',
|
||||||
fieldname: 'fromDate',
|
fieldname: 'fromDate',
|
||||||
|
default: DateTime.local().minus({ months: 3 }).toISODate(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldtype: 'Date',
|
fieldtype: 'Date',
|
||||||
@ -37,6 +39,7 @@ export default {
|
|||||||
size: 'small',
|
size: 'small',
|
||||||
placeholder: 'To Date',
|
placeholder: 'To Date',
|
||||||
fieldname: 'toDate',
|
fieldname: 'toDate',
|
||||||
|
default: DateTime.local().toISODate(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
linkFields: [
|
linkFields: [
|
||||||
|
@ -2,21 +2,10 @@ const title = 'GSTR 1';
|
|||||||
import baseConfig from './BaseViewConfig';
|
import baseConfig from './BaseViewConfig';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
|
|
||||||
const filterFields = baseConfig.filterFields;
|
|
||||||
filterFields.forEach((field) => {
|
|
||||||
if (field.fieldname === 'toDate') {
|
|
||||||
field.default = DateTime.local().toISODate();
|
|
||||||
}
|
|
||||||
else if(field.fieldname === 'fromDate') {
|
|
||||||
field.default = DateTime.local().minus({months: 3}).toISODate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: title,
|
title: title,
|
||||||
method: 'gstr-1',
|
method: 'gstr-1',
|
||||||
filterFields,
|
filterFields: baseConfig.filterFields,
|
||||||
linkFields: baseConfig.linkFields,
|
linkFields: baseConfig.linkFields,
|
||||||
getColumns: baseConfig.getColumns,
|
getColumns: baseConfig.getColumns,
|
||||||
};
|
};
|
||||||
|
@ -6,5 +6,5 @@ export default {
|
|||||||
method: 'gstr-2',
|
method: 'gstr-2',
|
||||||
filterFields: baseConfig.filterFields,
|
filterFields: baseConfig.filterFields,
|
||||||
linkFields: baseConfig.linkFields,
|
linkFields: baseConfig.linkFields,
|
||||||
getColumns: baseConfig.getColumns
|
getColumns: baseConfig.getColumns,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user