2019-07-30 12:02:49 +00:00
|
|
|
const title = 'GSTR 1';
|
2021-11-04 10:31:26 +00:00
|
|
|
import baseConfig from './BaseViewConfig';
|
2022-01-12 16:56:40 +00:00
|
|
|
import { generateGstr1Json, generateGstr1Csv } from '../../accounting/gst';
|
2021-12-29 10:44:35 +00:00
|
|
|
|
2022-01-10 13:24:32 +00:00
|
|
|
const transferTypeMap = {
|
|
|
|
B2B: 'B2B',
|
|
|
|
B2CL: 'B2C-Large',
|
|
|
|
B2CS: 'B2C-Small',
|
|
|
|
NR: 'Nil Rated, Exempted and Non GST supplies',
|
|
|
|
};
|
|
|
|
|
|
|
|
const transferType = {
|
|
|
|
fieldtype: 'Select',
|
|
|
|
label: 'Transfer Type',
|
|
|
|
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',
|
|
|
|
label: 'JSON',
|
|
|
|
type: 'primary',
|
|
|
|
action: async (report, filters) => {
|
|
|
|
generateGstr1Json(report, filters);
|
|
|
|
},
|
|
|
|
},
|
2022-01-12 16:56:40 +00:00
|
|
|
{
|
|
|
|
group: 'Export',
|
|
|
|
label: 'CSV',
|
|
|
|
type: 'primary',
|
|
|
|
action: async (report, filters) => {
|
|
|
|
generateGstr1Csv(report, filters);
|
|
|
|
},
|
|
|
|
},
|
2021-12-29 10:44:35 +00:00
|
|
|
]
|
2021-12-08 18:43:19 +00:00
|
|
|
|
2021-11-04 10:31:26 +00:00
|
|
|
export default {
|
2019-07-30 12:02:49 +00:00
|
|
|
title: title,
|
|
|
|
method: 'gstr-1',
|
2022-01-10 13:24:32 +00:00
|
|
|
filterFields: [ transferType, ...baseConfig.filterFields],
|
2021-12-29 10:44:35 +00:00
|
|
|
actions: actions,
|
2021-12-08 18:43:19 +00:00
|
|
|
getColumns: baseConfig.getColumns,
|
2019-07-30 12:02:49 +00:00
|
|
|
};
|