2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/reports/GoodsAndServiceTax/GSTR2View.js
18alantom de7e5ba807 refactor: rename 'frappe' to 'fyo' outside src
- cause now most of it is different from what it was
2022-05-23 16:18:22 +05:30

39 lines
789 B
JavaScript

const title = 'GSTR 2';
import { t } from 'fyo';
import { generateGstr2Csv } from '../../accounting/gst';
import baseConfig from './BaseViewConfig';
const transferTypeMap = {
B2B: 'B2B',
};
const transferType = {
fieldtype: 'Select',
label: t`Transfer Type`,
placeholder: t`Transfer Type`,
fieldname: 'transferType',
options: Object.keys(transferTypeMap),
map: transferTypeMap,
default: 'B2B',
size: 'small',
};
const actions = [
{
group: t`Export`,
label: t`CSV`,
type: 'primary',
action: async (report, filters) => {
generateGstr2Csv(report, filters);
},
},
];
export default {
title: title,
method: 'gstr-2',
filterFields: [ transferType, ...baseConfig.filterFields],
actions: actions,
getColumns: baseConfig.getColumns,
};