Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | |
| 6 | import frappe, os, json |
Rushabh Mehta | f056974 | 2017-09-13 12:52:30 +0530 | [diff] [blame] | 7 | from frappe.custom.doctype.custom_field.custom_field import create_custom_fields |
Nabin Hait | 49b41e4 | 2019-01-24 17:55:44 +0530 | [diff] [blame] | 8 | from frappe.permissions import add_permission, update_permission_property |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 9 | from erpnext.regional.india import states |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 10 | from erpnext.accounts.utils import get_fiscal_year |
| 11 | from frappe.utils import today |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 12 | |
Rushabh Mehta | 0165927 | 2017-06-27 18:05:17 +0530 | [diff] [blame] | 13 | def setup(company=None, patch=True): |
Prateeksha Singh | dabf349 | 2018-11-13 15:56:15 +0530 | [diff] [blame] | 14 | setup_company_independent_fixtures() |
Prateeksha Singh | 39b8765 | 2018-11-12 17:19:56 +0530 | [diff] [blame] | 15 | if not patch: |
| 16 | update_address_template() |
Prateeksha Singh | dabf349 | 2018-11-13 15:56:15 +0530 | [diff] [blame] | 17 | make_fixtures(company) |
Prateeksha Singh | 39b8765 | 2018-11-12 17:19:56 +0530 | [diff] [blame] | 18 | |
| 19 | # TODO: for all countries |
| 20 | def setup_company_independent_fixtures(): |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 21 | make_custom_fields() |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 22 | add_permissions() |
Rushabh Mehta | 919a74a | 2017-06-22 16:37:04 +0530 | [diff] [blame] | 23 | add_custom_roles_for_reports() |
Nabin Hait | c314485 | 2017-09-28 18:55:40 +0530 | [diff] [blame] | 24 | frappe.enqueue('erpnext.regional.india.setup.add_hsn_sac_codes', now=frappe.flags.in_test) |
Nabin Hait | 852cb64 | 2017-07-05 12:58:19 +0530 | [diff] [blame] | 25 | add_print_formats() |
Rushabh Mehta | 919a74a | 2017-06-22 16:37:04 +0530 | [diff] [blame] | 26 | |
| 27 | def 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 Mehta | 9b09ff2 | 2017-06-27 12:17:39 +0530 | [diff] [blame] | 36 | frappe.get_doc(dict( |
Rushabh Mehta | 919a74a | 2017-06-22 16:37:04 +0530 | [diff] [blame] | 37 | doctype='Address Template', |
| 38 | country='India', |
| 39 | template=html |
Rushabh Mehta | 9b09ff2 | 2017-06-27 12:17:39 +0530 | [diff] [blame] | 40 | )).insert() |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 41 | |
Nabin Hait | 1a60931 | 2017-07-13 12:16:04 +0530 | [diff] [blame] | 42 | def add_hsn_sac_codes(): |
| 43 | # HSN codes |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 44 | 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 Hait | 1a60931 | 2017-07-13 12:16:04 +0530 | [diff] [blame] | 47 | create_hsn_codes(hsn_codes, code_field="hsn_code") |
Prateeksha Singh | 95d8fd3 | 2017-09-04 11:14:04 +0530 | [diff] [blame] | 48 | |
Nabin Hait | 1a60931 | 2017-07-13 12:16:04 +0530 | [diff] [blame] | 49 | # 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 Singh | 95d8fd3 | 2017-09-04 11:14:04 +0530 | [diff] [blame] | 53 | |
Nabin Hait | 1a60931 | 2017-07-13 12:16:04 +0530 | [diff] [blame] | 54 | def create_hsn_codes(data, code_field): |
| 55 | for d in data: |
Rushabh Mehta | f702d72 | 2017-09-27 15:31:30 +0530 | [diff] [blame] | 56 | 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 Hait | 1a60931 | 2017-07-13 12:16:04 +0530 | [diff] [blame] | 61 | hsn_code.db_insert() |
Rushabh Mehta | f702d72 | 2017-09-27 15:31:30 +0530 | [diff] [blame] | 62 | except frappe.DuplicateEntryError: |
| 63 | pass |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 64 | |
Rushabh Mehta | 919a74a | 2017-06-22 16:37:04 +0530 | [diff] [blame] | 65 | def add_custom_roles_for_reports(): |
| 66 | for report_name in ('GST Sales Register', 'GST Purchase Register', |
rohitwaghchaure | 8cca61f | 2018-08-20 17:53:56 +0530 | [diff] [blame] | 67 | 'GST Itemised Sales Register', 'GST Itemised Purchase Register', 'Eway Bill'): |
Rushabh Mehta | 919a74a | 2017-06-22 16:37:04 +0530 | [diff] [blame] | 68 | |
Rushabh Mehta | 919a74a | 2017-06-22 16:37:04 +0530 | [diff] [blame] | 69 | 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 Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 79 | def add_permissions(): |
Rushabh Mehta | 00ae424 | 2017-06-27 17:31:41 +0530 | [diff] [blame] | 80 | for doctype in ('GST HSN Code', 'GST Settings'): |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 81 | add_permission(doctype, 'All', 0) |
Nabin Hait | 49b41e4 | 2019-01-24 17:55:44 +0530 | [diff] [blame] | 82 | add_permission(doctype, 'Accounts Manager', 0) |
| 83 | update_permission_property(doctype, 'Accounts Manager', 0, 'write', 1) |
| 84 | update_permission_property(doctype, 'Accounts Manager', 0, 'create', 1) |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 85 | |
Nabin Hait | 852cb64 | 2017-07-05 12:58:19 +0530 | [diff] [blame] | 86 | def add_print_formats(): |
| 87 | frappe.reload_doc("regional", "print_format", "gst_tax_invoice") |
rohitwaghchaure | e3b5c0f | 2017-12-16 10:53:53 +0530 | [diff] [blame] | 88 | frappe.reload_doc("accounts", "print_format", "gst_pos_invoice") |
| 89 | |
| 90 | frappe.db.sql(""" update `tabPrint Format` set disabled = 0 where |
| 91 | name in('GST POS Invoice', 'GST Tax Invoice') """) |
Nabin Hait | 852cb64 | 2017-07-05 12:58:19 +0530 | [diff] [blame] | 92 | |
Rushabh Mehta | 69fa808 | 2018-07-17 18:22:51 +0530 | [diff] [blame] | 93 | def make_custom_fields(update=True): |
Nabin Hait | f3f0dfe | 2017-07-06 14:49:34 +0530 | [diff] [blame] | 94 | hsn_sac_field = dict(fieldname='gst_hsn_code', label='HSN/SAC', |
Nabin Hait | d34bfa8 | 2018-11-13 18:19:58 +0530 | [diff] [blame] | 95 | fieldtype='Data', fetch_from='item_code.gst_hsn_code', insert_after='description', |
Nabin Hait | e5716e3 | 2017-09-11 19:21:37 +0530 | [diff] [blame] | 96 | allow_on_submit=1, print_hide=1) |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 97 | nil_rated_exempt = dict(fieldname='is_nil_exempt', label='Is nil rated or exempted', |
| 98 | fieldtype='Check', fetch_from='item_code.is_nil_exempt', insert_after='gst_hsn_code', |
| 99 | print_hide=1) |
| 100 | is_non_gst = dict(fieldname='is_non_gst', label='Is Non GST', |
| 101 | fieldtype='Check', fetch_from='item_code.is_non_gst', insert_after='is_nil_exempt', |
| 102 | print_hide=1) |
| 103 | |
| 104 | purchase_invoice_gst_category = [ |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 105 | dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break', |
vishdha | 109b408 | 2018-01-30 12:11:13 +0530 | [diff] [blame] | 106 | insert_after='language', print_hide=1, collapsible=1), |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 107 | dict(fieldname='gst_category', label='GST Category', |
| 108 | fieldtype='Data', insert_after='gst_section', print_hide=1, |
| 109 | fetch_from='supplier.gst_category') |
| 110 | ] |
| 111 | |
| 112 | sales_invoice_gst_category = [ |
| 113 | dict(fieldname='gst_section', label='GST Details', fieldtype='Section Break', |
| 114 | insert_after='language', print_hide=1, collapsible=1), |
| 115 | dict(fieldname='gst_category', label='GST Category', |
| 116 | fieldtype='Data', insert_after='gst_section', print_hide=1, |
| 117 | fetch_from='customer.gst_category') |
| 118 | ] |
| 119 | |
| 120 | invoice_gst_fields = [ |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 121 | dict(fieldname='invoice_copy', label='Invoice Copy', |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 122 | fieldtype='Select', insert_after='gst_category', print_hide=1, allow_on_submit=1, |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 123 | options='Original for Recipient\nDuplicate for Transporter\nDuplicate for Supplier\nTriplicate for Supplier'), |
| 124 | dict(fieldname='reverse_charge', label='Reverse Charge', |
| 125 | fieldtype='Select', insert_after='invoice_copy', print_hide=1, |
| 126 | options='Y\nN', default='N'), |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 127 | dict(fieldname='export_type', label='Export Type', |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 128 | fieldtype='Select', insert_after='reverse_charge', print_hide=1, |
| 129 | depends_on='eval:in_list(["SEZ", "Overseas", "Deemed Export"], doc.gst_category)', |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 130 | options='\nWith Payment of Tax\nWithout Payment of Tax'), |
| 131 | dict(fieldname='ecommerce_gstin', label='E-commerce GSTIN', |
Vishal Dhayagude | c463c06 | 2018-01-26 11:27:22 +0530 | [diff] [blame] | 132 | fieldtype='Data', insert_after='export_type', print_hide=1), |
Nabin Hait | e6d65bc | 2018-02-14 17:44:06 +0530 | [diff] [blame] | 133 | dict(fieldname='gst_col_break', fieldtype='Column Break', insert_after='ecommerce_gstin'), |
Vishal Dhayagude | c463c06 | 2018-01-26 11:27:22 +0530 | [diff] [blame] | 134 | dict(fieldname='reason_for_issuing_document', label='Reason For Issuing document', |
Nabin Hait | b02c109 | 2018-02-05 16:09:51 +0530 | [diff] [blame] | 135 | fieldtype='Select', insert_after='gst_col_break', print_hide=1, |
Nabin Hait | e6d65bc | 2018-02-14 17:44:06 +0530 | [diff] [blame] | 136 | depends_on='eval:doc.is_return==1', |
Nabin Hait | a8d10b7 | 2018-02-12 16:54:13 +0530 | [diff] [blame] | 137 | 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 Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 138 | ] |
Prateeksha Singh | 95d8fd3 | 2017-09-04 11:14:04 +0530 | [diff] [blame] | 139 | |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 140 | purchase_invoice_gst_fields = [ |
| 141 | dict(fieldname='supplier_gstin', label='Supplier GSTIN', |
| 142 | fieldtype='Data', insert_after='supplier_address', |
Shreya Shah | 4fa600a | 2018-06-05 11:27:53 +0530 | [diff] [blame] | 143 | fetch_from='supplier_address.gstin', print_hide=1), |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 144 | dict(fieldname='company_gstin', label='Company GSTIN', |
Shreya Shah | 4fa600a | 2018-06-05 11:27:53 +0530 | [diff] [blame] | 145 | fieldtype='Data', insert_after='shipping_address_display', |
| 146 | fetch_from='shipping_address.gstin', print_hide=1), |
Nabin Hait | b02c109 | 2018-02-05 16:09:51 +0530 | [diff] [blame] | 147 | dict(fieldname='place_of_supply', label='Place of Supply', |
| 148 | fieldtype='Data', insert_after='shipping_address', |
| 149 | print_hide=1, read_only=0), |
deepeshgarg007 | d29ee97 | 2019-01-09 17:09:11 +0530 | [diff] [blame] | 150 | ] |
| 151 | |
| 152 | purchase_invoice_itc_fields = [ |
vishdha | 98e33c3 | 2018-01-29 13:57:34 +0530 | [diff] [blame] | 153 | dict(fieldname='eligibility_for_itc', label='Eligibility For ITC', |
| 154 | fieldtype='Select', insert_after='reason_for_issuing_document', print_hide=1, |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 155 | options='Input Service Distributor\nImport Of Service\nImport Of Capital Goods\nIneligible\nAll Other ITC', default="All Other ITC"), |
vishdha | 98e33c3 | 2018-01-29 13:57:34 +0530 | [diff] [blame] | 156 | dict(fieldname='itc_integrated_tax', label='Availed ITC Integrated Tax', |
| 157 | fieldtype='Data', insert_after='eligibility_for_itc', print_hide=1), |
| 158 | dict(fieldname='itc_central_tax', label='Availed ITC Central Tax', |
| 159 | fieldtype='Data', insert_after='itc_integrated_tax', print_hide=1), |
| 160 | dict(fieldname='itc_state_tax', label='Availed ITC State/UT Tax', |
| 161 | fieldtype='Data', insert_after='itc_central_tax', print_hide=1), |
| 162 | dict(fieldname='itc_cess_amount', label='Availed ITC Cess', |
| 163 | fieldtype='Data', insert_after='itc_state_tax', print_hide=1), |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 164 | ] |
Prateeksha Singh | 95d8fd3 | 2017-09-04 11:14:04 +0530 | [diff] [blame] | 165 | |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 166 | sales_invoice_gst_fields = [ |
rohitwaghchaure | 1664580 | 2017-09-28 11:05:03 +0530 | [diff] [blame] | 167 | dict(fieldname='billing_address_gstin', label='Billing Address GSTIN', |
| 168 | fieldtype='Data', insert_after='customer_address', |
Shreya Shah | 4fa600a | 2018-06-05 11:27:53 +0530 | [diff] [blame] | 169 | fetch_from='customer_address.gstin', print_hide=1), |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 170 | dict(fieldname='customer_gstin', label='Customer GSTIN', |
Shreya Shah | 4fa600a | 2018-06-05 11:27:53 +0530 | [diff] [blame] | 171 | fieldtype='Data', insert_after='shipping_address_name', |
| 172 | fetch_from='shipping_address_name.gstin', print_hide=1), |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 173 | dict(fieldname='place_of_supply', label='Place of Supply', |
Nabin Hait | 619c42b | 2018-01-10 17:48:03 +0530 | [diff] [blame] | 174 | fieldtype='Data', insert_after='customer_gstin', |
| 175 | print_hide=1, read_only=0), |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 176 | dict(fieldname='company_gstin', label='Company GSTIN', |
| 177 | fieldtype='Data', insert_after='company_address', |
Shreya Shah | 4fa600a | 2018-06-05 11:27:53 +0530 | [diff] [blame] | 178 | fetch_from='company_address.gstin', print_hide=1), |
deepeshgarg007 | d29ee97 | 2019-01-09 17:09:11 +0530 | [diff] [blame] | 179 | ] |
| 180 | |
| 181 | sales_invoice_shipping_fields = [ |
vishdha | 98e33c3 | 2018-01-29 13:57:34 +0530 | [diff] [blame] | 182 | dict(fieldname='port_code', label='Port Code', |
| 183 | fieldtype='Data', insert_after='reason_for_issuing_document', print_hide=1, |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 184 | depends_on="eval:doc.gst_category=='Overseas' "), |
vishdha | 98e33c3 | 2018-01-29 13:57:34 +0530 | [diff] [blame] | 185 | dict(fieldname='shipping_bill_number', label=' Shipping Bill Number', |
| 186 | fieldtype='Data', insert_after='port_code', print_hide=1, |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 187 | depends_on="eval:doc.gst_category=='Overseas' "), |
vishdha | 98e33c3 | 2018-01-29 13:57:34 +0530 | [diff] [blame] | 188 | dict(fieldname='shipping_bill_date', label='Shipping Bill Date', |
| 189 | fieldtype='Date', insert_after='shipping_bill_number', print_hide=1, |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 190 | depends_on="eval:doc.gst_category=='Overseas' "), |
Nabin Hait | 879e162 | 2017-08-21 08:28:55 +0530 | [diff] [blame] | 191 | ] |
Prateeksha Singh | 95d8fd3 | 2017-09-04 11:14:04 +0530 | [diff] [blame] | 192 | |
Shreya Shah | 4fa600a | 2018-06-05 11:27:53 +0530 | [diff] [blame] | 193 | inter_state_gst_field = [ |
| 194 | dict(fieldname='is_inter_state', label='Is Inter State', |
| 195 | fieldtype='Check', insert_after='disabled', print_hide=1) |
| 196 | ] |
| 197 | |
Sagar Vora | d92f3ac | 2018-10-10 14:51:26 +0530 | [diff] [blame] | 198 | ewaybill_fields = [ |
| 199 | { |
| 200 | 'fieldname': 'distance', |
| 201 | 'label': 'Distance (in km)', |
| 202 | 'fieldtype': 'Float', |
| 203 | 'insert_after': 'vehicle_no', |
| 204 | 'print_hide': 1 |
| 205 | }, |
| 206 | { |
| 207 | 'fieldname': 'gst_transporter_id', |
| 208 | 'label': 'GST Transporter ID', |
| 209 | 'fieldtype': 'Data', |
| 210 | 'insert_after': 'transporter_name', |
| 211 | 'fetch_from': 'transporter.gst_transporter_id', |
| 212 | 'print_hide': 1 |
| 213 | }, |
| 214 | { |
| 215 | 'fieldname': 'mode_of_transport', |
| 216 | 'label': 'Mode of Transport', |
| 217 | 'fieldtype': 'Select', |
| 218 | 'options': '\nRoad\nAir\nRail\nShip', |
| 219 | 'default': 'Road', |
| 220 | 'insert_after': 'lr_date', |
| 221 | 'print_hide': 1 |
| 222 | }, |
| 223 | { |
| 224 | 'fieldname': 'gst_vehicle_type', |
| 225 | 'label': 'GST Vehicle Type', |
| 226 | 'fieldtype': 'Select', |
| 227 | 'options': '\nRegular\nOver Dimensional Cargo (ODC)', |
| 228 | 'default': 'Regular', |
| 229 | 'depends_on': 'eval:(doc.mode_of_transport === "Road")', |
| 230 | 'insert_after': 'mode_of_transport', |
| 231 | 'print_hide': 1 |
| 232 | } |
| 233 | ] |
| 234 | |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 235 | custom_fields = { |
| 236 | 'Address': [ |
Rushabh Mehta | 919a74a | 2017-06-22 16:37:04 +0530 | [diff] [blame] | 237 | dict(fieldname='gstin', label='Party GSTIN', fieldtype='Data', |
| 238 | insert_after='fax'), |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 239 | dict(fieldname='gst_state', label='GST State', fieldtype='Select', |
Nabin Hait | f3f0dfe | 2017-07-06 14:49:34 +0530 | [diff] [blame] | 240 | options='\n'.join(states), insert_after='gstin'), |
| 241 | dict(fieldname='gst_state_number', label='GST State Number', |
Nabin Hait | 562d942 | 2018-09-07 16:14:44 +0530 | [diff] [blame] | 242 | fieldtype='Data', insert_after='gst_state', read_only=1), |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 243 | ], |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 244 | 'Purchase Invoice': purchase_invoice_gst_category + invoice_gst_fields + purchase_invoice_itc_fields + purchase_invoice_gst_fields, |
deepeshgarg007 | d29ee97 | 2019-01-09 17:09:11 +0530 | [diff] [blame] | 245 | 'Purchase Order': purchase_invoice_gst_fields, |
| 246 | 'Purchase Receipt': purchase_invoice_gst_fields, |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 247 | 'Sales Invoice': sales_invoice_gst_category + invoice_gst_fields + sales_invoice_shipping_fields + sales_invoice_gst_fields, |
| 248 | 'Delivery Note': sales_invoice_gst_fields + ewaybill_fields, |
deepeshgarg007 | d29ee97 | 2019-01-09 17:09:11 +0530 | [diff] [blame] | 249 | 'Sales Order': sales_invoice_gst_fields, |
Shreya Shah | 4fa600a | 2018-06-05 11:27:53 +0530 | [diff] [blame] | 250 | 'Sales Taxes and Charges Template': inter_state_gst_field, |
| 251 | 'Purchase Taxes and Charges Template': inter_state_gst_field, |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 252 | 'Item': [ |
Nabin Hait | f3f0dfe | 2017-07-06 14:49:34 +0530 | [diff] [blame] | 253 | dict(fieldname='gst_hsn_code', label='HSN/SAC', |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 254 | fieldtype='Link', options='GST HSN Code', insert_after='item_group'), |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 255 | dict(fieldname='is_nil_exempt', label='Is nil rated or exempted', |
| 256 | fieldtype='Check', insert_after='gst_hsn_code'), |
| 257 | dict(fieldname='is_non_gst', label='Is Non GST ', |
| 258 | fieldtype='Check', insert_after='is_nil_exempt') |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 259 | ], |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 260 | 'Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
| 261 | 'Supplier Quotation Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
| 262 | 'Sales Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
| 263 | 'Delivery Note Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
| 264 | 'Sales Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
| 265 | 'Purchase Order Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
| 266 | 'Purchase Receipt Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
| 267 | 'Purchase Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst], |
Pawan Mehta | f419635 | 2018-04-05 14:54:51 +0530 | [diff] [blame] | 268 | 'Employee': [ |
| 269 | dict(fieldname='ifsc_code', label='IFSC Code', |
Rushabh Mehta | 369afce | 2018-04-26 10:10:03 +0530 | [diff] [blame] | 270 | fieldtype='Data', insert_after='bank_ac_no', print_hide=1, |
Ranjith Kurungadam | a8e047a | 2018-06-14 17:56:16 +0530 | [diff] [blame] | 271 | depends_on='eval:doc.salary_mode == "Bank"') |
| 272 | ], |
| 273 | 'Company': [ |
| 274 | dict(fieldname='hra_section', label='HRA Settings', |
| 275 | fieldtype='Section Break', insert_after='asset_received_but_not_billed'), |
Ranjith Kurungadam | b1a756c | 2018-07-01 16:42:38 +0530 | [diff] [blame] | 276 | dict(fieldname='basic_component', label='Basic Component', |
Ranjith Kurungadam | a8e047a | 2018-06-14 17:56:16 +0530 | [diff] [blame] | 277 | fieldtype='Link', options='Salary Component', insert_after='hra_section'), |
Ranjith Kurungadam | b1a756c | 2018-07-01 16:42:38 +0530 | [diff] [blame] | 278 | dict(fieldname='hra_component', label='HRA Component', |
| 279 | fieldtype='Link', options='Salary Component', insert_after='basic_component'), |
Ranjith Kurungadam | a8e047a | 2018-06-14 17:56:16 +0530 | [diff] [blame] | 280 | dict(fieldname='arrear_component', label='Arrear Component', |
| 281 | fieldtype='Link', options='Salary Component', insert_after='hra_component') |
| 282 | ], |
| 283 | 'Employee Tax Exemption Declaration':[ |
| 284 | dict(fieldname='hra_section', label='HRA Exemption', |
| 285 | fieldtype='Section Break', insert_after='declarations'), |
| 286 | dict(fieldname='salary_structure_hra', label='HRA as per Salary Structure', |
| 287 | fieldtype='Currency', insert_after='hra_section', read_only=1), |
| 288 | dict(fieldname='monthly_house_rent', label='Monthly House Rent', |
| 289 | fieldtype='Currency', insert_after='salary_structure_hra'), |
| 290 | dict(fieldname='rented_in_metro_city', label='Rented in Metro City', |
| 291 | fieldtype='Check', insert_after='monthly_house_rent'), |
| 292 | dict(fieldname='hra_column_break', fieldtype='Column Break', |
| 293 | insert_after='rented_in_metro_city'), |
| 294 | dict(fieldname='annual_hra_exemption', label='Annual HRA Exemption', |
| 295 | fieldtype='Currency', insert_after='hra_column_break', read_only=1), |
| 296 | dict(fieldname='monthly_hra_exemption', label='Monthly HRA Exemption', |
| 297 | fieldtype='Currency', insert_after='annual_hra_exemption', read_only=1) |
| 298 | ], |
| 299 | 'Employee Tax Exemption Proof Submission': [ |
| 300 | dict(fieldname='hra_section', label='HRA Exemption', |
| 301 | fieldtype='Section Break', insert_after='tax_exemption_proofs'), |
| 302 | dict(fieldname='house_rent_payment_amount', label='House Rent Payment Amount', |
| 303 | fieldtype='Currency', insert_after='hra_section'), |
| 304 | dict(fieldname='rented_in_metro_city', label='Rented in Metro City', |
| 305 | fieldtype='Check', insert_after='house_rent_payment_amount'), |
| 306 | dict(fieldname='rented_from_date', label='Rented From Date', |
| 307 | fieldtype='Date', insert_after='rented_in_metro_city'), |
| 308 | dict(fieldname='rented_to_date', label='Rented To Date', |
| 309 | fieldtype='Date', insert_after='rented_from_date'), |
| 310 | dict(fieldname='hra_column_break', fieldtype='Column Break', |
| 311 | insert_after='rented_to_date'), |
| 312 | dict(fieldname='monthly_house_rent', label='Monthly House Rent', |
| 313 | fieldtype='Currency', insert_after='hra_column_break', read_only=1), |
| 314 | dict(fieldname='monthly_hra_exemption', label='Monthly Eligible Amount', |
| 315 | fieldtype='Currency', insert_after='monthly_house_rent', read_only=1), |
| 316 | dict(fieldname='total_eligible_hra_exemption', label='Total Eligible HRA Exemption', |
| 317 | fieldtype='Currency', insert_after='monthly_hra_exemption', read_only=1) |
Sagar Vora | d92f3ac | 2018-10-10 14:51:26 +0530 | [diff] [blame] | 318 | ], |
| 319 | 'Supplier': [ |
| 320 | { |
| 321 | 'fieldname': 'gst_transporter_id', |
| 322 | 'label': 'GST Transporter ID', |
| 323 | 'fieldtype': 'Data', |
| 324 | 'insert_after': 'supplier_type', |
| 325 | 'depends_on': 'eval:doc.is_transporter' |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 326 | }, |
| 327 | { |
| 328 | 'fieldname': 'gst_category', |
| 329 | 'label': 'GST Category', |
| 330 | 'fieldtype': 'Select', |
| 331 | 'insert_after': 'gst_transporter_id', |
| 332 | 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nUIN Holders', |
| 333 | 'default': 'Unregistered' |
| 334 | } |
| 335 | ], |
| 336 | 'Customer': [ |
| 337 | { |
| 338 | 'fieldname': 'gst_category', |
| 339 | 'label': 'GST Category', |
| 340 | 'fieldtype': 'Select', |
| 341 | 'insert_after': 'customer_type', |
| 342 | 'options': 'Registered Regular\nRegistered Composition\nUnregistered\nSEZ\nOverseas\nConsumer\nDeemed Export\nUIN Holders', |
| 343 | 'default': 'Unregistered' |
Sagar Vora | d92f3ac | 2018-10-10 14:51:26 +0530 | [diff] [blame] | 344 | } |
Ranjith Kurungadam | a8e047a | 2018-06-14 17:56:16 +0530 | [diff] [blame] | 345 | ] |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 346 | } |
Deepesh Garg | 22b6160 | 2019-03-21 20:47:47 +0530 | [diff] [blame] | 347 | create_custom_fields(custom_fields, update=update) |
Nabin Hait | 9c42161 | 2017-07-20 13:32:01 +0530 | [diff] [blame] | 348 | |
Saurabh | 2d8a7ee | 2018-05-11 13:16:16 +0530 | [diff] [blame] | 349 | def make_fixtures(company=None): |
| 350 | docs = [] |
| 351 | company = company.name if company else frappe.db.get_value("Global Defaults", None, "default_company") |
| 352 | |
| 353 | set_salary_components(docs) |
Ranjith Kurungadam | e51c175 | 2018-07-24 11:07:28 +0530 | [diff] [blame] | 354 | set_tds_account(docs, company) |
Rushabh Mehta | b3c8f44 | 2017-06-21 17:22:38 +0530 | [diff] [blame] | 355 | |
| 356 | for d in docs: |
| 357 | try: |
| 358 | doc = frappe.get_doc(d) |
| 359 | doc.flags.ignore_permissions = True |
| 360 | doc.insert() |
| 361 | except frappe.NameError: |
| 362 | pass |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 363 | except frappe.DuplicateEntryError: |
| 364 | pass |
Saurabh | 2d8a7ee | 2018-05-11 13:16:16 +0530 | [diff] [blame] | 365 | |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 366 | # create records for Tax Withholding Category |
Ranjith Kurungadam | e51c175 | 2018-07-24 11:07:28 +0530 | [diff] [blame] | 367 | set_tax_withholding_category(company) |
| 368 | |
Saurabh | 2d8a7ee | 2018-05-11 13:16:16 +0530 | [diff] [blame] | 369 | def set_salary_components(docs): |
| 370 | docs.extend([ |
| 371 | {'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional Tax', 'type': 'Deduction'}, |
| 372 | {'doctype': 'Salary Component', 'salary_component': 'Provident Fund', 'description': 'Provident fund', 'type': 'Deduction'}, |
| 373 | {'doctype': 'Salary Component', 'salary_component': 'House Rent Allowance', 'description': 'House Rent Allowance', 'type': 'Earning'}, |
| 374 | {'doctype': 'Salary Component', 'salary_component': 'Basic', 'description': 'Basic', 'type': 'Earning'}, |
| 375 | {'doctype': 'Salary Component', 'salary_component': 'Arrear', 'description': 'Arrear', 'type': 'Earning'}, |
| 376 | {'doctype': 'Salary Component', 'salary_component': 'Leave Encashment', 'description': 'Leave Encashment', 'type': 'Earning'} |
| 377 | ]) |
| 378 | |
Ranjith Kurungadam | e51c175 | 2018-07-24 11:07:28 +0530 | [diff] [blame] | 379 | def set_tax_withholding_category(company): |
Saurabh | 2d8a7ee | 2018-05-11 13:16:16 +0530 | [diff] [blame] | 380 | accounts = [] |
Ranjith Kurungadam | e51c175 | 2018-07-24 11:07:28 +0530 | [diff] [blame] | 381 | abbr = frappe.get_value("Company", company, "abbr") |
| 382 | tds_account = frappe.get_value("Account", 'TDS Payable - {0}'.format(abbr), 'name') |
Saurabh | 2d8a7ee | 2018-05-11 13:16:16 +0530 | [diff] [blame] | 383 | |
| 384 | if company and tds_account: |
Ranjith Kurungadam | e51c175 | 2018-07-24 11:07:28 +0530 | [diff] [blame] | 385 | accounts = [dict(company=company, account=tds_account)] |
Saurabh | 2d8a7ee | 2018-05-11 13:16:16 +0530 | [diff] [blame] | 386 | |
Nabin Hait | afef9c1 | 2019-02-12 11:28:20 +0530 | [diff] [blame] | 387 | fiscal_year = get_fiscal_year(today(), company=company)[0] |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 388 | docs = get_tds_details(accounts, fiscal_year) |
Ranjith Kurungadam | e51c175 | 2018-07-24 11:07:28 +0530 | [diff] [blame] | 389 | |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 390 | for d in docs: |
| 391 | try: |
| 392 | doc = frappe.get_doc(d) |
| 393 | doc.flags.ignore_permissions = True |
Nabin Hait | afef9c1 | 2019-02-12 11:28:20 +0530 | [diff] [blame] | 394 | doc.flags.ignore_mandatory = True |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 395 | doc.insert() |
| 396 | except frappe.DuplicateEntryError: |
| 397 | doc = frappe.get_doc("Tax Withholding Category", d.get("name")) |
Zarrar | 963d62b | 2019-03-23 10:30:12 +0530 | [diff] [blame] | 398 | |
| 399 | if accounts: |
| 400 | doc.append("accounts", accounts[0]) |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 401 | |
| 402 | # if fiscal year don't match with any of the already entered data, append rate row |
| 403 | fy_exist = [k for k in doc.get('rates') if k.get('fiscal_year')==fiscal_year] |
| 404 | if not fy_exist: |
| 405 | doc.append("rates", d.get('rates')[0]) |
| 406 | |
| 407 | doc.save() |
Saurabh | 2d8a7ee | 2018-05-11 13:16:16 +0530 | [diff] [blame] | 408 | |
| 409 | def set_tds_account(docs, company): |
Ranjith Kurungadam | e51c175 | 2018-07-24 11:07:28 +0530 | [diff] [blame] | 410 | abbr = frappe.get_value("Company", company, "abbr") |
Nabin Hait | f77cd54 | 2018-11-20 16:46:25 +0530 | [diff] [blame] | 411 | parent_account = frappe.db.get_value("Account", filters = {"account_name": "Duties and Taxes", "company": company}) |
| 412 | if parent_account: |
| 413 | docs.extend([ |
| 414 | { |
| 415 | "doctype": "Account", |
| 416 | "account_name": "TDS Payable", |
| 417 | "account_type": "Tax", |
| 418 | "parent_account": parent_account, |
| 419 | "company": company |
| 420 | } |
| 421 | ]) |
Zarrar | 7f8024c | 2018-08-01 17:45:05 +0530 | [diff] [blame] | 422 | |
| 423 | def get_tds_details(accounts, fiscal_year): |
| 424 | # bootstrap default tax withholding sections |
| 425 | return [ |
| 426 | dict(name="TDS - 194C - Company", |
| 427 | category_name="Payment to Contractors (Single / Aggregate)", |
| 428 | doctype="Tax Withholding Category", accounts=accounts, |
| 429 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2, |
| 430 | "single_threshold": 30000, "cumulative_threshold": 100000}]), |
| 431 | dict(name="TDS - 194C - Individual", |
| 432 | category_name="Payment to Contractors (Single / Aggregate)", |
| 433 | doctype="Tax Withholding Category", accounts=accounts, |
| 434 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1, |
| 435 | "single_threshold": 30000, "cumulative_threshold": 100000}]), |
| 436 | dict(name="TDS - 194C - No PAN / Invalid PAN", |
| 437 | category_name="Payment to Contractors (Single / Aggregate)", |
| 438 | doctype="Tax Withholding Category", accounts=accounts, |
| 439 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 440 | "single_threshold": 30000, "cumulative_threshold": 100000}]), |
| 441 | dict(name="TDS - 194D - Company", |
| 442 | category_name="Insurance Commission", |
| 443 | doctype="Tax Withholding Category", accounts=accounts, |
| 444 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5, |
| 445 | "single_threshold": 15000, "cumulative_threshold": 0}]), |
| 446 | dict(name="TDS - 194D - Company Assessee", |
| 447 | category_name="Insurance Commission", |
| 448 | doctype="Tax Withholding Category", accounts=accounts, |
| 449 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 450 | "single_threshold": 15000, "cumulative_threshold": 0}]), |
| 451 | dict(name="TDS - 194D - Individual", |
| 452 | category_name="Insurance Commission", |
| 453 | doctype="Tax Withholding Category", accounts=accounts, |
| 454 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5, |
| 455 | "single_threshold": 15000, "cumulative_threshold": 0}]), |
| 456 | dict(name="TDS - 194D - No PAN / Invalid PAN", |
| 457 | category_name="Insurance Commission", |
| 458 | doctype="Tax Withholding Category", accounts=accounts, |
| 459 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 460 | "single_threshold": 15000, "cumulative_threshold": 0}]), |
| 461 | dict(name="TDS - 194DA - Company", |
| 462 | category_name="Non-exempt payments made under a life insurance policy", |
| 463 | doctype="Tax Withholding Category", accounts=accounts, |
| 464 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1, |
| 465 | "single_threshold": 100000, "cumulative_threshold": 0}]), |
| 466 | dict(name="TDS - 194DA - Individual", |
| 467 | category_name="Non-exempt payments made under a life insurance policy", |
| 468 | doctype="Tax Withholding Category", accounts=accounts, |
| 469 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 1, |
| 470 | "single_threshold": 100000, "cumulative_threshold": 0}]), |
| 471 | dict(name="TDS - 194DA - No PAN / Invalid PAN", |
| 472 | category_name="Non-exempt payments made under a life insurance policy", |
| 473 | doctype="Tax Withholding Category", accounts=accounts, |
| 474 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 475 | "single_threshold": 100000, "cumulative_threshold": 0}]), |
| 476 | dict(name="TDS - 194H - Company", |
| 477 | category_name="Commission / Brokerage", |
| 478 | doctype="Tax Withholding Category", accounts=accounts, |
| 479 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5, |
| 480 | "single_threshold": 15000, "cumulative_threshold": 0}]), |
| 481 | dict(name="TDS - 194H - Individual", |
| 482 | category_name="Commission / Brokerage", |
| 483 | doctype="Tax Withholding Category", accounts=accounts, |
| 484 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 5, |
| 485 | "single_threshold": 15000, "cumulative_threshold": 0}]), |
| 486 | dict(name="TDS - 194H - No PAN / Invalid PAN", |
| 487 | category_name="Commission / Brokerage", |
| 488 | doctype="Tax Withholding Category", accounts=accounts, |
| 489 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 490 | "single_threshold": 15000, "cumulative_threshold": 0}]), |
| 491 | dict(name="TDS - 194I - Rent - Company", |
| 492 | category_name="Rent", |
| 493 | doctype="Tax Withholding Category", accounts=accounts, |
| 494 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 495 | "single_threshold": 180000, "cumulative_threshold": 0}]), |
| 496 | dict(name="TDS - 194I - Rent - Individual", |
| 497 | category_name="Rent", |
| 498 | doctype="Tax Withholding Category", accounts=accounts, |
| 499 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 500 | "single_threshold": 180000, "cumulative_threshold": 0}]), |
| 501 | dict(name="TDS - 194I - Rent - No PAN / Invalid PAN", |
| 502 | category_name="Rent", |
| 503 | doctype="Tax Withholding Category", accounts=accounts, |
| 504 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 505 | "single_threshold": 180000, "cumulative_threshold": 0}]), |
| 506 | dict(name="TDS - 194I - Rent/Machinery - Company", |
| 507 | category_name="Rent-Plant / Machinery", |
| 508 | doctype="Tax Withholding Category", accounts=accounts, |
| 509 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2, |
| 510 | "single_threshold": 180000, "cumulative_threshold": 0}]), |
| 511 | dict(name="TDS - 194I - Rent/Machinery - Individual", |
| 512 | category_name="Rent-Plant / Machinery", |
| 513 | doctype="Tax Withholding Category", accounts=accounts, |
| 514 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 2, |
| 515 | "single_threshold": 180000, "cumulative_threshold": 0}]), |
| 516 | dict(name="TDS - 194I - Rent/Machinery - No PAN / Invalid PAN", |
| 517 | category_name="Rent-Plant / Machinery", |
| 518 | doctype="Tax Withholding Category", accounts=accounts, |
| 519 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 520 | "single_threshold": 180000, "cumulative_threshold": 0}]), |
| 521 | dict(name="TDS - 194J - Professional Fees - Company", |
| 522 | category_name="Professional Fees", |
| 523 | doctype="Tax Withholding Category", accounts=accounts, |
| 524 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 525 | "single_threshold": 30000, "cumulative_threshold": 0}]), |
| 526 | dict(name="TDS - 194J - Professional Fees - Individual", |
| 527 | category_name="Professional Fees", |
| 528 | doctype="Tax Withholding Category", accounts=accounts, |
| 529 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 530 | "single_threshold": 30000, "cumulative_threshold": 0}]), |
| 531 | dict(name="TDS - 194J - Professional Fees - No PAN / Invalid PAN", |
| 532 | category_name="Professional Fees", |
| 533 | doctype="Tax Withholding Category", accounts=accounts, |
| 534 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 535 | "single_threshold": 30000, "cumulative_threshold": 0}]), |
| 536 | dict(name="TDS - 194J - Director Fees - Company", |
| 537 | category_name="Director Fees", |
| 538 | doctype="Tax Withholding Category", accounts=accounts, |
| 539 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 540 | "single_threshold": 0, "cumulative_threshold": 0}]), |
| 541 | dict(name="TDS - 194J - Director Fees - Individual", |
| 542 | category_name="Director Fees", |
| 543 | doctype="Tax Withholding Category", accounts=accounts, |
| 544 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 545 | "single_threshold": 0, "cumulative_threshold": 0}]), |
| 546 | dict(name="TDS - 194J - Director Fees - No PAN / Invalid PAN", |
| 547 | category_name="Director Fees", |
| 548 | doctype="Tax Withholding Category", accounts=accounts, |
| 549 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 550 | "single_threshold": 0, "cumulative_threshold": 0}]), |
| 551 | dict(name="TDS - 194 - Dividends - Company", |
| 552 | category_name="Dividends", |
| 553 | doctype="Tax Withholding Category", accounts=accounts, |
| 554 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 555 | "single_threshold": 2500, "cumulative_threshold": 0}]), |
| 556 | dict(name="TDS - 194 - Dividends - Individual", |
| 557 | category_name="Dividends", |
| 558 | doctype="Tax Withholding Category", accounts=accounts, |
| 559 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 10, |
| 560 | "single_threshold": 2500, "cumulative_threshold": 0}]), |
| 561 | dict(name="TDS - 194 - Dividends - No PAN / Invalid PAN", |
| 562 | category_name="Dividends", |
| 563 | doctype="Tax Withholding Category", accounts=accounts, |
| 564 | rates=[{"fiscal_year": fiscal_year, "tax_withholding_rate": 20, |
| 565 | "single_threshold": 2500, "cumulative_threshold": 0}]) |
| 566 | ] |