2
0
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:
Piyush Singhania 2021-12-12 15:30:50 +05:30 committed by Alan
parent 776f12c2d1
commit d652ee800d
3 changed files with 5 additions and 13 deletions

View File

@ -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: [

View File

@ -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,
};

View File

@ -6,5 +6,5 @@ export default {
method: 'gstr-2',
filterFields: baseConfig.filterFields,
linkFields: baseConfig.linkFields,
getColumns: baseConfig.getColumns
getColumns: baseConfig.getColumns,
};