blob: cbcd6e3203ad4d3fb40cdd71d2a542ad1b4cd49b [file] [log] [blame]
Rushabh Mehtab3c8f442017-06-21 17:22:38 +05301# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5
6import frappe, os, json
Rushabh Mehtaf0569742017-09-13 12:52:30 +05307from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
Nabin Hait49b41e42019-01-24 17:55:44 +05308from frappe.permissions import add_permission, update_permission_property
Rushabh Mehtab3c8f442017-06-21 17:22:38 +05309from erpnext.regional.india import states
Zarrar7f8024c2018-08-01 17:45:05 +053010from erpnext.accounts.utils import get_fiscal_year
11from frappe.utils import today
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053012
Rushabh Mehta01659272017-06-27 18:05:17 +053013def setup(company=None, patch=True):
Prateeksha Singhdabf3492018-11-13 15:56:15 +053014 setup_company_independent_fixtures()
Prateeksha Singh39b87652018-11-12 17:19:56 +053015 if not patch:
Prateeksha Singhdabf3492018-11-13 15:56:15 +053016 make_fixtures(company)
Prateeksha Singh39b87652018-11-12 17:19:56 +053017
18# TODO: for all countries
19def setup_company_independent_fixtures():
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053020 make_custom_fields()
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053021 add_permissions()
Rushabh Mehta919a74a2017-06-22 16:37:04 +053022 add_custom_roles_for_reports()
Nabin Haitc3144852017-09-28 18:55:40 +053023 frappe.enqueue('erpnext.regional.india.setup.add_hsn_sac_codes', now=frappe.flags.in_test)
Nabin Hait852cb642017-07-05 12:58:19 +053024 add_print_formats()
Rushabh Mehta919a74a2017-06-22 16:37:04 +053025
Nabin Hait1a609312017-07-13 12:16:04 +053026def add_hsn_sac_codes():
27 # HSN codes
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053028 with open(os.path.join(os.path.dirname(__file__), 'hsn_code_data.json'), 'r') as f:
29 hsn_codes = json.loads(f.read())
30
Nabin Hait1a609312017-07-13 12:16:04 +053031 create_hsn_codes(hsn_codes, code_field="hsn_code")
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053032
Nabin Hait1a609312017-07-13 12:16:04 +053033 # SAC Codes
34 with open(os.path.join(os.path.dirname(__file__), 'sac_code_data.json'), 'r') as f:
35 sac_codes = json.loads(f.read())
36 create_hsn_codes(sac_codes, code_field="sac_code")
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053037
Nabin Hait1a609312017-07-13 12:16:04 +053038def create_hsn_codes(data, code_field):
39 for d in data:
Rushabh Mehtaf702d722017-09-27 15:31:30 +053040 hsn_code = frappe.new_doc('GST HSN Code')
41 hsn_code.description = d["description"]
42 hsn_code.hsn_code = d[code_field]
43 hsn_code.name = d[code_field]
44 try:
Nabin Hait1a609312017-07-13 12:16:04 +053045 hsn_code.db_insert()
Rushabh Mehtaf702d722017-09-27 15:31:30 +053046 except frappe.DuplicateEntryError:
47 pass
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053048
Rushabh Mehta919a74a2017-06-22 16:37:04 +053049def add_custom_roles_for_reports():
50 for report_name in ('GST Sales Register', 'GST Purchase Register',
rohitwaghchaure8cca61f2018-08-20 17:53:56 +053051 'GST Itemised Sales Register', 'GST Itemised Purchase Register', 'Eway Bill'):
Rushabh Mehta919a74a2017-06-22 16:37:04 +053052
Rushabh Mehta919a74a2017-06-22 16:37:04 +053053 if not frappe.db.get_value('Custom Role', dict(report=report_name)):
54 frappe.get_doc(dict(
55 doctype='Custom Role',
56 report=report_name,
57 roles= [
58 dict(role='Accounts User'),
59 dict(role='Accounts Manager')
60 ]
61 )).insert()
62
Anurag Mishra289c8222020-06-19 19:17:57 +053063 for report_name in ('Professional Tax Deductions', 'Provident Fund Deductions'):
64
65 if not frappe.db.get_value('Custom Role', dict(report=report_name)):
66 frappe.get_doc(dict(
67 doctype='Custom Role',
68 report=report_name,
69 roles= [
70 dict(role='HR User'),
71 dict(role='HR Manager'),
72 dict(role='Employee')
73 ]
74 )).insert()
75
Anurag Mishra54cd1942020-09-03 13:51:26 +053076 for report_name in ('HSN-wise-summary of outward supplies', 'GSTR-1', 'GSTR-2'):
77
78 if not frappe.db.get_value('Custom Role', dict(report=report_name)):
79 frappe.get_doc(dict(
80 doctype='Custom Role',
81 report=report_name,
82 roles= [
83 dict(role='Accounts User'),
84 dict(role='Accounts Manager'),
85 dict(role='Auditor')
86 ]
87 )).insert()
88
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053089def add_permissions():
Deepesh Gargd78cf972020-04-26 20:08:52 +053090 for doctype in ('GST HSN Code', 'GST Settings', 'GSTR 3B Report', 'Lower Deduction Certificate'):
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053091 add_permission(doctype, 'All', 0)
Deepesh Garg6c8efde2020-04-04 20:05:17 +053092 for role in ('Accounts Manager', 'Accounts User', 'System Manager'):
Saqib5e6ce882020-02-03 15:40:35 +053093 add_permission(doctype, role, 0)
94 update_permission_property(doctype, role, 0, 'write', 1)
95 update_permission_property(doctype, role, 0, 'create', 1)
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053096
Deepesh Garg6c8efde2020-04-04 20:05:17 +053097 if doctype == 'GST HSN Code':
98 for role in ('Item Manager', 'Stock Manager'):
99 add_permission(doctype, role, 0)
100 update_permission_property(doctype, role, 0, 'write', 1)
101 update_permission_property(doctype, role, 0, 'create', 1)
102
Nabin Hait852cb642017-07-05 12:58:19 +0530103def add_print_formats():
104 frappe.reload_doc("regional", "print_format", "gst_tax_invoice")
rohitwaghchauree3b5c0f2017-12-16 10:53:53 +0530105 frappe.reload_doc("accounts", "print_format", "gst_pos_invoice")
106
107 frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where
108 name in('GST POS Invoice', 'GST Tax Invoice') """)
Nabin Hait852cb642017-07-05 12:58:19 +0530109
Rushabh Mehta69fa8082018-07-17 18:22:51 +0530110def make_custom_fields(update=True):
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530111 hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
Nabin Haitd34bfa82018-11-13 18:19:58 +0530112 fieldtype='Data', fetch_from='item_code.gst_hsn_code', insert_after='description',
Nabin Haitf4af6082019-04-01 11:51:54 +0530113 allow_on_submit=1, print_hide=1, fetch_if_empty=1)
Marica9942acd2020-04-21 13:13:39 +0530114 nil_rated_exempt = dict(fieldname='is_nil_exempt', label='Is Nil Rated or Exempted',
Deepesh Garg22b61602019-03-21 20:47:47 +0530115 fieldtype='Check', fetch_from='item_code.is_nil_exempt', insert_after='gst_hsn_code',
116 print_hide=1)
117 is_non_gst = dict(fieldname='is_non_gst', label='Is Non GST',
118 fieldtype='Check', fetch_from='item_code.is_non_gst', insert_after='is_nil_exempt',
119 print_hide=1)
120
121 purchase_invoice_gst_category = [
Nabin Hait879e1622017-08-21 08:28:55 +0530122 dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',
vishdha109b4082018-01-30 12:11:13 +0530123 insert_after='language', print_hide=1, collapsible=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530124 dict(fieldname='gst_category', label='GST Category',
Nabin Hait10dae5d2019-04-01 20:56:51 +0530125 fieldtype='Select', insert_after='gst_section', print_hide=1,
Nabin Hait89b06132019-05-01 14:18:21 +0530126 options='\nRegistered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nUIN Holders',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530127 fetch_from='supplier.gst_category', fetch_if_empty=1),
128 dict(fieldname='export_type', label='Export Type',
129 fieldtype='Select', insert_after='gst_category', print_hide=1,
130 depends_on='eval:in_list(["SEZ", "Overseas"], doc.gst_category)',
131 options='\nWith Payment of Tax\nWithout Payment of Tax', fetch_from='supplier.export_type',
132 fetch_if_empty=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530133 ]
134
135 sales_invoice_gst_category = [
136 dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',
137 insert_after='language', print_hide=1, collapsible=1),
138 dict(fieldname='gst_category', label='GST Category',
Nabin Hait10dae5d2019-04-01 20:56:51 +0530139 fieldtype='Select', insert_after='gst_section', print_hide=1,
Nabin Hait89b06132019-05-01 14:18:21 +0530140 options='\nRegistered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530141 fetch_from='customer.gst_category', fetch_if_empty=1),
142 dict(fieldname='export_type', label='Export Type',
143 fieldtype='Select', insert_after='gst_category', print_hide=1,
144 depends_on='eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)',
145 options='\nWith Payment of Tax\nWithout Payment of Tax', fetch_from='customer.export_type',
146 fetch_if_empty=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530147 ]
148
149 invoice_gst_fields = [
Nabin Hait879e1622017-08-21 08:28:55 +0530150 dict(fieldname='invoice_copy', label='Invoice Copy',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530151 fieldtype='Select', insert_after='export_type', print_hide=1, allow_on_submit=1,
Nabin Hait879e1622017-08-21 08:28:55 +0530152 options='Original for Recipient\nDuplicate for Transporter\nDuplicate for Supplier\nTriplicate for Supplier'),
153 dict(fieldname='reverse_charge', label='Reverse Charge',
154 fieldtype='Select', insert_after='invoice_copy', print_hide=1,
155 options='Y\nN', default='N'),
Nabin Hait879e1622017-08-21 08:28:55 +0530156 dict(fieldname='ecommerce_gstin', label='E-commerce GSTIN',
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530157 fieldtype='Data', insert_after='export_type', print_hide=1),
Nabin Haite6d65bc2018-02-14 17:44:06 +0530158 dict(fieldname='gst_col_break', fieldtype='Column Break', insert_after='ecommerce_gstin'),
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530159 dict(fieldname='reason_for_issuing_document', label='Reason For Issuing document',
Nabin Haitb02c1092018-02-05 16:09:51 +0530160 fieldtype='Select', insert_after='gst_col_break', print_hide=1,
Nabin Haite6d65bc2018-02-14 17:44:06 +0530161 depends_on='eval:doc.is_return==1',
Nabin Haita8d10b72018-02-12 16:54:13 +0530162 options='\n01-Sales Return\n02-Post Sale Discount\n03-Deficiency in services\n04-Correction in Invoice\n05-Change in POS\n06-Finalization of Provisional assessment\n07-Others')
Nabin Hait879e1622017-08-21 08:28:55 +0530163 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530164
Nabin Hait879e1622017-08-21 08:28:55 +0530165 purchase_invoice_gst_fields = [
166 dict(fieldname='supplier_gstin', label='Supplier GSTIN',
167 fieldtype='Data', insert_after='supplier_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530168 fetch_from='supplier_address.gstin', print_hide=1, read_only=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530169 dict(fieldname='company_gstin', label='Company GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530170 fieldtype='Data', insert_after='shipping_address_display',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530171 fetch_from='shipping_address.gstin', print_hide=1, read_only=1),
Nabin Haitb02c1092018-02-05 16:09:51 +0530172 dict(fieldname='place_of_supply', label='Place of Supply',
173 fieldtype='Data', insert_after='shipping_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530174 print_hide=1, read_only=1),
deepeshgarg007d29ee972019-01-09 17:09:11 +0530175 ]
176
177 purchase_invoice_itc_fields = [
vishdha98e33c32018-01-29 13:57:34 +0530178 dict(fieldname='eligibility_for_itc', label='Eligibility For ITC',
179 fieldtype='Select', insert_after='reason_for_issuing_document', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530180 options='Input Service Distributor\nImport Of Service\nImport Of Capital Goods\nIneligible\nAll Other ITC', default="All Other ITC"),
vishdha98e33c32018-01-29 13:57:34 +0530181 dict(fieldname='itc_integrated_tax', label='Availed ITC Integrated Tax',
182 fieldtype='Data', insert_after='eligibility_for_itc', print_hide=1),
183 dict(fieldname='itc_central_tax', label='Availed ITC Central Tax',
184 fieldtype='Data', insert_after='itc_integrated_tax', print_hide=1),
185 dict(fieldname='itc_state_tax', label='Availed ITC State/UT Tax',
186 fieldtype='Data', insert_after='itc_central_tax', print_hide=1),
187 dict(fieldname='itc_cess_amount', label='Availed ITC Cess',
188 fieldtype='Data', insert_after='itc_state_tax', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530189 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530190
Nabin Hait879e1622017-08-21 08:28:55 +0530191 sales_invoice_gst_fields = [
rohitwaghchaure16645802017-09-28 11:05:03 +0530192 dict(fieldname='billing_address_gstin', label='Billing Address GSTIN',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530193 fieldtype='Data', insert_after='customer_address', read_only=1,
Shreya Shah4fa600a2018-06-05 11:27:53 +0530194 fetch_from='customer_address.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530195 dict(fieldname='customer_gstin', label='Customer GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530196 fieldtype='Data', insert_after='shipping_address_name',
197 fetch_from='shipping_address_name.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530198 dict(fieldname='place_of_supply', label='Place of Supply',
Nabin Hait619c42b2018-01-10 17:48:03 +0530199 fieldtype='Data', insert_after='customer_gstin',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530200 print_hide=1, read_only=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530201 dict(fieldname='company_gstin', label='Company GSTIN',
202 fieldtype='Data', insert_after='company_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530203 fetch_from='company_address.gstin', print_hide=1, read_only=1),
deepeshgarg007d29ee972019-01-09 17:09:11 +0530204 ]
205
206 sales_invoice_shipping_fields = [
vishdha98e33c32018-01-29 13:57:34 +0530207 dict(fieldname='port_code', label='Port Code',
208 fieldtype='Data', insert_after='reason_for_issuing_document', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530209 depends_on="eval:doc.gst_category=='Overseas' "),
vishdha98e33c32018-01-29 13:57:34 +0530210 dict(fieldname='shipping_bill_number', label=' Shipping Bill Number',
211 fieldtype='Data', insert_after='port_code', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530212 depends_on="eval:doc.gst_category=='Overseas' "),
vishdha98e33c32018-01-29 13:57:34 +0530213 dict(fieldname='shipping_bill_date', label='Shipping Bill Date',
214 fieldtype='Date', insert_after='shipping_bill_number', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530215 depends_on="eval:doc.gst_category=='Overseas' "),
Nabin Hait879e1622017-08-21 08:28:55 +0530216 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530217
Shreya Shah4fa600a2018-06-05 11:27:53 +0530218 inter_state_gst_field = [
219 dict(fieldname='is_inter_state', label='Is Inter State',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530220 fieldtype='Check', insert_after='disabled', print_hide=1),
221 dict(fieldname='tax_category_column_break', fieldtype='Column Break',
222 insert_after='is_inter_state'),
223 dict(fieldname='gst_state', label='Source State', fieldtype='Select',
224 options='\n'.join(states), insert_after='company')
Shreya Shah4fa600a2018-06-05 11:27:53 +0530225 ]
226
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530227 ewaybill_fields = [
228 {
229 'fieldname': 'distance',
230 'label': 'Distance (in km)',
231 'fieldtype': 'Float',
232 'insert_after': 'vehicle_no',
233 'print_hide': 1
234 },
235 {
236 'fieldname': 'gst_transporter_id',
237 'label': 'GST Transporter ID',
238 'fieldtype': 'Data',
Nabin Hait34c551d2019-07-03 10:34:31 +0530239 'insert_after': 'transporter',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530240 'fetch_from': 'transporter.gst_transporter_id',
Nabin Hait34c551d2019-07-03 10:34:31 +0530241 'print_hide': 1,
242 'translatable': 0
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530243 },
244 {
245 'fieldname': 'mode_of_transport',
246 'label': 'Mode of Transport',
247 'fieldtype': 'Select',
248 'options': '\nRoad\nAir\nRail\nShip',
249 'default': 'Road',
Nabin Hait34c551d2019-07-03 10:34:31 +0530250 'insert_after': 'transporter_name',
251 'print_hide': 1,
252 'translatable': 0
253 },
254 {
255 'fieldname': 'gst_vehicle_type',
256 'label': 'GST Vehicle Type',
257 'fieldtype': 'Select',
258 'options': 'Regular\nOver Dimensional Cargo (ODC)',
259 'depends_on': 'eval:(doc.mode_of_transport === "Road")',
260 'default': 'Regular',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530261 'insert_after': 'lr_date',
Nabin Hait34c551d2019-07-03 10:34:31 +0530262 'print_hide': 1,
263 'translatable': 0
Deepesh Garg15ff6a52020-02-18 12:28:41 +0530264 },
265 {
266 'fieldname': 'ewaybill',
267 'label': 'E-Way Bill No.',
268 'fieldtype': 'Data',
269 'depends_on': 'eval:(doc.docstatus === 1)',
270 'allow_on_submit': 1,
271 'insert_after': 'customer_name_in_arabic',
272 'translatable': 0,
273 }
Nabin Hait34c551d2019-07-03 10:34:31 +0530274 ]
275
276 si_ewaybill_fields = [
277 {
278 'fieldname': 'transporter_info',
279 'label': 'Transporter Info',
280 'fieldtype': 'Section Break',
281 'insert_after': 'terms',
282 'collapsible': 1,
283 'collapsible_depends_on': 'transporter',
284 'print_hide': 1
285 },
286 {
287 'fieldname': 'transporter',
288 'label': 'Transporter',
289 'fieldtype': 'Link',
290 'insert_after': 'transporter_info',
291 'options': 'Supplier',
292 'print_hide': 1
293 },
294 {
295 'fieldname': 'gst_transporter_id',
296 'label': 'GST Transporter ID',
297 'fieldtype': 'Data',
298 'insert_after': 'transporter',
299 'fetch_from': 'transporter.gst_transporter_id',
300 'print_hide': 1,
301 'translatable': 0
302 },
303 {
304 'fieldname': 'driver',
305 'label': 'Driver',
306 'fieldtype': 'Link',
307 'insert_after': 'gst_transporter_id',
308 'options': 'Driver',
309 'print_hide': 1
310 },
311 {
312 'fieldname': 'lr_no',
313 'label': 'Transport Receipt No',
314 'fieldtype': 'Data',
315 'insert_after': 'driver',
316 'print_hide': 1,
317 'translatable': 0
318 },
319 {
320 'fieldname': 'vehicle_no',
321 'label': 'Vehicle No',
322 'fieldtype': 'Data',
323 'insert_after': 'lr_no',
324 'print_hide': 1,
325 'translatable': 0
326 },
327 {
328 'fieldname': 'distance',
329 'label': 'Distance (in km)',
330 'fieldtype': 'Float',
331 'insert_after': 'vehicle_no',
332 'print_hide': 1
333 },
334 {
335 'fieldname': 'transporter_col_break',
336 'fieldtype': 'Column Break',
337 'insert_after': 'distance'
338 },
339 {
340 'fieldname': 'transporter_name',
341 'label': 'Transporter Name',
342 'fieldtype': 'Data',
343 'insert_after': 'transporter_col_break',
344 'fetch_from': 'transporter.name',
345 'read_only': 1,
346 'print_hide': 1,
347 'translatable': 0
348 },
349 {
350 'fieldname': 'mode_of_transport',
351 'label': 'Mode of Transport',
352 'fieldtype': 'Select',
353 'options': '\nRoad\nAir\nRail\nShip',
354 'default': 'Road',
355 'insert_after': 'transporter_name',
356 'print_hide': 1,
357 'translatable': 0
358 },
359 {
360 'fieldname': 'driver_name',
361 'label': 'Driver Name',
362 'fieldtype': 'Data',
363 'insert_after': 'mode_of_transport',
364 'fetch_from': 'driver.full_name',
365 'print_hide': 1,
366 'translatable': 0
367 },
368 {
369 'fieldname': 'lr_date',
370 'label': 'Transport Receipt Date',
371 'fieldtype': 'Date',
372 'insert_after': 'driver_name',
373 'default': 'Today',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530374 'print_hide': 1
375 },
376 {
377 'fieldname': 'gst_vehicle_type',
378 'label': 'GST Vehicle Type',
379 'fieldtype': 'Select',
Nabin Hait34c551d2019-07-03 10:34:31 +0530380 'options': 'Regular\nOver Dimensional Cargo (ODC)',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530381 'depends_on': 'eval:(doc.mode_of_transport === "Road")',
Nabin Hait34c551d2019-07-03 10:34:31 +0530382 'default': 'Regular',
383 'insert_after': 'lr_date',
384 'print_hide': 1,
385 'translatable': 0
386 },
387 {
388 'fieldname': 'ewaybill',
Deepesh Garg15ff6a52020-02-18 12:28:41 +0530389 'label': 'E-Way Bill No.',
Nabin Hait34c551d2019-07-03 10:34:31 +0530390 'fieldtype': 'Data',
391 'depends_on': 'eval:(doc.docstatus === 1)',
392 'allow_on_submit': 1,
deepeshgarg007a85db662019-07-14 18:15:19 +0530393 'insert_after': 'tax_id',
Nabin Hait34c551d2019-07-03 10:34:31 +0530394 'translatable': 0
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530395 }
396 ]
397
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530398 custom_fields = {
399 'Address': [
Rushabh Mehta919a74a2017-06-22 16:37:04 +0530400 dict(fieldname='gstin', label='Party GSTIN', fieldtype='Data',
401 insert_after='fax'),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530402 dict(fieldname='gst_state', label='GST State', fieldtype='Select',
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530403 options='\n'.join(states), insert_after='gstin'),
404 dict(fieldname='gst_state_number', label='GST State Number',
Nabin Hait562d9422018-09-07 16:14:44 +0530405 fieldtype='Data', insert_after='gst_state', read_only=1),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530406 ],
Deepesh Garg22b61602019-03-21 20:47:47 +0530407 'Purchase Invoice': purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields + purchase_invoice_gst_fields,
deepeshgarg007d29ee972019-01-09 17:09:11 +0530408 'Purchase Order': purchase_invoice_gst_fields,
409 'Purchase Receipt': purchase_invoice_gst_fields,
Nabin Hait34c551d2019-07-03 10:34:31 +0530410 'Sales Invoice': sales_invoice_gst_category + invoice_gst_fields + sales_invoice_shipping_fields + sales_invoice_gst_fields + si_ewaybill_fields,
411 'Delivery Note': sales_invoice_gst_fields + ewaybill_fields + sales_invoice_shipping_fields,
deepeshgarg007d29ee972019-01-09 17:09:11 +0530412 'Sales Order': sales_invoice_gst_fields,
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530413 'Tax Category': inter_state_gst_field,
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530414 'Item': [
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530415 dict(fieldname='gst_hsn_code', label='HSN/SAC',
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530416 fieldtype='Link', options='GST HSN Code', insert_after='item_group'),
Marica9942acd2020-04-21 13:13:39 +0530417 dict(fieldname='is_nil_exempt', label='Is Nil Rated or Exempted',
Deepesh Garg22b61602019-03-21 20:47:47 +0530418 fieldtype='Check', insert_after='gst_hsn_code'),
419 dict(fieldname='is_non_gst', label='Is Non GST ',
420 fieldtype='Check', insert_after='is_nil_exempt')
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530421 ],
Deepesh Garg22b61602019-03-21 20:47:47 +0530422 'Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
423 'Supplier Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
424 'Sales Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
425 'Delivery Note Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
426 'Sales Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
427 'Purchase Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
428 'Purchase Receipt Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
429 'Purchase Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
Himanshu Warekar656d8e42019-04-01 19:38:43 +0530430 'Material Request Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
Anurag Mishra289c8222020-06-19 19:17:57 +0530431 'Salary Component': [
432 dict(fieldname= 'component_type',
433 label= 'Component Type',
434 fieldtype= 'Select',
435 insert_after= 'description',
436 options= "\nProvident Fund\nAdditional Provident Fund\nProvident Fund Loan\nProfessional Tax",
437 depends_on = 'eval:doc.type == "Deduction"'
438 )
439 ],
Pawan Mehtaf4196352018-04-05 14:54:51 +0530440 'Employee': [
Anurag Mishra289c8222020-06-19 19:17:57 +0530441 dict(fieldname='ifsc_code',
442 label='IFSC Code',
443 fieldtype='Data',
444 insert_after='bank_ac_no',
445 print_hide=1,
446 depends_on='eval:doc.salary_mode == "Bank"'
447 ),
448 dict(
449 fieldname = 'pan_number',
450 label = 'PAN Number',
451 fieldtype = 'Data',
452 insert_after = 'payroll_cost_center',
453 print_hide = 1
454 ),
455 dict(
456 fieldname = 'micr_code',
457 label = 'MICR Code',
458 fieldtype = 'Data',
459 insert_after = 'ifsc_code',
460 print_hide = 1,
461 depends_on='eval:doc.salary_mode == "Bank"'
462 ),
463 dict(
464 fieldname = 'provident_fund_account',
465 label = 'Provident Fund Account',
466 fieldtype = 'Data',
467 insert_after = 'pan_number'
468 )
469
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530470 ],
471 'Company': [
472 dict(fieldname='hra_section', label='HRA Settings',
Anurag Mishraa5527222019-06-14 15:25:57 +0530473 fieldtype='Section Break', insert_after='asset_received_but_not_billed', collapsible=1),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530474 dict(fieldname='basic_component', label='Basic Component',
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530475 fieldtype='Link', options='Salary Component', insert_after='hra_section'),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530476 dict(fieldname='hra_component', label='HRA Component',
477 fieldtype='Link', options='Salary Component', insert_after='basic_component'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530478 dict(fieldname='arrear_component', label='Arrear Component',
Mangesh-Khairnar9215de02019-05-06 16:24:10 +0530479 fieldtype='Link', options='Salary Component', insert_after='hra_component'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530480 ],
481 'Employee Tax Exemption Declaration':[
482 dict(fieldname='hra_section', label='HRA Exemption',
483 fieldtype='Section Break', insert_after='declarations'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530484 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530485 fieldtype='Currency', insert_after='hra_section'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530486 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530487 fieldtype='Check', insert_after='monthly_house_rent', depends_on='monthly_house_rent'),
488 dict(fieldname='salary_structure_hra', label='HRA as per Salary Structure',
489 fieldtype='Currency', insert_after='rented_in_metro_city', read_only=1, depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530490 dict(fieldname='hra_column_break', fieldtype='Column Break',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530491 insert_after='salary_structure_hra', depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530492 dict(fieldname='annual_hra_exemption', label='Annual HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530493 fieldtype='Currency', insert_after='hra_column_break', read_only=1, depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530494 dict(fieldname='monthly_hra_exemption', label='Monthly HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530495 fieldtype='Currency', insert_after='annual_hra_exemption', read_only=1, depends_on='monthly_house_rent')
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530496 ],
497 'Employee Tax Exemption Proof Submission': [
498 dict(fieldname='hra_section', label='HRA Exemption',
499 fieldtype='Section Break', insert_after='tax_exemption_proofs'),
500 dict(fieldname='house_rent_payment_amount', label='House Rent Payment Amount',
501 fieldtype='Currency', insert_after='hra_section'),
502 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530503 fieldtype='Check', insert_after='house_rent_payment_amount', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530504 dict(fieldname='rented_from_date', label='Rented From Date',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530505 fieldtype='Date', insert_after='rented_in_metro_city', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530506 dict(fieldname='rented_to_date', label='Rented To Date',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530507 fieldtype='Date', insert_after='rented_from_date', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530508 dict(fieldname='hra_column_break', fieldtype='Column Break',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530509 insert_after='rented_to_date', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530510 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530511 fieldtype='Currency', insert_after='hra_column_break', read_only=1, depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530512 dict(fieldname='monthly_hra_exemption', label='Monthly Eligible Amount',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530513 fieldtype='Currency', insert_after='monthly_house_rent', read_only=1, depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530514 dict(fieldname='total_eligible_hra_exemption', label='Total Eligible HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530515 fieldtype='Currency', insert_after='monthly_hra_exemption', read_only=1, depends_on='house_rent_payment_amount')
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530516 ],
517 'Supplier': [
518 {
519 'fieldname': 'gst_transporter_id',
520 'label': 'GST Transporter ID',
521 'fieldtype': 'Data',
522 'insert_after': 'supplier_type',
523 'depends_on': 'eval:doc.is_transporter'
Deepesh Garg22b61602019-03-21 20:47:47 +0530524 },
525 {
526 'fieldname': 'gst_category',
527 'label': 'GST Category',
528 'fieldtype': 'Select',
529 'insert_after': 'gst_transporter_id',
530 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nUIN Holders',
531 'default': 'Unregistered'
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530532 },
533 {
534 'fieldname': 'export_type',
535 'label': 'Export Type',
536 'fieldtype': 'Select',
537 'insert_after': 'gst_category',
538 'default': 'Without Payment of Tax',
539 'depends_on':'eval:in_list(["SEZ", "Overseas"], doc.gst_category)',
540 'options': '\nWith Payment of Tax\nWithout Payment of Tax'
Deepesh Garg22b61602019-03-21 20:47:47 +0530541 }
542 ],
543 'Customer': [
544 {
545 'fieldname': 'gst_category',
546 'label': 'GST Category',
547 'fieldtype': 'Select',
548 'insert_after': 'customer_type',
549 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
550 'default': 'Unregistered'
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530551 },
552 {
553 'fieldname': 'export_type',
554 'label': 'Export Type',
555 'fieldtype': 'Select',
556 'insert_after': 'gst_category',
557 'default': 'Without Payment of Tax',
558 'depends_on':'eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)',
559 'options': '\nWith Payment of Tax\nWithout Payment of Tax'
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530560 }
Shivam Mishra1d6395c2020-03-30 18:14:44 +0530561 ],
562 "Member": [
563 {
564 'fieldname': 'pan_number',
565 'label': 'PAN Details',
566 'fieldtype': 'Data',
567 'insert_after': 'email'
568 }
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530569 ]
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530570 }
Deepesh Garg22b61602019-03-21 20:47:47 +0530571 create_custom_fields(custom_fields, update=update)
Nabin Hait9c421612017-07-20 13:32:01 +0530572
Saurabh2d8a7ee2018-05-11 13:16:16 +0530573def make_fixtures(company=None):
574 docs = []
575 company = company.name if company else frappe.db.get_value("Global Defaults", None, "default_company")
576
577 set_salary_components(docs)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530578 set_tds_account(docs, company)
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530579
580 for d in docs:
581 try:
582 doc = frappe.get_doc(d)
583 doc.flags.ignore_permissions = True
584 doc.insert()
585 except frappe.NameError:
Faris Ansariec7b0642019-05-14 16:21:09 +0530586 frappe.clear_messages()
Zarrar7f8024c2018-08-01 17:45:05 +0530587 except frappe.DuplicateEntryError:
Faris Ansariec7b0642019-05-14 16:21:09 +0530588 frappe.clear_messages()
Saurabh2d8a7ee2018-05-11 13:16:16 +0530589
Zarrar7f8024c2018-08-01 17:45:05 +0530590 # create records for Tax Withholding Category
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530591 set_tax_withholding_category(company)
592
Saurabh2d8a7ee2018-05-11 13:16:16 +0530593def set_salary_components(docs):
594 docs.extend([
Nabin Hait58ee6c12020-04-26 17:45:57 +0530595 {'doctype': 'Salary Component', 'salary_component': 'Professional Tax',
596 'description': 'Professional Tax', 'type': 'Deduction', 'exempted_from_income_tax': 1},
597 {'doctype': 'Salary Component', 'salary_component': 'Provident Fund',
598 'description': 'Provident fund', 'type': 'Deduction', 'is_tax_applicable': 1},
599 {'doctype': 'Salary Component', 'salary_component': 'House Rent Allowance',
600 'description': 'House Rent Allowance', 'type': 'Earning', 'is_tax_applicable': 1},
601 {'doctype': 'Salary Component', 'salary_component': 'Basic',
602 'description': 'Basic', 'type': 'Earning', 'is_tax_applicable': 1},
603 {'doctype': 'Salary Component', 'salary_component': 'Arrear',
604 'description': 'Arrear', 'type': 'Earning', 'is_tax_applicable': 1},
605 {'doctype': 'Salary Component', 'salary_component': 'Leave Encashment',
606 'description': 'Leave Encashment', 'type': 'Earning', 'is_tax_applicable': 1}
Saurabh2d8a7ee2018-05-11 13:16:16 +0530607 ])
608
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530609def set_tax_withholding_category(company):
Saurabh2d8a7ee2018-05-11 13:16:16 +0530610 accounts = []
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530611 abbr = frappe.get_value("Company", company, "abbr")
612 tds_account = frappe.get_value("Account", 'TDS Payable - {0}'.format(abbr), 'name')
Saurabh2d8a7ee2018-05-11 13:16:16 +0530613
614 if company and tds_account:
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530615 accounts = [dict(company=company, account=tds_account)]
Saurabh2d8a7ee2018-05-11 13:16:16 +0530616
Nabin Haitafef9c12019-02-12 11:28:20 +0530617 fiscal_year = get_fiscal_year(today(), company=company)[0]
Zarrar7f8024c2018-08-01 17:45:05 +0530618 docs = get_tds_details(accounts, fiscal_year)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530619
Zarrar7f8024c2018-08-01 17:45:05 +0530620 for d in docs:
621 try:
622 doc = frappe.get_doc(d)
623 doc.flags.ignore_permissions = True
Nabin Haitafef9c12019-02-12 11:28:20 +0530624 doc.flags.ignore_mandatory = True
Zarrar7f8024c2018-08-01 17:45:05 +0530625 doc.insert()
626 except frappe.DuplicateEntryError:
627 doc = frappe.get_doc("Tax Withholding Category", d.get("name"))
Zarrar963d62b2019-03-23 10:30:12 +0530628
629 if accounts:
630 doc.append("accounts", accounts[0])
Zarrar7f8024c2018-08-01 17:45:05 +0530631
632 # if fiscal year don't match with any of the already entered data, append rate row
633 fy_exist = [k for k in doc.get('rates') if k.get('fiscal_year')==fiscal_year]
634 if not fy_exist:
635 doc.append("rates", d.get('rates')[0])
636
637 doc.save()
Saurabh2d8a7ee2018-05-11 13:16:16 +0530638
639def set_tds_account(docs, company):
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530640 abbr = frappe.get_value("Company", company, "abbr")
Nabin Haitf77cd542018-11-20 16:46:25 +0530641 parent_account = frappe.db.get_value("Account", filters = {"account_name": "Duties and Taxes", "company": company})
642 if parent_account:
643 docs.extend([
644 {
645 "doctype": "Account",
646 "account_name": "TDS Payable",
647 "account_type": "Tax",
648 "parent_account": parent_account,
649 "company": company
650 }
651 ])
Zarrar7f8024c2018-08-01 17:45:05 +0530652
653def get_tds_details(accounts, fiscal_year):
654 # bootstrap default tax withholding sections
655 return [
656 dict(name="TDS - 194C - Company",
657 category_name="Payment to Contractors (Single / Aggregate)",
658 doctype="Tax Withholding Category", accounts=accounts,
659 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
660 "single_threshold": 30000, "cumulative_threshold": 100000}]),
661 dict(name="TDS - 194C - Individual",
662 category_name="Payment to Contractors (Single / Aggregate)",
663 doctype="Tax Withholding Category", accounts=accounts,
664 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
665 "single_threshold": 30000, "cumulative_threshold": 100000}]),
666 dict(name="TDS - 194C - No PAN / Invalid PAN",
667 category_name="Payment to Contractors (Single / Aggregate)",
668 doctype="Tax Withholding Category", accounts=accounts,
669 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
670 "single_threshold": 30000, "cumulative_threshold": 100000}]),
671 dict(name="TDS - 194D - Company",
672 category_name="Insurance Commission",
673 doctype="Tax Withholding Category", accounts=accounts,
674 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
675 "single_threshold": 15000, "cumulative_threshold": 0}]),
676 dict(name="TDS - 194D - Company Assessee",
677 category_name="Insurance Commission",
678 doctype="Tax Withholding Category", accounts=accounts,
679 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
680 "single_threshold": 15000, "cumulative_threshold": 0}]),
681 dict(name="TDS - 194D - Individual",
682 category_name="Insurance Commission",
683 doctype="Tax Withholding Category", accounts=accounts,
684 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
685 "single_threshold": 15000, "cumulative_threshold": 0}]),
686 dict(name="TDS - 194D - No PAN / Invalid PAN",
687 category_name="Insurance Commission",
688 doctype="Tax Withholding Category", accounts=accounts,
689 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
690 "single_threshold": 15000, "cumulative_threshold": 0}]),
691 dict(name="TDS - 194DA - Company",
692 category_name="Non-exempt payments made under a life insurance policy",
693 doctype="Tax Withholding Category", accounts=accounts,
694 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
695 "single_threshold": 100000, "cumulative_threshold": 0}]),
696 dict(name="TDS - 194DA - Individual",
697 category_name="Non-exempt payments made under a life insurance policy",
698 doctype="Tax Withholding Category", accounts=accounts,
699 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
700 "single_threshold": 100000, "cumulative_threshold": 0}]),
701 dict(name="TDS - 194DA - No PAN / Invalid PAN",
702 category_name="Non-exempt payments made under a life insurance policy",
703 doctype="Tax Withholding Category", accounts=accounts,
704 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
705 "single_threshold": 100000, "cumulative_threshold": 0}]),
706 dict(name="TDS - 194H - Company",
707 category_name="Commission / Brokerage",
708 doctype="Tax Withholding Category", accounts=accounts,
709 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
710 "single_threshold": 15000, "cumulative_threshold": 0}]),
711 dict(name="TDS - 194H - Individual",
712 category_name="Commission / Brokerage",
713 doctype="Tax Withholding Category", accounts=accounts,
714 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
715 "single_threshold": 15000, "cumulative_threshold": 0}]),
716 dict(name="TDS - 194H - No PAN / Invalid PAN",
717 category_name="Commission / Brokerage",
718 doctype="Tax Withholding Category", accounts=accounts,
719 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
720 "single_threshold": 15000, "cumulative_threshold": 0}]),
721 dict(name="TDS - 194I - Rent - Company",
722 category_name="Rent",
723 doctype="Tax Withholding Category", accounts=accounts,
724 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
725 "single_threshold": 180000, "cumulative_threshold": 0}]),
726 dict(name="TDS - 194I - Rent - Individual",
727 category_name="Rent",
728 doctype="Tax Withholding Category", accounts=accounts,
729 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
730 "single_threshold": 180000, "cumulative_threshold": 0}]),
731 dict(name="TDS - 194I - Rent - No PAN / Invalid PAN",
732 category_name="Rent",
733 doctype="Tax Withholding Category", accounts=accounts,
734 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
735 "single_threshold": 180000, "cumulative_threshold": 0}]),
736 dict(name="TDS - 194I - Rent/Machinery - Company",
737 category_name="Rent-Plant / Machinery",
738 doctype="Tax Withholding Category", accounts=accounts,
739 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
740 "single_threshold": 180000, "cumulative_threshold": 0}]),
741 dict(name="TDS - 194I - Rent/Machinery - Individual",
742 category_name="Rent-Plant / Machinery",
743 doctype="Tax Withholding Category", accounts=accounts,
744 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
745 "single_threshold": 180000, "cumulative_threshold": 0}]),
746 dict(name="TDS - 194I - Rent/Machinery - No PAN / Invalid PAN",
747 category_name="Rent-Plant / Machinery",
748 doctype="Tax Withholding Category", accounts=accounts,
749 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
750 "single_threshold": 180000, "cumulative_threshold": 0}]),
751 dict(name="TDS - 194J - Professional Fees - Company",
752 category_name="Professional Fees",
753 doctype="Tax Withholding Category", accounts=accounts,
754 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
755 "single_threshold": 30000, "cumulative_threshold": 0}]),
756 dict(name="TDS - 194J - Professional Fees - Individual",
757 category_name="Professional Fees",
758 doctype="Tax Withholding Category", accounts=accounts,
759 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
760 "single_threshold": 30000, "cumulative_threshold": 0}]),
761 dict(name="TDS - 194J - Professional Fees - No PAN / Invalid PAN",
762 category_name="Professional Fees",
763 doctype="Tax Withholding Category", accounts=accounts,
764 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
765 "single_threshold": 30000, "cumulative_threshold": 0}]),
766 dict(name="TDS - 194J - Director Fees - Company",
767 category_name="Director Fees",
768 doctype="Tax Withholding Category", accounts=accounts,
769 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
770 "single_threshold": 0, "cumulative_threshold": 0}]),
771 dict(name="TDS - 194J - Director Fees - Individual",
772 category_name="Director Fees",
773 doctype="Tax Withholding Category", accounts=accounts,
774 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
775 "single_threshold": 0, "cumulative_threshold": 0}]),
776 dict(name="TDS - 194J - Director Fees - No PAN / Invalid PAN",
777 category_name="Director Fees",
778 doctype="Tax Withholding Category", accounts=accounts,
779 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
780 "single_threshold": 0, "cumulative_threshold": 0}]),
781 dict(name="TDS - 194 - Dividends - Company",
782 category_name="Dividends",
783 doctype="Tax Withholding Category", accounts=accounts,
784 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
785 "single_threshold": 2500, "cumulative_threshold": 0}]),
786 dict(name="TDS - 194 - Dividends - Individual",
787 category_name="Dividends",
788 doctype="Tax Withholding Category", accounts=accounts,
789 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
790 "single_threshold": 2500, "cumulative_threshold": 0}]),
791 dict(name="TDS - 194 - Dividends - No PAN / Invalid PAN",
792 category_name="Dividends",
793 doctype="Tax Withholding Category", accounts=accounts,
794 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
795 "single_threshold": 2500, "cumulative_threshold": 0}])
Shivam Mishra1d6395c2020-03-30 18:14:44 +0530796 ]