blob: 970a831e0ea9906e83d7da26cb46991c5a7f3145 [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:
16 update_address_template()
Prateeksha Singhdabf3492018-11-13 15:56:15 +053017 make_fixtures(company)
Prateeksha Singh39b87652018-11-12 17:19:56 +053018
19# TODO: for all countries
20def setup_company_independent_fixtures():
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053021 make_custom_fields()
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053022 add_permissions()
Rushabh Mehta919a74a2017-06-22 16:37:04 +053023 add_custom_roles_for_reports()
Nabin Haitc3144852017-09-28 18:55:40 +053024 frappe.enqueue('erpnext.regional.india.setup.add_hsn_sac_codes', now=frappe.flags.in_test)
Nabin Hait852cb642017-07-05 12:58:19 +053025 add_print_formats()
Rushabh Mehta919a74a2017-06-22 16:37:04 +053026
27def update_address_template():
28 with open(os.path.join(os.path.dirname(__file__), 'address_template.html'), 'r') as f:
29 html = f.read()
30
31 address_template = frappe.db.get_value('Address Template', 'India')
32 if address_template:
33 frappe.db.set_value('Address Template', 'India', 'template', html)
34 else:
35 # make new html template for India
Rushabh Mehta9b09ff22017-06-27 12:17:39 +053036 frappe.get_doc(dict(
Rushabh Mehta919a74a2017-06-22 16:37:04 +053037 doctype='Address Template',
38 country='India',
39 template=html
Rushabh Mehta9b09ff22017-06-27 12:17:39 +053040 )).insert()
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053041
Nabin Hait1a609312017-07-13 12:16:04 +053042def add_hsn_sac_codes():
43 # HSN codes
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053044 with open(os.path.join(os.path.dirname(__file__), 'hsn_code_data.json'), 'r') as f:
45 hsn_codes = json.loads(f.read())
46
Nabin Hait1a609312017-07-13 12:16:04 +053047 create_hsn_codes(hsn_codes, code_field="hsn_code")
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053048
Nabin Hait1a609312017-07-13 12:16:04 +053049 # SAC Codes
50 with open(os.path.join(os.path.dirname(__file__), 'sac_code_data.json'), 'r') as f:
51 sac_codes = json.loads(f.read())
52 create_hsn_codes(sac_codes, code_field="sac_code")
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053053
Nabin Hait1a609312017-07-13 12:16:04 +053054def create_hsn_codes(data, code_field):
55 for d in data:
Rushabh Mehtaf702d722017-09-27 15:31:30 +053056 hsn_code = frappe.new_doc('GST HSN Code')
57 hsn_code.description = d["description"]
58 hsn_code.hsn_code = d[code_field]
59 hsn_code.name = d[code_field]
60 try:
Nabin Hait1a609312017-07-13 12:16:04 +053061 hsn_code.db_insert()
Rushabh Mehtaf702d722017-09-27 15:31:30 +053062 except frappe.DuplicateEntryError:
63 pass
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053064
Rushabh Mehta919a74a2017-06-22 16:37:04 +053065def add_custom_roles_for_reports():
66 for report_name in ('GST Sales Register', 'GST Purchase Register',
rohitwaghchaure8cca61f2018-08-20 17:53:56 +053067 'GST Itemised Sales Register', 'GST Itemised Purchase Register', 'Eway Bill'):
Rushabh Mehta919a74a2017-06-22 16:37:04 +053068
Rushabh Mehta919a74a2017-06-22 16:37:04 +053069 if not frappe.db.get_value('Custom Role', dict(report=report_name)):
70 frappe.get_doc(dict(
71 doctype='Custom Role',
72 report=report_name,
73 roles= [
74 dict(role='Accounts User'),
75 dict(role='Accounts Manager')
76 ]
77 )).insert()
78
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053079def add_permissions():
Rushabh Mehta00ae4242017-06-27 17:31:41 +053080 for doctype in ('GST HSN Code', 'GST Settings'):
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053081 add_permission(doctype, 'All', 0)
Saqib5e6ce882020-02-03 15:40:35 +053082 for role in ('Accounts Manager', 'System Manager', 'Item Manager', 'Stock Manager'):
83 add_permission(doctype, role, 0)
84 update_permission_property(doctype, role, 0, 'write', 1)
85 update_permission_property(doctype, role, 0, 'create', 1)
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053086
Nabin Hait852cb642017-07-05 12:58:19 +053087def add_print_formats():
88 frappe.reload_doc("regional", "print_format", "gst_tax_invoice")
rohitwaghchauree3b5c0f2017-12-16 10:53:53 +053089 frappe.reload_doc("accounts", "print_format", "gst_pos_invoice")
90
91 frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where
92 name in('GST POS Invoice', 'GST Tax Invoice') """)
Nabin Hait852cb642017-07-05 12:58:19 +053093
Rushabh Mehta69fa8082018-07-17 18:22:51 +053094def make_custom_fields(update=True):
Nabin Haitf3f0dfe2017-07-06 14:49:34 +053095 hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
Nabin Haitd34bfa82018-11-13 18:19:58 +053096 fieldtype='Data', fetch_from='item_code.gst_hsn_code', insert_after='description',
Nabin Haitf4af6082019-04-01 11:51:54 +053097 allow_on_submit=1, print_hide=1, fetch_if_empty=1)
Deepesh Garg22b61602019-03-21 20:47:47 +053098 nil_rated_exempt = dict(fieldname='is_nil_exempt', label='Is nil rated or exempted',
99 fieldtype='Check', fetch_from='item_code.is_nil_exempt', insert_after='gst_hsn_code',
100 print_hide=1)
101 is_non_gst = dict(fieldname='is_non_gst', label='Is Non GST',
102 fieldtype='Check', fetch_from='item_code.is_non_gst', insert_after='is_nil_exempt',
103 print_hide=1)
104
105 purchase_invoice_gst_category = [
Nabin Hait879e1622017-08-21 08:28:55 +0530106 dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',
vishdha109b4082018-01-30 12:11:13 +0530107 insert_after='language', print_hide=1, collapsible=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530108 dict(fieldname='gst_category', label='GST Category',
Nabin Hait10dae5d2019-04-01 20:56:51 +0530109 fieldtype='Select', insert_after='gst_section', print_hide=1,
Nabin Hait89b06132019-05-01 14:18:21 +0530110 options='\nRegistered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nUIN Holders',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530111 fetch_from='supplier.gst_category', fetch_if_empty=1),
112 dict(fieldname='export_type', label='Export Type',
113 fieldtype='Select', insert_after='gst_category', print_hide=1,
114 depends_on='eval:in_list(["SEZ", "Overseas"], doc.gst_category)',
115 options='\nWith Payment of Tax\nWithout Payment of Tax', fetch_from='supplier.export_type',
116 fetch_if_empty=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530117 ]
118
119 sales_invoice_gst_category = [
120 dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',
121 insert_after='language', print_hide=1, collapsible=1),
122 dict(fieldname='gst_category', label='GST Category',
Nabin Hait10dae5d2019-04-01 20:56:51 +0530123 fieldtype='Select', insert_after='gst_section', print_hide=1,
Nabin Hait89b06132019-05-01 14:18:21 +0530124 options='\nRegistered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530125 fetch_from='customer.gst_category', fetch_if_empty=1),
126 dict(fieldname='export_type', label='Export Type',
127 fieldtype='Select', insert_after='gst_category', print_hide=1,
128 depends_on='eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)',
129 options='\nWith Payment of Tax\nWithout Payment of Tax', fetch_from='customer.export_type',
130 fetch_if_empty=1),
Deepesh Garg22b61602019-03-21 20:47:47 +0530131 ]
132
133 invoice_gst_fields = [
Nabin Hait879e1622017-08-21 08:28:55 +0530134 dict(fieldname='invoice_copy', label='Invoice Copy',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530135 fieldtype='Select', insert_after='export_type', print_hide=1, allow_on_submit=1,
Nabin Hait879e1622017-08-21 08:28:55 +0530136 options='Original for Recipient\nDuplicate for Transporter\nDuplicate for Supplier\nTriplicate for Supplier'),
137 dict(fieldname='reverse_charge', label='Reverse Charge',
138 fieldtype='Select', insert_after='invoice_copy', print_hide=1,
139 options='Y\nN', default='N'),
Nabin Hait879e1622017-08-21 08:28:55 +0530140 dict(fieldname='ecommerce_gstin', label='E-commerce GSTIN',
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530141 fieldtype='Data', insert_after='export_type', print_hide=1),
Nabin Haite6d65bc2018-02-14 17:44:06 +0530142 dict(fieldname='gst_col_break', fieldtype='Column Break', insert_after='ecommerce_gstin'),
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530143 dict(fieldname='reason_for_issuing_document', label='Reason For Issuing document',
Nabin Haitb02c1092018-02-05 16:09:51 +0530144 fieldtype='Select', insert_after='gst_col_break', print_hide=1,
Nabin Haite6d65bc2018-02-14 17:44:06 +0530145 depends_on='eval:doc.is_return==1',
Nabin Haita8d10b72018-02-12 16:54:13 +0530146 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 +0530147 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530148
Nabin Hait879e1622017-08-21 08:28:55 +0530149 purchase_invoice_gst_fields = [
150 dict(fieldname='supplier_gstin', label='Supplier GSTIN',
151 fieldtype='Data', insert_after='supplier_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530152 fetch_from='supplier_address.gstin', print_hide=1, read_only=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530153 dict(fieldname='company_gstin', label='Company GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530154 fieldtype='Data', insert_after='shipping_address_display',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530155 fetch_from='shipping_address.gstin', print_hide=1, read_only=1),
Nabin Haitb02c1092018-02-05 16:09:51 +0530156 dict(fieldname='place_of_supply', label='Place of Supply',
157 fieldtype='Data', insert_after='shipping_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530158 print_hide=1, read_only=1),
deepeshgarg007d29ee972019-01-09 17:09:11 +0530159 ]
160
161 purchase_invoice_itc_fields = [
vishdha98e33c32018-01-29 13:57:34 +0530162 dict(fieldname='eligibility_for_itc', label='Eligibility For ITC',
163 fieldtype='Select', insert_after='reason_for_issuing_document', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530164 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 +0530165 dict(fieldname='itc_integrated_tax', label='Availed ITC Integrated Tax',
166 fieldtype='Data', insert_after='eligibility_for_itc', print_hide=1),
167 dict(fieldname='itc_central_tax', label='Availed ITC Central Tax',
168 fieldtype='Data', insert_after='itc_integrated_tax', print_hide=1),
169 dict(fieldname='itc_state_tax', label='Availed ITC State/UT Tax',
170 fieldtype='Data', insert_after='itc_central_tax', print_hide=1),
171 dict(fieldname='itc_cess_amount', label='Availed ITC Cess',
172 fieldtype='Data', insert_after='itc_state_tax', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530173 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530174
Nabin Hait879e1622017-08-21 08:28:55 +0530175 sales_invoice_gst_fields = [
rohitwaghchaure16645802017-09-28 11:05:03 +0530176 dict(fieldname='billing_address_gstin', label='Billing Address GSTIN',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530177 fieldtype='Data', insert_after='customer_address', read_only=1,
Shreya Shah4fa600a2018-06-05 11:27:53 +0530178 fetch_from='customer_address.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530179 dict(fieldname='customer_gstin', label='Customer GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530180 fieldtype='Data', insert_after='shipping_address_name',
181 fetch_from='shipping_address_name.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530182 dict(fieldname='place_of_supply', label='Place of Supply',
Nabin Hait619c42b2018-01-10 17:48:03 +0530183 fieldtype='Data', insert_after='customer_gstin',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530184 print_hide=1, read_only=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530185 dict(fieldname='company_gstin', label='Company GSTIN',
186 fieldtype='Data', insert_after='company_address',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530187 fetch_from='company_address.gstin', print_hide=1, read_only=1),
deepeshgarg007d29ee972019-01-09 17:09:11 +0530188 ]
189
190 sales_invoice_shipping_fields = [
vishdha98e33c32018-01-29 13:57:34 +0530191 dict(fieldname='port_code', label='Port Code',
192 fieldtype='Data', insert_after='reason_for_issuing_document', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530193 depends_on="eval:doc.gst_category=='Overseas' "),
vishdha98e33c32018-01-29 13:57:34 +0530194 dict(fieldname='shipping_bill_number', label=' Shipping Bill Number',
195 fieldtype='Data', insert_after='port_code', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530196 depends_on="eval:doc.gst_category=='Overseas' "),
vishdha98e33c32018-01-29 13:57:34 +0530197 dict(fieldname='shipping_bill_date', label='Shipping Bill Date',
198 fieldtype='Date', insert_after='shipping_bill_number', print_hide=1,
Deepesh Garg22b61602019-03-21 20:47:47 +0530199 depends_on="eval:doc.gst_category=='Overseas' "),
Nabin Hait879e1622017-08-21 08:28:55 +0530200 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530201
Shreya Shah4fa600a2018-06-05 11:27:53 +0530202 inter_state_gst_field = [
203 dict(fieldname='is_inter_state', label='Is Inter State',
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530204 fieldtype='Check', insert_after='disabled', print_hide=1),
205 dict(fieldname='tax_category_column_break', fieldtype='Column Break',
206 insert_after='is_inter_state'),
207 dict(fieldname='gst_state', label='Source State', fieldtype='Select',
208 options='\n'.join(states), insert_after='company')
Shreya Shah4fa600a2018-06-05 11:27:53 +0530209 ]
210
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530211 ewaybill_fields = [
212 {
213 'fieldname': 'distance',
214 'label': 'Distance (in km)',
215 'fieldtype': 'Float',
216 'insert_after': 'vehicle_no',
217 'print_hide': 1
218 },
219 {
220 'fieldname': 'gst_transporter_id',
221 'label': 'GST Transporter ID',
222 'fieldtype': 'Data',
Nabin Hait34c551d2019-07-03 10:34:31 +0530223 'insert_after': 'transporter',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530224 'fetch_from': 'transporter.gst_transporter_id',
Nabin Hait34c551d2019-07-03 10:34:31 +0530225 'print_hide': 1,
226 'translatable': 0
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530227 },
228 {
229 'fieldname': 'mode_of_transport',
230 'label': 'Mode of Transport',
231 'fieldtype': 'Select',
232 'options': '\nRoad\nAir\nRail\nShip',
233 'default': 'Road',
Nabin Hait34c551d2019-07-03 10:34:31 +0530234 'insert_after': 'transporter_name',
235 'print_hide': 1,
236 'translatable': 0
237 },
238 {
239 'fieldname': 'gst_vehicle_type',
240 'label': 'GST Vehicle Type',
241 'fieldtype': 'Select',
242 'options': 'Regular\nOver Dimensional Cargo (ODC)',
243 'depends_on': 'eval:(doc.mode_of_transport === "Road")',
244 'default': 'Regular',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530245 'insert_after': 'lr_date',
Nabin Hait34c551d2019-07-03 10:34:31 +0530246 'print_hide': 1,
247 'translatable': 0
Deepesh Garg15ff6a52020-02-18 12:28:41 +0530248 },
249 {
250 'fieldname': 'ewaybill',
251 'label': 'E-Way Bill No.',
252 'fieldtype': 'Data',
253 'depends_on': 'eval:(doc.docstatus === 1)',
254 'allow_on_submit': 1,
255 'insert_after': 'customer_name_in_arabic',
256 'translatable': 0,
257 }
Nabin Hait34c551d2019-07-03 10:34:31 +0530258 ]
259
260 si_ewaybill_fields = [
261 {
262 'fieldname': 'transporter_info',
263 'label': 'Transporter Info',
264 'fieldtype': 'Section Break',
265 'insert_after': 'terms',
266 'collapsible': 1,
267 'collapsible_depends_on': 'transporter',
268 'print_hide': 1
269 },
270 {
271 'fieldname': 'transporter',
272 'label': 'Transporter',
273 'fieldtype': 'Link',
274 'insert_after': 'transporter_info',
275 'options': 'Supplier',
276 'print_hide': 1
277 },
278 {
279 'fieldname': 'gst_transporter_id',
280 'label': 'GST Transporter ID',
281 'fieldtype': 'Data',
282 'insert_after': 'transporter',
283 'fetch_from': 'transporter.gst_transporter_id',
284 'print_hide': 1,
285 'translatable': 0
286 },
287 {
288 'fieldname': 'driver',
289 'label': 'Driver',
290 'fieldtype': 'Link',
291 'insert_after': 'gst_transporter_id',
292 'options': 'Driver',
293 'print_hide': 1
294 },
295 {
296 'fieldname': 'lr_no',
297 'label': 'Transport Receipt No',
298 'fieldtype': 'Data',
299 'insert_after': 'driver',
300 'print_hide': 1,
301 'translatable': 0
302 },
303 {
304 'fieldname': 'vehicle_no',
305 'label': 'Vehicle No',
306 'fieldtype': 'Data',
307 'insert_after': 'lr_no',
308 'print_hide': 1,
309 'translatable': 0
310 },
311 {
312 'fieldname': 'distance',
313 'label': 'Distance (in km)',
314 'fieldtype': 'Float',
315 'insert_after': 'vehicle_no',
316 'print_hide': 1
317 },
318 {
319 'fieldname': 'transporter_col_break',
320 'fieldtype': 'Column Break',
321 'insert_after': 'distance'
322 },
323 {
324 'fieldname': 'transporter_name',
325 'label': 'Transporter Name',
326 'fieldtype': 'Data',
327 'insert_after': 'transporter_col_break',
328 'fetch_from': 'transporter.name',
329 'read_only': 1,
330 'print_hide': 1,
331 'translatable': 0
332 },
333 {
334 'fieldname': 'mode_of_transport',
335 'label': 'Mode of Transport',
336 'fieldtype': 'Select',
337 'options': '\nRoad\nAir\nRail\nShip',
338 'default': 'Road',
339 'insert_after': 'transporter_name',
340 'print_hide': 1,
341 'translatable': 0
342 },
343 {
344 'fieldname': 'driver_name',
345 'label': 'Driver Name',
346 'fieldtype': 'Data',
347 'insert_after': 'mode_of_transport',
348 'fetch_from': 'driver.full_name',
349 'print_hide': 1,
350 'translatable': 0
351 },
352 {
353 'fieldname': 'lr_date',
354 'label': 'Transport Receipt Date',
355 'fieldtype': 'Date',
356 'insert_after': 'driver_name',
357 'default': 'Today',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530358 'print_hide': 1
359 },
360 {
361 'fieldname': 'gst_vehicle_type',
362 'label': 'GST Vehicle Type',
363 'fieldtype': 'Select',
Nabin Hait34c551d2019-07-03 10:34:31 +0530364 'options': 'Regular\nOver Dimensional Cargo (ODC)',
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530365 'depends_on': 'eval:(doc.mode_of_transport === "Road")',
Nabin Hait34c551d2019-07-03 10:34:31 +0530366 'default': 'Regular',
367 'insert_after': 'lr_date',
368 'print_hide': 1,
369 'translatable': 0
370 },
371 {
372 'fieldname': 'ewaybill',
Deepesh Garg15ff6a52020-02-18 12:28:41 +0530373 'label': 'E-Way Bill No.',
Nabin Hait34c551d2019-07-03 10:34:31 +0530374 'fieldtype': 'Data',
375 'depends_on': 'eval:(doc.docstatus === 1)',
376 'allow_on_submit': 1,
deepeshgarg007a85db662019-07-14 18:15:19 +0530377 'insert_after': 'tax_id',
Nabin Hait34c551d2019-07-03 10:34:31 +0530378 'translatable': 0
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530379 }
380 ]
381
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530382 custom_fields = {
383 'Address': [
Rushabh Mehta919a74a2017-06-22 16:37:04 +0530384 dict(fieldname='gstin', label='Party GSTIN', fieldtype='Data',
385 insert_after='fax'),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530386 dict(fieldname='gst_state', label='GST State', fieldtype='Select',
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530387 options='\n'.join(states), insert_after='gstin'),
388 dict(fieldname='gst_state_number', label='GST State Number',
Nabin Hait562d9422018-09-07 16:14:44 +0530389 fieldtype='Data', insert_after='gst_state', read_only=1),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530390 ],
Deepesh Garg22b61602019-03-21 20:47:47 +0530391 'Purchase Invoice': purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields + purchase_invoice_gst_fields,
deepeshgarg007d29ee972019-01-09 17:09:11 +0530392 'Purchase Order': purchase_invoice_gst_fields,
393 'Purchase Receipt': purchase_invoice_gst_fields,
Nabin Hait34c551d2019-07-03 10:34:31 +0530394 'Sales Invoice': sales_invoice_gst_category + invoice_gst_fields + sales_invoice_shipping_fields + sales_invoice_gst_fields + si_ewaybill_fields,
395 'Delivery Note': sales_invoice_gst_fields + ewaybill_fields + sales_invoice_shipping_fields,
deepeshgarg007d29ee972019-01-09 17:09:11 +0530396 'Sales Order': sales_invoice_gst_fields,
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530397 'Tax Category': inter_state_gst_field,
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530398 'Item': [
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530399 dict(fieldname='gst_hsn_code', label='HSN/SAC',
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530400 fieldtype='Link', options='GST HSN Code', insert_after='item_group'),
Deepesh Garg22b61602019-03-21 20:47:47 +0530401 dict(fieldname='is_nil_exempt', label='Is nil rated or exempted',
402 fieldtype='Check', insert_after='gst_hsn_code'),
403 dict(fieldname='is_non_gst', label='Is Non GST ',
404 fieldtype='Check', insert_after='is_nil_exempt')
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530405 ],
Deepesh Garg22b61602019-03-21 20:47:47 +0530406 'Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
407 'Supplier Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
408 'Sales Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
409 'Delivery Note Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
410 'Sales Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
411 'Purchase Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
412 'Purchase Receipt Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
413 'Purchase Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
Himanshu Warekar656d8e42019-04-01 19:38:43 +0530414 'Material Request Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
Pawan Mehtaf4196352018-04-05 14:54:51 +0530415 'Employee': [
416 dict(fieldname='ifsc_code', label='IFSC Code',
Rushabh Mehta369afce2018-04-26 10:10:03 +0530417 fieldtype='Data', insert_after='bank_ac_no', print_hide=1,
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530418 depends_on='eval:doc.salary_mode == "Bank"')
419 ],
420 'Company': [
421 dict(fieldname='hra_section', label='HRA Settings',
Anurag Mishraa5527222019-06-14 15:25:57 +0530422 fieldtype='Section Break', insert_after='asset_received_but_not_billed', collapsible=1),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530423 dict(fieldname='basic_component', label='Basic Component',
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530424 fieldtype='Link', options='Salary Component', insert_after='hra_section'),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530425 dict(fieldname='hra_component', label='HRA Component',
426 fieldtype='Link', options='Salary Component', insert_after='basic_component'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530427 dict(fieldname='arrear_component', label='Arrear Component',
Mangesh-Khairnar9215de02019-05-06 16:24:10 +0530428 fieldtype='Link', options='Salary Component', insert_after='hra_component'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530429 ],
430 'Employee Tax Exemption Declaration':[
431 dict(fieldname='hra_section', label='HRA Exemption',
432 fieldtype='Section Break', insert_after='declarations'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530433 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530434 fieldtype='Currency', insert_after='hra_section'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530435 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530436 fieldtype='Check', insert_after='monthly_house_rent', depends_on='monthly_house_rent'),
437 dict(fieldname='salary_structure_hra', label='HRA as per Salary Structure',
438 fieldtype='Currency', insert_after='rented_in_metro_city', read_only=1, depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530439 dict(fieldname='hra_column_break', fieldtype='Column Break',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530440 insert_after='salary_structure_hra', depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530441 dict(fieldname='annual_hra_exemption', label='Annual HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530442 fieldtype='Currency', insert_after='hra_column_break', read_only=1, depends_on='monthly_house_rent'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530443 dict(fieldname='monthly_hra_exemption', label='Monthly HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530444 fieldtype='Currency', insert_after='annual_hra_exemption', read_only=1, depends_on='monthly_house_rent')
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530445 ],
446 'Employee Tax Exemption Proof Submission': [
447 dict(fieldname='hra_section', label='HRA Exemption',
448 fieldtype='Section Break', insert_after='tax_exemption_proofs'),
449 dict(fieldname='house_rent_payment_amount', label='House Rent Payment Amount',
450 fieldtype='Currency', insert_after='hra_section'),
451 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530452 fieldtype='Check', insert_after='house_rent_payment_amount', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530453 dict(fieldname='rented_from_date', label='Rented From Date',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530454 fieldtype='Date', insert_after='rented_in_metro_city', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530455 dict(fieldname='rented_to_date', label='Rented To Date',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530456 fieldtype='Date', insert_after='rented_from_date', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530457 dict(fieldname='hra_column_break', fieldtype='Column Break',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530458 insert_after='rented_to_date', depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530459 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530460 fieldtype='Currency', insert_after='hra_column_break', read_only=1, depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530461 dict(fieldname='monthly_hra_exemption', label='Monthly Eligible Amount',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530462 fieldtype='Currency', insert_after='monthly_house_rent', read_only=1, depends_on='house_rent_payment_amount'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530463 dict(fieldname='total_eligible_hra_exemption', label='Total Eligible HRA Exemption',
Nabin Hait04e7bf42019-04-25 18:44:10 +0530464 fieldtype='Currency', insert_after='monthly_hra_exemption', read_only=1, depends_on='house_rent_payment_amount')
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530465 ],
466 'Supplier': [
467 {
468 'fieldname': 'gst_transporter_id',
469 'label': 'GST Transporter ID',
470 'fieldtype': 'Data',
471 'insert_after': 'supplier_type',
472 'depends_on': 'eval:doc.is_transporter'
Deepesh Garg22b61602019-03-21 20:47:47 +0530473 },
474 {
475 'fieldname': 'gst_category',
476 'label': 'GST Category',
477 'fieldtype': 'Select',
478 'insert_after': 'gst_transporter_id',
479 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nUIN Holders',
480 'default': 'Unregistered'
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530481 },
482 {
483 'fieldname': 'export_type',
484 'label': 'Export Type',
485 'fieldtype': 'Select',
486 'insert_after': 'gst_category',
487 'default': 'Without Payment of Tax',
488 'depends_on':'eval:in_list(["SEZ", "Overseas"], doc.gst_category)',
489 'options': '\nWith Payment of Tax\nWithout Payment of Tax'
Deepesh Garg22b61602019-03-21 20:47:47 +0530490 }
491 ],
492 'Customer': [
493 {
494 'fieldname': 'gst_category',
495 'label': 'GST Category',
496 'fieldtype': 'Select',
497 'insert_after': 'customer_type',
498 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders',
499 'default': 'Unregistered'
Deepesh Garg6e2c13f2019-12-10 15:55:05 +0530500 },
501 {
502 'fieldname': 'export_type',
503 'label': 'Export Type',
504 'fieldtype': 'Select',
505 'insert_after': 'gst_category',
506 'default': 'Without Payment of Tax',
507 'depends_on':'eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)',
508 'options': '\nWith Payment of Tax\nWithout Payment of Tax'
Sagar Vorad92f3ac2018-10-10 14:51:26 +0530509 }
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530510 ]
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530511 }
Deepesh Garg22b61602019-03-21 20:47:47 +0530512 create_custom_fields(custom_fields, update=update)
Nabin Hait9c421612017-07-20 13:32:01 +0530513
Saurabh2d8a7ee2018-05-11 13:16:16 +0530514def make_fixtures(company=None):
515 docs = []
516 company = company.name if company else frappe.db.get_value("Global Defaults", None, "default_company")
517
518 set_salary_components(docs)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530519 set_tds_account(docs, company)
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530520
521 for d in docs:
522 try:
523 doc = frappe.get_doc(d)
524 doc.flags.ignore_permissions = True
525 doc.insert()
526 except frappe.NameError:
Faris Ansariec7b0642019-05-14 16:21:09 +0530527 frappe.clear_messages()
Zarrar7f8024c2018-08-01 17:45:05 +0530528 except frappe.DuplicateEntryError:
Faris Ansariec7b0642019-05-14 16:21:09 +0530529 frappe.clear_messages()
Saurabh2d8a7ee2018-05-11 13:16:16 +0530530
Zarrar7f8024c2018-08-01 17:45:05 +0530531 # create records for Tax Withholding Category
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530532 set_tax_withholding_category(company)
533
Saurabh2d8a7ee2018-05-11 13:16:16 +0530534def set_salary_components(docs):
535 docs.extend([
536 {'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional Tax', 'type': 'Deduction'},
537 {'doctype': 'Salary Component', 'salary_component': 'Provident Fund', 'description': 'Provident fund', 'type': 'Deduction'},
538 {'doctype': 'Salary Component', 'salary_component': 'House Rent Allowance', 'description': 'House Rent Allowance', 'type': 'Earning'},
539 {'doctype': 'Salary Component', 'salary_component': 'Basic', 'description': 'Basic', 'type': 'Earning'},
540 {'doctype': 'Salary Component', 'salary_component': 'Arrear', 'description': 'Arrear', 'type': 'Earning'},
541 {'doctype': 'Salary Component', 'salary_component': 'Leave Encashment', 'description': 'Leave Encashment', 'type': 'Earning'}
542 ])
543
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530544def set_tax_withholding_category(company):
Saurabh2d8a7ee2018-05-11 13:16:16 +0530545 accounts = []
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530546 abbr = frappe.get_value("Company", company, "abbr")
547 tds_account = frappe.get_value("Account", 'TDS Payable - {0}'.format(abbr), 'name')
Saurabh2d8a7ee2018-05-11 13:16:16 +0530548
549 if company and tds_account:
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530550 accounts = [dict(company=company, account=tds_account)]
Saurabh2d8a7ee2018-05-11 13:16:16 +0530551
Nabin Haitafef9c12019-02-12 11:28:20 +0530552 fiscal_year = get_fiscal_year(today(), company=company)[0]
Zarrar7f8024c2018-08-01 17:45:05 +0530553 docs = get_tds_details(accounts, fiscal_year)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530554
Zarrar7f8024c2018-08-01 17:45:05 +0530555 for d in docs:
556 try:
557 doc = frappe.get_doc(d)
558 doc.flags.ignore_permissions = True
Nabin Haitafef9c12019-02-12 11:28:20 +0530559 doc.flags.ignore_mandatory = True
Zarrar7f8024c2018-08-01 17:45:05 +0530560 doc.insert()
561 except frappe.DuplicateEntryError:
562 doc = frappe.get_doc("Tax Withholding Category", d.get("name"))
Zarrar963d62b2019-03-23 10:30:12 +0530563
564 if accounts:
565 doc.append("accounts", accounts[0])
Zarrar7f8024c2018-08-01 17:45:05 +0530566
567 # if fiscal year don't match with any of the already entered data, append rate row
568 fy_exist = [k for k in doc.get('rates') if k.get('fiscal_year')==fiscal_year]
569 if not fy_exist:
570 doc.append("rates", d.get('rates')[0])
571
572 doc.save()
Saurabh2d8a7ee2018-05-11 13:16:16 +0530573
574def set_tds_account(docs, company):
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530575 abbr = frappe.get_value("Company", company, "abbr")
Nabin Haitf77cd542018-11-20 16:46:25 +0530576 parent_account = frappe.db.get_value("Account", filters = {"account_name": "Duties and Taxes", "company": company})
577 if parent_account:
578 docs.extend([
579 {
580 "doctype": "Account",
581 "account_name": "TDS Payable",
582 "account_type": "Tax",
583 "parent_account": parent_account,
584 "company": company
585 }
586 ])
Zarrar7f8024c2018-08-01 17:45:05 +0530587
588def get_tds_details(accounts, fiscal_year):
589 # bootstrap default tax withholding sections
590 return [
591 dict(name="TDS - 194C - Company",
592 category_name="Payment to Contractors (Single / Aggregate)",
593 doctype="Tax Withholding Category", accounts=accounts,
594 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
595 "single_threshold": 30000, "cumulative_threshold": 100000}]),
596 dict(name="TDS - 194C - Individual",
597 category_name="Payment to Contractors (Single / Aggregate)",
598 doctype="Tax Withholding Category", accounts=accounts,
599 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
600 "single_threshold": 30000, "cumulative_threshold": 100000}]),
601 dict(name="TDS - 194C - No PAN / Invalid PAN",
602 category_name="Payment to Contractors (Single / Aggregate)",
603 doctype="Tax Withholding Category", accounts=accounts,
604 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
605 "single_threshold": 30000, "cumulative_threshold": 100000}]),
606 dict(name="TDS - 194D - Company",
607 category_name="Insurance Commission",
608 doctype="Tax Withholding Category", accounts=accounts,
609 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
610 "single_threshold": 15000, "cumulative_threshold": 0}]),
611 dict(name="TDS - 194D - Company Assessee",
612 category_name="Insurance Commission",
613 doctype="Tax Withholding Category", accounts=accounts,
614 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
615 "single_threshold": 15000, "cumulative_threshold": 0}]),
616 dict(name="TDS - 194D - Individual",
617 category_name="Insurance Commission",
618 doctype="Tax Withholding Category", accounts=accounts,
619 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
620 "single_threshold": 15000, "cumulative_threshold": 0}]),
621 dict(name="TDS - 194D - No PAN / Invalid PAN",
622 category_name="Insurance Commission",
623 doctype="Tax Withholding Category", accounts=accounts,
624 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
625 "single_threshold": 15000, "cumulative_threshold": 0}]),
626 dict(name="TDS - 194DA - Company",
627 category_name="Non-exempt payments made under a life insurance policy",
628 doctype="Tax Withholding Category", accounts=accounts,
629 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
630 "single_threshold": 100000, "cumulative_threshold": 0}]),
631 dict(name="TDS - 194DA - Individual",
632 category_name="Non-exempt payments made under a life insurance policy",
633 doctype="Tax Withholding Category", accounts=accounts,
634 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
635 "single_threshold": 100000, "cumulative_threshold": 0}]),
636 dict(name="TDS - 194DA - No PAN / Invalid PAN",
637 category_name="Non-exempt payments made under a life insurance policy",
638 doctype="Tax Withholding Category", accounts=accounts,
639 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
640 "single_threshold": 100000, "cumulative_threshold": 0}]),
641 dict(name="TDS - 194H - Company",
642 category_name="Commission / Brokerage",
643 doctype="Tax Withholding Category", accounts=accounts,
644 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
645 "single_threshold": 15000, "cumulative_threshold": 0}]),
646 dict(name="TDS - 194H - Individual",
647 category_name="Commission / Brokerage",
648 doctype="Tax Withholding Category", accounts=accounts,
649 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
650 "single_threshold": 15000, "cumulative_threshold": 0}]),
651 dict(name="TDS - 194H - No PAN / Invalid PAN",
652 category_name="Commission / Brokerage",
653 doctype="Tax Withholding Category", accounts=accounts,
654 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
655 "single_threshold": 15000, "cumulative_threshold": 0}]),
656 dict(name="TDS - 194I - Rent - Company",
657 category_name="Rent",
658 doctype="Tax Withholding Category", accounts=accounts,
659 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
660 "single_threshold": 180000, "cumulative_threshold": 0}]),
661 dict(name="TDS - 194I - Rent - Individual",
662 category_name="Rent",
663 doctype="Tax Withholding Category", accounts=accounts,
664 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
665 "single_threshold": 180000, "cumulative_threshold": 0}]),
666 dict(name="TDS - 194I - Rent - No PAN / Invalid PAN",
667 category_name="Rent",
668 doctype="Tax Withholding Category", accounts=accounts,
669 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
670 "single_threshold": 180000, "cumulative_threshold": 0}]),
671 dict(name="TDS - 194I - Rent/Machinery - Company",
672 category_name="Rent-Plant / Machinery",
673 doctype="Tax Withholding Category", accounts=accounts,
674 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
675 "single_threshold": 180000, "cumulative_threshold": 0}]),
676 dict(name="TDS - 194I - Rent/Machinery - Individual",
677 category_name="Rent-Plant / Machinery",
678 doctype="Tax Withholding Category", accounts=accounts,
679 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
680 "single_threshold": 180000, "cumulative_threshold": 0}]),
681 dict(name="TDS - 194I - Rent/Machinery - No PAN / Invalid PAN",
682 category_name="Rent-Plant / Machinery",
683 doctype="Tax Withholding Category", accounts=accounts,
684 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
685 "single_threshold": 180000, "cumulative_threshold": 0}]),
686 dict(name="TDS - 194J - Professional Fees - Company",
687 category_name="Professional Fees",
688 doctype="Tax Withholding Category", accounts=accounts,
689 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
690 "single_threshold": 30000, "cumulative_threshold": 0}]),
691 dict(name="TDS - 194J - Professional Fees - Individual",
692 category_name="Professional Fees",
693 doctype="Tax Withholding Category", accounts=accounts,
694 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
695 "single_threshold": 30000, "cumulative_threshold": 0}]),
696 dict(name="TDS - 194J - Professional Fees - No PAN / Invalid PAN",
697 category_name="Professional Fees",
698 doctype="Tax Withholding Category", accounts=accounts,
699 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
700 "single_threshold": 30000, "cumulative_threshold": 0}]),
701 dict(name="TDS - 194J - Director Fees - Company",
702 category_name="Director Fees",
703 doctype="Tax Withholding Category", accounts=accounts,
704 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
705 "single_threshold": 0, "cumulative_threshold": 0}]),
706 dict(name="TDS - 194J - Director Fees - Individual",
707 category_name="Director Fees",
708 doctype="Tax Withholding Category", accounts=accounts,
709 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
710 "single_threshold": 0, "cumulative_threshold": 0}]),
711 dict(name="TDS - 194J - Director Fees - No PAN / Invalid PAN",
712 category_name="Director Fees",
713 doctype="Tax Withholding Category", accounts=accounts,
714 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
715 "single_threshold": 0, "cumulative_threshold": 0}]),
716 dict(name="TDS - 194 - Dividends - Company",
717 category_name="Dividends",
718 doctype="Tax Withholding Category", accounts=accounts,
719 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
720 "single_threshold": 2500, "cumulative_threshold": 0}]),
721 dict(name="TDS - 194 - Dividends - Individual",
722 category_name="Dividends",
723 doctype="Tax Withholding Category", accounts=accounts,
724 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
725 "single_threshold": 2500, "cumulative_threshold": 0}]),
726 dict(name="TDS - 194 - Dividends - No PAN / Invalid PAN",
727 category_name="Dividends",
728 doctype="Tax Withholding Category", accounts=accounts,
729 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
730 "single_threshold": 2500, "cumulative_threshold": 0}])
Saqib5e6ce882020-02-03 15:40:35 +0530731 ]