mirror of
https://github.com/frappe/books.git
synced 2025-01-08 17:24:05 +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 { generateGstr1Json } from '../../accounting/gst';
|
||||
import { DateTime } from 'luxon';
|
||||
|
||||
export default {
|
||||
filterFields: [
|
||||
@ -30,6 +31,7 @@ export default {
|
||||
size: 'small',
|
||||
placeholder: 'From Date',
|
||||
fieldname: 'fromDate',
|
||||
default: DateTime.local().minus({ months: 3 }).toISODate(),
|
||||
},
|
||||
{
|
||||
fieldtype: 'Date',
|
||||
@ -37,6 +39,7 @@ export default {
|
||||
size: 'small',
|
||||
placeholder: 'To Date',
|
||||
fieldname: 'toDate',
|
||||
default: DateTime.local().toISODate(),
|
||||
},
|
||||
],
|
||||
linkFields: [
|
||||
|
@ -2,21 +2,10 @@ const title = 'GSTR 1';
|
||||
import baseConfig from './BaseViewConfig';
|
||||
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 {
|
||||
title: title,
|
||||
method: 'gstr-1',
|
||||
filterFields,
|
||||
filterFields: baseConfig.filterFields,
|
||||
linkFields: baseConfig.linkFields,
|
||||
getColumns: baseConfig.getColumns,
|
||||
};
|
||||
|
@ -6,5 +6,5 @@ export default {
|
||||
method: 'gstr-2',
|
||||
filterFields: baseConfig.filterFields,
|
||||
linkFields: baseConfig.linkFields,
|
||||
getColumns: baseConfig.getColumns
|
||||
getColumns: baseConfig.getColumns,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user