blob: b4e3558af678cfcb3a0f848d00f2aebaaebd2105 [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
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053063def add_permissions():
Deepesh Garg6c8efde2020-04-04 20:05:17 +053064 for doctype in ('GST HSN Code', 'GST Settings', 'GSTR 3B Report'):
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053065 add_permission(doctype, 'All', 0)
Deepesh Garg6c8efde2020-04-04 20:05:17 +053066 for role in ('Accounts Manager', 'Accounts User', 'System Manager'):
Saqib5e6ce882020-02-03 15:40:35 +053067 add_permission(doctype, role, 0)
68 update_permission_property(doctype, role, 0, 'write', 1)
69 update_permission_property(doctype, role, 0, 'create', 1)
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053070
Deepesh Garg6c8efde2020-04-04 20:05:17 +053071 if doctype == 'GST HSN Code':
72 for role in ('Item Manager', 'Stock Manager'):
73 add_permission(doctype, role, 0)
74 update_permission_property(doctype, role, 0, 'write', 1)
75 update_permission_property(doctype, role, 0, 'create', 1)
76
Nabin Hait852cb642017-07-05 12:58:19 +053077def add_print_formats():
78 frappe.reload_doc("regional", "print_format", "gst_tax_invoice")
rohitwaghchauree3b5c0f2017-12-16 10:53:53 +053079 frappe.reload_doc("accounts", "print_format", "gst_pos_invoice")
80
81 frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where
82 name in('GST POS Invoice', 'GST Tax Invoice') """)
Nabin Hait852cb642017-07-05 12:58:19 +053083
Rushabh Mehta69fa8082018-07-17 18:22:51 +053084def make_custom_fields(update=True):
Nabin Haitf3f0dfe2017-07-06 14:49:34 +053085 hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
Nabin Haitd34bfa82018-11-13 18:19:58 +053086 fieldtype='Data', fetch_from='item_code.gst_hsn_code', insert_after='description',
Nabin Haitf4af6082019-04-01 11:51:54 +053087 allow_on_submit=1, print_hide=1, fetch_if_empty=1)
Marica9942acd2020-04-21 13:13:39 +053088 nil_rated_exempt = dict(fieldname='is_nil_exempt', label='Is Nil Rated or Exempted',
Deepesh Garg22b61602019-03-21 20:47:47 +053089 fieldtype='Check', fetch_from='item_code.is_nil_exempt', insert_after='gst_hsn_code',
90 print_hide=1)
91 is_non_gst = dict(fieldname='is_non_gst', label='Is Non GST',
92 fieldtype='Check', fetch_from='item_code.is_non_gst', insert_after='is_nil_exempt',
93 print_hide=1)
94
95 purchase_invoice_gst_category = [
Nabin Hait879e1622017-08-21 08:28:55 +053096 dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',
vishdha109b4082018-01-30 12:11:13 +053097 insert_after='language', print_hide=1, collapsible=1),
Deepesh Garg22b61602019-03-21 20:47:47 +053098 dict(fieldname='gst_category', label='GST Category',
Nabin Hait10dae5d2019-04-01 20:56:51 +053099 fieldtype='Select', insert_after='gst_section', print_hide=1,
Nabin Hait89b06132019-05-01 14:18:21 +0530100 options='\nRegistered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nUIN Holders',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530101 fetch_from='supplier.gst_category', fetch_if_empty=1),
102 dict(fieldname='export_type', label='Export Type',
103 fieldtype='Select', insert_after='gst_category', print_hide=1,
104 depends_on='eval:in_list(["SEZ", "Overseas"], doc.gst_category)',
105 options='\nWith Payment of Tax\nWithout Payment of Tax', fetch_from='supplier.export_type',
106 fetch_if_empty=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530107 ]
108
109 sales_invoice_gst_category = [
110 dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',
111 insert_after='language', print_hide=1, collapsible=1),
112 dict(fieldname='gst_category', label='GST Category',
Nabin Hait10dae5d2019-04-01 20:56:51 +0530113 fieldtype='Select', insert_after='gst_section', print_hide=1,
Nabin Hait89b06132019-05-01 14:18:21 +0530114 options='\nRegistered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530115 fetch_from='customer.gst_category', fetch_if_empty=1),
116 dict(fieldname='export_type', label='Export Type',
117 fieldtype='Select', insert_after='gst_category', print_hide=1,
118 depends_on='eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)',
119 options='\nWith Payment of Tax\nWithout Payment of Tax', fetch_from='customer.export_type',
120 fetch_if_empty=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530121 ]
122
123 invoice_gst_fields = [
Nabin Hait879e1622017-08-21 08:28:55 +0530124 dict(fieldname='invoice_copy', label='Invoice Copy',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530125 fieldtype='Select', insert_after='export_type', print_hide=1, allow_on_submit=1,
Nabin Hait879e1622017-08-21 08:28:55 +0530126 options='Original for Recipient\nDuplicate for Transporter\nDuplicate for Supplier\nTriplicate for Supplier'),
127 dict(fieldname='reverse_charge', label='Reverse Charge',
128 fieldtype='Select', insert_after='invoice_copy', print_hide=1,
129 options='Y\nN', default='N'),
Nabin Hait879e1622017-08-21 08:28:55 +0530130 dict(fieldname='ecommerce_gstin', label='E-commerce GSTIN',
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530131 fieldtype='Data', insert_after='export_type', print_hide=1),
Nabin Haite6d65bc2018-02-14 17:44:06 +0530132 dict(fieldname='gst_col_break', fieldtype='Column Break', insert_after='ecommerce_gstin'),
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530133 dict(fieldname='reason_for_issuing_document', label='Reason For Issuing document',
Nabin Haitb02c1092018-02-05 16:09:51 +0530134 fieldtype='Select', insert_after='gst_col_break', print_hide=1,
Nabin Haite6d65bc2018-02-14 17:44:06 +0530135 depends_on='eval:doc.is_return==1',
Nabin Haita8d10b72018-02-12 16:54:13 +0530136 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 +0530137 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530138
Nabin Hait879e1622017-08-21 08:28:55 +0530139 purchase_invoice_gst_fields = [
140 dict(fieldname='supplier_gstin', label='Supplier GSTIN',
141 fieldtype='Data', insert_after='supplier_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530142 fetch_from='supplier_address.gstin', print_hide=1, read_only=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530143 dict(fieldname='company_gstin', label='Company GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530144 fieldtype='Data', insert_after='shipping_address_display',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530145 fetch_from='shipping_address.gstin', print_hide=1, read_only=1),
Nabin Haitb02c1092018-02-05 16:09:51 +0530146 dict(fieldname='place_of_supply', label='Place of Supply',
147 fieldtype='Data', insert_after='shipping_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530148 print_hide=1, read_only=1),
deepeshgarg007d29ee972019-01-09 17:09:11 +0530149 ]
150
151 purchase_invoice_itc_fields = [
vishdha98e33c32018-01-29 13:57:34 +0530152 dict(fieldname='eligibility_for_itc', label='Eligibility For ITC',
153 fieldtype='Select', insert_after='reason_for_issuing_document', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530154 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 +0530155 dict(fieldname='itc_integrated_tax', label='Availed ITC Integrated Tax',
156 fieldtype='Data', insert_after='eligibility_for_itc', print_hide=1),
157 dict(fieldname='itc_central_tax', label='Availed ITC Central Tax',
158 fieldtype='Data', insert_after='itc_integrated_tax', print_hide=1),
159 dict(fieldname='itc_state_tax', label='Availed ITC State/UT Tax',
160 fieldtype='Data', insert_after='itc_central_tax', print_hide=1),
161 dict(fieldname='itc_cess_amount', label='Availed ITC Cess',
162 fieldtype='Data', insert_after='itc_state_tax', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530163 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530164
Nabin Hait879e1622017-08-21 08:28:55 +0530165 sales_invoice_gst_fields = [
rohitwaghchaure16645802017-09-28 11:05:03 +0530166 dict(fieldname='billing_address_gstin', label='Billing Address GSTIN',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530167 fieldtype='Data', insert_after='customer_address', read_only=1,
Shreya Shah4fa600a2018-06-05 11:27:53 +0530168 fetch_from='customer_address.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530169 dict(fieldname='customer_gstin', label='Customer GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530170 fieldtype='Data', insert_after='shipping_address_name',
171 fetch_from='shipping_address_name.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530172 dict(fieldname='place_of_supply', label='Place of Supply',
Nabin Hait619c42b2018-01-10 17:48:03 +0530173 fieldtype='Data', insert_after='customer_gstin',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530174 print_hide=1, read_only=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530175 dict(fieldname='company_gstin', label='Company GSTIN',
176 fieldtype='Data', insert_after='company_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530177 fetch_from='company_address.gstin', print_hide=1, read_only=1),
deepeshgarg007d29ee972019-01-09 17:09:11 +0530178 ]
179
180 sales_invoice_shipping_fields = [
vishdha98e33c32018-01-29 13:57:34 +0530181 dict(fieldname='port_code', label='Port Code',
182 fieldtype='Data', insert_after='reason_for_issuing_document', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530183 depends_on="eval:doc.gst_category=='Overseas' "),
vishdha98e33c32018-01-29 13:57:34 +0530184 dict(fieldname='shipping_bill_number', label=' Shipping Bill Number',
185 fieldtype='Data', insert_after='port_code', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530186 depends_on="eval:doc.gst_category=='Overseas' "),
vishdha98e33c32018-01-29 13:57:34 +0530187 dict(fieldname='shipping_bill_date', label='Shipping Bill Date',
188 fieldtype='Date', insert_after='shipping_bill_number', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530189 depends_on="eval:doc.gst_category=='Overseas' "),
Nabin Hait879e1622017-08-21 08:28:55 +0530190 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530191
Shreya Shah4fa600a2018-06-05 11:27:53 +0530192 inter_state_gst_field = [
193 dict(fieldname='is_inter_state', label='Is Inter State',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530194 fieldtype='Check', insert_after='disabled', print_hide=1),
195 dict(fieldname='tax_category_column_break', fieldtype='Column Break',
196 insert_after='is_inter_state'),
197 dict(fieldname='gst_state', label='Source State', fieldtype='Select',
198 options='\n'.join(states), insert_after='company')
Shreya Shah4fa600a2018-06-05 11:27:53 +0530199 ]
200
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530201 ewaybill_fields = [
202 {
203 'fieldname': 'distance',
204 'label': 'Distance (in km)',
205 'fieldtype': 'Float',
206 'insert_after': 'vehicle_no',
207 'print_hide': 1
208 },
209 {
210 'fieldname': 'gst_transporter_id',
211 'label': 'GST Transporter ID',
212 'fieldtype': 'Data',
Nabin Hait34c551d2019-07-03 10:34:31 +0530213 'insert_after': 'transporter',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530214 'fetch_from': 'transporter.gst_transporter_id',
Nabin Hait34c551d2019-07-03 10:34:31 +0530215 'print_hide': 1,
216 'translatable': 0
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530217 },
218 {
219 'fieldname': 'mode_of_transport',
220 'label': 'Mode of Transport',
221 'fieldtype': 'Select',
222 'options': '\nRoad\nAir\nRail\nShip',
223 'default': 'Road',
Nabin Hait34c551d2019-07-03 10:34:31 +0530224 'insert_after': 'transporter_name',
225 'print_hide': 1,
226 'translatable': 0
227 },
228 {
229 'fieldname': 'gst_vehicle_type',
230 'label': 'GST Vehicle Type',
231 'fieldtype': 'Select',
232 'options': 'Regular\nOver Dimensional Cargo (ODC)',
233 'depends_on': 'eval:(doc.mode_of_transport === "Road")',
234 'default': 'Regular',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530235 'insert_after': 'lr_date',
Nabin Hait34c551d2019-07-03 10:34:31 +0530236 'print_hide': 1,
237 'translatable': 0
Deepesh Garg15ff6a52020-02-18 12:28:41 +0530238 },
239 {
240 'fieldname': 'ewaybill',
241 'label': 'E-Way Bill No.',
242 'fieldtype': 'Data',
243 'depends_on': 'eval:(doc.docstatus === 1)',
244 'allow_on_submit': 1,
245 'insert_after': 'customer_name_in_arabic',
246 'translatable': 0,
247 }
Nabin Hait34c551d2019-07-03 10:34:31 +0530248 ]
249
250 si_ewaybill_fields = [
251 {
252 'fieldname': 'transporter_info',
253 'label': 'Transporter Info',
254 'fieldtype': 'Section Break',
255 'insert_after': 'terms',
256 'collapsible': 1,
257 'collapsible_depends_on': 'transporter',
258 'print_hide': 1
259 },
260 {
261 'fieldname': 'transporter',
262 'label': 'Transporter',
263 'fieldtype': 'Link',
264 'insert_after': 'transporter_info',
265 'options': 'Supplier',
266 'print_hide': 1
267 },
268 {
269 'fieldname': 'gst_transporter_id',
270 'label': 'GST Transporter ID',
271 'fieldtype': 'Data',
272 'insert_after': 'transporter',
273 'fetch_from': 'transporter.gst_transporter_id',
274 'print_hide': 1,
275 'translatable': 0
276 },
277 {
278 'fieldname': 'driver',
279 'label': 'Driver',
280 'fieldtype': 'Link',
281 'insert_after': 'gst_transporter_id',
282 'options': 'Driver',
283 'print_hide': 1
284 },
285 {
286 'fieldname': 'lr_no',
287 'label': 'Transport Receipt No',
288 'fieldtype': 'Data',
289 'insert_after': 'driver',
290 'print_hide': 1,
291 'translatable': 0
292 },
293 {
294 'fieldname': 'vehicle_no',
295 'label': 'Vehicle No',
296 'fieldtype': 'Data',
297 'insert_after': 'lr_no',
298 'print_hide': 1,
299 'translatable': 0
300 },
301 {
302 'fieldname': 'distance',
303 'label': 'Distance (in km)',
304 'fieldtype': 'Float',
305 'insert_after': 'vehicle_no',
306 'print_hide': 1
307 },
308 {
309 'fieldname': 'transporter_col_break',
310 'fieldtype': 'Column Break',
311 'insert_after': 'distance'
312 },
313 {
314 'fieldname': 'transporter_name',
315 'label': 'Transporter Name',
316 'fieldtype': 'Data',
317 'insert_after': 'transporter_col_break',
318 'fetch_from': 'transporter.name',
319 'read_only': 1,
320 'print_hide': 1,
321 'translatable': 0
322 },
323 {
324 'fieldname': 'mode_of_transport',
325 'label': 'Mode of Transport',
326 'fieldtype': 'Select',
327 'options': '\nRoad\nAir\nRail\nShip',
328 'default': 'Road',
329 'insert_after': 'transporter_name',
330 'print_hide': 1,
331 'translatable': 0
332 },
333 {
334 'fieldname': 'driver_name',
335 'label': 'Driver Name',
336 'fieldtype': 'Data',
337 'insert_after': 'mode_of_transport',
338 'fetch_from': 'driver.full_name',
339 'print_hide': 1,
340 'translatable': 0
341 },
342 {
343 'fieldname': 'lr_date',
344 'label': 'Transport Receipt Date',
345 'fieldtype': 'Date',
346 'insert_after': 'driver_name',
347 'default': 'Today',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530348 'print_hide': 1
349 },
350 {
351 'fieldname': 'gst_vehicle_type',
352 'label': 'GST Vehicle Type',
353 'fieldtype': 'Select',
Nabin Hait34c551d2019-07-03 10:34:31 +0530354 'options': 'Regular\nOver Dimensional Cargo (ODC)',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530355 'depends_on': 'eval:(doc.mode_of_transport === "Road")',
Nabin Hait34c551d2019-07-03 10:34:31 +0530356 'default': 'Regular',
357 'insert_after': 'lr_date',
358 'print_hide': 1,
359 'translatable': 0
360 },
361 {
362 'fieldname': 'ewaybill',
Deepesh Garg15ff6a52020-02-18 12:28:41 +0530363 'label': 'E-Way Bill No.',
Nabin Hait34c551d2019-07-03 10:34:31 +0530364 'fieldtype': 'Data',
365 'depends_on': 'eval:(doc.docstatus === 1)',
366 'allow_on_submit': 1,
deepeshgarg007a85db662019-07-14 18:15:19 +0530367 'insert_after': 'tax_id',
Nabin Hait34c551d2019-07-03 10:34:31 +0530368 'translatable': 0
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530369 }
370 ]
371
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530372 custom_fields = {
373 'Address': [
Rushabh Mehta919a74a2017-06-22 16:37:04 +0530374 dict(fieldname='gstin', label='Party GSTIN', fieldtype='Data',
375 insert_after='fax'),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530376 dict(fieldname='gst_state', label='GST State', fieldtype='Select',
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530377 options='\n'.join(states), insert_after='gstin'),
378 dict(fieldname='gst_state_number', label='GST State Number',
Nabin Hait562d9422018-09-07 16:14:44 +0530379 fieldtype='Data', insert_after='gst_state', read_only=1),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530380 ],
Deepesh Garg22b61602019-03-21 20:47:47 +0530381 'Purchase Invoice': purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields + purchase_invoice_gst_fields,
deepeshgarg007d29ee972019-01-09 17:09:11 +0530382 'Purchase Order': purchase_invoice_gst_fields,
383 'Purchase Receipt': purchase_invoice_gst_fields,
Nabin Hait34c551d2019-07-03 10:34:31 +0530384 'Sales Invoice': sales_invoice_gst_category + invoice_gst_fields + sales_invoice_shipping_fields + sales_invoice_gst_fields + si_ewaybill_fields,
385 'Delivery Note': sales_invoice_gst_fields + ewaybill_fields + sales_invoice_shipping_fields,
deepeshgarg007d29ee972019-01-09 17:09:11 +0530386 'Sales Order': sales_invoice_gst_fields,
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530387 'Tax Category': inter_state_gst_field,
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530388 'Item': [
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530389 dict(fieldname='gst_hsn_code', label='HSN/SAC',
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530390 fieldtype='Link', options='GST HSN Code', insert_after='item_group'),
Marica9942acd2020-04-21 13:13:39 +0530391 dict(fieldname='is_nil_exempt', label='Is Nil Rated or Exempted',
Deepesh Garg22b61602019-03-21 20:47:47 +0530392 fieldtype='Check', insert_after='gst_hsn_code'),
393 dict(fieldname='is_non_gst', label='Is Non GST ',
394 fieldtype='Check', insert_after='is_nil_exempt')
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530395 ],
Deepesh Garg22b61602019-03-21 20:47:47 +0530396 'Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
397 'Supplier Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
398 'Sales Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
399 'Delivery Note Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
400 'Sales Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
401 'Purchase Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
402 'Purchase Receipt Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
403 'Purchase Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
Himanshu Warekar656d8e42019-04-01 19:38:43 +0530404 'Material Request Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
Pawan Mehtaf4196352018-04-05 14:54:51 +0530405 'Employee': [
406 dict(fieldname='ifsc_code', label='IFSC Code',
Rushabh Mehta369afce2018-04-26 10:10:03 +0530407 fieldtype='Data', insert_after='bank_ac_no', print_hide=1,
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530408 depends_on='eval:doc.salary_mode == "Bank"')
409 ],
410 'Company': [
411 dict(fieldname='hra_section', label='HRA Settings',
Anurag Mishraa5527222019-06-14 15:25:57 +0530412 fieldtype='Section Break', insert_after='asset_received_but_not_billed', collapsible=1),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530413 dict(fieldname='basic_component', label='Basic Component',
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530414 fieldtype='Link', options='Salary Component', insert_after='hra_section'),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530415 dict(fieldname='hra_component', label='HRA Component',
416 fieldtype='Link', options='Salary Component', insert_after='basic_component'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530417 dict(fieldname='arrear_component', label='Arrear Component',
Mangesh-Khairnar9215de02019-05-06 16:24:10 +0530418 fieldtype='Link', options='Salary Component', insert_after='hra_component'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530419 ],
420 'Employee Tax Exemption Declaration':[
421 dict(fieldname='hra_section', label='HRA Exemption',
422 fieldtype='Section Break', insert_after='declarations'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530423 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530424 fieldtype='Currency', insert_after='hra_section'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530425 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530426 fieldtype='Check', insert_after='monthly_house_rent', depends_on='monthly_house_rent'),
427 dict(fieldname='salary_structure_hra', label='HRA as per Salary Structure',
428 fieldtype='Currency', insert_after='rented_in_metro_city', read_only=1, depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530429 dict(fieldname='hra_column_break', fieldtype='Column Break',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530430 insert_after='salary_structure_hra', depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530431 dict(fieldname='annual_hra_exemption', label='Annual HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530432 fieldtype='Currency', insert_after='hra_column_break', read_only=1, depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530433 dict(fieldname='monthly_hra_exemption', label='Monthly HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530434 fieldtype='Currency', insert_after='annual_hra_exemption', read_only=1, depends_on='monthly_house_rent')
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530435 ],
436 'Employee Tax Exemption Proof Submission': [
437 dict(fieldname='hra_section', label='HRA Exemption',
438 fieldtype='Section Break', insert_after='tax_exemption_proofs'),
439 dict(fieldname='house_rent_payment_amount', label='House Rent Payment Amount',
440 fieldtype='Currency', insert_after='hra_section'),
441 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530442 fieldtype='Check', insert_after='house_rent_payment_amount', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530443 dict(fieldname='rented_from_date', label='Rented From Date',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530444 fieldtype='Date', insert_after='rented_in_metro_city', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530445 dict(fieldname='rented_to_date', label='Rented To Date',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530446 fieldtype='Date', insert_after='rented_from_date', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530447 dict(fieldname='hra_column_break', fieldtype='Column Break',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530448 insert_after='rented_to_date', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530449 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530450 fieldtype='Currency', insert_after='hra_column_break', read_only=1, depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530451 dict(fieldname='monthly_hra_exemption', label='Monthly Eligible Amount',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530452 fieldtype='Currency', insert_after='monthly_house_rent', read_only=1, depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530453 dict(fieldname='total_eligible_hra_exemption', label='Total Eligible HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530454 fieldtype='Currency', insert_after='monthly_hra_exemption', read_only=1, depends_on='house_rent_payment_amount')
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530455 ],
456 'Supplier': [
457 {
458 'fieldname': 'gst_transporter_id',
459 'label': 'GST Transporter ID',
460 'fieldtype': 'Data',
461 'insert_after': 'supplier_type',
462 'depends_on': 'eval:doc.is_transporter'
Deepesh Garg22b61602019-03-21 20:47:47 +0530463 },
464 {
465 'fieldname': 'gst_category',
466 'label': 'GST Category',
467 'fieldtype': 'Select',
468 'insert_after': 'gst_transporter_id',
469 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nUIN Holders',
470 'default': 'Unregistered'
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530471 },
472 {
473 'fieldname': 'export_type',
474 'label': 'Export Type',
475 'fieldtype': 'Select',
476 'insert_after': 'gst_category',
477 'default': 'Without Payment of Tax',
478 'depends_on':'eval:in_list(["SEZ", "Overseas"], doc.gst_category)',
479 'options': '\nWith Payment of Tax\nWithout Payment of Tax'
Deepesh Garg22b61602019-03-21 20:47:47 +0530480 }
481 ],
482 'Customer': [
483 {
484 'fieldname': 'gst_category',
485 'label': 'GST Category',
486 'fieldtype': 'Select',
487 'insert_after': 'customer_type',
488 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
489 'default': 'Unregistered'
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530490 },
491 {
492 'fieldname': 'export_type',
493 'label': 'Export Type',
494 'fieldtype': 'Select',
495 'insert_after': 'gst_category',
496 'default': 'Without Payment of Tax',
497 'depends_on':'eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)',
498 'options': '\nWith Payment of Tax\nWithout Payment of Tax'
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530499 }
Shivam Mishra1d6395c2020-03-30 18:14:44 +0530500 ],
501 "Member": [
502 {
503 'fieldname': 'pan_number',
504 'label': 'PAN Details',
505 'fieldtype': 'Data',
506 'insert_after': 'email'
507 }
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530508 ]
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530509 }
Deepesh Garg22b61602019-03-21 20:47:47 +0530510 create_custom_fields(custom_fields, update=update)
Nabin Hait9c421612017-07-20 13:32:01 +0530511
Saurabh2d8a7ee2018-05-11 13:16:16 +0530512def make_fixtures(company=None):
513 docs = []
514 company = company.name if company else frappe.db.get_value("Global Defaults", None, "default_company")
515
516 set_salary_components(docs)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530517 set_tds_account(docs, company)
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530518
519 for d in docs:
520 try:
521 doc = frappe.get_doc(d)
522 doc.flags.ignore_permissions = True
523 doc.insert()
524 except frappe.NameError:
Faris Ansariec7b0642019-05-14 16:21:09 +0530525 frappe.clear_messages()
Zarrar7f8024c2018-08-01 17:45:05 +0530526 except frappe.DuplicateEntryError:
Faris Ansariec7b0642019-05-14 16:21:09 +0530527 frappe.clear_messages()
Saurabh2d8a7ee2018-05-11 13:16:16 +0530528
Zarrar7f8024c2018-08-01 17:45:05 +0530529 # create records for Tax Withholding Category
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530530 set_tax_withholding_category(company)
531
Saurabh2d8a7ee2018-05-11 13:16:16 +0530532def set_salary_components(docs):
533 docs.extend([
Nabin Hait58ee6c12020-04-26 17:45:57 +0530534 {'doctype': 'Salary Component', 'salary_component': 'Professional Tax',
535 'description': 'Professional Tax', 'type': 'Deduction', 'exempted_from_income_tax': 1},
536 {'doctype': 'Salary Component', 'salary_component': 'Provident Fund',
537 'description': 'Provident fund', 'type': 'Deduction', 'is_tax_applicable': 1},
538 {'doctype': 'Salary Component', 'salary_component': 'House Rent Allowance',
539 'description': 'House Rent Allowance', 'type': 'Earning', 'is_tax_applicable': 1},
540 {'doctype': 'Salary Component', 'salary_component': 'Basic',
541 'description': 'Basic', 'type': 'Earning', 'is_tax_applicable': 1},
542 {'doctype': 'Salary Component', 'salary_component': 'Arrear',
543 'description': 'Arrear', 'type': 'Earning', 'is_tax_applicable': 1},
544 {'doctype': 'Salary Component', 'salary_component': 'Leave Encashment',
545 'description': 'Leave Encashment', 'type': 'Earning', 'is_tax_applicable': 1}
Saurabh2d8a7ee2018-05-11 13:16:16 +0530546 ])
547
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530548def set_tax_withholding_category(company):
Saurabh2d8a7ee2018-05-11 13:16:16 +0530549 accounts = []
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530550 abbr = frappe.get_value("Company", company, "abbr")
551 tds_account = frappe.get_value("Account", 'TDS Payable - {0}'.format(abbr), 'name')
Saurabh2d8a7ee2018-05-11 13:16:16 +0530552
553 if company and tds_account:
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530554 accounts = [dict(company=company, account=tds_account)]
Saurabh2d8a7ee2018-05-11 13:16:16 +0530555
Nabin Haitafef9c12019-02-12 11:28:20 +0530556 fiscal_year = get_fiscal_year(today(), company=company)[0]
Zarrar7f8024c2018-08-01 17:45:05 +0530557 docs = get_tds_details(accounts, fiscal_year)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530558
Zarrar7f8024c2018-08-01 17:45:05 +0530559 for d in docs:
560 try:
561 doc = frappe.get_doc(d)
562 doc.flags.ignore_permissions = True
Nabin Haitafef9c12019-02-12 11:28:20 +0530563 doc.flags.ignore_mandatory = True
Zarrar7f8024c2018-08-01 17:45:05 +0530564 doc.insert()
565 except frappe.DuplicateEntryError:
566 doc = frappe.get_doc("Tax Withholding Category", d.get("name"))
Zarrar963d62b2019-03-23 10:30:12 +0530567
568 if accounts:
569 doc.append("accounts", accounts[0])
Zarrar7f8024c2018-08-01 17:45:05 +0530570
571 # if fiscal year don't match with any of the already entered data, append rate row
572 fy_exist = [k for k in doc.get('rates') if k.get('fiscal_year')==fiscal_year]
573 if not fy_exist:
574 doc.append("rates", d.get('rates')[0])
575
576 doc.save()
Saurabh2d8a7ee2018-05-11 13:16:16 +0530577
578def set_tds_account(docs, company):
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530579 abbr = frappe.get_value("Company", company, "abbr")
Nabin Haitf77cd542018-11-20 16:46:25 +0530580 parent_account = frappe.db.get_value("Account", filters = {"account_name": "Duties and Taxes", "company": company})
581 if parent_account:
582 docs.extend([
583 {
584 "doctype": "Account",
585 "account_name": "TDS Payable",
586 "account_type": "Tax",
587 "parent_account": parent_account,
588 "company": company
589 }
590 ])
Zarrar7f8024c2018-08-01 17:45:05 +0530591
592def get_tds_details(accounts, fiscal_year):
593 # bootstrap default tax withholding sections
594 return [
595 dict(name="TDS - 194C - Company",
596 category_name="Payment to Contractors (Single / Aggregate)",
597 doctype="Tax Withholding Category", accounts=accounts,
598 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
599 "single_threshold": 30000, "cumulative_threshold": 100000}]),
600 dict(name="TDS - 194C - Individual",
601 category_name="Payment to Contractors (Single / Aggregate)",
602 doctype="Tax Withholding Category", accounts=accounts,
603 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
604 "single_threshold": 30000, "cumulative_threshold": 100000}]),
605 dict(name="TDS - 194C - No PAN / Invalid PAN",
606 category_name="Payment to Contractors (Single / Aggregate)",
607 doctype="Tax Withholding Category", accounts=accounts,
608 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
609 "single_threshold": 30000, "cumulative_threshold": 100000}]),
610 dict(name="TDS - 194D - Company",
611 category_name="Insurance Commission",
612 doctype="Tax Withholding Category", accounts=accounts,
613 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
614 "single_threshold": 15000, "cumulative_threshold": 0}]),
615 dict(name="TDS - 194D - Company Assessee",
616 category_name="Insurance Commission",
617 doctype="Tax Withholding Category", accounts=accounts,
618 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
619 "single_threshold": 15000, "cumulative_threshold": 0}]),
620 dict(name="TDS - 194D - Individual",
621 category_name="Insurance Commission",
622 doctype="Tax Withholding Category", accounts=accounts,
623 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
624 "single_threshold": 15000, "cumulative_threshold": 0}]),
625 dict(name="TDS - 194D - No PAN / Invalid PAN",
626 category_name="Insurance Commission",
627 doctype="Tax Withholding Category", accounts=accounts,
628 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
629 "single_threshold": 15000, "cumulative_threshold": 0}]),
630 dict(name="TDS - 194DA - Company",
631 category_name="Non-exempt payments made under a life insurance policy",
632 doctype="Tax Withholding Category", accounts=accounts,
633 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
634 "single_threshold": 100000, "cumulative_threshold": 0}]),
635 dict(name="TDS - 194DA - Individual",
636 category_name="Non-exempt payments made under a life insurance policy",
637 doctype="Tax Withholding Category", accounts=accounts,
638 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
639 "single_threshold": 100000, "cumulative_threshold": 0}]),
640 dict(name="TDS - 194DA - No PAN / Invalid PAN",
641 category_name="Non-exempt payments made under a life insurance policy",
642 doctype="Tax Withholding Category", accounts=accounts,
643 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
644 "single_threshold": 100000, "cumulative_threshold": 0}]),
645 dict(name="TDS - 194H - Company",
646 category_name="Commission / Brokerage",
647 doctype="Tax Withholding Category", accounts=accounts,
648 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
649 "single_threshold": 15000, "cumulative_threshold": 0}]),
650 dict(name="TDS - 194H - Individual",
651 category_name="Commission / Brokerage",
652 doctype="Tax Withholding Category", accounts=accounts,
653 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
654 "single_threshold": 15000, "cumulative_threshold": 0}]),
655 dict(name="TDS - 194H - No PAN / Invalid PAN",
656 category_name="Commission / Brokerage",
657 doctype="Tax Withholding Category", accounts=accounts,
658 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
659 "single_threshold": 15000, "cumulative_threshold": 0}]),
660 dict(name="TDS - 194I - Rent - Company",
661 category_name="Rent",
662 doctype="Tax Withholding Category", accounts=accounts,
663 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
664 "single_threshold": 180000, "cumulative_threshold": 0}]),
665 dict(name="TDS - 194I - Rent - Individual",
666 category_name="Rent",
667 doctype="Tax Withholding Category", accounts=accounts,
668 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
669 "single_threshold": 180000, "cumulative_threshold": 0}]),
670 dict(name="TDS - 194I - Rent - No PAN / Invalid PAN",
671 category_name="Rent",
672 doctype="Tax Withholding Category", accounts=accounts,
673 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
674 "single_threshold": 180000, "cumulative_threshold": 0}]),
675 dict(name="TDS - 194I - Rent/Machinery - Company",
676 category_name="Rent-Plant / Machinery",
677 doctype="Tax Withholding Category", accounts=accounts,
678 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
679 "single_threshold": 180000, "cumulative_threshold": 0}]),
680 dict(name="TDS - 194I - Rent/Machinery - Individual",
681 category_name="Rent-Plant / Machinery",
682 doctype="Tax Withholding Category", accounts=accounts,
683 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
684 "single_threshold": 180000, "cumulative_threshold": 0}]),
685 dict(name="TDS - 194I - Rent/Machinery - No PAN / Invalid PAN",
686 category_name="Rent-Plant / Machinery",
687 doctype="Tax Withholding Category", accounts=accounts,
688 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
689 "single_threshold": 180000, "cumulative_threshold": 0}]),
690 dict(name="TDS - 194J - Professional Fees - Company",
691 category_name="Professional Fees",
692 doctype="Tax Withholding Category", accounts=accounts,
693 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
694 "single_threshold": 30000, "cumulative_threshold": 0}]),
695 dict(name="TDS - 194J - Professional Fees - Individual",
696 category_name="Professional Fees",
697 doctype="Tax Withholding Category", accounts=accounts,
698 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
699 "single_threshold": 30000, "cumulative_threshold": 0}]),
700 dict(name="TDS - 194J - Professional Fees - No PAN / Invalid PAN",
701 category_name="Professional Fees",
702 doctype="Tax Withholding Category", accounts=accounts,
703 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
704 "single_threshold": 30000, "cumulative_threshold": 0}]),
705 dict(name="TDS - 194J - Director Fees - Company",
706 category_name="Director Fees",
707 doctype="Tax Withholding Category", accounts=accounts,
708 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
709 "single_threshold": 0, "cumulative_threshold": 0}]),
710 dict(name="TDS - 194J - Director Fees - Individual",
711 category_name="Director Fees",
712 doctype="Tax Withholding Category", accounts=accounts,
713 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
714 "single_threshold": 0, "cumulative_threshold": 0}]),
715 dict(name="TDS - 194J - Director Fees - No PAN / Invalid PAN",
716 category_name="Director Fees",
717 doctype="Tax Withholding Category", accounts=accounts,
718 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
719 "single_threshold": 0, "cumulative_threshold": 0}]),
720 dict(name="TDS - 194 - Dividends - Company",
721 category_name="Dividends",
722 doctype="Tax Withholding Category", accounts=accounts,
723 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
724 "single_threshold": 2500, "cumulative_threshold": 0}]),
725 dict(name="TDS - 194 - Dividends - Individual",
726 category_name="Dividends",
727 doctype="Tax Withholding Category", accounts=accounts,
728 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
729 "single_threshold": 2500, "cumulative_threshold": 0}]),
730 dict(name="TDS - 194 - Dividends - No PAN / Invalid PAN",
731 category_name="Dividends",
732 doctype="Tax Withholding Category", accounts=accounts,
733 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
734 "single_threshold": 2500, "cumulative_threshold": 0}])
Shivam Mishra1d6395c2020-03-30 18:14:44 +0530735 ]