blob: 07a42ff8538355ed8bcd7e3fb9839291bea29a83 [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
Rushabh Mehtab3c8f442017-06-21 17:22:38 +05308from frappe.permissions import add_permission
9from 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):
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053014 make_custom_fields()
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053015 add_permissions()
Rushabh Mehta919a74a2017-06-22 16:37:04 +053016 add_custom_roles_for_reports()
Nabin Haitc3144852017-09-28 18:55:40 +053017 frappe.enqueue('erpnext.regional.india.setup.add_hsn_sac_codes', now=frappe.flags.in_test)
Nabin Hait852cb642017-07-05 12:58:19 +053018 add_print_formats()
Rushabh Mehta01659272017-06-27 18:05:17 +053019 if not patch:
Nabin Hait1a609312017-07-13 12:16:04 +053020 update_address_template()
Saurabh2d8a7ee2018-05-11 13:16:16 +053021 make_fixtures(company)
Rushabh Mehta919a74a2017-06-22 16:37:04 +053022
23def update_address_template():
24 with open(os.path.join(os.path.dirname(__file__), 'address_template.html'), 'r') as f:
25 html = f.read()
26
27 address_template = frappe.db.get_value('Address Template', 'India')
28 if address_template:
29 frappe.db.set_value('Address Template', 'India', 'template', html)
30 else:
31 # make new html template for India
Rushabh Mehta9b09ff22017-06-27 12:17:39 +053032 frappe.get_doc(dict(
Rushabh Mehta919a74a2017-06-22 16:37:04 +053033 doctype='Address Template',
34 country='India',
35 template=html
Rushabh Mehta9b09ff22017-06-27 12:17:39 +053036 )).insert()
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053037
Nabin Hait1a609312017-07-13 12:16:04 +053038def add_hsn_sac_codes():
39 # HSN codes
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053040 with open(os.path.join(os.path.dirname(__file__), 'hsn_code_data.json'), 'r') as f:
41 hsn_codes = json.loads(f.read())
42
Nabin Hait1a609312017-07-13 12:16:04 +053043 create_hsn_codes(hsn_codes, code_field="hsn_code")
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053044
Nabin Hait1a609312017-07-13 12:16:04 +053045 # SAC Codes
46 with open(os.path.join(os.path.dirname(__file__), 'sac_code_data.json'), 'r') as f:
47 sac_codes = json.loads(f.read())
48 create_hsn_codes(sac_codes, code_field="sac_code")
Prateeksha Singh95d8fd32017-09-04 11:14:04 +053049
Nabin Hait1a609312017-07-13 12:16:04 +053050def create_hsn_codes(data, code_field):
51 for d in data:
Rushabh Mehtaf702d722017-09-27 15:31:30 +053052 hsn_code = frappe.new_doc('GST HSN Code')
53 hsn_code.description = d["description"]
54 hsn_code.hsn_code = d[code_field]
55 hsn_code.name = d[code_field]
56 try:
Nabin Hait1a609312017-07-13 12:16:04 +053057 hsn_code.db_insert()
Rushabh Mehtaf702d722017-09-27 15:31:30 +053058 except frappe.DuplicateEntryError:
59 pass
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053060
Rushabh Mehta919a74a2017-06-22 16:37:04 +053061def add_custom_roles_for_reports():
62 for report_name in ('GST Sales Register', 'GST Purchase Register',
rohitwaghchaure8cca61f2018-08-20 17:53:56 +053063 'GST Itemised Sales Register', 'GST Itemised Purchase Register', 'Eway Bill'):
Rushabh Mehta919a74a2017-06-22 16:37:04 +053064
Rushabh Mehta919a74a2017-06-22 16:37:04 +053065 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='Accounts User'),
71 dict(role='Accounts Manager')
72 ]
73 )).insert()
74
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053075def add_permissions():
Rushabh Mehta00ae4242017-06-27 17:31:41 +053076 for doctype in ('GST HSN Code', 'GST Settings'):
Rushabh Mehtab3c8f442017-06-21 17:22:38 +053077 add_permission(doctype, 'All', 0)
78
Nabin Hait852cb642017-07-05 12:58:19 +053079def add_print_formats():
80 frappe.reload_doc("regional", "print_format", "gst_tax_invoice")
rohitwaghchauree3b5c0f2017-12-16 10:53:53 +053081 frappe.reload_doc("accounts", "print_format", "gst_pos_invoice")
82
83 frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where
84 name in('GST POS Invoice', 'GST Tax Invoice') """)
Nabin Hait852cb642017-07-05 12:58:19 +053085
Rushabh Mehta69fa8082018-07-17 18:22:51 +053086def make_custom_fields(update=True):
Nabin Haitf3f0dfe2017-07-06 14:49:34 +053087 hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC',
Nabin Haite5716e32017-09-11 19:21:37 +053088 fieldtype='Data', options='item_code.gst_hsn_code', insert_after='description',
89 allow_on_submit=1, print_hide=1)
Nabin Hait879e1622017-08-21 08:28:55 +053090 invoice_gst_fields = [
91 dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break',
vishdha109b4082018-01-30 12:11:13 +053092 insert_after='language', print_hide=1, collapsible=1),
Nabin Hait879e1622017-08-21 08:28:55 +053093 dict(fieldname='invoice_copy', label='Invoice Copy',
94 fieldtype='Select', insert_after='gst_section', print_hide=1, allow_on_submit=1,
95 options='Original for Recipient\nDuplicate for Transporter\nDuplicate for Supplier\nTriplicate for Supplier'),
96 dict(fieldname='reverse_charge', label='Reverse Charge',
97 fieldtype='Select', insert_after='invoice_copy', print_hide=1,
98 options='Y\nN', default='N'),
Nabin Hait879e1622017-08-21 08:28:55 +053099 dict(fieldname='invoice_type', label='Invoice Type',
Nabin Haite6d65bc2018-02-14 17:44:06 +0530100 fieldtype='Select', insert_after='invoice_copy', print_hide=1,
Nabin Hait879e1622017-08-21 08:28:55 +0530101 options='Regular\nSEZ\nExport\nDeemed Export', default='Regular'),
102 dict(fieldname='export_type', label='Export Type',
103 fieldtype='Select', insert_after='invoice_type', print_hide=1,
104 depends_on='eval:in_list(["SEZ", "Export", "Deemed Export"], doc.invoice_type)',
105 options='\nWith Payment of Tax\nWithout Payment of Tax'),
106 dict(fieldname='ecommerce_gstin', label='E-commerce GSTIN',
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530107 fieldtype='Data', insert_after='export_type', print_hide=1),
Nabin Haite6d65bc2018-02-14 17:44:06 +0530108 dict(fieldname='gst_col_break', fieldtype='Column Break', insert_after='ecommerce_gstin'),
Vishal Dhayagudec463c062018-01-26 11:27:22 +0530109 dict(fieldname='reason_for_issuing_document', label='Reason For Issuing document',
Nabin Haitb02c1092018-02-05 16:09:51 +0530110 fieldtype='Select', insert_after='gst_col_break', print_hide=1,
Nabin Haite6d65bc2018-02-14 17:44:06 +0530111 depends_on='eval:doc.is_return==1',
Nabin Haita8d10b72018-02-12 16:54:13 +0530112 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 +0530113 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530114
Nabin Hait879e1622017-08-21 08:28:55 +0530115 purchase_invoice_gst_fields = [
116 dict(fieldname='supplier_gstin', label='Supplier GSTIN',
117 fieldtype='Data', insert_after='supplier_address',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530118 fetch_from='supplier_address.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530119 dict(fieldname='company_gstin', label='Company GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530120 fieldtype='Data', insert_after='shipping_address_display',
121 fetch_from='shipping_address.gstin', print_hide=1),
Nabin Haitb02c1092018-02-05 16:09:51 +0530122 dict(fieldname='place_of_supply', label='Place of Supply',
123 fieldtype='Data', insert_after='shipping_address',
124 print_hide=1, read_only=0),
vishdha98e33c32018-01-29 13:57:34 +0530125 dict(fieldname='eligibility_for_itc', label='Eligibility For ITC',
126 fieldtype='Select', insert_after='reason_for_issuing_document', print_hide=1,
127 options='input\ninput service\ncapital goods\nineligible', default="ineligible"),
128 dict(fieldname='itc_integrated_tax', label='Availed ITC Integrated Tax',
129 fieldtype='Data', insert_after='eligibility_for_itc', print_hide=1),
130 dict(fieldname='itc_central_tax', label='Availed ITC Central Tax',
131 fieldtype='Data', insert_after='itc_integrated_tax', print_hide=1),
132 dict(fieldname='itc_state_tax', label='Availed ITC State/UT Tax',
133 fieldtype='Data', insert_after='itc_central_tax', print_hide=1),
134 dict(fieldname='itc_cess_amount', label='Availed ITC Cess',
135 fieldtype='Data', insert_after='itc_state_tax', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530136 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530137
Nabin Hait879e1622017-08-21 08:28:55 +0530138 sales_invoice_gst_fields = [
rohitwaghchaure16645802017-09-28 11:05:03 +0530139 dict(fieldname='billing_address_gstin', label='Billing Address GSTIN',
140 fieldtype='Data', insert_after='customer_address',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530141 fetch_from='customer_address.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530142 dict(fieldname='customer_gstin', label='Customer GSTIN',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530143 fieldtype='Data', insert_after='shipping_address_name',
144 fetch_from='shipping_address_name.gstin', print_hide=1),
Nabin Hait879e1622017-08-21 08:28:55 +0530145 dict(fieldname='place_of_supply', label='Place of Supply',
Nabin Hait619c42b2018-01-10 17:48:03 +0530146 fieldtype='Data', insert_after='customer_gstin',
147 print_hide=1, read_only=0),
Nabin Hait879e1622017-08-21 08:28:55 +0530148 dict(fieldname='company_gstin', label='Company GSTIN',
149 fieldtype='Data', insert_after='company_address',
Shreya Shah4fa600a2018-06-05 11:27:53 +0530150 fetch_from='company_address.gstin', print_hide=1),
vishdha98e33c32018-01-29 13:57:34 +0530151 dict(fieldname='port_code', label='Port Code',
152 fieldtype='Data', insert_after='reason_for_issuing_document', print_hide=1,
153 depends_on="eval:doc.invoice_type=='Export' "),
154 dict(fieldname='shipping_bill_number', label=' Shipping Bill Number',
155 fieldtype='Data', insert_after='port_code', print_hide=1,
156 depends_on="eval:doc.invoice_type=='Export' "),
157 dict(fieldname='shipping_bill_date', label='Shipping Bill Date',
158 fieldtype='Date', insert_after='shipping_bill_number', print_hide=1,
159 depends_on="eval:doc.invoice_type=='Export' ")
Nabin Hait879e1622017-08-21 08:28:55 +0530160 ]
Prateeksha Singh95d8fd32017-09-04 11:14:04 +0530161
Shreya Shah4fa600a2018-06-05 11:27:53 +0530162 inter_state_gst_field = [
163 dict(fieldname='is_inter_state', label='Is Inter State',
164 fieldtype='Check', insert_after='disabled', print_hide=1)
165 ]
166
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530167 custom_fields = {
168 'Address': [
Rushabh Mehta919a74a2017-06-22 16:37:04 +0530169 dict(fieldname='gstin', label='Party GSTIN', fieldtype='Data',
170 insert_after='fax'),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530171 dict(fieldname='gst_state', label='GST State', fieldtype='Select',
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530172 options='\n'.join(states), insert_after='gstin'),
173 dict(fieldname='gst_state_number', label='GST State Number',
Nabin Hait562d9422018-09-07 16:14:44 +0530174 fieldtype='Data', insert_after='gst_state', read_only=1),
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530175 ],
Nabin Haitb02c1092018-02-05 16:09:51 +0530176 'Purchase Invoice': invoice_gst_fields + purchase_invoice_gst_fields,
177 'Sales Invoice': invoice_gst_fields + sales_invoice_gst_fields,
Shreya Shah4fa600a2018-06-05 11:27:53 +0530178 'Delivery Note': sales_invoice_gst_fields,
179 'Sales Taxes and Charges Template': inter_state_gst_field,
180 'Purchase Taxes and Charges Template': inter_state_gst_field,
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530181 'Item': [
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530182 dict(fieldname='gst_hsn_code', label='HSN/SAC',
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530183 fieldtype='Link', options='GST HSN Code', insert_after='item_group'),
184 ],
Nabin Hait9c421612017-07-20 13:32:01 +0530185 'Quotation Item': [hsn_sac_field],
186 'Supplier Quotation Item': [hsn_sac_field],
Nabin Haitf3f0dfe2017-07-06 14:49:34 +0530187 'Sales Order Item': [hsn_sac_field],
188 'Delivery Note Item': [hsn_sac_field],
189 'Sales Invoice Item': [hsn_sac_field],
190 'Purchase Order Item': [hsn_sac_field],
191 'Purchase Receipt Item': [hsn_sac_field],
Pawan Mehtaf4196352018-04-05 14:54:51 +0530192 'Purchase Invoice Item': [hsn_sac_field],
193 'Employee': [
194 dict(fieldname='ifsc_code', label='IFSC Code',
Rushabh Mehta369afce2018-04-26 10:10:03 +0530195 fieldtype='Data', insert_after='bank_ac_no', print_hide=1,
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530196 depends_on='eval:doc.salary_mode == "Bank"')
197 ],
198 'Company': [
199 dict(fieldname='hra_section', label='HRA Settings',
200 fieldtype='Section Break', insert_after='asset_received_but_not_billed'),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530201 dict(fieldname='basic_component', label='Basic Component',
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530202 fieldtype='Link', options='Salary Component', insert_after='hra_section'),
Ranjith Kurungadamb1a756c2018-07-01 16:42:38 +0530203 dict(fieldname='hra_component', label='HRA Component',
204 fieldtype='Link', options='Salary Component', insert_after='basic_component'),
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530205 dict(fieldname='arrear_component', label='Arrear Component',
206 fieldtype='Link', options='Salary Component', insert_after='hra_component')
207 ],
208 'Employee Tax Exemption Declaration':[
209 dict(fieldname='hra_section', label='HRA Exemption',
210 fieldtype='Section Break', insert_after='declarations'),
211 dict(fieldname='salary_structure_hra', label='HRA as per Salary Structure',
212 fieldtype='Currency', insert_after='hra_section', read_only=1),
213 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
214 fieldtype='Currency', insert_after='salary_structure_hra'),
215 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
216 fieldtype='Check', insert_after='monthly_house_rent'),
217 dict(fieldname='hra_column_break', fieldtype='Column Break',
218 insert_after='rented_in_metro_city'),
219 dict(fieldname='annual_hra_exemption', label='Annual HRA Exemption',
220 fieldtype='Currency', insert_after='hra_column_break', read_only=1),
221 dict(fieldname='monthly_hra_exemption', label='Monthly HRA Exemption',
222 fieldtype='Currency', insert_after='annual_hra_exemption', read_only=1)
223 ],
224 'Employee Tax Exemption Proof Submission': [
225 dict(fieldname='hra_section', label='HRA Exemption',
226 fieldtype='Section Break', insert_after='tax_exemption_proofs'),
227 dict(fieldname='house_rent_payment_amount', label='House Rent Payment Amount',
228 fieldtype='Currency', insert_after='hra_section'),
229 dict(fieldname='rented_in_metro_city', label='Rented in Metro City',
230 fieldtype='Check', insert_after='house_rent_payment_amount'),
231 dict(fieldname='rented_from_date', label='Rented From Date',
232 fieldtype='Date', insert_after='rented_in_metro_city'),
233 dict(fieldname='rented_to_date', label='Rented To Date',
234 fieldtype='Date', insert_after='rented_from_date'),
235 dict(fieldname='hra_column_break', fieldtype='Column Break',
236 insert_after='rented_to_date'),
237 dict(fieldname='monthly_house_rent', label='Monthly House Rent',
238 fieldtype='Currency', insert_after='hra_column_break', read_only=1),
239 dict(fieldname='monthly_hra_exemption', label='Monthly Eligible Amount',
240 fieldtype='Currency', insert_after='monthly_house_rent', read_only=1),
241 dict(fieldname='total_eligible_hra_exemption', label='Total Eligible HRA Exemption',
242 fieldtype='Currency', insert_after='monthly_hra_exemption', read_only=1)
243 ]
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530244 }
245
Rushabh Mehta69fa8082018-07-17 18:22:51 +0530246 create_custom_fields(custom_fields, ignore_validate = frappe.flags.in_patch, update=update)
Nabin Hait9c421612017-07-20 13:32:01 +0530247
Saurabh2d8a7ee2018-05-11 13:16:16 +0530248def make_fixtures(company=None):
249 docs = []
250 company = company.name if company else frappe.db.get_value("Global Defaults", None, "default_company")
251
252 set_salary_components(docs)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530253 set_tds_account(docs, company)
Rushabh Mehtab3c8f442017-06-21 17:22:38 +0530254
255 for d in docs:
256 try:
257 doc = frappe.get_doc(d)
258 doc.flags.ignore_permissions = True
259 doc.insert()
260 except frappe.NameError:
261 pass
Zarrar7f8024c2018-08-01 17:45:05 +0530262 except frappe.DuplicateEntryError:
263 pass
Saurabh2d8a7ee2018-05-11 13:16:16 +0530264
Zarrar7f8024c2018-08-01 17:45:05 +0530265 # create records for Tax Withholding Category
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530266 set_tax_withholding_category(company)
267
Saurabh2d8a7ee2018-05-11 13:16:16 +0530268def set_salary_components(docs):
269 docs.extend([
270 {'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional Tax', 'type': 'Deduction'},
271 {'doctype': 'Salary Component', 'salary_component': 'Provident Fund', 'description': 'Provident fund', 'type': 'Deduction'},
272 {'doctype': 'Salary Component', 'salary_component': 'House Rent Allowance', 'description': 'House Rent Allowance', 'type': 'Earning'},
273 {'doctype': 'Salary Component', 'salary_component': 'Basic', 'description': 'Basic', 'type': 'Earning'},
274 {'doctype': 'Salary Component', 'salary_component': 'Arrear', 'description': 'Arrear', 'type': 'Earning'},
275 {'doctype': 'Salary Component', 'salary_component': 'Leave Encashment', 'description': 'Leave Encashment', 'type': 'Earning'}
276 ])
277
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530278def set_tax_withholding_category(company):
Saurabh2d8a7ee2018-05-11 13:16:16 +0530279 accounts = []
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530280 abbr = frappe.get_value("Company", company, "abbr")
281 tds_account = frappe.get_value("Account", 'TDS Payable - {0}'.format(abbr), 'name')
Saurabh2d8a7ee2018-05-11 13:16:16 +0530282
283 if company and tds_account:
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530284 accounts = [dict(company=company, account=tds_account)]
Saurabh2d8a7ee2018-05-11 13:16:16 +0530285
Zarrar7f8024c2018-08-01 17:45:05 +0530286 fiscal_year = get_fiscal_year(today(), company=accounts[0].get('company'))[0]
287 docs = get_tds_details(accounts, fiscal_year)
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530288
Zarrar7f8024c2018-08-01 17:45:05 +0530289 for d in docs:
290 try:
291 doc = frappe.get_doc(d)
292 doc.flags.ignore_permissions = True
293 doc.insert()
294 except frappe.DuplicateEntryError:
295 doc = frappe.get_doc("Tax Withholding Category", d.get("name"))
296 doc.append("accounts", accounts[0])
297
298 # if fiscal year don't match with any of the already entered data, append rate row
299 fy_exist = [k for k in doc.get('rates') if k.get('fiscal_year')==fiscal_year]
300 if not fy_exist:
301 doc.append("rates", d.get('rates')[0])
302
303 doc.save()
Saurabh2d8a7ee2018-05-11 13:16:16 +0530304
305def set_tds_account(docs, company):
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530306 abbr = frappe.get_value("Company", company, "abbr")
Saurabh2d8a7ee2018-05-11 13:16:16 +0530307 docs.extend([
308 {
Ranjith Kurungadame51c1752018-07-24 11:07:28 +0530309 "doctype": "Account", "account_name": "TDS Payable", "account_type": "Tax",
310 "parent_account": "Duties and Taxes - {0}".format(abbr), "company": company
Saurabh2d8a7ee2018-05-11 13:16:16 +0530311 }
Ranjith Kurungadama8e047a2018-06-14 17:56:16 +0530312 ])
Zarrar7f8024c2018-08-01 17:45:05 +0530313
314def get_tds_details(accounts, fiscal_year):
315 # bootstrap default tax withholding sections
316 return [
317 dict(name="TDS - 194C - Company",
318 category_name="Payment to Contractors (Single / Aggregate)",
319 doctype="Tax Withholding Category", accounts=accounts,
320 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
321 "single_threshold": 30000, "cumulative_threshold": 100000}]),
322 dict(name="TDS - 194C - Individual",
323 category_name="Payment to Contractors (Single / Aggregate)",
324 doctype="Tax Withholding Category", accounts=accounts,
325 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
326 "single_threshold": 30000, "cumulative_threshold": 100000}]),
327 dict(name="TDS - 194C - No PAN / Invalid PAN",
328 category_name="Payment to Contractors (Single / Aggregate)",
329 doctype="Tax Withholding Category", accounts=accounts,
330 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
331 "single_threshold": 30000, "cumulative_threshold": 100000}]),
332 dict(name="TDS - 194D - Company",
333 category_name="Insurance Commission",
334 doctype="Tax Withholding Category", accounts=accounts,
335 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
336 "single_threshold": 15000, "cumulative_threshold": 0}]),
337 dict(name="TDS - 194D - Company Assessee",
338 category_name="Insurance Commission",
339 doctype="Tax Withholding Category", accounts=accounts,
340 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
341 "single_threshold": 15000, "cumulative_threshold": 0}]),
342 dict(name="TDS - 194D - Individual",
343 category_name="Insurance Commission",
344 doctype="Tax Withholding Category", accounts=accounts,
345 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
346 "single_threshold": 15000, "cumulative_threshold": 0}]),
347 dict(name="TDS - 194D - No PAN / Invalid PAN",
348 category_name="Insurance Commission",
349 doctype="Tax Withholding Category", accounts=accounts,
350 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
351 "single_threshold": 15000, "cumulative_threshold": 0}]),
352 dict(name="TDS - 194DA - Company",
353 category_name="Non-exempt payments made under a life insurance policy",
354 doctype="Tax Withholding Category", accounts=accounts,
355 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
356 "single_threshold": 100000, "cumulative_threshold": 0}]),
357 dict(name="TDS - 194DA - Individual",
358 category_name="Non-exempt payments made under a life insurance policy",
359 doctype="Tax Withholding Category", accounts=accounts,
360 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1,
361 "single_threshold": 100000, "cumulative_threshold": 0}]),
362 dict(name="TDS - 194DA - No PAN / Invalid PAN",
363 category_name="Non-exempt payments made under a life insurance policy",
364 doctype="Tax Withholding Category", accounts=accounts,
365 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
366 "single_threshold": 100000, "cumulative_threshold": 0}]),
367 dict(name="TDS - 194H - Company",
368 category_name="Commission / Brokerage",
369 doctype="Tax Withholding Category", accounts=accounts,
370 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
371 "single_threshold": 15000, "cumulative_threshold": 0}]),
372 dict(name="TDS - 194H - Individual",
373 category_name="Commission / Brokerage",
374 doctype="Tax Withholding Category", accounts=accounts,
375 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5,
376 "single_threshold": 15000, "cumulative_threshold": 0}]),
377 dict(name="TDS - 194H - No PAN / Invalid PAN",
378 category_name="Commission / Brokerage",
379 doctype="Tax Withholding Category", accounts=accounts,
380 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
381 "single_threshold": 15000, "cumulative_threshold": 0}]),
382 dict(name="TDS - 194I - Rent - Company",
383 category_name="Rent",
384 doctype="Tax Withholding Category", accounts=accounts,
385 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
386 "single_threshold": 180000, "cumulative_threshold": 0}]),
387 dict(name="TDS - 194I - Rent - Individual",
388 category_name="Rent",
389 doctype="Tax Withholding Category", accounts=accounts,
390 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
391 "single_threshold": 180000, "cumulative_threshold": 0}]),
392 dict(name="TDS - 194I - Rent - No PAN / Invalid PAN",
393 category_name="Rent",
394 doctype="Tax Withholding Category", accounts=accounts,
395 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
396 "single_threshold": 180000, "cumulative_threshold": 0}]),
397 dict(name="TDS - 194I - Rent/Machinery - Company",
398 category_name="Rent-Plant / Machinery",
399 doctype="Tax Withholding Category", accounts=accounts,
400 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
401 "single_threshold": 180000, "cumulative_threshold": 0}]),
402 dict(name="TDS - 194I - Rent/Machinery - Individual",
403 category_name="Rent-Plant / Machinery",
404 doctype="Tax Withholding Category", accounts=accounts,
405 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2,
406 "single_threshold": 180000, "cumulative_threshold": 0}]),
407 dict(name="TDS - 194I - Rent/Machinery - No PAN / Invalid PAN",
408 category_name="Rent-Plant / Machinery",
409 doctype="Tax Withholding Category", accounts=accounts,
410 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
411 "single_threshold": 180000, "cumulative_threshold": 0}]),
412 dict(name="TDS - 194J - Professional Fees - Company",
413 category_name="Professional Fees",
414 doctype="Tax Withholding Category", accounts=accounts,
415 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
416 "single_threshold": 30000, "cumulative_threshold": 0}]),
417 dict(name="TDS - 194J - Professional Fees - Individual",
418 category_name="Professional Fees",
419 doctype="Tax Withholding Category", accounts=accounts,
420 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
421 "single_threshold": 30000, "cumulative_threshold": 0}]),
422 dict(name="TDS - 194J - Professional Fees - No PAN / Invalid PAN",
423 category_name="Professional Fees",
424 doctype="Tax Withholding Category", accounts=accounts,
425 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
426 "single_threshold": 30000, "cumulative_threshold": 0}]),
427 dict(name="TDS - 194J - Director Fees - Company",
428 category_name="Director Fees",
429 doctype="Tax Withholding Category", accounts=accounts,
430 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
431 "single_threshold": 0, "cumulative_threshold": 0}]),
432 dict(name="TDS - 194J - Director Fees - Individual",
433 category_name="Director Fees",
434 doctype="Tax Withholding Category", accounts=accounts,
435 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
436 "single_threshold": 0, "cumulative_threshold": 0}]),
437 dict(name="TDS - 194J - Director Fees - No PAN / Invalid PAN",
438 category_name="Director Fees",
439 doctype="Tax Withholding Category", accounts=accounts,
440 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
441 "single_threshold": 0, "cumulative_threshold": 0}]),
442 dict(name="TDS - 194 - Dividends - Company",
443 category_name="Dividends",
444 doctype="Tax Withholding Category", accounts=accounts,
445 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
446 "single_threshold": 2500, "cumulative_threshold": 0}]),
447 dict(name="TDS - 194 - Dividends - Individual",
448 category_name="Dividends",
449 doctype="Tax Withholding Category", accounts=accounts,
450 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10,
451 "single_threshold": 2500, "cumulative_threshold": 0}]),
452 dict(name="TDS - 194 - Dividends - No PAN / Invalid PAN",
453 category_name="Dividends",
454 doctype="Tax Withholding Category", accounts=accounts,
455 rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20,
456 "single_threshold": 2500, "cumulative_threshold": 0}])
457 ]