2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00
books/reports/GoodsAndServiceTax/GSTR2View.js

39 lines
790 B
JavaScript
Raw Normal View History

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