2019-07-30 17:32:49 +05:30
|
|
|
const title = 'GSTR 1';
|
2022-02-16 11:49:16 +05:30
|
|
|
import { t } from 'frappe';
|
|
|
|
import { generateGstr1Csv, generateGstr1Json } from '../../accounting/gst';
|
2021-11-04 16:01:26 +05:30
|
|
|
import baseConfig from './BaseViewConfig';
|
2021-12-29 16:14:35 +05:30
|
|
|
|
2022-01-10 18:54:32 +05:30
|
|
|
const transferTypeMap = {
|
|
|
|
B2B: 'B2B',
|
|
|
|
B2CL: 'B2C-Large',
|
|
|
|
B2CS: 'B2C-Small',
|
|
|
|
NR: 'Nil Rated, Exempted and Non GST supplies',
|
|
|
|
};
|
|
|
|
|
|
|
|
const transferType = {
|
|
|
|
fieldtype: 'Select',
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`Transfer Type`,
|
2022-03-30 16:27:45 +05:30
|
|
|
placeholder: t`Transfer Type`,
|
2022-01-10 18:54:32 +05:30
|
|
|
fieldname: 'transferType',
|
|
|
|
options: Object.keys(transferTypeMap),
|
|
|
|
map: transferTypeMap,
|
|
|
|
default: 'B2B',
|
|
|
|
size: 'small',
|
|
|
|
};
|
|
|
|
|
2021-12-29 16:14:35 +05:30
|
|
|
const actions = [
|
|
|
|
{
|
2022-03-30 16:27:45 +05:30
|
|
|
group: t`Export`,
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`JSON`,
|
2021-12-29 16:14:35 +05:30
|
|
|
type: 'primary',
|
|
|
|
action: async (report, filters) => {
|
|
|
|
generateGstr1Json(report, filters);
|
|
|
|
},
|
|
|
|
},
|
2022-01-12 22:26:40 +05:30
|
|
|
{
|
2022-03-30 16:27:45 +05:30
|
|
|
group: t`Export`,
|
2022-02-16 11:49:16 +05:30
|
|
|
label: t`CSV`,
|
2022-01-12 22:26:40 +05:30
|
|
|
type: 'primary',
|
|
|
|
action: async (report, filters) => {
|
|
|
|
generateGstr1Csv(report, filters);
|
|
|
|
},
|
|
|
|
},
|
2022-02-16 11:49:16 +05:30
|
|
|
];
|
2021-12-09 00:13:19 +05:30
|
|
|
|
2021-11-04 16:01:26 +05:30
|
|
|
export default {
|
2019-07-30 17:32:49 +05:30
|
|
|
title: title,
|
|
|
|
method: 'gstr-1',
|
2022-01-10 18:54:32 +05:30
|
|
|
filterFields: [ transferType, ...baseConfig.filterFields],
|
2021-12-29 16:14:35 +05:30
|
|
|
actions: actions,
|
2021-12-09 00:13:19 +05:30
|
|
|
getColumns: baseConfig.getColumns,
|
2019-07-30 17:32:49 +05:30
|
|
|
};
|