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