mirror of
https://github.com/frappe/books.git
synced 2025-01-08 17:24:05 +00:00
Added date filter for a quater, added download path setup
This commit is contained in:
parent
b7980c6a56
commit
482f7875bb
@ -1,10 +1,22 @@
|
||||
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: baseConfig.filterFields,
|
||||
filterFields,
|
||||
linkFields: baseConfig.linkFields,
|
||||
getColumns: baseConfig.getColumns
|
||||
getColumns: baseConfig.getColumns,
|
||||
};
|
||||
|
@ -102,6 +102,8 @@ import Row from '@/components/Row';
|
||||
import WithScroll from '@/components/WithScroll';
|
||||
import FormControl from '@/components/Controls/FormControl';
|
||||
import reportViewConfig from '@/../reports/view';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { IPC_ACTIONS } from '@/messages';
|
||||
|
||||
export default {
|
||||
name: 'Report',
|
||||
@ -271,9 +273,29 @@ export default {
|
||||
this.loading ? 'text-gray-100' : 'text-gray-900',
|
||||
];
|
||||
},
|
||||
downloadAsJson() {
|
||||
async downloadAsJson() {
|
||||
const savePath = await this.getSavePath();
|
||||
console.log('download complete');
|
||||
},
|
||||
async getSavePath() {
|
||||
const options = {
|
||||
title: this._('Select folder'),
|
||||
defaultPath: `${this.reportName}.json`,
|
||||
};
|
||||
|
||||
let { filePath } = await ipcRenderer.invoke(
|
||||
IPC_ACTIONS.GET_SAVE_FILEPATH,
|
||||
options
|
||||
);
|
||||
|
||||
if (filePath) {
|
||||
if (!filePath.endsWith('.json')) {
|
||||
filePath = filePath + '.json';
|
||||
}
|
||||
}
|
||||
|
||||
return filePath;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
columns() {
|
||||
|
Loading…
Reference in New Issue
Block a user