Merge pull request #22350 from AfshanKhan/ISS_20_21_02392

fix: Skipping total row for tree-view reports
diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml
index 8f67858..4b1147e 100644
--- a/.github/workflows/docker-release.yml
+++ b/.github/workflows/docker-release.yml
@@ -1,7 +1,7 @@
 name: Trigger Docker build on release
 on:
   release:
-    types: [created]
+    types: [released]
 jobs:
   curl:
     runs-on: ubuntu-latest
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js
index 9a832e3..5685f83 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js
@@ -278,7 +278,7 @@
 			// payroll entry
 			if(jvd.reference_type==="Payroll Entry") {
 				return {
-					query: "erpnext.hr.doctype.payroll_entry.payroll_entry.get_payroll_entries_for_jv",
+					query: "erpnext.payroll.doctype.payroll_entry.payroll_entry.get_payroll_entries_for_jv",
 				};
 			}
 
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 41922a2..caaf30f 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -54,7 +54,7 @@
 
 	def on_cancel(self):
 		from erpnext.accounts.utils import unlink_ref_doc_from_payment_entries
-		from erpnext.hr.doctype.salary_slip.salary_slip import unlink_ref_doc_from_salary_slip
+		from erpnext.payroll.doctype.salary_slip.salary_slip import unlink_ref_doc_from_salary_slip
 		unlink_ref_doc_from_payment_entries(self)
 		unlink_ref_doc_from_salary_slip(self.name)
 		self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry')
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
index 800ed92..86c2e40 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js
@@ -16,7 +16,7 @@
 			} else if(frappe.datetime.get_diff(doc.due_date) < 0) {
 				return [__("Overdue"), "red", "outstanding_amount,>,0|due_date,<,Today"];
 			} else {
-				return [__("Unpaid"), "orange", "outstanding_amount,>,0|due,>=,Today"];
+				return [__("Unpaid"), "orange", "outstanding_amount,>,0|due_date,>=,Today"];
 			}
 		} else if(cint(doc.is_return)) {
 			return [__("Return"), "darkgrey", "is_return,=,Yes"];
@@ -24,4 +24,4 @@
 			return [__("Paid"), "green", "outstanding_amount,=,0"];
 		}
 	}
-};
+};
\ No newline at end of file
diff --git a/erpnext/hr/dashboard_fixtures.py b/erpnext/hr/dashboard_fixtures.py
index 6e042ac..6d8091b 100644
--- a/erpnext/hr/dashboard_fixtures.py
+++ b/erpnext/hr/dashboard_fixtures.py
@@ -24,24 +24,19 @@
 		"dashboard_name": "Human Resource",
 		"is_default": 1,
 		"charts": [
-			{ "chart": "Outgoing Salary", "width": "Full"},
+			{ "chart": "Attendance Count", "width": "Full"},
 			{ "chart": "Gender Diversity Ratio", "width": "Half"},
 			{ "chart": "Job Application Status", "width": "Half"},
 			{ "chart": 'Designation Wise Employee Count', "width": "Half"},
 			{ "chart": 'Department Wise Employee Count', "width": "Half"},
 			{ "chart": 'Designation Wise Openings', "width": "Half"},
-			{ "chart": 'Department Wise Openings', "width": "Half"},
-			{ "chart": "Attendance Count", "width": "Full"}
+			{ "chart": 'Department Wise Openings', "width": "Half"}
 		],
 		"cards": [
 			{"card": "Total Employees"},
 			{"card": "New Joinees (Last year)"},
 			{'card': "Employees Left (Last year)"},
-			{'card': "Total Job Openings (Last month)"},
 			{'card': "Total Applicants (Last month)"},
-			{'card': "Shortlisted Candidates (Last month)"},
-			{'card': "Rejected Candidates (Last month)"},
-			{'card': "Total Job Offered (Last month)"},
 		]
 	}
 
@@ -71,13 +66,6 @@
 			filters_json = json.dumps([["Job Applicant", "creation", "Previous", "1 month"]]))
 	)
 
-	dashboard_charts.append(
-		get_dashboards_chart_doc('Outgoing Salary', "Sum", "Line",
-			document_type = "Salary Slip", based_on="end_date",
-			value_based_on = "rounded_total", time_interval = "Monthly", timeseries = 1,
-			filters_json = json.dumps([["Salary Slip", "docstatus", "=", 1]]))
-	)
-
 	custom_options = '''{
 		"type": "line",
 		"axisOptions": {
@@ -156,32 +144,6 @@
 		)
 	)
 
-	number_cards.append(
-		get_number_cards_doc("Job Opening", "Total Job Openings (Last month)", func = "Sum",
-			aggregate_function_based_on = "planned_vacancies",
-			filters_json = json.dumps([["Job Opening", "creation", "Previous", "1 month"]])
-		)
-	)
-	number_cards.append(
-		get_number_cards_doc("Job Applicant", "Shortlisted Candidates (Last month)", filters_json = json.dumps([
-				["Job Applicant", "status", "=", "Accepted"],
-				["Job Applicant", "creation", "Previous", "1 month"]
-			])
-		)
-	)
-	number_cards.append(
-		get_number_cards_doc("Job Applicant", "Rejected Candidates (Last month)", filters_json = json.dumps([
-				["Job Applicant", "status", "=", "Rejected"],
-				["Job Applicant", "creation", "Previous", "1 month"]
-			])
-		)
-	)
-	number_cards.append(
-		get_number_cards_doc("Job Offer", "Total Job Offered (Last month)",
-			filters_json = json.dumps([["Job Offer", "creation", "Previous", "1 month"]])
-		)
-	)
-
 	return number_cards
 
 
diff --git a/erpnext/hr/desk_page/hr/hr.json b/erpnext/hr/desk_page/hr/hr.json
index 12548d4..0fed8d3 100644
--- a/erpnext/hr/desk_page/hr/hr.json
+++ b/erpnext/hr/desk_page/hr/hr.json
@@ -22,11 +22,6 @@
   },
   {
    "hidden": 0,
-   "label": "Payroll",
-   "links": "[\n    {\n        \"label\": \"Salary Structure\",\n        \"name\": \"Salary Structure\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Salary Structure\",\n            \"Employee\"\n        ],\n        \"label\": \"Salary Structure Assignment\",\n        \"name\": \"Salary Structure Assignment\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Payroll Entry\",\n        \"name\": \"Payroll Entry\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Salary Slip\",\n        \"name\": \"Salary Slip\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Payroll Period\",\n        \"name\": \"Payroll Period\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Income Tax Slab\",\n        \"name\": \"Income Tax Slab\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Salary Component\",\n        \"name\": \"Salary Component\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Additional Salary\",\n        \"name\": \"Additional Salary\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Retention Bonus\",\n        \"name\": \"Retention Bonus\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Employee Incentive\",\n        \"name\": \"Employee Incentive\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Salary Slip\"\n        ],\n        \"doctype\": \"Salary Slip\",\n        \"is_query_report\": true,\n        \"label\": \"Salary Register\",\n        \"name\": \"Salary Register\",\n        \"type\": \"report\"\n    }\n]"
-  },
-  {
-   "hidden": 0,
    "label": "Attendance",
    "links": "[\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"hide_count\": true,\n        \"label\": \"Employee Attendance Tool\",\n        \"name\": \"Employee Attendance Tool\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Attendance\",\n        \"name\": \"Attendance\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Attendance Request\",\n        \"name\": \"Attendance Request\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"hide_count\": true,\n        \"label\": \"Upload Attendance\",\n        \"name\": \"Upload Attendance\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"hide_count\": true,\n        \"label\": \"Employee Checkin\",\n        \"name\": \"Employee Checkin\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Attendance\"\n        ],\n        \"doctype\": \"Attendance\",\n        \"is_query_report\": true,\n        \"label\": \"Monthly Attendance Sheet\",\n        \"name\": \"Monthly Attendance Sheet\",\n        \"type\": \"report\"\n    }\n]"
   },
@@ -52,11 +47,6 @@
   },
   {
    "hidden": 0,
-   "label": "Loans",
-   "links": "[\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Loan Application\",\n        \"name\": \"Loan Application\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Loan\",\n        \"name\": \"Loan\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Loan Type\",\n        \"name\": \"Loan Type\",\n        \"type\": \"doctype\"\n    }\n]"
-  },
-  {
-   "hidden": 0,
    "label": "Training",
    "links": "[\n    {\n        \"label\": \"Training Program\",\n        \"name\": \"Training Program\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Training Event\",\n        \"name\": \"Training Event\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Training Result\",\n        \"name\": \"Training Result\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Training Feedback\",\n        \"name\": \"Training Feedback\",\n        \"type\": \"doctype\"\n    }\n]"
   },
@@ -69,18 +59,13 @@
    "hidden": 0,
    "label": "Performance",
    "links": "[\n    {\n        \"label\": \"Appraisal\",\n        \"name\": \"Appraisal\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Appraisal Template\",\n        \"name\": \"Appraisal Template\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Energy Point Rule\",\n        \"name\": \"Energy Point Rule\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Energy Point Log\",\n        \"name\": \"Energy Point Log\",\n        \"type\": \"doctype\"\n    }\n]"
-  },
-  {
-   "hidden": 0,
-   "label": "Employee Tax and Benefits",
-   "links": "[\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Employee Tax Exemption Declaration\",\n        \"name\": \"Employee Tax Exemption Declaration\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Employee Tax Exemption Proof Submission\",\n        \"name\": \"Employee Tax Exemption Proof Submission\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\",\n            \"Payroll Period\"\n        ],\n        \"label\": \"Employee Other Income\",\n        \"name\": \"Employee Other Income\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Employee Benefit Application\",\n        \"name\": \"Employee Benefit Application\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Employee Benefit Claim\",\n        \"name\": \"Employee Benefit Claim\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Employee Tax Exemption Category\",\n        \"name\": \"Employee Tax Exemption Category\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"dependencies\": [\n            \"Employee\"\n        ],\n        \"label\": \"Employee Tax Exemption Sub Category\",\n        \"name\": \"Employee Tax Exemption Sub Category\",\n        \"type\": \"doctype\"\n    }\n]"
   }
  ],
  "category": "Modules",
  "charts": [
   {
-   "chart_name": "Outgoing Salary",
-   "label": "Outgoing Salary"
+   "chart_name": "Attendance Count",
+   "label": "Attendance Count"
   }
  ],
  "creation": "2020-03-02 15:48:58.322521",
@@ -103,7 +88,7 @@
  "pin_to_top": 0,
  "shortcuts": [
   {
-   "color": "#cef6d1",
+   "color": "#9deca2",
    "format": "{} Active",
    "label": "Employee",
    "link_to": "Employee",
@@ -111,22 +96,21 @@
    "type": "DocType"
   },
   {
-   "color": "#ffe8cd",
-   "format": "{} Open",
-   "label": "Leave Application",
-   "link_to": "Leave Application",
-   "stats_filter": "{\"status\":\"Open\"}",
-   "type": "DocType"
-  },
-  {
    "label": "Attendance",
    "link_to": "Attendance",
    "stats_filter": "",
    "type": "DocType"
   },
   {
-   "label": "Salary Structure",
-   "link_to": "Salary Structure",
+   "format": "{} Open",
+   "label": "Leave Application",
+   "link_to": "Leave Application",
+   "stats_filter": "{\"status\":\"Open\"}",
+   "type": "DocType"
+  },
+  {
+   "label": "Job Applicant",
+   "link_to": "Job Applicant",
    "type": "DocType"
   },
   {
diff --git a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.json b/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.json
deleted file mode 100644
index cf62419..0000000
--- a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.json
+++ /dev/null
@@ -1,576 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "HR-BEN-APP-.YY.-.MM.-.#####", 
- "beta": 0, 
- "creation": "2018-04-13 16:31:39.190787", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "employee", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Employee", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "employee.employee_name", 
-   "fieldname": "employee_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Employee Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "max_benefits", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Max Benefits (Yearly)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "remaining_benefit", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Remaining Benefits (Yearly)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_2", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "Today", 
-   "fieldname": "date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Date", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "payroll_period", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Payroll Period", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Payroll Period", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "employee.department", 
-   "fieldname": "department", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Department", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Department", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "amended_from", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Amended From", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Employee Benefit Application", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_4", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Benefits Applied", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "employee_benefits", 
-   "fieldtype": "Table", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Employee Benefits", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee Benefit Application Detail", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "totals", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Totals", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "total_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Total Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "pro_rata_dispensed_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Dispensed Amount (Pro-rated)", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 1, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2018-08-21 16:15:39.714081", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Employee Benefit Application", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [
-  {
-   "amend": 1, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "System Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }, 
-  {
-   "amend": 1, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }, 
-  {
-   "amend": 1, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR User", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Employee", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }
- ], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "title_field": "employee_name", 
- "track_changes": 1, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_benefit_application_detail/employee_benefit_application_detail.json b/erpnext/hr/doctype/employee_benefit_application_detail/employee_benefit_application_detail.json
deleted file mode 100644
index 56421db..0000000
--- a/erpnext/hr/doctype/employee_benefit_application_detail/employee_benefit_application_detail.json
+++ /dev/null
@@ -1,177 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "autoname": "", 
- "beta": 0, 
- "creation": "2018-04-13 16:36:18.389786", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "earning_component", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Earning Component", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Salary Component", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "earning_component.pay_against_benefit_claim", 
-   "fieldname": "pay_against_benefit_claim", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Pay Against Benefit Claim", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "earning_component.max_benefit_amount", 
-   "fieldname": "max_benefit_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Max Benefit Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2018-08-21 16:15:42.111118", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Employee Benefit Application Detail", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "search_fields": "", 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 1, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json b/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json
deleted file mode 100644
index 1aa69d0..0000000
--- a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.json
+++ /dev/null
@@ -1,580 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 0, 
- "autoname": "HR-BEN-CLM-.YY.-.MM.-.#####", 
- "beta": 0, 
- "creation": "2018-04-13 16:43:10.386409", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "employee", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Employee", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "employee.employee_name", 
-   "fieldname": "employee_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Employee Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "employee.department", 
-   "fieldname": "department", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Department", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Department", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_3", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "Today", 
-   "fieldname": "claim_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Claim Date", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "benefit_type_and_amount", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Benefit Type and Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "earning_component", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Claim Benefit For", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Salary Component", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "earning_component.max_benefit_amount", 
-   "fieldname": "max_amount_eligible", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Max Amount Eligible", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "earning_component.pay_against_benefit_claim", 
-   "fieldname": "pay_against_benefit_claim", 
-   "fieldtype": "Check", 
-   "hidden": 1, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Pay Against Benefit Claim", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "claimed_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Claimed Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "salary_slip", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Salary Slip", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Salary Slip", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "amended_from", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Amended From", 
-   "length": 0, 
-   "no_copy": 1, 
-   "options": "Employee Benefit Claim", 
-   "permlevel": 0, 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "section_break_9", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Expense Proof", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "attachments", 
-   "fieldtype": "Attach", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Attachments", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 1, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2018-08-21 16:15:35.942067", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Employee Benefit Claim", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [
-  {
-   "amend": 1, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "System Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }, 
-  {
-   "amend": 1, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }, 
-  {
-   "amend": 1, 
-   "cancel": 1, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR User", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 1, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "Employee", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }
- ], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "title_field": "employee_name", 
- "track_changes": 1, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
index 420bbe6..9e7d318 100644
--- a/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
+++ b/erpnext/hr/doctype/employee_promotion/test_employee_promotion.py
@@ -6,7 +6,7 @@
 import frappe
 import unittest
 from frappe.utils import getdate, add_days
-from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
+from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee
 
 class TestEmployeePromotion(unittest.TestCase):
 	def setUp(self):
diff --git a/erpnext/hr/doctype/employee_tax_exemption_category/employee_tax_exemption_category.json b/erpnext/hr/doctype/employee_tax_exemption_category/employee_tax_exemption_category.json
deleted file mode 100644
index 66fac5b..0000000
--- a/erpnext/hr/doctype/employee_tax_exemption_category/employee_tax_exemption_category.json
+++ /dev/null
@@ -1,169 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_events_in_timeline": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "Prompt", 
- "beta": 0, 
- "creation": "2018-04-13 16:51:36.971140", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_if_empty": 0, 
-   "fieldname": "max_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Max Exemption Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "1", 
-   "fetch_if_empty": 0, 
-   "fieldname": "is_active", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Is Active", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2019-04-25 13:20:31.367158", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Employee Tax Exemption Category", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "System Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR User", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }
- ], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.json b/erpnext/hr/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.json
deleted file mode 100644
index 7b3b8f5..0000000
--- a/erpnext/hr/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.json
+++ /dev/null
@@ -1,179 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_events_in_timeline": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2018-04-13 16:56:23.333041", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_if_empty": 0, 
-   "fieldname": "exemption_sub_category", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Exemption Sub Category", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee Tax Exemption Sub Category", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "exemption_sub_category.exemption_category", 
-   "fetch_if_empty": 0, 
-   "fieldname": "exemption_category", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Exemption Category", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee Tax Exemption Category", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "exemption_sub_category.max_amount", 
-   "fetch_if_empty": 0, 
-   "fieldname": "max_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Maximum Exempted Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_if_empty": 0, 
-   "fieldname": "amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Declared Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2019-04-26 11:28:14.023086", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Employee Tax Exemption Declaration Category", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 1, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py b/erpnext/hr/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py
deleted file mode 100644
index e54d919..0000000
--- a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-
-import frappe
-import unittest
-# from erpnext.hr.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_exemption_category, create_payroll_period
-#
-# class TestEmployeeTaxExemptionProofSubmission(unittest.TestCase):
-# 	def setup(self):
-# 		make_employee("employee@proofsubmission.com")
-# 		create_payroll_period()
-# 		create_exemption_category()
-# 		frappe.db.sql("""delete from `tabEmployee Tax Exemption Proof Submission`""")
-#
-# 	def test_exemption_amount_lesser_than_category_max(self):
-# 		declaration = frappe.get_doc({
-# 			"doctype": "Employee Tax Exemption Proof Submission",
-# 			"employee": frappe.get_value("Employee", {"user_id":"employee@proofsubmission.com"}, "name"),
-# 			"payroll_period": "Test Payroll Period",
-# 			"tax_exemption_proofs": [dict(exemption_sub_category = "_Test Sub Category",
-# 							type_of_proof = "Test Proof",
-# 							exemption_category = "_Test Category",
-# 							amount = 150000)]
-# 		})
-# 		self.assertRaises(frappe.ValidationError, declaration.save)
-# 		declaration = frappe.get_doc({
-# 			"doctype": "Employee Tax Exemption Proof Submission",
-# 			"payroll_period": "Test Payroll Period",
-# 			"employee": frappe.get_value("Employee", {"user_id":"employee@proofsubmission.com"}, "name"),
-# 			"tax_exemption_proofs": [dict(exemption_sub_category = "_Test Sub Category",
-# 							type_of_proof = "Test Proof",
-# 							exemption_category = "_Test Category",
-# 							amount = 100000)]
-# 		})
-# 		self.assertTrue(declaration.save)
-# 		self.assertTrue(declaration.submit)
-#
-# 	def test_duplicate_category_in_proof_submission(self):
-# 		declaration = frappe.get_doc({
-# 			"doctype": "Employee Tax Exemption Proof Submission",
-# 			"employee": frappe.get_value("Employee", {"user_id":"employee@proofsubmission.com"}, "name"),
-# 			"payroll_period": "Test Payroll Period",
-# 			"tax_exemption_proofs": [dict(exemption_sub_category = "_Test Sub Category",
-# 							exemption_category = "_Test Category",
-# 							type_of_proof = "Test Proof",
-# 							amount = 100000),
-# 							dict(exemption_sub_category = "_Test Sub Category",
-# 							exemption_category = "_Test Category",
-# 							amount = 50000),
-# 							]
-# 		})
-# 		self.assertRaises(frappe.ValidationError, declaration.save)
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.json b/erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.json
deleted file mode 100644
index b9254af..0000000
--- a/erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.json
+++ /dev/null
@@ -1,213 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_events_in_timeline": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2018-04-13 17:19:03.006149", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_if_empty": 0, 
-   "fieldname": "exemption_sub_category", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Exemption Sub Category", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee Tax Exemption Sub Category", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "exemption_sub_category.exemption_category", 
-   "fetch_if_empty": 0, 
-   "fieldname": "exemption_category", 
-   "fieldtype": "Read Only", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Exemption Category", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "exemption_sub_category.max_amount", 
-   "fetch_if_empty": 0, 
-   "fieldname": "max_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Maximum Exemption Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_if_empty": 0, 
-   "fieldname": "type_of_proof", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Type of Proof", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_if_empty": 0, 
-   "fieldname": "amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Actual Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2019-04-25 15:45:03.154904", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Employee Tax Exemption Proof Submission Detail", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 1, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.json b/erpnext/hr/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.json
deleted file mode 100644
index b0e492e..0000000
--- a/erpnext/hr/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.json
+++ /dev/null
@@ -1,204 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_events_in_timeline": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 1, 
- "allow_rename": 1, 
- "autoname": "Prompt", 
- "beta": 0, 
- "creation": "2018-05-09 12:47:26.983095", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_if_empty": 0, 
-   "fieldname": "exemption_category", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 1, 
-   "label": "Tax Exemption Category", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee Tax Exemption Category", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "exemption_category.max_amount", 
-   "fetch_if_empty": 1, 
-   "fieldname": "max_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Max Exemption Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "default": "1", 
-   "fetch_if_empty": 0, 
-   "fieldname": "is_active", 
-   "fieldtype": "Check", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Is Active", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 0, 
- "max_attachments": 0, 
- "modified": "2019-04-25 13:24:05.164877", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Employee Tax Exemption Sub Category", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "System Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR Manager", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }, 
-  {
-   "amend": 0, 
-   "cancel": 0, 
-   "create": 1, 
-   "delete": 1, 
-   "email": 1, 
-   "export": 1, 
-   "if_owner": 0, 
-   "import": 0, 
-   "permlevel": 0, 
-   "print": 1, 
-   "read": 1, 
-   "report": 1, 
-   "role": "HR User", 
-   "set_user_permissions": 0, 
-   "share": 1, 
-   "submit": 0, 
-   "write": 1
-  }
- ], 
- "quick_entry": 0, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.js b/erpnext/hr/doctype/hr_settings/hr_settings.js
index b629b42..fd082fd 100644
--- a/erpnext/hr/doctype/hr_settings/hr_settings.js
+++ b/erpnext/hr/doctype/hr_settings/hr_settings.js
@@ -2,21 +2,6 @@
 // For license information, please see license.txt
 
 frappe.ui.form.on('HR Settings', {
-	encrypt_salary_slips_in_emails: function(frm) {
-		let encrypt_state = frm.doc.encrypt_salary_slips_in_emails;
-		frm.set_df_property('password_policy', 'reqd', encrypt_state);
-	},
-
-	validate: function(frm) {
-		let policy = frm.doc.password_policy;
-		if (policy) {
-			if (policy.includes(' ') || policy.includes('--')) {
-				frappe.msgprint(__("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically"));
-			}
-			frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-'));
-		}
-	},
-
 	restrict_backdated_leave_application: function(frm) {
 		frm.toggle_reqd("role_allowed_to_create_backdated_leave_application", frm.doc.restrict_backdated_leave_application);
 	}
diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.json b/erpnext/hr/doctype/hr_settings/hr_settings.json
index ebf8723..c42e1d7 100644
--- a/erpnext/hr/doctype/hr_settings/hr_settings.json
+++ b/erpnext/hr/doctype/hr_settings/hr_settings.json
@@ -12,16 +12,6 @@
   "column_break_4",
   "stop_birthday_reminders",
   "expense_approver_mandatory_in_expense_claim",
-  "payroll_settings",
-  "payroll_based_on",
-  "max_working_hours_against_timesheet",
-  "include_holidays_in_total_working_days",
-  "disable_rounded_total",
-  "column_break_11",
-  "daily_wages_fraction_for_half_day",
-  "email_salary_slip_to_employee",
-  "encrypt_salary_slips_in_emails",
-  "password_policy",
   "leave_settings",
   "leave_approval_notification_template",
   "leave_status_notification_template",
@@ -38,13 +28,17 @@
   {
    "fieldname": "employee_settings",
    "fieldtype": "Section Break",
-   "label": "Employee Settings"
+   "label": "Employee Settings",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "description": "Enter retirement age in years",
    "fieldname": "retirement_age",
    "fieldtype": "Data",
-   "label": "Retirement Age"
+   "label": "Retirement Age",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "Naming Series",
@@ -52,161 +46,126 @@
    "fieldname": "emp_created_by",
    "fieldtype": "Select",
    "label": "Employee Records to be created by",
-   "options": "Naming Series\nEmployee Number\nFull Name"
+   "options": "Naming Series\nEmployee Number\nFull Name",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_4",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "description": "Don't send Employee Birthday Reminders",
    "fieldname": "stop_birthday_reminders",
    "fieldtype": "Check",
-   "label": "Stop Birthday Reminders"
+   "label": "Stop Birthday Reminders",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "1",
    "fieldname": "expense_approver_mandatory_in_expense_claim",
    "fieldtype": "Check",
-   "label": "Expense Approver Mandatory In Expense Claim"
-  },
-  {
-   "fieldname": "payroll_settings",
-   "fieldtype": "Section Break",
-   "label": "Payroll Settings"
-  },
-  {
-   "default": "0",
-   "description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day",
-   "fieldname": "include_holidays_in_total_working_days",
-   "fieldtype": "Check",
-   "label": "Include holidays in Total no. of Working Days"
-  },
-  {
-   "fieldname": "max_working_hours_against_timesheet",
-   "fieldtype": "Float",
-   "label": "Max working hours against Timesheet"
-  },
-  {
-   "fieldname": "column_break_11",
-   "fieldtype": "Column Break"
-  },
-  {
-   "default": "1",
-   "description": "Emails salary slip to employee based on preferred email selected in Employee",
-   "fieldname": "email_salary_slip_to_employee",
-   "fieldtype": "Check",
-   "label": "Email Salary Slip to Employee"
-  },
-  {
-   "default": "0",
-   "depends_on": "eval: doc.email_salary_slip_to_employee == 1;",
-   "description": "The salary slip emailed to the employee will be password protected, the password will be generated based on the password policy.",
-   "fieldname": "encrypt_salary_slips_in_emails",
-   "fieldtype": "Check",
-   "label": "Encrypt Salary Slips in Emails"
-  },
-  {
-   "depends_on": "eval: doc.encrypt_salary_slips_in_emails == 1",
-   "description": "<b>Example:</b> SAL-{first_name}-{date_of_birth.year} <br>This will generate a password like SAL-Jane-1972",
-   "fieldname": "password_policy",
-   "fieldtype": "Data",
-   "in_list_view": 1,
-   "label": "Password Policy"
+   "label": "Expense Approver Mandatory In Expense Claim",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "collapsible": 1,
    "fieldname": "leave_settings",
    "fieldtype": "Section Break",
-   "label": "Leave Settings"
+   "label": "Leave Settings",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "leave_approval_notification_template",
    "fieldtype": "Link",
    "label": "Leave Approval Notification Template",
-   "options": "Email Template"
+   "options": "Email Template",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "leave_status_notification_template",
    "fieldtype": "Link",
    "label": "Leave Status Notification Template",
-   "options": "Email Template"
+   "options": "Email Template",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_18",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "1",
    "fieldname": "leave_approver_mandatory_in_leave_application",
    "fieldtype": "Check",
-   "label": "Leave Approver Mandatory In Leave Application"
+   "label": "Leave Approver Mandatory In Leave Application",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "show_leaves_of_all_department_members_in_calendar",
    "fieldtype": "Check",
-   "label": "Show Leaves Of All Department Members In Calendar"
+   "label": "Show Leaves Of All Department Members In Calendar",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "collapsible": 1,
    "fieldname": "hiring_settings",
    "fieldtype": "Section Break",
-   "label": "Hiring Settings"
+   "label": "Hiring Settings",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "check_vacancies",
    "fieldtype": "Check",
-   "label": "Check Vacancies On Job Offer Creation"
+   "label": "Check Vacancies On Job Offer Creation",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "auto_leave_encashment",
    "fieldtype": "Check",
-   "label": "Auto Leave Encashment"
-  },
-  {
-   "default": "0",
-   "description": "If checked, hides and disables Rounded Total field in Salary Slips",
-   "fieldname": "disable_rounded_total",
-   "fieldtype": "Check",
-   "label": "Disable Rounded Total"
+   "label": "Auto Leave Encashment",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "restrict_backdated_leave_application",
    "fieldtype": "Check",
-   "label": "Restrict Backdated Leave Application"
+   "label": "Restrict Backdated Leave Application",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "depends_on": "eval:doc.restrict_backdated_leave_application == 1",
    "fieldname": "role_allowed_to_create_backdated_leave_application",
    "fieldtype": "Link",
    "label": "Role Allowed to Create Backdated Leave Application",
-   "options": "Role"
-  },
-  {
-   "default": "Leave",
-   "fieldname": "payroll_based_on",
-   "fieldtype": "Select",
-   "label": "Calculate Payroll Working Days Based On",
-   "options": "Leave\nAttendance"
-  },
-  {
-   "default": "0.5",
-   "description": "The fraction of daily wages to be paid for half-day attendance",
-   "fieldname": "daily_wages_fraction_for_half_day",
-   "fieldtype": "Float",
-   "label": "Daily Wages Fraction for Half Day"
+   "options": "Role",
+   "show_days": 1,
+   "show_seconds": 1
   }
  ],
  "icon": "fa fa-cog",
  "idx": 1,
  "issingle": 1,
  "links": [],
- "modified": "2020-05-11 13:02:51.274347",
+ "modified": "2020-06-04 15:15:09.865476",
  "modified_by": "Administrator",
  "module": "HR",
  "name": "HR Settings",
diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py
index 5ed4c87..ced98fb 100644
--- a/erpnext/hr/doctype/hr_settings/hr_settings.py
+++ b/erpnext/hr/doctype/hr_settings/hr_settings.py
@@ -5,34 +5,14 @@
 
 from __future__ import unicode_literals
 import frappe
-from frappe import _
 from frappe.model.document import Document
-from frappe.utils import cint
-from frappe.custom.doctype.property_setter.property_setter import make_property_setter
 
 class HRSettings(Document):
 	def validate(self):
 		self.set_naming_series()
-		self.validate_password_policy()
-
-		if not self.daily_wages_fraction_for_half_day:
-			self.daily_wages_fraction_for_half_day = 0.5
 
 	def set_naming_series(self):
 		from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series
 		set_by_naming_series("Employee", "employee_number",
 			self.get("emp_created_by")=="Naming Series", hide_name_field=True)
 
-	def validate_password_policy(self):
-		if self.email_salary_slip_to_employee and self.encrypt_salary_slips_in_emails:
-			if not self.password_policy:
-				frappe.throw(_("Password policy for Salary Slips is not set"))
-	
-	def on_update(self):
-		self.toggle_rounded_total()
-		frappe.clear_cache()
-
-	def toggle_rounded_total(self):
-		self.disable_rounded_total = cint(self.disable_rounded_total)
-		make_property_setter("Salary Slip", "rounded_total", "hidden", self.disable_rounded_total, "Check")
-		make_property_setter("Salary Slip", "rounded_total", "print_hide", self.disable_rounded_total, "Check")
diff --git a/erpnext/hr/doctype/leave_encashment/leave_encashment.py b/erpnext/hr/doctype/leave_encashment/leave_encashment.py
index 50a08b1..8913c64 100644
--- a/erpnext/hr/doctype/leave_encashment/leave_encashment.py
+++ b/erpnext/hr/doctype/leave_encashment/leave_encashment.py
@@ -8,7 +8,7 @@
 from frappe.model.document import Document
 from frappe.utils import getdate, nowdate, flt
 from erpnext.hr.utils import set_employee_name
-from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
+from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
 from erpnext.hr.doctype.leave_ledger_entry.leave_ledger_entry import create_leave_ledger_entry
 from erpnext.hr.doctype.leave_allocation.leave_allocation import get_unused_leaves
 
diff --git a/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py b/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py
index ac7755b..99f6463 100644
--- a/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py
+++ b/erpnext/hr/doctype/leave_encashment/test_leave_encashment.py
@@ -7,7 +7,7 @@
 import unittest
 from frappe.utils import today, add_months
 from erpnext.hr.doctype.employee.test_employee import make_employee
-from erpnext.hr.doctype.salary_structure.test_salary_structure import make_salary_structure
+from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
 from erpnext.hr.doctype.leave_period.test_leave_period import create_leave_period
 from erpnext.hr.doctype.leave_policy.test_leave_policy import create_leave_policy\
 
diff --git a/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.json b/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.json
deleted file mode 100644
index 0dd3403..0000000
--- a/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.json
+++ /dev/null
@@ -1,209 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_events_in_timeline": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2017-11-30 06:07:33.477781", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "employee", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Employee", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Employee", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "employee.employee_name", 
-   "fieldname": "employee_name", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Employee Name", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_3", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "employee.department", 
-   "fieldname": "department", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Department", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Department", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fetch_from": "employee.designation", 
-   "fieldname": "designation", 
-   "fieldtype": "Data", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Designation", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2019-01-30 11:28:16.544471", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Payroll Employee Detail", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 1, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 1, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/payroll_period_date/payroll_period_date.json b/erpnext/hr/doctype/payroll_period_date/payroll_period_date.json
deleted file mode 100644
index 29bd2a3..0000000
--- a/erpnext/hr/doctype/payroll_period_date/payroll_period_date.json
+++ /dev/null
@@ -1,103 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2018-04-13 15:17:30.513630", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "start_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Start Date", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "end_date", 
-   "fieldtype": "Date", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "End Date", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2018-04-13 19:39:37.473294", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Payroll Period Date", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 1, 
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json b/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
deleted file mode 100644
index 797f8f7..0000000
--- a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_events_in_timeline": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2016-06-14 19:22:29.811658", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "time_sheet", 
-   "fieldtype": "Link", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Time Sheet", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Timesheet", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "working_hours", 
-   "fieldtype": "Float", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Working Hours", 
-   "length": 0, 
-   "no_copy": 1, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2019-02-19 08:33:41.762144", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Salary Slip Timesheet", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 0, 
- "track_seen": 0, 
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/taxable_salary_slab/taxable_salary_slab.json b/erpnext/hr/doctype/taxable_salary_slab/taxable_salary_slab.json
deleted file mode 100644
index a094f8a..0000000
--- a/erpnext/hr/doctype/taxable_salary_slab/taxable_salary_slab.json
+++ /dev/null
@@ -1,232 +0,0 @@
-{
- "allow_copy": 0, 
- "allow_guest_to_view": 0, 
- "allow_import": 0, 
- "allow_rename": 0, 
- "beta": 0, 
- "creation": "2018-04-13 17:42:13.516032", 
- "custom": 0, 
- "docstatus": 0, 
- "doctype": "DocType", 
- "document_type": "", 
- "editable_grid": 1, 
- "engine": "InnoDB", 
- "fields": [
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "from_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "From Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "to_amount", 
-   "fieldtype": "Currency", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "To Amount", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "percent_deduction", 
-   "fieldtype": "Percent", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Percent Deduction", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 1, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "condition", 
-   "fieldtype": "Code", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 1, 
-   "in_standard_filter": 0, 
-   "label": "Condition", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "column_break_5", 
-   "fieldtype": "Column Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_in_quick_entry": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "html_6", 
-   "fieldtype": "HTML", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "<h4>Condition Examples</h4>\n<ol>\n<li>Applying tax if employee born between 31-12-1937 and 01-01-1958 (Employees aged 60 to 80)<br>\n<code>Condition: date_of_birth&gt;date(1937, 12, 31) and date_of_birth&lt;date(1958, 01, 01)</code></li><br><li>Applying tax by employee gender<br>\n<code>Condition: gender==\"Male\"</code></li><br>\n<li>Applying tax by Salary Component<br>\n<code>Condition: base &gt; 10000</code></li></ol>", 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "translatable": 0, 
-   "unique": 0
-  }
- ], 
- "has_web_view": 0, 
- "hide_heading": 0, 
- "hide_toolbar": 0, 
- "idx": 0, 
- "image_view": 0, 
- "in_create": 0, 
- "is_submittable": 0, 
- "issingle": 0, 
- "istable": 1, 
- "max_attachments": 0, 
- "modified": "2018-06-19 10:10:23.732132", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Taxable Salary Slab", 
- "name_case": "", 
- "owner": "Administrator", 
- "permissions": [], 
- "quick_entry": 1, 
- "read_only": 0, 
- "read_only_onload": 0, 
- "show_name_in_global_search": 0, 
- "sort_field": "modified", 
- "sort_order": "DESC", 
- "track_changes": 1, 
- "track_seen": 0
-}
diff --git a/erpnext/hr/doctype/training_event/test_training_event.py b/erpnext/hr/doctype/training_event/test_training_event.py
index 57123e3..313f90e 100644
--- a/erpnext/hr/doctype/training_event/test_training_event.py
+++ b/erpnext/hr/doctype/training_event/test_training_event.py
@@ -6,7 +6,7 @@
 import frappe
 import unittest
 from frappe.utils import today, add_days
-from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
+from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee
 
 class TestTrainingEvent(unittest.TestCase):
 	def setUp(self):
diff --git a/erpnext/hr/report/salary_register/salary_register.json b/erpnext/hr/report/salary_register/salary_register.json
deleted file mode 100644
index 89a7ba2..0000000
--- a/erpnext/hr/report/salary_register/salary_register.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "add_total_row": 1, 
- "apply_user_permissions": 1, 
- "creation": "2017-01-10 17:36:58.153863", 
- "disabled": 0, 
- "docstatus": 0, 
- "doctype": "Report", 
- "idx": 2, 
- "is_standard": "Yes", 
- "modified": "2017-02-24 19:58:33.143974", 
- "modified_by": "Administrator", 
- "module": "HR", 
- "name": "Salary Register", 
- "owner": "Administrator", 
- "ref_doctype": "Salary Slip", 
- "report_name": "Salary Register", 
- "report_type": "Script Report", 
- "roles": [
-  {
-   "role": "HR User"
-  }, 
-  {
-   "role": "HR Manager"
-  }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/loan_management/doctype/loan/test_loan.py b/erpnext/loan_management/doctype/loan/test_loan.py
index 364e2ff..3f37a26 100644
--- a/erpnext/loan_management/doctype/loan/test_loan.py
+++ b/erpnext/loan_management/doctype/loan/test_loan.py
@@ -9,7 +9,7 @@
 from frappe.utils import (nowdate, add_days, getdate, now_datetime, add_to_date, get_datetime,
 	add_months, get_first_day, get_last_day, flt, date_diff)
 from erpnext.selling.doctype.customer.test_customer import get_customer_dict
-from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
+from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee
 from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import (process_loan_interest_accrual_for_demand_loans,
 	process_loan_interest_accrual_for_term_loans)
 from erpnext.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import days_in_year
diff --git a/erpnext/loan_management/doctype/loan_application/test_loan_application.py b/erpnext/loan_management/doctype/loan_application/test_loan_application.py
index 99c807b..687c580 100644
--- a/erpnext/loan_management/doctype/loan_application/test_loan_application.py
+++ b/erpnext/loan_management/doctype/loan_application/test_loan_application.py
@@ -5,7 +5,7 @@
 
 import frappe
 import unittest
-from erpnext.hr.doctype.salary_structure.test_salary_structure import make_employee
+from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_employee
 from erpnext.loan_management.doctype.loan.test_loan import create_loan_type, create_loan_accounts
 
 class TestLoanApplication(unittest.TestCase):
diff --git a/erpnext/modules.txt b/erpnext/modules.txt
index 3b34758..1e2aeea 100644
--- a/erpnext/modules.txt
+++ b/erpnext/modules.txt
@@ -24,4 +24,5 @@
 Hub Node
 Quality Management
 Communication
-Loan Management
\ No newline at end of file
+Loan Management
+Payroll
\ No newline at end of file
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index a7395a4..b17cc47 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -333,7 +333,7 @@
 
 execute:frappe.reload_doctype('Employee') #2016-10-18
 execute:frappe.db.sql("update `tabEmployee` set prefered_contact_email = IFNULL(prefered_contact_email,'') ")
-execute:frappe.reload_doctype("Salary Slip")
+execute:frappe.reload_doc("Payroll", "doctype", "salary_slip")
 execute:frappe.db.sql("update `tabSalary Slip` set posting_date=creation")
 execute:frappe.reload_doc("stock", "doctype", "stock_settings")
 erpnext.patches.v8_0.create_domain_docs	#16-05-2017
@@ -701,4 +701,7 @@
 erpnext.patches.v12_0.update_address_template_for_india
 erpnext.patches.v12_0.set_multi_uom_in_rfq
 erpnext.patches.v13_0.delete_old_sales_reports
-execute:frappe.delete_doc_if_exists("DocType", "Bank Reconciliation")
\ No newline at end of file
+execute:frappe.delete_doc_if_exists("DocType", "Bank Reconciliation")
+erpnext.patches.v13_0.move_doctype_reports_and_notification_from_hr_to_payroll
+erpnext.patches.v13_0.move_payroll_setting_separately_from_hr_settings
+erpnext.patches.v13_0.check_is_income_tax_component
diff --git a/erpnext/patches/v11_0/create_department_records_for_each_company.py b/erpnext/patches/v11_0/create_department_records_for_each_company.py
index f09c5b2..e9b5950 100644
--- a/erpnext/patches/v11_0/create_department_records_for_each_company.py
+++ b/erpnext/patches/v11_0/create_department_records_for_each_company.py
@@ -6,8 +6,9 @@
 def execute():
 	frappe.local.lang = frappe.db.get_default("lang") or 'en'
 
-	for doctype in ['department', 'leave_period', 'staffing_plan', 'job_opening', 'payroll_entry']:
+	for doctype in ['department', 'leave_period', 'staffing_plan', 'job_opening']:
 		frappe.reload_doc("hr", "doctype", doctype)
+	frappe.reload_doc("Payroll", "doctype", 'payroll_entry')
 
 	companies = frappe.db.get_all("Company", fields=["name", "abbr"])
 	departments = frappe.db.get_all("Department")
diff --git a/erpnext/patches/v11_0/create_salary_structure_assignments.py b/erpnext/patches/v11_0/create_salary_structure_assignments.py
index 610fa85..c51c381 100644
--- a/erpnext/patches/v11_0/create_salary_structure_assignments.py
+++ b/erpnext/patches/v11_0/create_salary_structure_assignments.py
@@ -5,11 +5,11 @@
 import frappe
 from datetime import datetime
 from frappe.utils import getdate
-from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import DuplicateAssignment
+from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import DuplicateAssignment
 
 def execute():
-	frappe.reload_doc('hr', 'doctype', 'salary_structure')
-	frappe.reload_doc("hr", "doctype", "salary_structure_assignment")
+	frappe.reload_doc('Payroll', 'doctype', 'salary_structure')
+	frappe.reload_doc("Payroll", "doctype", "salary_structure_assignment")
 	frappe.db.sql("""
 		delete from `tabSalary Structure Assignment`
 		where salary_structure in (select name from `tabSalary Structure` where is_active='No' or docstatus!=1)
diff --git a/erpnext/patches/v11_0/inter_state_field_for_gst.py b/erpnext/patches/v11_0/inter_state_field_for_gst.py
index 48249c9..730eebc 100644
--- a/erpnext/patches/v11_0/inter_state_field_for_gst.py
+++ b/erpnext/patches/v11_0/inter_state_field_for_gst.py
@@ -6,8 +6,8 @@
 	company = frappe.get_all('Company', filters = {'country': 'India'})
 	if not company:
 		return
-	frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Declaration")
-	frappe.reload_doc("hr", "doctype", "Employee Tax Exemption Proof Submission")
+	frappe.reload_doc("Payroll", "doctype", "Employee Tax Exemption Declaration")
+	frappe.reload_doc("Payroll", "doctype", "Employee Tax Exemption Proof Submission")
 	frappe.reload_doc("hr", "doctype", "Employee Grade")
 	frappe.reload_doc("hr", "doctype", "Leave Policy")
 
diff --git a/erpnext/patches/v11_0/set_salary_component_properties.py b/erpnext/patches/v11_0/set_salary_component_properties.py
index 83fb53d..2498888 100644
--- a/erpnext/patches/v11_0/set_salary_component_properties.py
+++ b/erpnext/patches/v11_0/set_salary_component_properties.py
@@ -2,8 +2,8 @@
 import frappe
 
 def execute():
-	frappe.reload_doc('hr', 'doctype', 'salary_detail')
-	frappe.reload_doc('hr', 'doctype', 'salary_component')
+	frappe.reload_doc('Payroll', 'doctype', 'salary_detail')
+	frappe.reload_doc('Payroll', 'doctype', 'salary_component')
 
 	frappe.db.sql("update `tabSalary Component` set is_tax_applicable=1 where type='Earning'")
 
diff --git a/erpnext/patches/v11_1/rename_depends_on_lwp.py b/erpnext/patches/v11_1/rename_depends_on_lwp.py
index 20d8867..a0f2536 100644
--- a/erpnext/patches/v11_1/rename_depends_on_lwp.py
+++ b/erpnext/patches/v11_1/rename_depends_on_lwp.py
@@ -9,5 +9,5 @@
 def execute():
 	for doctype in ("Salary Component", "Salary Detail"):
 		if "depends_on_lwp" in frappe.db.get_table_columns(doctype):
-			frappe.reload_doc("hr", "doctype", scrub(doctype))
+			frappe.reload_doc("Payroll", "doctype", scrub(doctype))
 			rename_field(doctype, "depends_on_lwp", "depends_on_payment_days")
\ No newline at end of file
diff --git a/erpnext/patches/v13_0/check_is_income_tax_component.py b/erpnext/patches/v13_0/check_is_income_tax_component.py
new file mode 100644
index 0000000..f69412c
--- /dev/null
+++ b/erpnext/patches/v13_0/check_is_income_tax_component.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2019, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+
+import frappe, erpnext
+
+def execute():
+    frappe.reload_doc('Payroll', 'doctype', 'salary_structure')
+
+    if frappe.db.exists("Salary Component", "Income Tax"):
+        frappe.db.set_value("Salary Component", "Income Tax", "is_income_tax_component", 1)
+    if frappe.db.exists("Salary Component", "TDS"):
+        frappe.db.set_value("Salary Component", "TDS", "is_income_tax_component", 1)
+
+    components = frappe.db.sql("select name from `tabSalary Component` where variable_based_on_taxable_salary = 1", as_dict=1)
+    for component in components:
+        frappe.db.set_value("Salary Component", component.name, "is_income_tax_component", 1)
+
+    if erpnext.get_region() == "India":
+        if frappe.db.exists("Salary Component", "Provident Fund"):
+            frappe.db.set_value("Salary Component", "Provident Fund", "component_type", "Provident Fund")
+        if frappe.db.exists("Salary Component", "Professional Tax"):
+            frappe.db.set_value("Salary Component", "Professional Tax", "component_type", "Professional Tax")
\ No newline at end of file
diff --git a/erpnext/patches/v13_0/move_doctype_reports_and_notification_from_hr_to_payroll.py b/erpnext/patches/v13_0/move_doctype_reports_and_notification_from_hr_to_payroll.py
new file mode 100644
index 0000000..4d7c85c
--- /dev/null
+++ b/erpnext/patches/v13_0/move_doctype_reports_and_notification_from_hr_to_payroll.py
@@ -0,0 +1,52 @@
+# Copyright (c) 2019, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+
+import frappe
+
+def execute():
+    frappe.db.sql("""UPDATE `tabPrint Format`
+        SET module = 'Payroll'
+        WHERE name IN ('Salary Slip Based On Timesheet', 'Salary Slip Standard')"""
+    )
+
+    frappe.db.sql("""UPDATE `tabNotification` SET module='Payroll' WHERE name='Retention Bonus';"""
+    )
+
+    doctypes_moved = [
+        'Employee Benefit Application Detail',
+        'Employee Tax Exemption Declaration Category',
+        'Salary Component',
+        'Employee Tax Exemption Proof Submission Detail',
+        'Income Tax Slab Other Charges',
+        'Taxable Salary Slab',
+        'Payroll Period Date',
+        'Salary Slip Timesheet',
+        'Payroll Employee Detail',
+        'Salary Detail',
+        'Employee Tax Exemption Sub Category',
+        'Employee Tax Exemption Category',
+        'Employee Benefit Claim',
+        'Employee Benefit Application',
+        'Employee Other Income',
+        'Employee Tax Exemption Proof Submission',
+        'Employee Tax Exemption Declaration',
+        'Employee Incentive',
+        'Retention Bonus',
+        'Additional Salary',
+        'Income Tax Slab',
+        'Payroll Period',
+        'Salary Slip',
+        'Payroll Entry',
+        'Salary Structure Assignment',
+        'Salary Structure'
+    ]
+
+    for doctype in doctypes_moved:
+        frappe.delete_doc_if_exists("DocType", doctype)
+
+    reports = ["Salary Register", "Bank Remittance"]
+
+    for report in reports:
+        frappe.delete_doc_if_exists("Report", report)
diff --git a/erpnext/patches/v13_0/move_payroll_setting_separately_from_hr_settings.py b/erpnext/patches/v13_0/move_payroll_setting_separately_from_hr_settings.py
new file mode 100644
index 0000000..a901064
--- /dev/null
+++ b/erpnext/patches/v13_0/move_payroll_setting_separately_from_hr_settings.py
@@ -0,0 +1,27 @@
+# Copyright (c) 2019, Frappe and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+
+import frappe
+
+def execute():
+    data = frappe.db.sql('''SELECT *
+        FROM `tabSingles`
+        WHERE
+            doctype = "HR Settings"
+        AND
+            field in (
+                "encrypt_salary_slips_in_emails",
+                "email_salary_slip_to_employee",
+                "daily_wages_fraction_for_half_day",
+                "disable_rounded_total",
+                "include_holidays_in_total_working_days",
+                "max_working_hours_against_timesheet",
+                "payroll_based_on",
+                "password_policy"
+            )
+            ''', as_dict=1)
+
+    for d in data:
+        frappe.db.set_value("Payroll Settings", None, d.field, d.value)
diff --git a/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py b/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py
index 5ade8ca..1a91d21 100644
--- a/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py
+++ b/erpnext/patches/v13_0/move_tax_slabs_from_payroll_period_to_income_tax_slab.py
@@ -11,7 +11,7 @@
 		return
 
 	for doctype in ("income_tax_slab", "salary_structure_assignment", "employee_other_income", "income_tax_slab_other_charges"):
-		frappe.reload_doc("hr", "doctype", doctype)
+		frappe.reload_doc("Payroll", "doctype", doctype)
 
 
 	standard_tax_exemption_amount_exists = frappe.db.has_column("Payroll Period", "standard_tax_exemption_amount")
@@ -29,7 +29,7 @@
 			WHERE company=%s
 			ORDER BY start_date DESC
 		""".format(select_fields), company.name, as_dict = 1)
-			
+
 		for i, period in enumerate(payroll_periods):
 			income_tax_slab = frappe.new_doc("Income Tax Slab")
 			income_tax_slab.name = "Tax Slab:" + period.name
diff --git a/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py b/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py
index ddcadcb..fde8f86 100644
--- a/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py
+++ b/erpnext/patches/v13_0/patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive.py
@@ -6,8 +6,10 @@
 	if not frappe.db.table_exists("Additional Salary"):
 		return
 
-	for doctype in ("Additional Salary", "Leave Encashment", "Employee Incentive", "Salary Detail"):
-		frappe.reload_doc("hr", "doctype", doctype)
+	for doctype in ("Additional Salary", "Employee Incentive", "Salary Detail"):
+		frappe.reload_doc("Payroll", "doctype", doctype)
+
+	frappe.reload_doc("hr", "doctype", "Leave Encashment")
 
 	additional_salaries = frappe.get_all("Additional Salary",
 		fields = ['name', "salary_slip", "type", "salary_component"],
diff --git a/erpnext/patches/v4_0/create_custom_fields_for_india_specific_fields.py b/erpnext/patches/v4_0/create_custom_fields_for_india_specific_fields.py
index 9c602a3..fe50e44 100644
--- a/erpnext/patches/v4_0/create_custom_fields_for_india_specific_fields.py
+++ b/erpnext/patches/v4_0/create_custom_fields_for_india_specific_fields.py
@@ -8,7 +8,7 @@
 def execute():
 	frappe.reload_doc("stock", "doctype", "purchase_receipt")
 	frappe.reload_doc("hr", "doctype", "employee")
-	frappe.reload_doc("hr", "doctype", "salary_slip")
+	frappe.reload_doc("Payroll", "doctype", "salary_slip")
 
 	india_specific_fields = {
 		"Purchase Receipt": [{
diff --git a/erpnext/patches/v5_0/rename_table_fieldnames.py b/erpnext/patches/v5_0/rename_table_fieldnames.py
index 59f5343..aefb0a2 100644
--- a/erpnext/patches/v5_0/rename_table_fieldnames.py
+++ b/erpnext/patches/v5_0/rename_table_fieldnames.py
@@ -220,7 +220,7 @@
 	frappe.reload_doc("manufacturing", "doctype", "work_order_operation")
 	frappe.reload_doc("manufacturing", "doctype", "workstation_working_hour")
 	frappe.reload_doc("stock", "doctype", "item_variant")
-	frappe.reload_doc("hr", "doctype", "salary_detail")
+	frappe.reload_doc("Payroll", "doctype", "salary_detail")
 	frappe.reload_doc("accounts", "doctype", "party_account")
 	frappe.reload_doc("accounts", "doctype", "fiscal_year_company")
 
diff --git a/erpnext/patches/v7_0/rename_salary_components.py b/erpnext/patches/v7_0/rename_salary_components.py
index bc48e34..1693f3b 100644
--- a/erpnext/patches/v7_0/rename_salary_components.py
+++ b/erpnext/patches/v7_0/rename_salary_components.py
@@ -6,8 +6,8 @@
 	if not frappe.db.exists("DocType", "Salary Structure Earning"):
 		return
 
-	frappe.reload_doc("hr", "doctype", "salary_detail")
-	frappe.reload_doc("hr", "doctype", "salary_component")
+	frappe.reload_doc("Payroll", "doctype", "salary_detail")
+	frappe.reload_doc("Payroll", "doctype", "salary_component")
 
 	standard_cols = ["name", "creation", "modified", "owner", "modified_by", "parent", "parenttype", "parentfield", "idx"]
 
diff --git a/erpnext/patches/v7_1/update_component_type.py b/erpnext/patches/v7_1/update_component_type.py
index 552fc89..24ca057 100644
--- a/erpnext/patches/v7_1/update_component_type.py
+++ b/erpnext/patches/v7_1/update_component_type.py
@@ -3,7 +3,7 @@
 from frappe.utils import flt
 
 def execute():
-	frappe.reload_doc('hr', 'doctype', 'salary_component')
+	frappe.reload_doc('Payroll', 'doctype', 'salary_component')
 	sal_components = frappe.db.sql("""
 		select DISTINCT salary_component, parentfield from `tabSalary Detail`""", as_dict=True)
 
diff --git a/erpnext/patches/v7_1/update_missing_salary_component_type.py b/erpnext/patches/v7_1/update_missing_salary_component_type.py
index 7d50ee4..824f2b8 100644
--- a/erpnext/patches/v7_1/update_missing_salary_component_type.py
+++ b/erpnext/patches/v7_1/update_missing_salary_component_type.py
@@ -10,12 +10,12 @@
 
 def execute():
 	frappe.reload_doc("accounts", "doctype", "salary_component_account")
-	frappe.reload_doc("hr", "doctype", "salary_component")
-	frappe.reload_doc("hr", "doctype", "taxable_salary_slab")
-	
-	for s in frappe.db.sql('''select name, type, salary_component_abbr from `tabSalary Component` 
+	frappe.reload_doc("Payroll", "doctype", "salary_component")
+	frappe.reload_doc("Payroll", "doctype", "taxable_salary_slab")
+
+	for s in frappe.db.sql('''select name, type, salary_component_abbr from `tabSalary Component`
 			where ifnull(type, "")="" or ifnull(salary_component_abbr, "") = ""''', as_dict=1):
-			
+
 		component = frappe.get_doc('Salary Component', s.name)
 
 		# guess
@@ -29,22 +29,22 @@
 
 			else:
 				component.type = 'Deduction'
-				
+
 		if not s.salary_component_abbr:
 			abbr = ''.join([c[0] for c in component.salary_component.split()]).upper()
-			
+
 			abbr_count = frappe.db.sql("""
-				select 
-					count(name) 
-				from 
-					`tabSalary Component` 
-				where 
+				select
+					count(name)
+				from
+					`tabSalary Component`
+				where
 					salary_component_abbr = %s or salary_component_abbr like %s
 				""", (abbr, abbr + "-%%"))
-				
+
 			if abbr_count and abbr_count[0][0] > 0:
 				abbr = abbr + "-" + cstr(abbr_count[0][0])
-				
+
 			component.salary_component_abbr = abbr
-			
+
 		component.save()
diff --git a/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py b/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
index 3b9642d..d2583b9 100644
--- a/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
+++ b/erpnext/patches/v7_2/arrear_leave_encashment_as_salary_component.py
@@ -2,7 +2,9 @@
 import frappe
 
 def execute():
-	frappe.reload_doctype('Salary Slip', 'Salary Component')
+	# frappe.reload_doctype('Salary Slip', 'Salary Component')
+	frappe.reload_doc("Payroll", "doctype", "Salary Slip")
+	frappe.reload_doc("Payroll", "doctype", "Salary Component")
 	salary_components = [['Arrear', "ARR"], ['Leave Encashment', 'LENC']]
 	for salary_component, salary_abbr in salary_components:
 		if not frappe.db.exists('Salary Component', salary_component):
diff --git a/erpnext/patches/v7_2/update_abbr_in_salary_slips.py b/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
index 19dcb5e..57432fe 100644
--- a/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
+++ b/erpnext/patches/v7_2/update_abbr_in_salary_slips.py
@@ -2,7 +2,7 @@
 import frappe
 
 def execute():
-	frappe.reload_doctype('Salary Slip')
+	frappe.reload_doc('Payroll', 'doctype', 'Salary Slip')
 	if not frappe.db.has_column('Salary Detail', 'abbr'):
 		return
 
diff --git a/erpnext/patches/v7_2/update_salary_slips.py b/erpnext/patches/v7_2/update_salary_slips.py
index 11a52f9..9fcce62 100644
--- a/erpnext/patches/v7_2/update_salary_slips.py
+++ b/erpnext/patches/v7_2/update_salary_slips.py
@@ -1,10 +1,10 @@
 from __future__ import unicode_literals
 import frappe
-from erpnext.hr.doctype.payroll_entry.payroll_entry import get_month_details
+from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_month_details
 from frappe.utils import cint
 
 def execute():
-	frappe.reload_doctype('Salary Slip')
+	frappe.reload_doc("Payroll", "doctype", "Salary Slip")
 	if not frappe.db.has_column('Salary Slip', 'fiscal_year'):
 		return
 
diff --git a/erpnext/patches/v8_7/sync_india_custom_fields.py b/erpnext/patches/v8_7/sync_india_custom_fields.py
index 73e1b18..eb24a90 100644
--- a/erpnext/patches/v8_7/sync_india_custom_fields.py
+++ b/erpnext/patches/v8_7/sync_india_custom_fields.py
@@ -7,11 +7,11 @@
 	if not company:
 		return
 
-	frappe.reload_doc('hr', 'doctype', 'payroll_period')
-	frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration')
-	frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission')
-	frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_declaration_category')
-	frappe.reload_doc('hr', 'doctype', 'employee_tax_exemption_proof_submission_detail')
+	frappe.reload_doc('Payroll', 'doctype', 'payroll_period')
+	frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_declaration')
+	frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_proof_submission')
+	frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_declaration_category')
+	frappe.reload_doc('Payroll', 'doctype', 'employee_tax_exemption_proof_submission_detail')
 
 	frappe.reload_doc('accounts', 'doctype', 'tax_category')
 
diff --git a/erpnext/patches/v9_0/update_employee_loan_details.py b/erpnext/patches/v9_0/update_employee_loan_details.py
index 86690fc..ef8d328 100644
--- a/erpnext/patches/v9_0/update_employee_loan_details.py
+++ b/erpnext/patches/v9_0/update_employee_loan_details.py
@@ -5,8 +5,8 @@
 import frappe
 
 def execute():
-	frappe.reload_doc('hr', 'doctype', 'salary_slip_loan')
-	frappe.reload_doc('hr', 'doctype', 'salary_slip')
+	frappe.reload_doc('Payroll', 'doctype', 'salary_slip_loan')
+	frappe.reload_doc('Payroll', 'doctype', 'salary_slip')
 
 	for data in frappe.db.sql(""" select name,
 			start_date, end_date, total_loan_repayment
diff --git a/erpnext/hr/doctype/salary_detail/__init__.py b/erpnext/payroll/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/salary_detail/__init__.py
copy to erpnext/payroll/__init__.py
diff --git a/erpnext/payroll/dashboard_fixtures.py b/erpnext/payroll/dashboard_fixtures.py
new file mode 100644
index 0000000..ae7a9ff
--- /dev/null
+++ b/erpnext/payroll/dashboard_fixtures.py
@@ -0,0 +1,100 @@
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+import frappe
+import erpnext
+from erpnext.hr.dashboard_fixtures import get_dashboards_chart_doc, get_number_cards_doc
+import json
+from frappe import _
+
+def get_data():
+	return frappe._dict({
+		"dashboards": get_dashboards(),
+		"charts": get_charts(),
+		"number_cards": get_number_cards(),
+	})
+
+def get_dashboards():
+	dashboards = []
+	dashboards.append(get_payroll_dashboard())
+	return dashboards
+
+def get_payroll_dashboard():
+	return {
+		"name": "Payroll",
+		"dashboard_name": "Payroll",
+		"is_default": 1,
+		"charts": [
+			{ "chart": "Outgoing Salary", "width": "Full"},
+			{ "chart": "Designation Wise Salary(Last Month)", "width": "Half"},
+			{ "chart": "Department Wise Salary(Last Month)", "width": "Half"},
+		],
+		"cards": [
+			{"card": "Total Declaration Submitted"},
+			{"card": "Total Salary Structure"},
+			{"card": "Total Incentive Given(Last month)"},
+			{"card": "Total Outgoing Salary(Last month)"},
+		]
+	}
+
+def get_charts():
+	dashboard_charts= [
+		get_dashboards_chart_doc('Outgoing Salary', "Sum", "Line",
+			document_type = "Salary Slip", based_on="end_date",
+			value_based_on = "rounded_total", time_interval = "Monthly", timeseries = 1,
+			filters_json = json.dumps([["Salary Slip", "docstatus", "=", 1]]))
+	]
+
+	dashboard_charts.append(
+		get_dashboards_chart_doc('Department Wise Salary(Last Month)', "Group By", "Bar",
+			document_type = "Salary Slip", group_by_type="Sum", group_by_based_on="department",
+			time_interval = "Monthly", aggregate_function_based_on = "rounded_total",
+			filters_json = json.dumps([
+				["Salary Slip", "docstatus", "=", 1],
+				["Salary Slip", "start_date", "Previous","1 month"]
+			])
+		)
+	)
+
+	dashboard_charts.append(
+		get_dashboards_chart_doc('Designation Wise Salary(Last Month)', "Group By", "Bar",
+			document_type = "Salary Slip", group_by_type="Sum", group_by_based_on="designation",
+			time_interval = "Monthly", aggregate_function_based_on = "rounded_total",
+			filters_json = json.dumps([
+				["Salary Slip", "docstatus", "=", 1],
+				["Salary Slip", "start_date", "Previous","1 month"]
+			])
+		)
+	)
+
+	return dashboard_charts
+
+def get_number_cards():
+	number_cards = [get_number_cards_doc("Employee Tax Exemption Declaration", "Total Declaration Submitted", filters_json = json.dumps([
+				["Employee Tax Exemption Declaration", "docstatus", "=","1"],
+				["Employee Tax Exemption Declaration","creation","Previous","1 year"]
+			])
+		)]
+
+	number_cards.append(get_number_cards_doc("Employee Incentive", "Total Incentive Given(Last month)",
+		time_interval = "Monthly", func = "Sum", aggregate_function_based_on = "incentive_amount",
+		filters_json = json.dumps([
+			["Employee Incentive", "docstatus", "=", 1],
+			["Employee Incentive","payroll_date","Previous","1 year"]
+		]))
+	)
+
+	number_cards.append(get_number_cards_doc("Salary Slip", "Total Outgoing Salary(Last month)",
+		time_interval = "Monthly", time_span= "Monthly", func = "Sum", aggregate_function_based_on = "rounded_total",
+		filters_json = json.dumps([
+			["Salary Slip", "docstatus", "=", 1],
+			["Salary Slip", "start_date","Previous","1 month"]
+		]))
+	)
+	number_cards.append(get_number_cards_doc("Salary Structure", "Total Salary Structure",
+		filters_json = json.dumps([
+			["Salary Structure", "docstatus", "=", 1]
+		]))
+	)
+
+	return number_cards
\ No newline at end of file
diff --git a/erpnext/payroll/desk_page/payroll/payroll.json b/erpnext/payroll/desk_page/payroll/payroll.json
new file mode 100644
index 0000000..b5eac46
--- /dev/null
+++ b/erpnext/payroll/desk_page/payroll/payroll.json
@@ -0,0 +1,84 @@
+{
+ "cards": [
+  {
+   "hidden": 0,
+   "label": "Payroll",
+   "links": "[\n    {\n        \"label\": \"Salary Component\",\n        \"name\": \"Salary Component\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n        \n    },\n    {\n        \"label\": \"Salary Structure\",\n        \"name\": \"Salary Structure\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Salary Structure Assignment\",\n        \"name\": \"Salary Structure Assignment\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Payroll Entry\",\n        \"name\": \"Payroll Entry\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Salary Slip\",\n        \"name\": \"Salary Slip\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    }\n]"
+  },
+  {
+   "hidden": 0,
+   "label": "Taxation",
+   "links": "[\n    {\n        \"label\": \"Payroll Period\",\n        \"name\": \"Payroll Period\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n        \n    },\n    {\n        \"label\": \"Income Tax Slab\",\n        \"name\": \"Income Tax Slab\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n        \n    },\n    {\n        \"label\": \"Employee Tax Exemption Declaration\",\n        \"name\": \"Employee Tax Exemption Declaration\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n        \n    },\n    {\n        \"label\": \"Employee Tax Exemption Proof Submission\",\n        \"name\": \"Employee Tax Exemption Proof Submission\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n        \n    },\n    {\n        \"label\": \"Employee Tax Exemption Category\",\n        \"name\": \"Employee Tax Exemption Category\",\n        \"type\": \"doctype\"\n        \n    },\n    {\n        \"label\": \"Employee Tax Exemption Sub Category\",\n        \"name\": \"Employee Tax Exemption Sub Category\",\n        \"type\": \"doctype\"\n        \n    }\n]"
+  },
+  {
+   "hidden": 0,
+   "label": "Compensations",
+   "links": "[\n    {\n        \"label\": \"Additional Salary\",\n        \"name\": \"Additional Salary\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n        \n    },\n    {\n        \"label\": \"Retention Bonus\",\n        \"name\": \"Retention Bonus\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Employee Incentive\",\n        \"name\": \"Employee Incentive\",\n        \"onboard\": 1,\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Employee Benefit Application\",\n        \"name\": \"Employee Benefit Application\",\n        \"type\": \"doctype\"\n    },\n    {\n        \"label\": \"Employee Benefit Claim\",\n        \"name\": \"Employee Benefit Claim\",\n        \"type\": \"doctype\"\n    }\n]"
+  },
+  {
+   "hidden": 0,
+   "label": "Reports",
+   "links": "[\n    {\n        \"dependencies\": [\n            \"Salary Slip\"\n        ],\n        \"doctype\": \"Salary Slip\",\n        \"is_query_report\": true,\n        \"label\": \"Salary Register\",\n        \"name\": \"Salary Register\",\n        \"type\": \"report\"\n        \n    },\n    {\n        \"dependencies\": [\n            \"Salary Slip\"\n        ],\n        \"doctype\": \"Salary Slip\",\n        \"label\": \"Salary Payments Based On Payment Mode\",\n        \"is_query_report\": true,\n        \"name\": \"Salary Payments Based On Payment Mode\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Salary Slip\"\n        ],\n        \"doctype\": \"Salary Slip\",\n        \"label\": \"Salary Payments via ECS\",\n        \"is_query_report\": true,\n        \"name\": \"Salary Payments via ECS\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Salary Slip\"\n        ],\n        \"doctype\": \"Salary Slip\",\n        \"label\": \"Income Tax Deductions\",\n        \"is_query_report\": true,\n        \"name\": \"Income Tax Deductions\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Salary Slip\"\n        ],\n        \"doctype\": \"Salary Slip\",\n        \"label\": \"Professional Tax Deductions\",\n        \"is_query_report\": true,\n        \"name\": \"Professional Tax Deductions\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Salary Slip\"\n        ],\n        \"doctype\": \"Salary Slip\",\n        \"label\": \"Provident Fund Deductions\",\n        \"is_query_report\": true,\n        \"name\": \"Provident Fund Deductions\",\n        \"type\": \"report\"\n    },\n    {\n        \"dependencies\": [\n            \"Payroll Entry\"\n        ],\n        \"doctype\": \"Payroll Entry\",\n        \"is_query_report\": true,\n        \"label\": \"Bank Remittance\",\n        \"name\": \"Bank Remittance\",\n        \"type\": \"report\"\n        \n    }\n]"
+  }
+ ],
+ "category": "Modules",
+ "charts": [
+  {
+   "chart_name": "Outgoing Salary",
+   "label": "Outgoing Salary"
+  }
+ ],
+ "creation": "2020-05-27 19:54:23.405607",
+ "developer_mode_only": 0,
+ "disable_user_customization": 0,
+ "docstatus": 0,
+ "doctype": "Desk Page",
+ "extends_another_page": 0,
+ "hide_custom": 0,
+ "idx": 0,
+ "is_standard": 1,
+ "label": "Payroll",
+ "modified": "2020-06-19 12:23:06.034046",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Payroll",
+ "onboarding": "Payroll",
+ "owner": "Administrator",
+ "pin_to_bottom": 0,
+ "pin_to_top": 0,
+ "shortcuts": [
+  {
+   "label": "Salary Structure",
+   "link_to": "Salary Structure",
+   "type": "DocType"
+  },
+  {
+   "label": "Payroll Entry",
+   "link_to": "Payroll Entry",
+   "type": "DocType"
+  },
+  {
+   "color": "",
+   "format": "{} Pending",
+   "label": "Salary Slip",
+   "link_to": "Salary Slip",
+   "stats_filter": "{\"status\": \"Draft\"}",
+   "type": "DocType"
+  },
+  {
+   "label": "Income Tax Slab",
+   "link_to": "Income Tax Slab",
+   "type": "DocType"
+  },
+  {
+   "label": "Salary Register",
+   "link_to": "Salary Register",
+   "type": "Report"
+  },
+  {
+   "label": "Dashboard",
+   "link_to": "Payroll",
+   "type": "Dashboard"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/bank_remittance/__init__.py b/erpnext/payroll/doctype/__init__.py
similarity index 100%
copy from erpnext/hr/report/bank_remittance/__init__.py
copy to erpnext/payroll/doctype/__init__.py
diff --git a/erpnext/hr/doctype/additional_salary/__init__.py b/erpnext/payroll/doctype/additional_salary/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/additional_salary/__init__.py
rename to erpnext/payroll/doctype/additional_salary/__init__.py
diff --git a/erpnext/hr/doctype/additional_salary/additional_salary.js b/erpnext/payroll/doctype/additional_salary/additional_salary.js
similarity index 100%
rename from erpnext/hr/doctype/additional_salary/additional_salary.js
rename to erpnext/payroll/doctype/additional_salary/additional_salary.js
diff --git a/erpnext/hr/doctype/additional_salary/additional_salary.json b/erpnext/payroll/doctype/additional_salary/additional_salary.json
similarity index 98%
rename from erpnext/hr/doctype/additional_salary/additional_salary.json
rename to erpnext/payroll/doctype/additional_salary/additional_salary.json
index bfb543f..ad64289 100644
--- a/erpnext/hr/doctype/additional_salary/additional_salary.json
+++ b/erpnext/payroll/doctype/additional_salary/additional_salary.json
@@ -146,7 +146,7 @@
    "label": "To Date",
    "mandatory_depends_on": "eval:(doc.is_recurring==1)"
   },
-   {
+  {
    "fieldname": "ref_doctype",
    "fieldtype": "Link",
    "label": "Reference Document Type",
@@ -163,9 +163,9 @@
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-04-04 18:06:29.170878",
+ "modified": "2020-05-27 21:10:50.374063",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Additional Salary",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/additional_salary/additional_salary.py b/erpnext/payroll/doctype/additional_salary/additional_salary.py
similarity index 100%
rename from erpnext/hr/doctype/additional_salary/additional_salary.py
rename to erpnext/payroll/doctype/additional_salary/additional_salary.py
diff --git a/erpnext/hr/doctype/additional_salary/test_additional_salary.js b/erpnext/payroll/doctype/additional_salary/test_additional_salary.js
similarity index 100%
rename from erpnext/hr/doctype/additional_salary/test_additional_salary.js
rename to erpnext/payroll/doctype/additional_salary/test_additional_salary.js
diff --git a/erpnext/hr/doctype/additional_salary/test_additional_salary.py b/erpnext/payroll/doctype/additional_salary/test_additional_salary.py
similarity index 87%
rename from erpnext/hr/doctype/additional_salary/test_additional_salary.py
rename to erpnext/payroll/doctype/additional_salary/test_additional_salary.py
index 6f93fb5..de26543 100644
--- a/erpnext/hr/doctype/additional_salary/test_additional_salary.py
+++ b/erpnext/payroll/doctype/additional_salary/test_additional_salary.py
@@ -6,8 +6,8 @@
 import frappe, erpnext
 from frappe.utils import nowdate, add_days
 from erpnext.hr.doctype.employee.test_employee import make_employee
-from erpnext.hr.doctype.salary_component.test_salary_component import create_salary_component
-from erpnext.hr.doctype.salary_slip.test_salary_slip import make_employee_salary_slip, setup_test
+from erpnext.payroll.doctype.salary_component.test_salary_component import create_salary_component
+from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_employee_salary_slip, setup_test
 
 
 class TestAdditionalSalary(unittest.TestCase):
diff --git a/erpnext/hr/doctype/employee_benefit_application/__init__.py b/erpnext/payroll/doctype/employee_benefit_application/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_benefit_application/__init__.py
rename to erpnext/payroll/doctype/employee_benefit_application/__init__.py
diff --git a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.js b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.js
similarity index 82%
rename from erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.js
rename to erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.js
index b73dcf8..f509df3 100644
--- a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.js
+++ b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.js
@@ -6,7 +6,7 @@
 		frm.trigger('set_earning_component');
 		var method, args;
 		if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
-			method = "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits_remaining";
+			method = "erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits_remaining";
 			args = {
 				employee: frm.doc.employee,
 				on_date: frm.doc.date,
@@ -15,7 +15,7 @@
 			get_max_benefits(frm, method, args);
 		}
 		else if(frm.doc.employee && frm.doc.date){
-			method = "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits";
+			method = "erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits";
 			args = {
 				employee: frm.doc.employee,
 				on_date: frm.doc.date
@@ -32,7 +32,7 @@
 		if(!frm.doc.employee && !frm.doc.date) return;
 		frm.set_query("earning_component", "employee_benefits", function() {
 			return {
-				query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
+				query : "erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
 				filters: {date: frm.doc.date, employee: frm.doc.employee}
 			};
 		});
@@ -41,7 +41,7 @@
 	payroll_period: function(frm) {
 		var method, args;
 		if(frm.doc.employee && frm.doc.date && frm.doc.payroll_period){
-			method = "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits_remaining";
+			method = "erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application.get_max_benefits_remaining";
 			args = {
 				employee: frm.doc.employee,
 				on_date: frm.doc.date,
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.json
similarity index 64%
copy from erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json
copy to erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.json
index 18fad85..275c855 100644
--- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json
+++ b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.json
@@ -2,25 +2,26 @@
  "actions": [],
  "allow_import": 1,
  "allow_rename": 1,
- "autoname": "HR-TAX-DEC-.YYYY.-.#####",
- "creation": "2018-04-13 16:53:36.175504",
+ "autoname": "HR-BEN-APP-.YY.-.MM.-.#####",
+ "creation": "2018-04-13 16:31:39.190787",
  "doctype": "DocType",
  "editable_grid": 1,
  "engine": "InnoDB",
  "field_order": [
   "employee",
   "employee_name",
-  "department",
+  "max_benefits",
+  "remaining_benefit",
   "column_break_2",
+  "date",
   "payroll_period",
-  "company",
+  "department",
   "amended_from",
-  "section_break_8",
-  "declarations",
-  "section_break_10",
-  "total_declared_amount",
-  "column_break_12",
-  "total_exemption_amount"
+  "section_break_4",
+  "employee_benefits",
+  "totals",
+  "total_amount",
+  "pro_rata_dispensed_amount"
  ],
  "fields": [
   {
@@ -39,11 +40,15 @@
    "read_only": 1
   },
   {
-   "fetch_from": "employee.department",
-   "fieldname": "department",
-   "fieldtype": "Link",
-   "label": "Department",
-   "options": "Department",
+   "fieldname": "max_benefits",
+   "fieldtype": "Currency",
+   "label": "Max Benefits (Yearly)",
+   "read_only": 1
+  },
+  {
+   "fieldname": "remaining_benefit",
+   "fieldtype": "Currency",
+   "label": "Remaining Benefits (Yearly)",
    "read_only": 1
   },
   {
@@ -51,6 +56,13 @@
    "fieldtype": "Column Break"
   },
   {
+   "default": "Today",
+   "fieldname": "date",
+   "fieldtype": "Date",
+   "label": "Date",
+   "reqd": 1
+  },
+  {
    "fieldname": "payroll_period",
    "fieldtype": "Link",
    "in_list_view": 1,
@@ -59,58 +71,58 @@
    "reqd": 1
   },
   {
-   "fetch_from": "employee.company",
-   "fieldname": "company",
+   "fetch_from": "employee.department",
+   "fieldname": "department",
    "fieldtype": "Link",
-   "label": "Company",
-   "options": "Company"
+   "label": "Department",
+   "options": "Department",
+   "read_only": 1
   },
   {
    "fieldname": "amended_from",
    "fieldtype": "Link",
    "label": "Amended From",
    "no_copy": 1,
-   "options": "Employee Tax Exemption Declaration",
+   "options": "Employee Benefit Application",
    "print_hide": 1,
    "read_only": 1
   },
   {
-   "fieldname": "section_break_8",
-   "fieldtype": "Section Break"
+   "fieldname": "section_break_4",
+   "fieldtype": "Section Break",
+   "label": "Benefits Applied"
   },
   {
-   "fieldname": "declarations",
+   "fieldname": "employee_benefits",
    "fieldtype": "Table",
-   "label": "Declarations",
-   "options": "Employee Tax Exemption Declaration Category"
+   "label": "Employee Benefits",
+   "options": "Employee Benefit Application Detail",
+   "reqd": 1
   },
   {
-   "fieldname": "section_break_10",
-   "fieldtype": "Section Break"
+   "fieldname": "totals",
+   "fieldtype": "Section Break",
+   "label": "Totals"
   },
   {
-   "fieldname": "total_declared_amount",
+   "fieldname": "total_amount",
    "fieldtype": "Currency",
-   "label": "Total Declared Amount",
+   "label": "Total Amount",
    "read_only": 1
   },
   {
-   "fieldname": "column_break_12",
-   "fieldtype": "Column Break"
-  },
-  {
-   "fieldname": "total_exemption_amount",
+   "fieldname": "pro_rata_dispensed_amount",
    "fieldtype": "Currency",
-   "label": "Total Exemption Amount",
+   "label": "Dispensed Amount (Pro-rated)",
    "read_only": 1
   }
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-03-18 14:56:25.625717",
+ "modified": "2020-05-27 22:58:31.271922",
  "modified_by": "Administrator",
- "module": "HR",
- "name": "Employee Tax Exemption Declaration",
+ "module": "Payroll",
+ "name": "Employee Benefit Application",
  "owner": "Administrator",
  "permissions": [
   {
@@ -159,8 +171,6 @@
    "write": 1
   },
   {
-   "amend": 1,
-   "cancel": 1,
    "create": 1,
    "delete": 1,
    "email": 1,
@@ -170,11 +180,12 @@
    "report": 1,
    "role": "Employee",
    "share": 1,
-   "submit": 1,
    "write": 1
   }
  ],
+ "quick_entry": 1,
  "sort_field": "modified",
  "sort_order": "DESC",
+ "title_field": "employee_name",
  "track_changes": 1
 }
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py
similarity index 97%
rename from erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py
rename to erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py
index feaa925..e166a70 100644
--- a/erpnext/hr/doctype/employee_benefit_application/employee_benefit_application.py
+++ b/erpnext/payroll/doctype/employee_benefit_application/employee_benefit_application.py
@@ -7,8 +7,8 @@
 from frappe import _
 from frappe.utils import date_diff, getdate, rounded, add_days, cstr, cint, flt
 from frappe.model.document import Document
-from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period_days, get_period_factor
-from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
+from erpnext.payroll.doctype.payroll_period.payroll_period import get_payroll_period_days, get_period_factor
+from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
 from erpnext.hr.utils import get_sal_slip_total_benefit_given, get_holidays_for_employee, get_previous_claimed_amount
 
 class EmployeeBenefitApplication(Document):
diff --git a/erpnext/hr/doctype/employee_benefit_application/test_employee_benefit_application.js b/erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.js
similarity index 100%
rename from erpnext/hr/doctype/employee_benefit_application/test_employee_benefit_application.js
rename to erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.js
diff --git a/erpnext/hr/doctype/employee_benefit_application/test_employee_benefit_application.py b/erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.py
similarity index 100%
rename from erpnext/hr/doctype/employee_benefit_application/test_employee_benefit_application.py
rename to erpnext/payroll/doctype/employee_benefit_application/test_employee_benefit_application.py
diff --git a/erpnext/hr/doctype/employee_benefit_application_detail/__init__.py b/erpnext/payroll/doctype/employee_benefit_application_detail/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_benefit_application_detail/__init__.py
rename to erpnext/payroll/doctype/employee_benefit_application_detail/__init__.py
diff --git a/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.json b/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.json
new file mode 100644
index 0000000..f0415d2
--- /dev/null
+++ b/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.json
@@ -0,0 +1,58 @@
+{
+ "actions": [],
+ "creation": "2018-04-13 16:36:18.389786",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "earning_component",
+  "pay_against_benefit_claim",
+  "max_benefit_amount",
+  "amount"
+ ],
+ "fields": [
+  {
+   "fieldname": "earning_component",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Earning Component",
+   "options": "Salary Component",
+   "reqd": 1
+  },
+  {
+   "default": "0",
+   "fetch_from": "earning_component.pay_against_benefit_claim",
+   "fieldname": "pay_against_benefit_claim",
+   "fieldtype": "Check",
+   "label": "Pay Against Benefit Claim",
+   "read_only": 1
+  },
+  {
+   "fetch_from": "earning_component.max_benefit_amount",
+   "fieldname": "max_benefit_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Max Benefit Amount",
+   "read_only": 1
+  },
+  {
+   "fieldname": "amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Amount",
+   "reqd": 1
+  }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:45:00.519134",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Employee Benefit Application Detail",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py b/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py
similarity index 73%
rename from erpnext/hr/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py
rename to erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py
index 3a502fe..65405fe 100644
--- a/erpnext/hr/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py
+++ b/erpnext/payroll/doctype/employee_benefit_application_detail/employee_benefit_application_detail.py
@@ -1,9 +1,9 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+# import frappe
 from frappe.model.document import Document
 
 class EmployeeBenefitApplicationDetail(Document):
diff --git a/erpnext/hr/doctype/employee_benefit_claim/__init__.py b/erpnext/payroll/doctype/employee_benefit_claim/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_benefit_claim/__init__.py
rename to erpnext/payroll/doctype/employee_benefit_claim/__init__.py
diff --git a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.js b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.js
similarity index 77%
rename from erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.js
rename to erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.js
index 5e12828..6db6cb8 100644
--- a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.js
+++ b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.js
@@ -5,7 +5,7 @@
 	setup: function(frm) {
 		frm.set_query("earning_component", function() {
 			return {
-				query : "erpnext.hr.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
+				query : "erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application.get_earning_components",
 				filters: {date: frm.doc.claim_date, employee: frm.doc.employee}
 			};
 		});
diff --git a/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.json b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.json
new file mode 100644
index 0000000..7fea59f
--- /dev/null
+++ b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.json
@@ -0,0 +1,194 @@
+{
+ "actions": [],
+ "allow_import": 1,
+ "autoname": "HR-BEN-CLM-.YY.-.MM.-.#####",
+ "creation": "2018-04-13 16:43:10.386409",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "employee",
+  "employee_name",
+  "department",
+  "column_break_3",
+  "claim_date",
+  "benefit_type_and_amount",
+  "earning_component",
+  "max_amount_eligible",
+  "pay_against_benefit_claim",
+  "claimed_amount",
+  "salary_slip",
+  "amended_from",
+  "section_break_9",
+  "attachments"
+ ],
+ "fields": [
+  {
+   "fieldname": "employee",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Employee",
+   "options": "Employee",
+   "reqd": 1
+  },
+  {
+   "fetch_from": "employee.employee_name",
+   "fieldname": "employee_name",
+   "fieldtype": "Data",
+   "label": "Employee Name",
+   "read_only": 1
+  },
+  {
+   "fetch_from": "employee.department",
+   "fieldname": "department",
+   "fieldtype": "Link",
+   "label": "Department",
+   "options": "Department",
+   "read_only": 1
+  },
+  {
+   "fieldname": "column_break_3",
+   "fieldtype": "Column Break"
+  },
+  {
+   "default": "Today",
+   "fieldname": "claim_date",
+   "fieldtype": "Date",
+   "in_list_view": 1,
+   "label": "Claim Date",
+   "reqd": 1
+  },
+  {
+   "fieldname": "benefit_type_and_amount",
+   "fieldtype": "Section Break",
+   "label": "Benefit Type and Amount"
+  },
+  {
+   "fieldname": "earning_component",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Claim Benefit For",
+   "options": "Salary Component",
+   "reqd": 1
+  },
+  {
+   "fetch_from": "earning_component.max_benefit_amount",
+   "fieldname": "max_amount_eligible",
+   "fieldtype": "Currency",
+   "label": "Max Amount Eligible",
+   "read_only": 1
+  },
+  {
+   "default": "0",
+   "fetch_from": "earning_component.pay_against_benefit_claim",
+   "fieldname": "pay_against_benefit_claim",
+   "fieldtype": "Check",
+   "hidden": 1,
+   "label": "Pay Against Benefit Claim",
+   "read_only": 1
+  },
+  {
+   "fieldname": "claimed_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Claimed Amount",
+   "reqd": 1
+  },
+  {
+   "fieldname": "salary_slip",
+   "fieldtype": "Link",
+   "label": "Salary Slip",
+   "options": "Salary Slip",
+   "read_only": 1
+  },
+  {
+   "fieldname": "amended_from",
+   "fieldtype": "Link",
+   "label": "Amended From",
+   "no_copy": 1,
+   "options": "Employee Benefit Claim",
+   "print_hide": 1,
+   "read_only": 1
+  },
+  {
+   "fieldname": "section_break_9",
+   "fieldtype": "Section Break",
+   "label": "Expense Proof"
+  },
+  {
+   "fieldname": "attachments",
+   "fieldtype": "Attach",
+   "label": "Attachments"
+  }
+ ],
+ "is_submittable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:01:50.791676",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Employee Benefit Claim",
+ "owner": "Administrator",
+ "permissions": [
+  {
+   "amend": 1,
+   "cancel": 1,
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "System Manager",
+   "share": 1,
+   "submit": 1,
+   "write": 1
+  },
+  {
+   "amend": 1,
+   "cancel": 1,
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "HR Manager",
+   "share": 1,
+   "submit": 1,
+   "write": 1
+  },
+  {
+   "amend": 1,
+   "cancel": 1,
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "HR User",
+   "share": 1,
+   "submit": 1,
+   "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "Employee",
+   "share": 1,
+   "write": 1
+  }
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "title_field": "employee_name",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py
similarity index 96%
rename from erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py
rename to erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py
index 3a12c9c..d9937a7 100644
--- a/erpnext/hr/doctype/employee_benefit_claim/employee_benefit_claim.py
+++ b/erpnext/payroll/doctype/employee_benefit_claim/employee_benefit_claim.py
@@ -7,10 +7,10 @@
 from frappe import _
 from frappe.utils import flt
 from frappe.model.document import Document
-from erpnext.hr.doctype.employee_benefit_application.employee_benefit_application import get_max_benefits
+from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import get_max_benefits
 from erpnext.hr.utils import get_previous_claimed_amount
-from erpnext.hr.doctype.payroll_period.payroll_period import get_payroll_period
-from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
+from erpnext.payroll.doctype.payroll_period.payroll_period import get_payroll_period
+from erpnext.payroll.doctype.salary_structure_assignment.salary_structure_assignment import get_assigned_salary_structure
 
 class EmployeeBenefitClaim(Document):
 	def validate(self):
diff --git a/erpnext/hr/doctype/employee_benefit_claim/test_employee_benefit_claim.js b/erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.js
similarity index 100%
rename from erpnext/hr/doctype/employee_benefit_claim/test_employee_benefit_claim.js
rename to erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.js
diff --git a/erpnext/hr/doctype/employee_benefit_claim/test_employee_benefit_claim.py b/erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.py
similarity index 100%
rename from erpnext/hr/doctype/employee_benefit_claim/test_employee_benefit_claim.py
rename to erpnext/payroll/doctype/employee_benefit_claim/test_employee_benefit_claim.py
diff --git a/erpnext/hr/doctype/employee_incentive/__init__.py b/erpnext/payroll/doctype/employee_incentive/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_incentive/__init__.py
rename to erpnext/payroll/doctype/employee_incentive/__init__.py
diff --git a/erpnext/hr/doctype/employee_incentive/employee_incentive.js b/erpnext/payroll/doctype/employee_incentive/employee_incentive.js
similarity index 100%
rename from erpnext/hr/doctype/employee_incentive/employee_incentive.js
rename to erpnext/payroll/doctype/employee_incentive/employee_incentive.js
diff --git a/erpnext/hr/doctype/employee_incentive/employee_incentive.json b/erpnext/payroll/doctype/employee_incentive/employee_incentive.json
similarity index 96%
rename from erpnext/hr/doctype/employee_incentive/employee_incentive.json
rename to erpnext/payroll/doctype/employee_incentive/employee_incentive.json
index e2d8a11..81ff865 100644
--- a/erpnext/hr/doctype/employee_incentive/employee_incentive.json
+++ b/erpnext/payroll/doctype/employee_incentive/employee_incentive.json
@@ -74,9 +74,9 @@
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-03-05 18:59:40.526014",
+ "modified": "2020-05-27 22:42:51.209630",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Employee Incentive",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/employee_incentive/employee_incentive.py b/erpnext/payroll/doctype/employee_incentive/employee_incentive.py
similarity index 100%
rename from erpnext/hr/doctype/employee_incentive/employee_incentive.py
rename to erpnext/payroll/doctype/employee_incentive/employee_incentive.py
diff --git a/erpnext/hr/doctype/employee_incentive/test_employee_incentive.js b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.js
similarity index 100%
rename from erpnext/hr/doctype/employee_incentive/test_employee_incentive.js
rename to erpnext/payroll/doctype/employee_incentive/test_employee_incentive.js
diff --git a/erpnext/hr/doctype/employee_incentive/test_employee_incentive.py b/erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py
similarity index 100%
rename from erpnext/hr/doctype/employee_incentive/test_employee_incentive.py
rename to erpnext/payroll/doctype/employee_incentive/test_employee_incentive.py
diff --git a/erpnext/hr/doctype/employee_other_income/__init__.py b/erpnext/payroll/doctype/employee_other_income/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_other_income/__init__.py
rename to erpnext/payroll/doctype/employee_other_income/__init__.py
diff --git a/erpnext/hr/doctype/employee_other_income/employee_other_income.js b/erpnext/payroll/doctype/employee_other_income/employee_other_income.js
similarity index 100%
rename from erpnext/hr/doctype/employee_other_income/employee_other_income.js
rename to erpnext/payroll/doctype/employee_other_income/employee_other_income.js
diff --git a/erpnext/hr/doctype/employee_other_income/employee_other_income.json b/erpnext/payroll/doctype/employee_other_income/employee_other_income.json
similarity index 97%
rename from erpnext/hr/doctype/employee_other_income/employee_other_income.json
rename to erpnext/payroll/doctype/employee_other_income/employee_other_income.json
index 8abfe1e..c5a2a73 100644
--- a/erpnext/hr/doctype/employee_other_income/employee_other_income.json
+++ b/erpnext/payroll/doctype/employee_other_income/employee_other_income.json
@@ -76,9 +76,9 @@
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-05-14 17:17:38.883126",
+ "modified": "2020-05-27 22:55:17.604688",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Employee Other Income",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/employee_other_income/employee_other_income.py b/erpnext/payroll/doctype/employee_other_income/employee_other_income.py
similarity index 100%
rename from erpnext/hr/doctype/employee_other_income/employee_other_income.py
rename to erpnext/payroll/doctype/employee_other_income/employee_other_income.py
diff --git a/erpnext/hr/doctype/employee_other_income/test_employee_other_income.py b/erpnext/payroll/doctype/employee_other_income/test_employee_other_income.py
similarity index 100%
rename from erpnext/hr/doctype/employee_other_income/test_employee_other_income.py
rename to erpnext/payroll/doctype/employee_other_income/test_employee_other_income.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_category/__init__.py b/erpnext/payroll/doctype/employee_tax_exemption_category/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_category/__init__.py
rename to erpnext/payroll/doctype/employee_tax_exemption_category/__init__.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_category/employee_tax_exemption_category.js b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.js
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_category/employee_tax_exemption_category.js
rename to erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.js
diff --git a/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.json b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.json
new file mode 100644
index 0000000..c097082
--- /dev/null
+++ b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.json
@@ -0,0 +1,74 @@
+{
+ "actions": [],
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "Prompt",
+ "creation": "2018-04-13 16:51:36.971140",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "max_amount",
+  "is_active"
+ ],
+ "fields": [
+  {
+   "fieldname": "max_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Max Exemption Amount"
+  },
+  {
+   "default": "1",
+   "fieldname": "is_active",
+   "fieldtype": "Check",
+   "label": "Is Active"
+  }
+ ],
+ "links": [],
+ "modified": "2020-05-27 23:16:47.472910",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Employee Tax Exemption Category",
+ "owner": "Administrator",
+ "permissions": [
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "System Manager",
+   "share": 1,
+   "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "HR Manager",
+   "share": 1,
+   "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "HR User",
+   "share": 1,
+   "write": 1
+  }
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py b/erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py
rename to erpnext/payroll/doctype/employee_tax_exemption_category/employee_tax_exemption_category.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.js b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.js
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.js
rename to erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.js
diff --git a/erpnext/hr/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py b/erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py
rename to erpnext/payroll/doctype/employee_tax_exemption_category/test_employee_tax_exemption_category.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/__init__.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration/__init__.py
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration/__init__.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js
similarity index 88%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js
index a827eca..0e0c9b5 100644
--- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js
+++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.js
@@ -42,7 +42,7 @@
 		if(frm.doc.docstatus==1) {
 			frm.add_custom_button(__('Submit Proof'), function() {
 				frappe.model.open_mapped_doc({
-					method: "erpnext.hr.doctype.employee_tax_exemption_declaration.employee_tax_exemption_declaration.make_proof_submission",
+					method: "erpnext.payroll.doctype.employee_tax_exemption_declaration.employee_tax_exemption_declaration.make_proof_submission",
 					frm: frm
 				});
 			}).addClass("btn-primary");
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json
similarity index 97%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json
index 18fad85..5423365 100644
--- a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json
+++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.json
@@ -107,9 +107,9 @@
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-03-18 14:56:25.625717",
+ "modified": "2020-05-27 22:49:43.829892",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Employee Tax Exemption Declaration",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.js b/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.js
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.js
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.js
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration/test_employee_tax_exemption_declaration.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration_category/__init__.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration_category/__init__.py
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration_category/__init__.py
diff --git a/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.json b/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.json
new file mode 100644
index 0000000..eddaec2
--- /dev/null
+++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.json
@@ -0,0 +1,61 @@
+{
+ "actions": [],
+ "creation": "2018-04-13 16:56:23.333041",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "exemption_sub_category",
+  "exemption_category",
+  "max_amount",
+  "amount"
+ ],
+ "fields": [
+  {
+   "fieldname": "exemption_sub_category",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Exemption Sub Category",
+   "options": "Employee Tax Exemption Sub Category",
+   "reqd": 1
+  },
+  {
+   "fetch_from": "exemption_sub_category.exemption_category",
+   "fieldname": "exemption_category",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Exemption Category",
+   "options": "Employee Tax Exemption Category",
+   "read_only": 1,
+   "reqd": 1
+  },
+  {
+   "fetch_from": "exemption_sub_category.max_amount",
+   "fieldname": "max_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Maximum Exempted Amount",
+   "read_only": 1,
+   "reqd": 1
+  },
+  {
+   "fieldname": "amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Declared Amount",
+   "reqd": 1
+  }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:41:03.638739",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Employee Tax Exemption Declaration Category",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py b/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py
similarity index 73%
rename from erpnext/hr/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py
rename to erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py
index 362677e..bff747f 100644
--- a/erpnext/hr/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py
+++ b/erpnext/payroll/doctype/employee_tax_exemption_declaration_category/employee_tax_exemption_declaration_category.py
@@ -1,9 +1,9 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+# import frappe
 from frappe.model.document import Document
 
 class EmployeeTaxExemptionDeclarationCategory(Document):
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/__init__.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_proof_submission/__init__.py
rename to erpnext/payroll/doctype/employee_tax_exemption_proof_submission/__init__.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.js b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.js
similarity index 90%
rename from erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.js
rename to erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.js
index 66118c0..715d755 100644
--- a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.js
+++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.js
@@ -43,7 +43,7 @@
 
 			frm.add_custom_button(__('Get Details From Declaration'), function() {
 				erpnext.utils.map_current_doc({
-					method: "erpnext.hr.doctype.employee_tax_exemption_declaration.employee_tax_exemption_declaration.make_proof_submission",
+					method: "erpnext.payroll.doctype.employee_tax_exemption_declaration.employee_tax_exemption_declaration.make_proof_submission",
 					source_doctype: "Employee Tax Exemption Declaration",
 					target: frm,
 					date_field: "creation",
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json
similarity index 98%
rename from erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json
rename to erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json
index 8b117a2..de8fa09 100644
--- a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json
+++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.json
@@ -130,9 +130,9 @@
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-03-18 14:55:51.420016",
+ "modified": "2020-05-27 22:53:10.412321",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Employee Tax Exemption Proof Submission",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py
rename to erpnext/payroll/doctype/employee_tax_exemption_proof_submission/employee_tax_exemption_proof_submission.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.js b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.js
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.js
rename to erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.js
diff --git a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py
new file mode 100644
index 0000000..cb9ed5f
--- /dev/null
+++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission/test_employee_tax_exemption_proof_submission.py
@@ -0,0 +1,54 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+import frappe
+import unittest
+from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_exemption_category, create_payroll_period
+
+class TestEmployeeTaxExemptionProofSubmission(unittest.TestCase):
+	def setup(self):
+		make_employee("employee@proofsubmission.com")
+		create_payroll_period()
+		create_exemption_category()
+		frappe.db.sql("""delete from `tabEmployee Tax Exemption Proof Submission`""")
+
+	def test_exemption_amount_lesser_than_category_max(self):
+		declaration = frappe.get_doc({
+			"doctype": "Employee Tax Exemption Proof Submission",
+			"employee": frappe.get_value("Employee", {"user_id":"employee@proofsubmission.com"}, "name"),
+			"payroll_period": "Test Payroll Period",
+			"tax_exemption_proofs": [dict(exemption_sub_category = "_Test Sub Category",
+							type_of_proof = "Test Proof",
+							exemption_category = "_Test Category",
+							amount = 150000)]
+		})
+		self.assertRaises(frappe.ValidationError, declaration.save)
+		declaration = frappe.get_doc({
+			"doctype": "Employee Tax Exemption Proof Submission",
+			"payroll_period": "Test Payroll Period",
+			"employee": frappe.get_value("Employee", {"user_id":"employee@proofsubmission.com"}, "name"),
+			"tax_exemption_proofs": [dict(exemption_sub_category = "_Test Sub Category",
+							type_of_proof = "Test Proof",
+							exemption_category = "_Test Category",
+							amount = 100000)]
+		})
+		self.assertTrue(declaration.save)
+		self.assertTrue(declaration.submit)
+
+	def test_duplicate_category_in_proof_submission(self):
+		declaration = frappe.get_doc({
+			"doctype": "Employee Tax Exemption Proof Submission",
+			"employee": frappe.get_value("Employee", {"user_id":"employee@proofsubmission.com"}, "name"),
+			"payroll_period": "Test Payroll Period",
+			"tax_exemption_proofs": [dict(exemption_sub_category = "_Test Sub Category",
+							exemption_category = "_Test Category",
+							type_of_proof = "Test Proof",
+							amount = 100000),
+							dict(exemption_sub_category = "_Test Sub Category",
+							exemption_category = "_Test Category",
+							amount = 50000),
+							]
+		})
+		self.assertRaises(frappe.ValidationError, declaration.save)
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/__init__.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/__init__.py
rename to erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/__init__.py
diff --git a/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.json b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.json
new file mode 100644
index 0000000..4c53bd3
--- /dev/null
+++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.json
@@ -0,0 +1,66 @@
+{
+ "actions": [],
+ "creation": "2018-04-13 17:19:03.006149",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "exemption_sub_category",
+  "exemption_category",
+  "max_amount",
+  "type_of_proof",
+  "amount"
+ ],
+ "fields": [
+  {
+   "fieldname": "exemption_sub_category",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Exemption Sub Category",
+   "options": "Employee Tax Exemption Sub Category",
+   "reqd": 1
+  },
+  {
+   "fetch_from": "exemption_sub_category.exemption_category",
+   "fieldname": "exemption_category",
+   "fieldtype": "Read Only",
+   "in_list_view": 1,
+   "label": "Exemption Category",
+   "reqd": 1
+  },
+  {
+   "fetch_from": "exemption_sub_category.max_amount",
+   "fieldname": "max_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Maximum Exemption Amount",
+   "read_only": 1,
+   "reqd": 1
+  },
+  {
+   "fieldname": "type_of_proof",
+   "fieldtype": "Data",
+   "in_list_view": 1,
+   "label": "Type of Proof",
+   "reqd": 1
+  },
+  {
+   "fieldname": "amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Actual Amount"
+  }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:37:08.265600",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Employee Tax Exemption Proof Submission Detail",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py
similarity index 74%
rename from erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py
rename to erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py
index c5d1a8f..0244ae6 100644
--- a/erpnext/hr/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py
+++ b/erpnext/payroll/doctype/employee_tax_exemption_proof_submission_detail/employee_tax_exemption_proof_submission_detail.py
@@ -1,9 +1,9 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+# import frappe
 from frappe.model.document import Document
 
 class EmployeeTaxExemptionProofSubmissionDetail(Document):
diff --git a/erpnext/hr/doctype/employee_tax_exemption_sub_category/__init__.py b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_sub_category/__init__.py
rename to erpnext/payroll/doctype/employee_tax_exemption_sub_category/__init__.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.js b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.js
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.js
rename to erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.js
diff --git a/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.json b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.json
new file mode 100644
index 0000000..b89d9c1
--- /dev/null
+++ b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.json
@@ -0,0 +1,86 @@
+{
+ "actions": [],
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "Prompt",
+ "creation": "2018-05-09 12:47:26.983095",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "exemption_category",
+  "max_amount",
+  "is_active"
+ ],
+ "fields": [
+  {
+   "fieldname": "exemption_category",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "in_standard_filter": 1,
+   "label": "Tax Exemption Category",
+   "options": "Employee Tax Exemption Category",
+   "reqd": 1
+  },
+  {
+   "fetch_from": "exemption_category.max_amount",
+   "fetch_if_empty": 1,
+   "fieldname": "max_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Max Exemption Amount"
+  },
+  {
+   "default": "1",
+   "fieldname": "is_active",
+   "fieldtype": "Check",
+   "label": "Is Active"
+  }
+ ],
+ "links": [],
+ "modified": "2020-05-27 23:18:08.254645",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Employee Tax Exemption Sub Category",
+ "owner": "Administrator",
+ "permissions": [
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "System Manager",
+   "share": 1,
+   "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "HR Manager",
+   "share": 1,
+   "write": 1
+  },
+  {
+   "create": 1,
+   "delete": 1,
+   "email": 1,
+   "export": 1,
+   "print": 1,
+   "read": 1,
+   "report": 1,
+   "role": "HR User",
+   "share": 1,
+   "write": 1
+  }
+ ],
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py
rename to erpnext/payroll/doctype/employee_tax_exemption_sub_category/employee_tax_exemption_sub_category.py
diff --git a/erpnext/hr/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.js b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.js
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.js
rename to erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.js
diff --git a/erpnext/hr/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py b/erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py
similarity index 100%
rename from erpnext/hr/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py
rename to erpnext/payroll/doctype/employee_tax_exemption_sub_category/test_employee_tax_exemption_sub_category.py
diff --git a/erpnext/hr/doctype/income_tax_slab/__init__.py b/erpnext/payroll/doctype/income_tax_slab/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/income_tax_slab/__init__.py
rename to erpnext/payroll/doctype/income_tax_slab/__init__.py
diff --git a/erpnext/hr/doctype/income_tax_slab/income_tax_slab.js b/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.js
similarity index 100%
rename from erpnext/hr/doctype/income_tax_slab/income_tax_slab.js
rename to erpnext/payroll/doctype/income_tax_slab/income_tax_slab.js
diff --git a/erpnext/hr/doctype/income_tax_slab/income_tax_slab.json b/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.json
similarity index 97%
rename from erpnext/hr/doctype/income_tax_slab/income_tax_slab.json
rename to erpnext/payroll/doctype/income_tax_slab/income_tax_slab.json
index f74315f..72b4332 100644
--- a/erpnext/hr/doctype/income_tax_slab/income_tax_slab.json
+++ b/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.json
@@ -94,9 +94,9 @@
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-04-29 15:08:21.436120",
+ "modified": "2020-05-27 20:27:13.425084",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Income Tax Slab",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/income_tax_slab/income_tax_slab.py b/erpnext/payroll/doctype/income_tax_slab/income_tax_slab.py
similarity index 100%
rename from erpnext/hr/doctype/income_tax_slab/income_tax_slab.py
rename to erpnext/payroll/doctype/income_tax_slab/income_tax_slab.py
diff --git a/erpnext/hr/doctype/income_tax_slab/test_income_tax_slab.py b/erpnext/payroll/doctype/income_tax_slab/test_income_tax_slab.py
similarity index 100%
rename from erpnext/hr/doctype/income_tax_slab/test_income_tax_slab.py
rename to erpnext/payroll/doctype/income_tax_slab/test_income_tax_slab.py
diff --git a/erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py b/erpnext/payroll/doctype/income_tax_slab_other_charges/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py
rename to erpnext/payroll/doctype/income_tax_slab_other_charges/__init__.py
diff --git a/erpnext/hr/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.json b/erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.json
similarity index 95%
rename from erpnext/hr/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.json
rename to erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.json
index b23fb3d..2531c79 100644
--- a/erpnext/hr/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.json
+++ b/erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.json
@@ -15,18 +15,6 @@
  ],
  "fields": [
   {
-   "fieldname": "column_break_2",
-   "fieldtype": "Column Break"
-  },
-  {
-   "columns": 2,
-   "fieldname": "min_taxable_income",
-   "fieldtype": "Currency",
-   "in_list_view": 1,
-   "label": "Min Taxable Income",
-   "options": "Company:company:default_currency"
-  },
-  {
    "columns": 4,
    "fieldname": "description",
    "fieldtype": "Data",
@@ -35,6 +23,10 @@
    "reqd": 1
   },
   {
+   "fieldname": "column_break_2",
+   "fieldtype": "Column Break"
+  },
+  {
    "columns": 2,
    "fieldname": "percent",
    "fieldtype": "Percent",
@@ -48,6 +40,14 @@
    "label": "Conditions"
   },
   {
+   "columns": 2,
+   "fieldname": "min_taxable_income",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "Min Taxable Income",
+   "options": "Company:company:default_currency"
+  },
+  {
    "fieldname": "column_break_7",
    "fieldtype": "Column Break"
   },
@@ -62,9 +62,9 @@
  ],
  "istable": 1,
  "links": [],
- "modified": "2020-04-24 13:27:43.598967",
+ "modified": "2020-05-27 23:33:17.931912",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Income Tax Slab Other Charges",
  "owner": "Administrator",
  "permissions": [],
diff --git a/erpnext/hr/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py b/erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py
similarity index 100%
rename from erpnext/hr/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py
rename to erpnext/payroll/doctype/income_tax_slab_other_charges/income_tax_slab_other_charges.py
diff --git a/erpnext/hr/doctype/payroll_employee_detail/__init__.py b/erpnext/payroll/doctype/payroll_employee_detail/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_employee_detail/__init__.py
rename to erpnext/payroll/doctype/payroll_employee_detail/__init__.py
diff --git a/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.json b/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.json
new file mode 100644
index 0000000..b22e5de
--- /dev/null
+++ b/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.json
@@ -0,0 +1,66 @@
+{
+ "actions": [],
+ "creation": "2017-11-30 06:07:33.477781",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "employee",
+  "employee_name",
+  "column_break_3",
+  "department",
+  "designation"
+ ],
+ "fields": [
+  {
+   "fieldname": "employee",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Employee",
+   "options": "Employee",
+   "read_only": 1
+  },
+  {
+   "fetch_from": "employee.employee_name",
+   "fieldname": "employee_name",
+   "fieldtype": "Data",
+   "in_list_view": 1,
+   "label": "Employee Name",
+   "read_only": 1
+  },
+  {
+   "fieldname": "column_break_3",
+   "fieldtype": "Column Break"
+  },
+  {
+   "fetch_from": "employee.department",
+   "fieldname": "department",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Department",
+   "options": "Department",
+   "read_only": 1
+  },
+  {
+   "fetch_from": "employee.designation",
+   "fieldname": "designation",
+   "fieldtype": "Data",
+   "in_list_view": 1,
+   "label": "Designation",
+   "read_only": 1
+  }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:25:13.779032",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Payroll Employee Detail",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "read_only": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.py b/erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_employee_detail/payroll_employee_detail.py
rename to erpnext/payroll/doctype/payroll_employee_detail/payroll_employee_detail.py
diff --git a/erpnext/hr/doctype/payroll_entry/__init__.py b/erpnext/payroll/doctype/payroll_entry/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_entry/__init__.py
rename to erpnext/payroll/doctype/payroll_entry/__init__.py
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.js b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js
similarity index 95%
rename from erpnext/hr/doctype/payroll_entry/payroll_entry.js
rename to erpnext/payroll/doctype/payroll_entry/payroll_entry.js
index da25d75..1ae3553 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.js
+++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.js
@@ -84,7 +84,7 @@
 
 	add_bank_entry_button: function(frm) {
 		frappe.call({
-			method: 'erpnext.hr.doctype.payroll_entry.payroll_entry.payroll_entry_has_bank_entries',
+			method: 'erpnext.payroll.doctype.payroll_entry.payroll_entry.payroll_entry_has_bank_entries',
 			args: {
 				'name': frm.doc.name
 			},
@@ -170,7 +170,7 @@
 	set_start_end_dates: function (frm) {
 		if (!frm.doc.salary_slip_based_on_timesheet) {
 			frappe.call({
-				method: 'erpnext.hr.doctype.payroll_entry.payroll_entry.get_start_end_dates',
+				method: 'erpnext.payroll.doctype.payroll_entry.payroll_entry.get_start_end_dates',
 				args: {
 					payroll_frequency: frm.doc.payroll_frequency,
 					start_date: frm.doc.posting_date
@@ -188,7 +188,7 @@
 
 	set_end_date: function(frm){
 		frappe.call({
-			method: 'erpnext.hr.doctype.payroll_entry.payroll_entry.get_end_date',
+			method: 'erpnext.payroll.doctype.payroll_entry.payroll_entry.get_end_date',
 			args: {
 				frequency: frm.doc.payroll_frequency,
 				start_date: frm.doc.start_date
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.json b/erpnext/payroll/doctype/payroll_entry/payroll_entry.json
similarity index 98%
rename from erpnext/hr/doctype/payroll_entry/payroll_entry.json
rename to erpnext/payroll/doctype/payroll_entry/payroll_entry.json
index 9356f3e..4888be2 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.json
+++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.json
@@ -1,4 +1,5 @@
 {
+ "actions": [],
  "allow_copy": 1,
  "autoname": "HR-PRUN-.YYYY.-.#####",
  "creation": "2017-10-23 15:22:29.291323",
@@ -260,9 +261,10 @@
  ],
  "icon": "fa fa-cog",
  "is_submittable": 1,
- "modified": "2019-09-12 15:46:31.436381",
+ "links": [],
+ "modified": "2020-05-27 20:06:06.953904",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Payroll Entry",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry.py b/erpnext/payroll/doctype/payroll_entry/payroll_entry.py
similarity index 99%
rename from erpnext/hr/doctype/payroll_entry/payroll_entry.py
rename to erpnext/payroll/doctype/payroll_entry/payroll_entry.py
index 656de01..e6bb708 100644
--- a/erpnext/hr/doctype/payroll_entry/payroll_entry.py
+++ b/erpnext/payroll/doctype/payroll_entry/payroll_entry.py
@@ -55,7 +55,7 @@
 					ifnull(salary_slip_based_on_timesheet,0) = %(salary_slip_based_on_timesheet)s
 					{condition}""".format(condition=condition),
 				{"company": self.company, "salary_slip_based_on_timesheet":self.salary_slip_based_on_timesheet})
-		
+
 		if sal_struct:
 			cond += "and t2.salary_structure IN %(sal_struct)s "
 			cond += "and %(from_date)s >= t2.from_date"
@@ -154,7 +154,7 @@
 			submit_salary_slips_for_employees(self, ss_list, publish_progress=False)
 
 	def email_salary_slip(self, submitted_ss):
-		if frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee"):
+		if frappe.db.get_single_value("Payroll Settings", "email_salary_slip_to_employee"):
 			for ss in submitted_ss:
 				ss.email_salary_slip()
 
@@ -170,7 +170,7 @@
 
 	def get_salary_components(self, component_type):
 		salary_slips = self.get_sal_slip_list(ss_status = 1, as_dict = True)
-		if salary_slips:			
+		if salary_slips:
 			salary_components = frappe.db.sql("""
 				select ssd.salary_component, ssd.amount, ssd.parentfield, ss.payroll_cost_center
 				from `tabSalary Slip` ss, `tabSalary Detail` ssd
@@ -197,7 +197,7 @@
 			return account_details
 
 	def get_account(self, component_dict = None):
-		account_dict = {}		
+		account_dict = {}
 		for key, amount in component_dict.items():
 			account = self.get_salary_component_account(key[0])
 			account_dict[(account, key[1])] = account_dict.get((account, key[1]), 0) + amount
diff --git a/erpnext/hr/doctype/payroll_entry/payroll_entry_dashboard.py b/erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_entry/payroll_entry_dashboard.py
rename to erpnext/payroll/doctype/payroll_entry/payroll_entry_dashboard.py
diff --git a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.js b/erpnext/payroll/doctype/payroll_entry/test_payroll_entry.js
similarity index 100%
rename from erpnext/hr/doctype/payroll_entry/test_payroll_entry.js
rename to erpnext/payroll/doctype/payroll_entry/test_payroll_entry.js
diff --git a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py b/erpnext/payroll/doctype/payroll_entry/test_payroll_entry.py
similarity index 95%
rename from erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
rename to erpnext/payroll/doctype/payroll_entry/test_payroll_entry.py
index 3c318e7..b0f225d 100644
--- a/erpnext/hr/doctype/payroll_entry/test_payroll_entry.py
+++ b/erpnext/payroll/doctype/payroll_entry/test_payroll_entry.py
@@ -7,11 +7,11 @@
 from dateutil.relativedelta import relativedelta
 from erpnext.accounts.utils import get_fiscal_year, getdate, nowdate
 from frappe.utils import add_months
-from erpnext.hr.doctype.payroll_entry.payroll_entry import get_start_end_dates, get_end_date
+from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates, get_end_date
 from erpnext.hr.doctype.employee.test_employee import make_employee
-from erpnext.hr.doctype.salary_slip.test_salary_slip import get_salary_component_account, \
+from erpnext.payroll.doctype.salary_slip.test_salary_slip import get_salary_component_account, \
 		make_earning_salary_component, make_deduction_salary_component, create_account
-from erpnext.hr.doctype.salary_structure.test_salary_structure import make_salary_structure
+from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
 from erpnext.loan_management.doctype.loan.test_loan import create_loan, make_loan_disbursement_entry
 from erpnext.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import process_loan_interest_accrual_for_term_loans
 
@@ -24,7 +24,7 @@
 		make_earning_salary_component(setup=True, company_list=["_Test Company"])
 		make_deduction_salary_component(setup=True, company_list=["_Test Company"])
 
-		frappe.db.set_value("HR Settings", None, "email_salary_slip_to_employee", 0)
+		frappe.db.set_value("Payroll Settings", None, "email_salary_slip_to_employee", 0)
 
 	def test_payroll_entry(self): # pylint: disable=no-self-use
 		company = erpnext.get_default_company()
diff --git a/erpnext/hr/doctype/payroll_entry/test_set_salary_components.js b/erpnext/payroll/doctype/payroll_entry/test_set_salary_components.js
similarity index 100%
rename from erpnext/hr/doctype/payroll_entry/test_set_salary_components.js
rename to erpnext/payroll/doctype/payroll_entry/test_set_salary_components.js
diff --git a/erpnext/hr/doctype/payroll_period/__init__.py b/erpnext/payroll/doctype/payroll_period/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_period/__init__.py
rename to erpnext/payroll/doctype/payroll_period/__init__.py
diff --git a/erpnext/hr/doctype/payroll_period/payroll_period.js b/erpnext/payroll/doctype/payroll_period/payroll_period.js
similarity index 100%
rename from erpnext/hr/doctype/payroll_period/payroll_period.js
rename to erpnext/payroll/doctype/payroll_period/payroll_period.js
diff --git a/erpnext/hr/doctype/payroll_period/payroll_period.json b/erpnext/payroll/doctype/payroll_period/payroll_period.json
similarity index 96%
rename from erpnext/hr/doctype/payroll_period/payroll_period.json
rename to erpnext/payroll/doctype/payroll_period/payroll_period.json
index c0fa506..345a241 100644
--- a/erpnext/hr/doctype/payroll_period/payroll_period.json
+++ b/erpnext/payroll/doctype/payroll_period/payroll_period.json
@@ -53,9 +53,9 @@
   }
  ],
  "links": [],
- "modified": "2020-03-18 18:13:23.859980",
+ "modified": "2020-05-27 20:12:32.684189",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Payroll Period",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/payroll_period/payroll_period.py b/erpnext/payroll/doctype/payroll_period/payroll_period.py
similarity index 97%
rename from erpnext/hr/doctype/payroll_period/payroll_period.py
rename to erpnext/payroll/doctype/payroll_period/payroll_period.py
index 6956c38..d7893d0 100644
--- a/erpnext/hr/doctype/payroll_period/payroll_period.py
+++ b/erpnext/payroll/doctype/payroll_period/payroll_period.py
@@ -64,7 +64,7 @@
 	if len(payroll_period) > 0:
 		actual_no_of_days = date_diff(getdate(payroll_period[0][2]), getdate(payroll_period[0][1])) + 1
 		working_days = actual_no_of_days
-		if not cint(frappe.db.get_value("HR Settings", None, "include_holidays_in_total_working_days")):
+		if not cint(frappe.db.get_value("Payroll Settings", None, "include_holidays_in_total_working_days")):
 			holidays = get_holidays_for_employee(employee, getdate(payroll_period[0][1]), getdate(payroll_period[0][2]))
 			working_days -= len(holidays)
 		return payroll_period[0][0], working_days, actual_no_of_days
diff --git a/erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py b/erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_period/payroll_period_dashboard.py
rename to erpnext/payroll/doctype/payroll_period/payroll_period_dashboard.py
diff --git a/erpnext/hr/doctype/payroll_period/test_payroll_period.js b/erpnext/payroll/doctype/payroll_period/test_payroll_period.js
similarity index 100%
rename from erpnext/hr/doctype/payroll_period/test_payroll_period.js
rename to erpnext/payroll/doctype/payroll_period/test_payroll_period.js
diff --git a/erpnext/hr/doctype/payroll_period/test_payroll_period.py b/erpnext/payroll/doctype/payroll_period/test_payroll_period.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_period/test_payroll_period.py
rename to erpnext/payroll/doctype/payroll_period/test_payroll_period.py
diff --git a/erpnext/hr/doctype/payroll_period_date/__init__.py b/erpnext/payroll/doctype/payroll_period_date/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/payroll_period_date/__init__.py
rename to erpnext/payroll/doctype/payroll_period_date/__init__.py
diff --git a/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.json b/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.json
new file mode 100644
index 0000000..d745fcd
--- /dev/null
+++ b/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.json
@@ -0,0 +1,39 @@
+{
+ "actions": [],
+ "creation": "2018-04-13 15:17:30.513630",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "start_date",
+  "end_date"
+ ],
+ "fields": [
+  {
+   "fieldname": "start_date",
+   "fieldtype": "Date",
+   "in_list_view": 1,
+   "label": "Start Date",
+   "reqd": 1
+  },
+  {
+   "fieldname": "end_date",
+   "fieldtype": "Date",
+   "in_list_view": 1,
+   "label": "End Date",
+   "reqd": 1
+  }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:30:15.943356",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Payroll Period Date",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/payroll_period_date/payroll_period_date.py b/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.py
similarity index 71%
rename from erpnext/hr/doctype/payroll_period_date/payroll_period_date.py
rename to erpnext/payroll/doctype/payroll_period_date/payroll_period_date.py
index 06ecb49..a3ee269 100644
--- a/erpnext/hr/doctype/payroll_period_date/payroll_period_date.py
+++ b/erpnext/payroll/doctype/payroll_period_date/payroll_period_date.py
@@ -1,9 +1,9 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+# import frappe
 from frappe.model.document import Document
 
 class PayrollPeriodDate(Document):
diff --git a/erpnext/hr/doctype/additional_salary/__init__.py b/erpnext/payroll/doctype/payroll_settings/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/additional_salary/__init__.py
copy to erpnext/payroll/doctype/payroll_settings/__init__.py
diff --git a/erpnext/payroll/doctype/payroll_settings/payroll_settings.js b/erpnext/payroll/doctype/payroll_settings/payroll_settings.js
new file mode 100644
index 0000000..941464d
--- /dev/null
+++ b/erpnext/payroll/doctype/payroll_settings/payroll_settings.js
@@ -0,0 +1,19 @@
+// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Payroll Settings', {
+	encrypt_salary_slips_in_emails: function(frm) {
+		let encrypt_state = frm.doc.encrypt_salary_slips_in_emails;
+		frm.set_df_property('password_policy', 'reqd', encrypt_state);
+	},
+
+	validate: function(frm) {
+		let policy = frm.doc.password_policy;
+		if (policy) {
+			if (policy.includes(' ') || policy.includes('--')) {
+				frappe.msgprint(__("Password policy cannot contain spaces or simultaneous hyphens. The format will be restructured automatically"));
+			}
+			frm.set_value('password_policy', policy.split(new RegExp(" |-", 'g')).filter((token) => token).join('-'));
+		}
+	},
+});
diff --git a/erpnext/payroll/doctype/payroll_settings/payroll_settings.json b/erpnext/payroll/doctype/payroll_settings/payroll_settings.json
new file mode 100644
index 0000000..e3b8b3e
--- /dev/null
+++ b/erpnext/payroll/doctype/payroll_settings/payroll_settings.json
@@ -0,0 +1,130 @@
+{
+ "actions": [],
+ "creation": "2020-06-04 15:13:33.589685",
+ "doctype": "DocType",
+ "document_type": "Other",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "payroll_based_on",
+  "consider_unmarked_attendance_as",
+  "max_working_hours_against_timesheet",
+  "include_holidays_in_total_working_days",
+  "disable_rounded_total",
+  "column_break_11",
+  "daily_wages_fraction_for_half_day",
+  "email_salary_slip_to_employee",
+  "encrypt_salary_slips_in_emails",
+  "password_policy"
+ ],
+ "fields": [
+  {
+   "default": "Leave",
+   "fieldname": "payroll_based_on",
+   "fieldtype": "Select",
+   "label": "Calculate Payroll Working Days Based On",
+   "options": "Leave\nAttendance",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "fieldname": "max_working_hours_against_timesheet",
+   "fieldtype": "Float",
+   "label": "Max working hours against Timesheet",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "default": "0",
+   "description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day",
+   "fieldname": "include_holidays_in_total_working_days",
+   "fieldtype": "Check",
+   "label": "Include holidays in Total no. of Working Days",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "default": "0",
+   "description": "If checked, hides and disables Rounded Total field in Salary Slips",
+   "fieldname": "disable_rounded_total",
+   "fieldtype": "Check",
+   "label": "Disable Rounded Total",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "fieldname": "column_break_11",
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "default": "0.5",
+   "description": "The fraction of daily wages to be paid for half-day attendance",
+   "fieldname": "daily_wages_fraction_for_half_day",
+   "fieldtype": "Float",
+   "label": "Daily Wages Fraction for Half Day",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "default": "1",
+   "description": "Emails salary slip to employee based on preferred email selected in Employee",
+   "fieldname": "email_salary_slip_to_employee",
+   "fieldtype": "Check",
+   "label": "Email Salary Slip to Employee",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "default": "0",
+   "depends_on": "eval: doc.email_salary_slip_to_employee == 1;",
+   "description": "The salary slip emailed to the employee will be password protected, the password will be generated based on the password policy.",
+   "fieldname": "encrypt_salary_slips_in_emails",
+   "fieldtype": "Check",
+   "label": "Encrypt Salary Slips in Emails",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "depends_on": "eval: doc.encrypt_salary_slips_in_emails == 1",
+   "description": "<b>Example:</b> SAL-{first_name}-{date_of_birth.year} <br>This will generate a password like SAL-Jane-1972",
+   "fieldname": "password_policy",
+   "fieldtype": "Data",
+   "in_list_view": 1,
+   "label": "Password Policy",
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "depends_on": "eval:doc.payroll_based_on == 'Attendance'",
+   "fieldname": "consider_unmarked_attendance_as",
+   "fieldtype": "Select",
+   "label": "Consider Unmarked Attendance As",
+   "options": "Present\nAbsent",
+   "show_days": 1,
+   "show_seconds": 1
+  }
+ ],
+ "icon": "fa fa-cog",
+ "issingle": 1,
+ "links": [],
+ "modified": "2020-06-05 12:35:34.861674",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Payroll Settings",
+ "owner": "Administrator",
+ "permissions": [
+  {
+   "create": 1,
+   "email": 1,
+   "print": 1,
+   "read": 1,
+   "role": "System Manager",
+   "share": 1,
+   "write": 1
+  }
+ ],
+ "sort_field": "modified",
+ "sort_order": "ASC"
+}
\ No newline at end of file
diff --git a/erpnext/payroll/doctype/payroll_settings/payroll_settings.py b/erpnext/payroll/doctype/payroll_settings/payroll_settings.py
new file mode 100644
index 0000000..5efa41d
--- /dev/null
+++ b/erpnext/payroll/doctype/payroll_settings/payroll_settings.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe.model.document import Document
+from frappe.utils import cint
+from frappe.custom.doctype.property_setter.property_setter import make_property_setter
+from frappe import _
+
+class PayrollSettings(Document):
+	def validate(self):
+		self.validate_password_policy()
+
+		if not self.daily_wages_fraction_for_half_day:
+			self.daily_wages_fraction_for_half_day = 0.5
+
+	def validate_password_policy(self):
+		if self.email_salary_slip_to_employee and self.encrypt_salary_slips_in_emails:
+			if not self.password_policy:
+				frappe.throw(_("Password policy for Salary Slips is not set"))
+
+
+	def on_update(self):
+		self.toggle_rounded_total()
+		frappe.clear_cache()
+
+	def toggle_rounded_total(self):
+		self.disable_rounded_total = cint(self.disable_rounded_total)
+		make_property_setter("Salary Slip", "rounded_total", "hidden", self.disable_rounded_total, "Check")
+		make_property_setter("Salary Slip", "rounded_total", "print_hide", self.disable_rounded_total, "Check")
diff --git a/erpnext/payroll/doctype/payroll_settings/test_payroll_settings.py b/erpnext/payroll/doctype/payroll_settings/test_payroll_settings.py
new file mode 100644
index 0000000..314866e
--- /dev/null
+++ b/erpnext/payroll/doctype/payroll_settings/test_payroll_settings.py
@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+
+# import frappe
+import unittest
+
+class TestPayrollSettings(unittest.TestCase):
+	pass
diff --git a/erpnext/hr/doctype/retention_bonus/__init__.py b/erpnext/payroll/doctype/retention_bonus/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/retention_bonus/__init__.py
rename to erpnext/payroll/doctype/retention_bonus/__init__.py
diff --git a/erpnext/hr/doctype/retention_bonus/retention_bonus.js b/erpnext/payroll/doctype/retention_bonus/retention_bonus.js
similarity index 100%
rename from erpnext/hr/doctype/retention_bonus/retention_bonus.js
rename to erpnext/payroll/doctype/retention_bonus/retention_bonus.js
diff --git a/erpnext/hr/doctype/retention_bonus/retention_bonus.json b/erpnext/payroll/doctype/retention_bonus/retention_bonus.json
similarity index 90%
rename from erpnext/hr/doctype/retention_bonus/retention_bonus.json
rename to erpnext/payroll/doctype/retention_bonus/retention_bonus.json
index 7781053..53fe17f 100644
--- a/erpnext/hr/doctype/retention_bonus/retention_bonus.json
+++ b/erpnext/payroll/doctype/retention_bonus/retention_bonus.json
@@ -1,4 +1,5 @@
 {
+ "actions": [],
  "allow_import": 1,
  "allow_rename": 1,
  "autoname": "HR-RTB-.YYYY.-.#####",
@@ -16,8 +17,7 @@
   "column_break_6",
   "employee_name",
   "department",
-  "date_of_joining",
-  "additional_salary"
+  "date_of_joining"
  ],
  "fields": [
   {
@@ -84,14 +84,6 @@
    "read_only": 1
   },
   {
-   "fieldname": "additional_salary",
-   "fieldtype": "Link",
-   "label": "Additional Salary",
-   "no_copy": 1,
-   "options": "Additional Salary",
-   "read_only": 1
-  },
-  {
    "fieldname": "salary_component",
    "fieldtype": "Link",
    "label": "Salary Component",
@@ -100,9 +92,10 @@
   }
  ],
  "is_submittable": 1,
- "modified": "2019-09-03 16:47:24.210422",
+ "links": [],
+ "modified": "2020-05-27 22:42:05.251951",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Retention Bonus",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/retention_bonus/retention_bonus.py b/erpnext/payroll/doctype/retention_bonus/retention_bonus.py
similarity index 76%
rename from erpnext/hr/doctype/retention_bonus/retention_bonus.py
rename to erpnext/payroll/doctype/retention_bonus/retention_bonus.py
index 48637a3..ed0d36c 100644
--- a/erpnext/hr/doctype/retention_bonus/retention_bonus.py
+++ b/erpnext/payroll/doctype/retention_bonus/retention_bonus.py
@@ -17,13 +17,7 @@
 
 	def on_submit(self):
 		company = frappe.db.get_value('Employee', self.employee, 'company')
-		additional_salary = frappe.db.exists('Additional Salary', {
-				'employee': self.employee, 
-				'salary_component': self.salary_component,
-				'payroll_date': self.bonus_payment_date, 
-				'company': company,
-				'docstatus': 1
-			})
+		additional_salary = self.get_additional_salary()
 
 		if not additional_salary:
 			additional_salary = frappe.new_doc('Additional Salary')
@@ -32,8 +26,10 @@
 			additional_salary.amount = self.bonus_amount
 			additional_salary.payroll_date = self.bonus_payment_date
 			additional_salary.company = company
+			additional_salary.ref_doctype = self.doctype
+			additional_salary.ref_docname = self.name
 			additional_salary.submit()
-			self.db_set('additional_salary', additional_salary.name)
+			# self.db_set('additional_salary', additional_salary.name)
 
 		else:
 			bonus_added = frappe.db.get_value('Additional Salary', additional_salary, 'amount') + self.bonus_amount
@@ -41,11 +37,24 @@
 			self.db_set('additional_salary', additional_salary)
 
 	def on_cancel(self):
+
+		additional_salary = self.get_additional_salary()
 		if self.additional_salary:
 			bonus_removed = frappe.db.get_value('Additional Salary', self.additional_salary, 'amount') - self.bonus_amount
 			if bonus_removed == 0:
 				frappe.get_doc('Additional Salary', self.additional_salary).cancel()
 			else:
 				frappe.db.set_value('Additional Salary', self.additional_salary, 'amount', bonus_removed)
-			
-			self.db_set('additional_salary', '')
\ No newline at end of file
+
+			# self.db_set('additional_salary', '')
+
+	def get_additional_salary(self):
+		return frappe.db.exists('Additional Salary', {
+				'employee': self.employee,
+				'salary_component': self.salary_component,
+				'payroll_date': self.bonus_payment_date,
+				'company': company,
+				'docstatus': 1,
+				'ref_doctype': self.doctype,
+				'ref_docname': self.name
+			})
diff --git a/erpnext/hr/doctype/retention_bonus/test_retention_bonus.js b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.js
similarity index 100%
rename from erpnext/hr/doctype/retention_bonus/test_retention_bonus.js
rename to erpnext/payroll/doctype/retention_bonus/test_retention_bonus.js
diff --git a/erpnext/hr/doctype/retention_bonus/test_retention_bonus.py b/erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py
similarity index 100%
rename from erpnext/hr/doctype/retention_bonus/test_retention_bonus.py
rename to erpnext/payroll/doctype/retention_bonus/test_retention_bonus.py
diff --git a/erpnext/hr/doctype/salary_component/README.md b/erpnext/payroll/doctype/salary_component/README.md
similarity index 100%
rename from erpnext/hr/doctype/salary_component/README.md
rename to erpnext/payroll/doctype/salary_component/README.md
diff --git a/erpnext/hr/doctype/salary_component/__init__.py b/erpnext/payroll/doctype/salary_component/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/salary_component/__init__.py
rename to erpnext/payroll/doctype/salary_component/__init__.py
diff --git a/erpnext/hr/doctype/salary_component/salary_component.js b/erpnext/payroll/doctype/salary_component/salary_component.js
similarity index 100%
rename from erpnext/hr/doctype/salary_component/salary_component.js
rename to erpnext/payroll/doctype/salary_component/salary_component.js
diff --git a/erpnext/hr/doctype/salary_component/salary_component.json b/erpnext/payroll/doctype/salary_component/salary_component.json
similarity index 95%
rename from erpnext/hr/doctype/salary_component/salary_component.json
rename to erpnext/payroll/doctype/salary_component/salary_component.json
index 97c46c8..f1e5cf0 100644
--- a/erpnext/hr/doctype/salary_component/salary_component.json
+++ b/erpnext/payroll/doctype/salary_component/salary_component.json
@@ -16,6 +16,7 @@
   "column_break_4",
   "depends_on_payment_days",
   "is_tax_applicable",
+  "is_income_tax_component",
   "deduct_full_tax_on_selected_payroll_date",
   "variable_based_on_taxable_salary",
   "exempted_from_income_tax",
@@ -231,13 +232,22 @@
    "fieldname": "exempted_from_income_tax",
    "fieldtype": "Check",
    "label": "Exempted from Income Tax"
+  },
+  {
+   "default": "0",
+   "depends_on": "eval:doc.type == \"Deduction\"",
+   "fieldname": "is_income_tax_component",
+   "fieldtype": "Check",
+   "label": "Is Income Tax Component",
+   "show_days": 1,
+   "show_seconds": 1
   }
  ],
  "icon": "fa fa-flag",
  "links": [],
- "modified": "2020-04-28 15:46:45.252945",
+ "modified": "2020-06-01 15:39:20.826565",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Salary Component",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/salary_component/salary_component.py b/erpnext/payroll/doctype/salary_component/salary_component.py
similarity index 100%
rename from erpnext/hr/doctype/salary_component/salary_component.py
rename to erpnext/payroll/doctype/salary_component/salary_component.py
diff --git a/erpnext/hr/doctype/salary_component/test_records.json b/erpnext/payroll/doctype/salary_component/test_records.json
similarity index 100%
rename from erpnext/hr/doctype/salary_component/test_records.json
rename to erpnext/payroll/doctype/salary_component/test_records.json
diff --git a/erpnext/hr/doctype/salary_component/test_salary_component.js b/erpnext/payroll/doctype/salary_component/test_salary_component.js
similarity index 100%
rename from erpnext/hr/doctype/salary_component/test_salary_component.js
rename to erpnext/payroll/doctype/salary_component/test_salary_component.js
diff --git a/erpnext/hr/doctype/salary_component/test_salary_component.py b/erpnext/payroll/doctype/salary_component/test_salary_component.py
similarity index 100%
rename from erpnext/hr/doctype/salary_component/test_salary_component.py
rename to erpnext/payroll/doctype/salary_component/test_salary_component.py
diff --git a/erpnext/hr/doctype/salary_detail/__init__.py b/erpnext/payroll/doctype/salary_detail/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/salary_detail/__init__.py
rename to erpnext/payroll/doctype/salary_detail/__init__.py
diff --git a/erpnext/hr/doctype/salary_detail/salary_detail.json b/erpnext/payroll/doctype/salary_detail/salary_detail.json
similarity index 98%
rename from erpnext/hr/doctype/salary_detail/salary_detail.json
rename to erpnext/payroll/doctype/salary_detail/salary_detail.json
index fe5f83b..b7d2bc1 100644
--- a/erpnext/hr/doctype/salary_detail/salary_detail.json
+++ b/erpnext/payroll/doctype/salary_detail/salary_detail.json
@@ -211,13 +211,13 @@
  ],
  "istable": 1,
  "links": [],
- "modified": "2020-04-04 20:00:16.475295",
+ "modified": "2020-05-27 23:21:26.300951",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Salary Detail",
  "owner": "Administrator",
  "permissions": [],
  "quick_entry": 1,
  "sort_field": "modified",
  "sort_order": "DESC"
-}
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_detail/salary_detail.py b/erpnext/payroll/doctype/salary_detail/salary_detail.py
similarity index 100%
rename from erpnext/hr/doctype/salary_detail/salary_detail.py
rename to erpnext/payroll/doctype/salary_detail/salary_detail.py
diff --git a/erpnext/hr/doctype/salary_slip/README.md b/erpnext/payroll/doctype/salary_slip/README.md
similarity index 100%
rename from erpnext/hr/doctype/salary_slip/README.md
rename to erpnext/payroll/doctype/salary_slip/README.md
diff --git a/erpnext/hr/doctype/salary_slip/__init__.py b/erpnext/payroll/doctype/salary_slip/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/salary_slip/__init__.py
rename to erpnext/payroll/doctype/salary_slip/__init__.py
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/payroll/doctype/salary_slip/salary_slip.js
similarity index 92%
rename from erpnext/hr/doctype/salary_slip/salary_slip.js
rename to erpnext/payroll/doctype/salary_slip/salary_slip.js
index 1c4d4e3..4b623e5 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.js
@@ -56,7 +56,7 @@
 
 	set_end_date: function(frm){
 		frappe.call({
-			method: 'erpnext.hr.doctype.payroll_entry.payroll_entry.get_end_date',
+			method: 'erpnext.payroll.doctype.payroll_entry.payroll_entry.get_end_date',
 			args: {
 				frequency: frm.doc.payroll_frequency,
 				start_date: frm.doc.start_date
@@ -123,6 +123,9 @@
 			doc: frm.doc,
 			callback: function(r, rt) {
 				frm.refresh();
+				if (frm.doc.absent_days){
+					frm.fields_dict.absent_days.set_description("Unmarked Days is treated as "+ r.message +". You can can change this in " + frappe.utils.get_form_link("Payroll Settings", "Payroll Settings", true));
+				}
 			}
 		});
 	}
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/payroll/doctype/salary_slip/salary_slip.json
similarity index 70%
rename from erpnext/hr/doctype/salary_slip/salary_slip.json
rename to erpnext/payroll/doctype/salary_slip/salary_slip.json
index cfd4d89..a6337de 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.json
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.json
@@ -23,11 +23,13 @@
   "salary_slip_based_on_timesheet",
   "start_date",
   "end_date",
-  "column_break_15",
   "salary_structure",
   "payroll_frequency",
+  "column_break_15",
   "total_working_days",
+  "unmarked_days",
   "leave_without_pay",
+  "absent_days",
   "payment_days",
   "hourly_wages",
   "timesheets",
@@ -37,6 +39,7 @@
   "section_break_26",
   "bank_name",
   "bank_account_no",
+  "mode_of_payment",
   "section_break_32",
   "deduct_tax_for_unclaimed_employee_benefits",
   "deduct_tax_for_unsubmitted_tax_exemption_proof",
@@ -71,7 +74,9 @@
    "fieldtype": "Date",
    "in_list_view": 1,
    "label": "Posting Date",
-   "reqd": 1
+   "reqd": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "employee",
@@ -84,7 +89,9 @@
    "oldfieldtype": "Link",
    "options": "Employee",
    "reqd": 1,
-   "search_index": 1
+   "search_index": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fetch_from": "employee.employee_name",
@@ -95,7 +102,9 @@
    "label": "Employee Name",
    "oldfieldname": "employee_name",
    "oldfieldtype": "Data",
-   "reqd": 1
+   "reqd": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fetch_from": "employee.department",
@@ -106,7 +115,9 @@
    "oldfieldname": "department",
    "oldfieldtype": "Link",
    "options": "Department",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "depends_on": "eval:doc.designation",
@@ -115,7 +126,9 @@
    "fieldtype": "Read Only",
    "label": "Designation",
    "oldfieldname": "designation",
-   "oldfieldtype": "Link"
+   "oldfieldtype": "Link",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fetch_from": "employee.branch",
@@ -126,12 +139,16 @@
    "oldfieldname": "branch",
    "oldfieldtype": "Link",
    "options": "Branch",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break1",
    "fieldtype": "Column Break",
    "oldfieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1,
    "width": "50%"
   },
   {
@@ -139,21 +156,27 @@
    "fieldtype": "Select",
    "label": "Status",
    "options": "Draft\nSubmitted\nCancelled",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "journal_entry",
    "fieldtype": "Link",
    "label": "Journal Entry",
    "options": "Journal Entry",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "payroll_entry",
    "fieldtype": "Link",
    "label": "Payroll Entry",
    "options": "Payroll Entry",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "company",
@@ -163,7 +186,9 @@
    "label": "Company",
    "options": "Company",
    "remember_last_selected_value": 1,
-   "reqd": 1
+   "reqd": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "allow_on_submit": 1,
@@ -172,46 +197,62 @@
    "ignore_user_permissions": 1,
    "label": "Letter Head",
    "options": "Letter Head",
-   "print_hide": 1
+   "print_hide": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "section_break_10",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "salary_slip_based_on_timesheet",
    "fieldtype": "Check",
    "label": "Salary Slip Based on Timesheet",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "start_date",
    "fieldtype": "Date",
-   "label": "Start Date"
+   "label": "Start Date",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "end_date",
    "fieldtype": "Date",
-   "label": "End Date"
+   "label": "End Date",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_15",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "salary_structure",
    "fieldtype": "Link",
    "label": "Salary Structure",
    "options": "Salary Structure",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "depends_on": "eval:(!doc.salary_slip_based_on_timesheet)",
    "fieldname": "payroll_frequency",
    "fieldtype": "Select",
    "label": "Payroll Frequency",
-   "options": "\nMonthly\nFortnightly\nBimonthly\nWeekly\nDaily"
+   "options": "\nMonthly\nFortnightly\nBimonthly\nWeekly\nDaily",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "total_working_days",
@@ -220,14 +261,18 @@
    "oldfieldname": "total_days_in_month",
    "oldfieldtype": "Int",
    "read_only": 1,
-   "reqd": 1
+   "reqd": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "leave_without_pay",
    "fieldtype": "Float",
    "label": "Leave Without Pay",
    "oldfieldname": "leave_without_pay",
-   "oldfieldtype": "Currency"
+   "oldfieldtype": "Currency",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "payment_days",
@@ -236,38 +281,52 @@
    "oldfieldname": "payment_days",
    "oldfieldtype": "Float",
    "read_only": 1,
-   "reqd": 1
+   "reqd": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "hourly_wages",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "timesheets",
    "fieldtype": "Table",
    "label": "Salary Slip Timesheet",
-   "options": "Salary Slip Timesheet"
+   "options": "Salary Slip Timesheet",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_20",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "total_working_hours",
    "fieldtype": "Float",
    "label": "Total Working Hours",
-   "print_hide_if_no_value": 1
+   "print_hide_if_no_value": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "hour_rate",
    "fieldtype": "Currency",
    "label": "Hour Rate",
    "options": "Company:company:default_currency",
-   "print_hide_if_no_value": 1
+   "print_hide_if_no_value": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "section_break_26",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "bank_name",
@@ -275,7 +334,9 @@
    "label": "Bank Name",
    "oldfieldname": "bank_name",
    "oldfieldtype": "Data",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "bank_account_no",
@@ -283,35 +344,47 @@
    "label": "Bank Account No.",
    "oldfieldname": "bank_account_no",
    "oldfieldtype": "Data",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "section_break_32",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "deduct_tax_for_unclaimed_employee_benefits",
    "fieldtype": "Check",
-   "label": "Deduct Tax For Unclaimed Employee Benefits"
+   "label": "Deduct Tax For Unclaimed Employee Benefits",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "deduct_tax_for_unsubmitted_tax_exemption_proof",
    "fieldtype": "Check",
-   "label": "Deduct Tax For Unsubmitted Tax Exemption Proof"
+   "label": "Deduct Tax For Unsubmitted Tax Exemption Proof",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "earning_deduction",
    "fieldtype": "Section Break",
    "label": "Earning & Deduction",
-   "oldfieldtype": "Section Break"
+   "oldfieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "earning",
    "fieldtype": "Column Break",
    "label": "Earning",
    "oldfieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1,
    "width": "50%"
   },
   {
@@ -320,13 +393,17 @@
    "label": "Earnings",
    "oldfieldname": "earning_details",
    "oldfieldtype": "Table",
-   "options": "Salary Detail"
+   "options": "Salary Detail",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "deduction",
    "fieldtype": "Column Break",
    "label": "Deduction",
    "oldfieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1,
    "width": "50%"
   },
   {
@@ -335,12 +412,16 @@
    "label": "Deductions",
    "oldfieldname": "deduction_details",
    "oldfieldtype": "Table",
-   "options": "Salary Detail"
+   "options": "Salary Detail",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "totals",
    "fieldtype": "Section Break",
-   "oldfieldtype": "Section Break"
+   "oldfieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "gross_pay",
@@ -349,11 +430,15 @@
    "oldfieldname": "gross_pay",
    "oldfieldtype": "Currency",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_25",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "total_deduction",
@@ -362,24 +447,32 @@
    "oldfieldname": "total_deduction",
    "oldfieldtype": "Currency",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "depends_on": "total_loan_repayment",
    "fieldname": "loan_repayment",
    "fieldtype": "Section Break",
-   "label": "Loan repayment"
+   "label": "Loan repayment",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "loans",
    "fieldtype": "Table",
    "label": "Employee Loan",
    "options": "Salary Slip Loan",
-   "print_hide": 1
+   "print_hide": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "section_break_43",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
@@ -387,7 +480,9 @@
    "fieldtype": "Currency",
    "label": "Total Principal Amount",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
@@ -395,11 +490,15 @@
    "fieldtype": "Currency",
    "label": "Total Interest Amount",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_45",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
@@ -407,12 +506,16 @@
    "fieldtype": "Currency",
    "label": "Total Loan Repayment",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "net_pay_info",
    "fieldtype": "Section Break",
-   "label": "net pay info"
+   "label": "net pay info",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "description": "Gross Pay - Total Deduction - Loan Repayment",
@@ -422,11 +525,15 @@
    "oldfieldname": "net_pay",
    "oldfieldtype": "Currency",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_53",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "bold": 1,
@@ -434,11 +541,15 @@
    "fieldtype": "Currency",
    "label": "Rounded Total",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "section_break_55",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "description": "Net Pay (in words) will be visible once you save the Salary Slip.",
@@ -447,7 +558,9 @@
    "label": "Total in words",
    "oldfieldname": "net_pay_in_words",
    "oldfieldtype": "Data",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "amended_from",
@@ -459,7 +572,9 @@
    "oldfieldtype": "Data",
    "options": "Salary Slip",
    "print_hide": 1,
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fetch_from": "employee.payroll_cost_center",
@@ -468,16 +583,42 @@
    "fieldtype": "Link",
    "label": "Payroll Cost Center",
    "options": "Cost Center",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "fieldname": "mode_of_payment",
+   "fieldtype": "Select",
+   "label": "Mode Of Payment",
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "fieldname": "absent_days",
+   "fieldtype": "Float",
+   "label": "Absent Days",
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "fieldname": "unmarked_days",
+   "fieldtype": "Float",
+   "hidden": 1,
+   "label": "Unmarked days",
+   "show_days": 1,
+   "show_seconds": 1
   }
  ],
  "icon": "fa fa-file-text",
  "idx": 9,
  "is_submittable": 1,
  "links": [],
- "modified": "2020-05-05 18:55:26.173629",
+ "modified": "2020-06-05 14:42:43.921828",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Salary Slip",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/payroll/doctype/salary_slip/salary_slip.py
similarity index 91%
rename from erpnext/hr/doctype/salary_slip/salary_slip.py
rename to erpnext/payroll/doctype/salary_slip/salary_slip.py
index 4d5c843..2da19b0 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py
@@ -9,14 +9,14 @@
 from frappe.model.naming import make_autoname
 
 from frappe import msgprint, _
-from erpnext.hr.doctype.payroll_entry.payroll_entry import get_start_end_dates
+from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_start_end_dates
 from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee
 from erpnext.utilities.transaction_base import TransactionBase
 from frappe.utils.background_jobs import enqueue
-from erpnext.hr.doctype.additional_salary.additional_salary import get_additional_salary_component
-from erpnext.hr.doctype.payroll_period.payroll_period import get_period_factor, get_payroll_period
-from erpnext.hr.doctype.employee_benefit_application.employee_benefit_application import get_benefit_component_amount
-from erpnext.hr.doctype.employee_benefit_claim.employee_benefit_claim import get_benefit_claim_amount, get_last_payroll_period_benefits
+from erpnext.payroll.doctype.additional_salary.additional_salary import get_additional_salary_component
+from erpnext.payroll.doctype.payroll_period.payroll_period import get_period_factor, get_payroll_period
+from erpnext.payroll.doctype.employee_benefit_application.employee_benefit_application import get_benefit_component_amount
+from erpnext.payroll.doctype.employee_benefit_claim.employee_benefit_claim import get_benefit_claim_amount, get_last_payroll_period_benefits
 from erpnext.loan_management.doctype.loan_repayment.loan_repayment import calculate_amounts, create_repayment_entry
 
 class SalarySlip(TransactionBase):
@@ -54,8 +54,8 @@
 		total = self.net_pay if self.is_rounding_total_disabled() else self.rounded_total
 		self.total_in_words = money_in_words(total, company_currency)
 
-		if frappe.db.get_single_value("HR Settings", "max_working_hours_against_timesheet"):
-			max_working_hours = frappe.db.get_single_value("HR Settings", "max_working_hours_against_timesheet")
+		if frappe.db.get_single_value("Payroll Settings", "max_working_hours_against_timesheet"):
+			max_working_hours = frappe.db.get_single_value("Payroll Settings", "max_working_hours_against_timesheet")
 			if self.salary_slip_based_on_timesheet and (self.total_working_hours > int(max_working_hours)):
 				frappe.msgprint(_("Total working hours should not be greater than max working hours {0}").
 								format(max_working_hours), alert=True)
@@ -67,7 +67,7 @@
 			self.set_status()
 			self.update_status(self.name)
 			self.make_loan_repayment_entry()
-			if (frappe.db.get_single_value("HR Settings", "email_salary_slip_to_employee")) and not frappe.flags.via_payroll_entry:
+			if (frappe.db.get_single_value("Payroll Settings", "email_salary_slip_to_employee")) and not frappe.flags.via_payroll_entry:
 				self.email_salary_slip()
 
 	def on_cancel(self):
@@ -93,7 +93,7 @@
 			frappe.throw(_("To date cannot be before From date"))
 
 	def is_rounding_total_disabled(self):
-		return cint(frappe.db.get_single_value("HR Settings", "disable_rounded_total"))
+		return cint(frappe.db.get_single_value("Payroll Settings", "disable_rounded_total"))
 
 	def check_existing(self):
 		if not self.salary_slip_based_on_timesheet:
@@ -136,6 +136,8 @@
 				self.salary_slip_based_on_timesheet = self._salary_structure_doc.salary_slip_based_on_timesheet or 0
 				self.set_time_sheet()
 				self.pull_sal_struct()
+				consider_unmarked_attendance_as = frappe.db.get_value("Payroll Settings", None, "consider_unmarked_attendance_as") or "Present"
+				return consider_unmarked_attendance_as
 
 	def set_time_sheet(self):
 		if self.salary_slip_based_on_timesheet:
@@ -175,7 +177,7 @@
 				.format(self.employee), title=_('Salary Structure Missing'))
 
 	def pull_sal_struct(self):
-		from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
+		from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
 
 		if self.salary_slip_based_on_timesheet:
 			self.salary_structure = self._salary_structure_doc.name
@@ -188,8 +190,8 @@
 		make_salary_slip(self._salary_structure_doc.name, self)
 
 	def get_working_days_details(self, joining_date=None, relieving_date=None, lwp=None, for_preview=0):
-		payroll_based_on = frappe.db.get_value("HR Settings", None, "payroll_based_on")
-		include_holidays_in_total_working_days = frappe.db.get_single_value("HR Settings", "include_holidays_in_total_working_days")
+		payroll_based_on = frappe.db.get_value("Payroll Settings", None, "payroll_based_on")
+		include_holidays_in_total_working_days = frappe.db.get_single_value("Payroll Settings", "include_holidays_in_total_working_days")
 
 		working_days = date_diff(self.end_date, self.start_date) + 1
 		if for_preview:
@@ -198,7 +200,7 @@
 			return
 
 		holidays = self.get_holidays_for_employee(self.start_date, self.end_date)
-		
+
 		if not cint(include_holidays_in_total_working_days):
 			working_days -= len(holidays)
 			if working_days < 0:
@@ -206,9 +208,10 @@
 
 		if not payroll_based_on:
 			frappe.throw(_("Please set Payroll based on in HR settings"))
-		
+
 		if payroll_based_on == "Attendance":
-			actual_lwp = self.calculate_lwp_based_on_attendance(holidays)
+			actual_lwp, absent = self.calculate_lwp_and_absent_days_based_on_attendance(holidays)
+			self.absent_days = absent
 		else:
 			actual_lwp = self.calculate_lwp_based_on_leave_application(holidays, working_days)
 
@@ -226,9 +229,36 @@
 
 		if flt(payment_days) > flt(lwp):
 			self.payment_days = flt(payment_days) - flt(lwp)
+
+			if payroll_based_on == "Attendance":
+				self.payment_days -= flt(absent)
+
+			unmarked_days = self.get_unmarked_days()
+			consider_unmarked_attendance_as = frappe.db.get_value("Payroll Settings", None, "consider_unmarked_attendance_as") or "Present"
+
+			if payroll_based_on == "Attendance" and consider_unmarked_attendance_as =="Absent":
+				self.absent_days += unmarked_days #will be treated as absent
+				self.payment_days -= unmarked_days
+				if include_holidays_in_total_working_days:
+					self.absent_days -= len(holidays)
+					for holiday in holidays:
+						if not frappe.db.exists("Attendance", {"employee": self.employee, "attendance_date": holiday, "docstatus": 1 }):
+							self.payment_days += 1
+
+
 		else:
 			self.payment_days = 0
 
+	def get_unmarked_days(self):
+		marked_days = frappe.get_all("Attendance", filters = {
+					"attendance_date": ["between", ['2020-05-1',"2020-05-30"]],
+					"employee": 'HR-EMP-00003',
+					"docstatus": 1
+				}, fields = ["COUNT(*) as marked_days"])[0].marked_days
+
+		return self.total_working_days - marked_days
+
+
 	def get_payment_days(self, joining_date, relieving_date, include_holidays_in_total_working_days):
 		if not joining_date:
 			joining_date, relieving_date = frappe.get_cached_value("Employee", self.employee,
@@ -277,7 +307,7 @@
 		lwp = 0
 		holidays = "','".join(holidays)
 		daily_wages_fraction_for_half_day = \
-			flt(frappe.db.get_value("HR Settings", None, "daily_wages_fraction_for_half_day")) or 0.5
+			flt(frappe.db.get_value("Payroll Settings", None, "daily_wages_fraction_for_half_day")) or 0.5
 
 		for d in range(working_days):
 			dt = add_days(cstr(getdate(self.start_date)), d)
@@ -304,15 +334,15 @@
 				lwp += (1 - daily_wages_fraction_for_half_day) if is_half_day_leave else 1
 
 		return lwp
-	
-	def calculate_lwp_based_on_attendance(self, holidays):
+
+	def calculate_lwp_and_absent_days_based_on_attendance(self, holidays):
 		lwp = 0
+		absent = 0
 
 		daily_wages_fraction_for_half_day = \
-			flt(frappe.db.get_value("HR Settings", None, "daily_wages_fraction_for_half_day")) or 0.5
+			flt(frappe.db.get_value("Payroll Settings", None, "daily_wages_fraction_for_half_day")) or 0.5
 
 		lwp_leave_types = dict(frappe.get_all("Leave Type", {"is_lwp": 1}, ["name", "include_holiday"], as_list=1))
-
 		attendances = frappe.db.sql('''
 			SELECT attendance_date, status, leave_type
 			FROM `tabAttendance`
@@ -322,7 +352,7 @@
 				AND docstatus = 1
 				AND attendance_date between %s and %s
 		''', values=(self.employee, self.start_date, self.end_date), as_dict=1)
-		
+
 		for d in attendances:
 			if d.status in ('Half Day', 'On Leave') and d.leave_type and d.leave_type not in lwp_leave_types:
 				continue
@@ -332,9 +362,14 @@
 					(d.leave_type and d.leave_type in lwp_leave_types and not lwp_leave_types[d.leave_type]):
 						continue
 
-			lwp += (1 - daily_wages_fraction_for_half_day) if d.status == "Half Day" else 1
+			if d.status == "Half Day":
+				lwp += (1 - daily_wages_fraction_for_half_day)
+			elif d.status == "On Leave" and d.leave_type in lwp_leave_types:
+				lwp += 1
+			elif d.status == "Absent":
+				absent += 1
 
-		return lwp
+		return lwp, absent
 
 	def add_earning_for_hourly_wages(self, doc, salary_component, amount):
 		row_exists = False
@@ -578,7 +613,7 @@
 		# Total taxable earnings including additional and other incomes
 		total_taxable_earnings = previous_taxable_earnings + current_structured_taxable_earnings + future_structured_taxable_earnings \
 			+ current_additional_earnings + other_incomes + unclaimed_taxable_benefits - total_exemption_amount
-		
+
 		# Total taxable earnings without additional earnings with full tax
 		total_taxable_earnings_without_full_tax_addl_components = total_taxable_earnings - current_additional_earnings_with_full_tax
 
@@ -586,7 +621,7 @@
 		total_structured_tax_amount = self.calculate_tax_by_tax_slab(
 			total_taxable_earnings_without_full_tax_addl_components, tax_slab)
 		current_structured_tax_amount = (total_structured_tax_amount - previous_total_paid_taxes) / remaining_sub_periods
-		
+
 		# Total taxable earnings with additional earnings with full tax
 		full_tax_on_additional_earnings = 0.0
 		if current_additional_earnings_with_full_tax:
@@ -622,7 +657,7 @@
 			select sum(sd.amount)
 			from
 				`tabSalary Detail` sd join `tabSalary Slip` ss on sd.parent=ss.name
-			where 
+			where
 				sd.parentfield='earnings'
 				and sd.is_tax_applicable=1
 				and is_flexible_benefit=0
@@ -841,7 +876,7 @@
 
 			if flt(d.max_taxable_income) and flt(d.max_taxable_income) < tax_amount:
 				continue
-			
+
 			tax_amount += tax_amount * flt(d.percent) / 100
 
 		return tax_amount
@@ -955,13 +990,13 @@
 
 	def email_salary_slip(self):
 		receiver = frappe.db.get_value("Employee", self.employee, "prefered_email")
-		hr_settings = frappe.get_single("HR Settings")
+		payroll_settings = frappe.get_single("Payroll Settings")
 		message = "Please see attachment"
 		password = None
-		if hr_settings.encrypt_salary_slips_in_emails:
-			password = generate_password_for_pdf(hr_settings.password_policy, self.employee)
+		if payroll_settings.encrypt_salary_slips_in_emails:
+			password = generate_password_for_pdf(payroll_settings.password_policy, self.employee)
 			message += """<br>Note: Your salary slip is password protected,
-				the password to unlock the PDF is of the format {0}. """.format(hr_settings.password_policy)
+				the password to unlock the PDF is of the format {0}. """.format(payroll_settings.password_policy)
 
 		if receiver:
 			email_args = {
@@ -1004,8 +1039,9 @@
 		self.calculate_net_pay()
 
 	def pull_emp_details(self):
-		emp = frappe.db.get_value("Employee", self.employee, ["bank_name", "bank_ac_no"], as_dict=1)
+		emp = frappe.db.get_value("Employee", self.employee, ["bank_name", "bank_ac_no", "salary_mode"], as_dict=1)
 		if emp:
+			self.mode_of_payment = emp.salary_mode
 			self.bank_name = emp.bank_name
 			self.bank_account_no = emp.bank_ac_no
 
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip_list.js b/erpnext/payroll/doctype/salary_slip/salary_slip_list.js
similarity index 100%
rename from erpnext/hr/doctype/salary_slip/salary_slip_list.js
rename to erpnext/payroll/doctype/salary_slip/salary_slip_list.js
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.js b/erpnext/payroll/doctype/salary_slip/test_salary_slip.js
similarity index 100%
rename from erpnext/hr/doctype/salary_slip/test_salary_slip.js
rename to erpnext/payroll/doctype/salary_slip/test_salary_slip.js
diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
similarity index 94%
rename from erpnext/hr/doctype/salary_slip/test_salary_slip.py
rename to erpnext/payroll/doctype/salary_slip/test_salary_slip.py
index 3eff738..f42b9ad 100644
--- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
@@ -10,17 +10,17 @@
 from erpnext.accounts.utils import get_fiscal_year
 from frappe.utils.make_random import get_random
 from frappe.utils import getdate, nowdate, add_days, add_months, flt, get_first_day, get_last_day
-from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
-from erpnext.hr.doctype.payroll_entry.payroll_entry import get_month_details
+from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
+from erpnext.payroll.doctype.payroll_entry.payroll_entry import get_month_details
 from erpnext.hr.doctype.employee.test_employee import make_employee
-from erpnext.hr.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration \
+from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration \
 	import create_payroll_period, create_exemption_category
 
 class TestSalarySlip(unittest.TestCase):
 	def setUp(self):
 		setup_test()
 	def tearDown(self):
-		frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 0)
+		frappe.db.set_value("Payroll Settings", None, "include_holidays_in_total_working_days", 0)
 		frappe.set_user("Administrator")
 
 	def test_payment_days_based_on_attendance(self):
@@ -28,8 +28,8 @@
 		no_of_days = self.get_no_of_days()
 
 		# Payroll based on attendance
-		frappe.db.set_value("HR Settings", None, "payroll_based_on", "Attendance")
-		frappe.db.set_value("HR Settings", None, "daily_wages_fraction_for_half_day", 0.75)
+		frappe.db.set_value("Payroll Settings", None, "payroll_based_on", "Attendance")
+		frappe.db.set_value("Payroll Settings", None, "daily_wages_fraction_for_half_day", 0.75)
 
 		emp_id = make_employee("test_for_attendance@salary.com")
 		frappe.db.set_value("Employee", emp_id, {"relieving_date": None, "status": "Active"})
@@ -47,7 +47,7 @@
 		""", (month_start_date, month_end_date))[0][0]
 
 		mark_attendance(emp_id, first_sunday, 'Absent', ignore_validate=True) # invalid lwp
-		mark_attendance(emp_id, add_days(first_sunday, 1), 'Absent', ignore_validate=True) # valid lwp
+		mark_attendance(emp_id, add_days(first_sunday, 1), 'Absent', ignore_validate=True) # counted as absent
 		mark_attendance(emp_id, add_days(first_sunday, 2), 'Half Day', leave_type='Leave Without Pay', ignore_validate=True) # valid 0.75 lwp
 		mark_attendance(emp_id, add_days(first_sunday, 3), 'On Leave', leave_type='Leave Without Pay', ignore_validate=True) # valid lwp
 		mark_attendance(emp_id, add_days(first_sunday, 4), 'On Leave', leave_type='Casual Leave', ignore_validate=True) # invalid lwp
@@ -55,7 +55,8 @@
 
 		ss = make_employee_salary_slip("test_for_attendance@salary.com", "Monthly")
 
-		self.assertEqual(ss.leave_without_pay, 2.25)
+		self.assertEqual(ss.leave_without_pay, 1.25)
+		self.assertEqual(ss.absent_days, 1)
 
 		days_in_month = no_of_days[0]
 		no_of_holidays = no_of_days[1]
@@ -63,17 +64,17 @@
 		self.assertEqual(ss.payment_days, days_in_month - no_of_holidays - 2.25)
 
 		#Gross pay calculation based on attendances
-		gross_pay = 78000 - ((78000 / (days_in_month - no_of_holidays)) * flt(ss.leave_without_pay))
+		gross_pay = 78000 - ((78000 / (days_in_month - no_of_holidays)) * flt(ss.leave_without_pay + ss.absent_days))
 
 		self.assertEqual(ss.gross_pay, gross_pay)
 
-		frappe.db.set_value("HR Settings", None, "payroll_based_on", "Leave")
+		frappe.db.set_value("Payroll Settings", None, "payroll_based_on", "Leave")
 
 	def test_payment_days_based_on_leave_application(self):
 		no_of_days = self.get_no_of_days()
 
 		# Payroll based on attendance
-		frappe.db.set_value("HR Settings", None, "payroll_based_on", "Leave")
+		frappe.db.set_value("Payroll Settings", None, "payroll_based_on", "Leave")
 
 		emp_id = make_employee("test_for_attendance@salary.com")
 		frappe.db.set_value("Employee", emp_id, {"relieving_date": None, "status": "Active"})
@@ -106,11 +107,11 @@
 
 		self.assertEqual(ss.gross_pay, gross_pay)
 
-		frappe.db.set_value("HR Settings", None, "payroll_based_on", "Leave")
+		frappe.db.set_value("Payroll Settings", None, "payroll_based_on", "Leave")
 
 	def test_salary_slip_with_holidays_included(self):
 		no_of_days = self.get_no_of_days()
-		frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 1)
+		frappe.db.set_value("Payroll Settings", None, "include_holidays_in_total_working_days", 1)
 		make_employee("test_employee@salary.com")
 		frappe.db.set_value("Employee", frappe.get_value("Employee",
 			{"employee_name":"test_employee@salary.com"}, "name"), "relieving_date", None)
@@ -126,7 +127,7 @@
 
 	def test_salary_slip_with_holidays_excluded(self):
 		no_of_days = self.get_no_of_days()
-		frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 0)
+		frappe.db.set_value("Payroll Settings", None, "include_holidays_in_total_working_days", 0)
 		make_employee("test_employee@salary.com")
 		frappe.db.set_value("Employee", frappe.get_value("Employee",
 			{"employee_name":"test_employee@salary.com"}, "name"), "relieving_date", None)
@@ -144,7 +145,7 @@
 	def test_payment_days(self):
 		no_of_days = self.get_no_of_days()
 		# Holidays not included in working days
-		frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 1)
+		frappe.db.set_value("Payroll Settings", None, "include_holidays_in_total_working_days", 1)
 
 		# set joinng date in the same month
 		make_employee("test_employee@salary.com")
@@ -200,7 +201,7 @@
 	def test_email_salary_slip(self):
 		frappe.db.sql("delete from `tabEmail Queue`")
 
-		frappe.db.set_value("HR Settings", None, "email_salary_slip_to_employee", 1)
+		frappe.db.set_value("Payroll Settings", None, "email_salary_slip_to_employee", 1)
 
 		make_employee("test_employee@salary.com")
 		ss = make_employee_salary_slip("test_employee@salary.com", "Monthly")
@@ -270,7 +271,7 @@
 		# as per assigned salary structure 40500 in monthly salary so 236000*5/100/12
 		frappe.db.sql("""delete from `tabPayroll Period`""")
 		frappe.db.sql("""delete from `tabSalary Component`""")
-	
+
 		payroll_period = create_payroll_period()
 
 		create_tax_slab(payroll_period, allow_tax_exemption=True)
@@ -287,7 +288,7 @@
 		for doc in delete_docs:
 			frappe.db.sql("delete from `tab%s` where employee='%s'" % (doc, employee))
 
-		from erpnext.hr.doctype.salary_structure.test_salary_structure import \
+		from erpnext.payroll.doctype.salary_structure.test_salary_structure import \
 			make_salary_structure, create_salary_structure_assignment
 		salary_structure = make_salary_structure("Stucture to test tax", "Monthly",
 			other_details={"max_benefits": 100000}, test_tax=True)
@@ -378,7 +379,7 @@
 		return [no_of_days_in_month[1], no_of_holidays_in_month]
 
 def make_employee_salary_slip(user, payroll_frequency, salary_structure=None):
-	from erpnext.hr.doctype.salary_structure.test_salary_structure import make_salary_structure
+	from erpnext.payroll.doctype.salary_structure.test_salary_structure import make_salary_structure
 	if not salary_structure:
 		salary_structure = payroll_frequency + " Salary Structure Test for Salary Slip"
 
@@ -699,7 +700,7 @@
 	make_holiday_list()
 
 	frappe.db.set_value("Company", erpnext.get_default_company(), "default_holiday_list", "Salary Slip Test Holiday List")
-	frappe.db.set_value("HR Settings", None, "email_salary_slip_to_employee", 0)
+	frappe.db.set_value("Payroll Settings", None, "email_salary_slip_to_employee", 0)
 	frappe.db.set_value('HR Settings', None, 'leave_status_notification_template', None)
 	frappe.db.set_value('HR Settings', None, 'leave_approval_notification_template', None)
 
diff --git a/erpnext/hr/doctype/salary_slip_timesheet/__init__.py b/erpnext/payroll/doctype/salary_slip_timesheet/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/salary_slip_timesheet/__init__.py
rename to erpnext/payroll/doctype/salary_slip_timesheet/__init__.py
diff --git a/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.json b/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.json
new file mode 100644
index 0000000..028c195
--- /dev/null
+++ b/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.json
@@ -0,0 +1,40 @@
+{
+ "actions": [],
+ "creation": "2016-06-14 19:22:29.811658",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "time_sheet",
+  "working_hours"
+ ],
+ "fields": [
+  {
+   "fieldname": "time_sheet",
+   "fieldtype": "Link",
+   "in_list_view": 1,
+   "label": "Time Sheet",
+   "options": "Timesheet",
+   "reqd": 1
+  },
+  {
+   "fieldname": "working_hours",
+   "fieldtype": "Float",
+   "in_list_view": 1,
+   "label": "Working Hours",
+   "no_copy": 1,
+   "read_only": 1
+  }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:27:43.463532",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Salary Slip Timesheet",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.py b/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.py
similarity index 72%
rename from erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.py
rename to erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.py
index 1bbfc53..7adb12e 100644
--- a/erpnext/hr/doctype/salary_slip_timesheet/salary_slip_timesheet.py
+++ b/erpnext/payroll/doctype/salary_slip_timesheet/salary_slip_timesheet.py
@@ -1,9 +1,9 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+# import frappe
 from frappe.model.document import Document
 
 class SalarySlipTimesheet(Document):
diff --git a/erpnext/hr/doctype/salary_structure/README.md b/erpnext/payroll/doctype/salary_structure/README.md
similarity index 100%
rename from erpnext/hr/doctype/salary_structure/README.md
rename to erpnext/payroll/doctype/salary_structure/README.md
diff --git a/erpnext/hr/doctype/salary_structure/__init__.py b/erpnext/payroll/doctype/salary_structure/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/salary_structure/__init__.py
rename to erpnext/payroll/doctype/salary_structure/__init__.py
diff --git a/erpnext/payroll/doctype/salary_structure/condition_and_formula_help.html b/erpnext/payroll/doctype/salary_structure/condition_and_formula_help.html
new file mode 100644
index 0000000..e59d78d
--- /dev/null
+++ b/erpnext/payroll/doctype/salary_structure/condition_and_formula_help.html
@@ -0,0 +1,47 @@
+<h3>Variables</h3>
+<ul>
+    <li>
+        Variables from Salary Structure Assignment:<br>
+        <code>base = Base</code>, <code>variable = Variable</code> etc.
+    </li>
+    <li>
+        Variables from Employee:<br> <code>Employment Type = employment_type</code>, <code>Branch = branch</code> etc.
+    </li>
+    <li>
+        Variables Salary Slip:<br>
+        <code>Payment Days = payment_days</code>, <code>Leave without pay = leave_without_pay</code> etc.
+    </li>
+    <li>
+        Abbreviation from Salary Component:<br>
+        <code>BS = Basic Salary</code> etc.
+    </li>
+    <li>
+        Some additional variable:<br>
+        <code>gross_pay</code> and <code>annual_taxable_earning</code> can also be used.
+    </li>
+        <li>Direct Amount can also be used</li>
+</ul>
+
+<h3>Examples for Conditions and formula</h3>
+<ul>
+    <li>
+        Calculating Basic Salary based on <code>base</code>
+        <pre><code>Condition: base &lt; 10000</code></pre>
+        <pre><code>Formula: base * .2</code></pre>
+    </li>
+    <li>
+        Calculating HRA based on Basic Salary<code>BS</code>
+        <pre><code>Condition: BS &gt; 2000</code></pre>
+        <pre><code>Formula: BS * .1</code></pre>
+    </li>
+    <li>
+        Calculating TDS based on Employment Type<code>employment_type</code>
+        <pre><code>Condition: employment_type=="Intern"</code></pre>
+        <pre><code>Amount: 1000</code></pre>
+    </li>
+    <li>
+        Calculating Income Tax based on <code>annual_taxable_earning </code>
+        <pre><code>Condition: annual_taxable_earning > 20000000</code></pre>
+        <pre><code>Formula: annual_taxable_earning * 0.10 </code></pre>
+    </li>
+</ul>
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/payroll/doctype/salary_structure/salary_structure.js
similarity index 91%
rename from erpnext/hr/doctype/salary_structure/salary_structure.js
rename to erpnext/payroll/doctype/salary_structure/salary_structure.js
index 7748403..ca458f9 100755
--- a/erpnext/hr/doctype/salary_structure/salary_structure.js
+++ b/erpnext/payroll/doctype/salary_structure/salary_structure.js
@@ -14,7 +14,30 @@
 
 frappe.ui.form.on('Salary Structure', {
 	onload: function(frm) {
-		frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet),
+
+		let help_button = $(`<a class = 'control-label'>
+			Condition and Formula Help
+		</a>`).click(()=>{
+
+			let d = new frappe.ui.Dialog({
+				title: 'Condition and Formula Help',
+				fields: [
+					{
+						fieldname: 'msg_wrapper',
+						fieldtype: 'HTML'
+					}
+				]
+			});
+
+			let message_html = frappe.render_template("condition_and_formula_help")
+
+			d.fields_dict.msg_wrapper.$wrapper.append(message_html)
+
+			d.show()
+		});
+		frm.get_field("conditions_and_formula_variable_and_example").$wrapper.append(frm.doc.filters_html).append(help_button)
+
+		frm.toggle_reqd(['payroll_frequency'], !frm.doc.salary_slip_based_on_timesheet)
 
 		frm.set_query("salary_component", "earnings", function() {
 			return {
@@ -114,7 +137,7 @@
 
 	preview_salary_slip: function(frm) {
 		frappe.call({
-			method: "erpnext.hr.doctype.salary_structure.salary_structure.get_employees",
+			method: "erpnext.payroll.doctype.salary_structure.salary_structure.get_employees",
 			args: {
 				salary_structure: frm.doc.name
 			},
@@ -155,7 +178,7 @@
 	open_salary_slip: function(frm, employee){
 		var print_format = frm.doc.salary_slip_based_on_timesheet ? "Salary Slip based on Timesheet" : "Salary Slip Standard";
 		frappe.call({
-			method: "erpnext.hr.doctype.salary_structure.salary_structure.make_salary_slip",
+			method: "erpnext.payroll.doctype.salary_structure.salary_structure.make_salary_slip",
 			args: {
 				source_name: frm.doc.name,
 				employee: employee,
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.json b/erpnext/payroll/doctype/salary_structure/salary_structure.json
similarity index 71%
rename from erpnext/hr/doctype/salary_structure/salary_structure.json
rename to erpnext/payroll/doctype/salary_structure/salary_structure.json
index 58c4044..e710f6b 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.json
+++ b/erpnext/payroll/doctype/salary_structure/salary_structure.json
@@ -22,10 +22,9 @@
   "leave_encashment_amount_per_day",
   "max_benefits",
   "earning_deduction",
-  "earning",
   "earnings",
-  "deduction",
   "deductions",
+  "conditions_and_formula_variable_and_example",
   "net_pay_detail",
   "column_break2",
   "total_earning",
@@ -44,17 +43,23 @@
    "label": "Company",
    "options": "Company",
    "remember_last_selected_value": 1,
-   "reqd": 1
+   "reqd": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "letter_head",
    "fieldtype": "Link",
    "label": "Letter Head",
-   "options": "Letter Head"
+   "options": "Letter Head",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break1",
    "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1,
    "width": "50%"
   },
   {
@@ -67,7 +72,9 @@
    "oldfieldname": "is_active",
    "oldfieldtype": "Select",
    "options": "\nYes\nNo",
-   "reqd": 1
+   "reqd": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "Monthly",
@@ -75,7 +82,9 @@
    "fieldname": "payroll_frequency",
    "fieldtype": "Select",
    "label": "Payroll Frequency",
-   "options": "\nMonthly\nFortnightly\nBimonthly\nWeekly\nDaily"
+   "options": "\nMonthly\nFortnightly\nBimonthly\nWeekly\nDaily",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "No",
@@ -86,46 +95,62 @@
    "no_copy": 1,
    "options": "Yes\nNo",
    "print_hide": 1,
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "time_sheet_earning_detail",
-   "fieldtype": "Section Break"
+   "fieldtype": "Section Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "default": "0",
    "fieldname": "salary_slip_based_on_timesheet",
    "fieldtype": "Check",
-   "label": "Salary Slip Based on Timesheet"
+   "label": "Salary Slip Based on Timesheet",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_17",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "description": "Salary Component for timesheet based payroll.",
    "fieldname": "salary_component",
    "fieldtype": "Link",
    "label": "Salary Component",
-   "options": "Salary Component"
+   "options": "Salary Component",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "hour_rate",
    "fieldtype": "Currency",
    "label": "Hour Rate",
-   "options": "Company:company:default_currency"
+   "options": "Company:company:default_currency",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "leave_encashment_amount_per_day",
    "fieldtype": "Currency",
    "label": "Leave Encashment Amount Per Day",
-   "options": "Company:company:default_currency"
+   "options": "Company:company:default_currency",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "max_benefits",
    "fieldtype": "Currency",
    "label": "Max Benefits (Amount)",
-   "options": "Company:company:default_currency"
+   "options": "Company:company:default_currency",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "description": "Salary breakup based on Earning and Deduction.",
@@ -133,15 +158,9 @@
    "fieldtype": "Section Break",
    "oldfieldname": "earning_deduction",
    "oldfieldtype": "Section Break",
-   "precision": "2"
-  },
-  {
-   "fieldname": "earning",
-   "fieldtype": "Section Break",
-   "label": "Earning",
-   "oldfieldname": "col_brk2",
-   "oldfieldtype": "Column Break",
-   "width": "50%"
+   "precision": "2",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "earnings",
@@ -149,15 +168,9 @@
    "label": "Earnings",
    "oldfieldname": "earning_details",
    "oldfieldtype": "Table",
-   "options": "Salary Detail"
-  },
-  {
-   "fieldname": "deduction",
-   "fieldtype": "Section Break",
-   "label": "Deduction",
-   "oldfieldname": "col_brk3",
-   "oldfieldtype": "Column Break",
-   "width": "50%"
+   "options": "Salary Detail",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "deductions",
@@ -165,16 +178,22 @@
    "label": "Deductions",
    "oldfieldname": "deduction_details",
    "oldfieldtype": "Table",
-   "options": "Salary Detail"
+   "options": "Salary Detail",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "net_pay_detail",
    "fieldtype": "Section Break",
-   "options": "Simple"
+   "options": "Simple",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break2",
    "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1,
    "width": "50%"
   },
   {
@@ -185,7 +204,9 @@
    "oldfieldname": "total_earning",
    "oldfieldtype": "Currency",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "total_deduction",
@@ -195,7 +216,9 @@
    "oldfieldname": "total_deduction",
    "oldfieldtype": "Currency",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "net_pay",
@@ -203,28 +226,38 @@
    "hidden": 1,
    "label": "Net Pay",
    "options": "Company:company:default_currency",
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "account",
    "fieldtype": "Section Break",
-   "label": "Account"
+   "label": "Account",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "mode_of_payment",
    "fieldtype": "Link",
    "label": "Mode of Payment",
-   "options": "Mode of Payment"
+   "options": "Mode of Payment",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "column_break_28",
-   "fieldtype": "Column Break"
+   "fieldtype": "Column Break",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "payment_account",
    "fieldtype": "Link",
    "label": "Payment Account",
-   "options": "Account"
+   "options": "Account",
+   "show_days": 1,
+   "show_seconds": 1
   },
   {
    "fieldname": "amended_from",
@@ -233,16 +266,25 @@
    "no_copy": 1,
    "options": "Salary Structure",
    "print_hide": 1,
-   "read_only": 1
+   "read_only": 1,
+   "show_days": 1,
+   "show_seconds": 1
+  },
+  {
+   "fieldname": "conditions_and_formula_variable_and_example",
+   "fieldtype": "HTML",
+   "label": "Conditions and Formula variable and example",
+   "show_days": 1,
+   "show_seconds": 1
   }
  ],
  "icon": "fa fa-file-text",
  "idx": 1,
  "is_submittable": 1,
  "links": [],
- "modified": "2019-12-31 16:34:35.087658",
+ "modified": "2020-06-05 17:07:26.129355",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Salary Structure",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/payroll/doctype/salary_structure/salary_structure.py
similarity index 100%
rename from erpnext/hr/doctype/salary_structure/salary_structure.py
rename to erpnext/payroll/doctype/salary_structure/salary_structure.py
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py b/erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py
similarity index 100%
rename from erpnext/hr/doctype/salary_structure/salary_structure_dashboard.py
rename to erpnext/payroll/doctype/salary_structure/salary_structure_dashboard.py
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.js b/erpnext/payroll/doctype/salary_structure/test_salary_structure.js
similarity index 100%
rename from erpnext/hr/doctype/salary_structure/test_salary_structure.js
rename to erpnext/payroll/doctype/salary_structure/test_salary_structure.js
diff --git a/erpnext/hr/doctype/salary_structure/test_salary_structure.py b/erpnext/payroll/doctype/salary_structure/test_salary_structure.py
similarity index 94%
rename from erpnext/hr/doctype/salary_structure/test_salary_structure.py
rename to erpnext/payroll/doctype/salary_structure/test_salary_structure.py
index eb5311e..e04fda8 100644
--- a/erpnext/hr/doctype/salary_structure/test_salary_structure.py
+++ b/erpnext/payroll/doctype/salary_structure/test_salary_structure.py
@@ -7,11 +7,11 @@
 import erpnext
 from frappe.utils.make_random import get_random
 from frappe.utils import nowdate, add_days, add_years, getdate, add_months
-from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
-from erpnext.hr.doctype.salary_slip.test_salary_slip import make_earning_salary_component,\
+from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
+from erpnext.payroll.doctype.salary_slip.test_salary_slip import make_earning_salary_component,\
 	make_deduction_salary_component, make_employee_salary_slip, create_tax_slab
 from erpnext.hr.doctype.employee.test_employee import make_employee
-from erpnext.hr.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_payroll_period
+from erpnext.payroll.doctype.employee_tax_exemption_declaration.test_employee_tax_exemption_declaration import create_payroll_period
 
 
 test_dependencies = ["Fiscal Year"]
@@ -62,7 +62,7 @@
 		self.assertEqual(assignment.base * 0.2, ss.deductions[0].amount)
 
 	def test_amount_totals(self):
-		frappe.db.set_value("HR Settings", None, "include_holidays_in_total_working_days", 0)
+		frappe.db.set_value("Payroll Settings", None, "include_holidays_in_total_working_days", 0)
 		sal_slip = frappe.get_value("Salary Slip", {"employee_name":"test_employee_2@salary.com"})
 		if not sal_slip:
 			sal_slip = make_employee_salary_slip("test_employee_2@salary.com", "Monthly", "Salary Structure Sample")
@@ -128,7 +128,7 @@
 		salary_structure_doc.insert()
 		if not dont_submit:
 			salary_structure_doc.submit()
-		
+
 	else:
 		salary_structure_doc = frappe.get_doc("Salary Structure", salary_structure)
 
diff --git a/erpnext/hr/doctype/salary_structure_assignment/__init__.py b/erpnext/payroll/doctype/salary_structure_assignment/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/salary_structure_assignment/__init__.py
rename to erpnext/payroll/doctype/salary_structure_assignment/__init__.py
diff --git a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.js b/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.js
similarity index 100%
rename from erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.js
rename to erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.js
diff --git a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.json b/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.json
similarity index 97%
rename from erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.json
rename to erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.json
index 0098aa8..4f74a7f 100644
--- a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.json
+++ b/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.json
@@ -124,9 +124,9 @@
  ],
  "is_submittable": 1,
  "links": [],
- "modified": "2020-04-25 18:24:23.617088",
+ "modified": "2020-05-27 19:58:09.964692",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Salary Structure Assignment",
  "owner": "Administrator",
  "permissions": [
diff --git a/erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py b/erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py
similarity index 100%
rename from erpnext/hr/doctype/salary_structure_assignment/salary_structure_assignment.py
rename to erpnext/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py
diff --git a/erpnext/hr/doctype/salary_structure_assignment/test_salary_structure_assignment.js b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.js
similarity index 100%
rename from erpnext/hr/doctype/salary_structure_assignment/test_salary_structure_assignment.js
rename to erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.js
diff --git a/erpnext/hr/doctype/salary_structure_assignment/test_salary_structure_assignment.py b/erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py
similarity index 100%
rename from erpnext/hr/doctype/salary_structure_assignment/test_salary_structure_assignment.py
rename to erpnext/payroll/doctype/salary_structure_assignment/test_salary_structure_assignment.py
diff --git a/erpnext/hr/doctype/taxable_salary_slab/__init__.py b/erpnext/payroll/doctype/taxable_salary_slab/__init__.py
similarity index 100%
rename from erpnext/hr/doctype/taxable_salary_slab/__init__.py
rename to erpnext/payroll/doctype/taxable_salary_slab/__init__.py
diff --git a/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.json b/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.json
new file mode 100644
index 0000000..277576e
--- /dev/null
+++ b/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.json
@@ -0,0 +1,64 @@
+{
+ "actions": [],
+ "creation": "2018-04-13 17:42:13.516032",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+  "from_amount",
+  "to_amount",
+  "percent_deduction",
+  "condition",
+  "column_break_5",
+  "html_6"
+ ],
+ "fields": [
+  {
+   "fieldname": "from_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "From Amount",
+   "reqd": 1
+  },
+  {
+   "fieldname": "to_amount",
+   "fieldtype": "Currency",
+   "in_list_view": 1,
+   "label": "To Amount"
+  },
+  {
+   "fieldname": "percent_deduction",
+   "fieldtype": "Percent",
+   "in_list_view": 1,
+   "label": "Percent Deduction",
+   "reqd": 1
+  },
+  {
+   "fieldname": "condition",
+   "fieldtype": "Code",
+   "in_list_view": 1,
+   "label": "Condition"
+  },
+  {
+   "fieldname": "column_break_5",
+   "fieldtype": "Column Break"
+  },
+  {
+   "fieldname": "html_6",
+   "fieldtype": "HTML",
+   "options": "<h4>Condition Examples</h4>\n<ol>\n<li>Applying tax if employee born between 31-12-1937 and 01-01-1958 (Employees aged 60 to 80)<br>\n<code>Condition: date_of_birth&gt;date(1937, 12, 31) and date_of_birth&lt;date(1958, 01, 01)</code></li><br><li>Applying tax by employee gender<br>\n<code>Condition: gender==\"Male\"</code></li><br>\n<li>Applying tax by Salary Component<br>\n<code>Condition: base &gt; 10000</code></li></ol>"
+  }
+ ],
+ "istable": 1,
+ "links": [],
+ "modified": "2020-05-27 23:32:47.253106",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Taxable Salary Slab",
+ "owner": "Administrator",
+ "permissions": [],
+ "quick_entry": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "track_changes": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/taxable_salary_slab/taxable_salary_slab.py b/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.py
similarity index 71%
rename from erpnext/hr/doctype/taxable_salary_slab/taxable_salary_slab.py
rename to erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.py
index 23e5ffb..49c5255 100644
--- a/erpnext/hr/doctype/taxable_salary_slab/taxable_salary_slab.py
+++ b/erpnext/payroll/doctype/taxable_salary_slab/taxable_salary_slab.py
@@ -1,9 +1,9 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
-import frappe
+# import frappe
 from frappe.model.document import Document
 
 class TaxableSalarySlab(Document):
diff --git a/erpnext/payroll/module_onboarding/payroll/payroll.json b/erpnext/payroll/module_onboarding/payroll/payroll.json
new file mode 100644
index 0000000..a4ea536
--- /dev/null
+++ b/erpnext/payroll/module_onboarding/payroll/payroll.json
@@ -0,0 +1,51 @@
+{
+ "allow_roles": [
+  {
+   "role": "HR Manager"
+  },
+  {
+   "role": "HR User"
+  }
+ ],
+ "creation": "2020-06-01 12:10:52.560472",
+ "docstatus": 0,
+ "doctype": "Module Onboarding",
+ "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/human-resources/payroll-entry",
+ "idx": 0,
+ "is_complete": 0,
+ "modified": "2020-06-04 16:35:30.650792",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Payroll",
+ "owner": "Administrator",
+ "steps": [
+  {
+   "step": "Create Employee"
+  },
+  {
+   "step": "Create Salary Component"
+  },
+  {
+   "step": "Create Payroll Period"
+  },
+  {
+   "step": "Create Income Tax Slab"
+  },
+  {
+   "step": "Create Salary Structure"
+  },
+  {
+   "step": "Assign Salary Structure"
+  },
+  {
+   "step": "Create Salary Slip"
+  },
+  {
+   "step": "Payroll Settings"
+  }
+ ],
+ "subtitle": "Salary, Compensations and more.",
+ "success_message": "The Payroll is all set up!",
+ "title": "Let's Setup the Payroll Module. ",
+ "user_can_dismiss": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/notification/as b/erpnext/payroll/notification/as
new file mode 100644
index 0000000..7a39557
--- /dev/null
+++ b/erpnext/payroll/notification/as
@@ -0,0 +1 @@
+update from `tabNotification` set module='Payroll' where name = "Retention Bonus"
\ No newline at end of file
diff --git a/erpnext/hr/notification/retention_bonus/__init__.py b/erpnext/payroll/notification/retention_bonus/__init__.py
similarity index 100%
rename from erpnext/hr/notification/retention_bonus/__init__.py
rename to erpnext/payroll/notification/retention_bonus/__init__.py
diff --git a/erpnext/hr/notification/retention_bonus/retention_bonus.json b/erpnext/payroll/notification/retention_bonus/retention_bonus.json
similarity index 86%
rename from erpnext/hr/notification/retention_bonus/retention_bonus.json
rename to erpnext/payroll/notification/retention_bonus/retention_bonus.json
index cbc8e2d..50db033 100644
--- a/erpnext/hr/notification/retention_bonus/retention_bonus.json
+++ b/erpnext/payroll/notification/retention_bonus/retention_bonus.json
@@ -13,10 +13,10 @@
  "is_standard": 1,
  "message": "<p>{{ _(\"Hello\") }},</p>\n\n<p> {{ _(\"Retention Bonus for\") }} {{ doc.employee_name }} {{ _(\"due on\") }} {{ doc.bonus_payment_date }}</p>",
  "modified": "2018-05-15 19:00:24.294418",
- "modified_by": "ranjith@earthianslive.com",
- "module": "HR",
+ "modified_by": "Administrator",
+ "module": "Payroll",
  "name": "Retention Bonus",
- "owner": "ranjith@earthianslive.com",
+ "owner": "Administrator",
  "recipients": [
   {
    "email_by_role": "HR Manager"
diff --git a/erpnext/hr/notification/retention_bonus/retention_bonus.md b/erpnext/payroll/notification/retention_bonus/retention_bonus.md
similarity index 100%
rename from erpnext/hr/notification/retention_bonus/retention_bonus.md
rename to erpnext/payroll/notification/retention_bonus/retention_bonus.md
diff --git a/erpnext/hr/notification/retention_bonus/retention_bonus.py b/erpnext/payroll/notification/retention_bonus/retention_bonus.py
similarity index 100%
rename from erpnext/hr/notification/retention_bonus/retention_bonus.py
rename to erpnext/payroll/notification/retention_bonus/retention_bonus.py
diff --git a/erpnext/payroll/onboarding_step/assign_salary_structure/assign_salary_structure.json b/erpnext/payroll/onboarding_step/assign_salary_structure/assign_salary_structure.json
new file mode 100644
index 0000000..8a07b10
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/assign_salary_structure/assign_salary_structure.json
@@ -0,0 +1,19 @@
+{
+ "action": "Create Entry",
+ "creation": "2020-06-01 11:58:43.927590",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 1,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-06-01 11:58:43.927590",
+ "modified_by": "Administrator",
+ "name": "Assign Salary Structure",
+ "owner": "Administrator",
+ "reference_document": "Salary Structure Assignment",
+ "show_full_form": 1,
+ "title": "Assign Salary Structure",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/onboarding_step/create_employee/create_employee.json b/erpnext/payroll/onboarding_step/create_employee/create_employee.json
new file mode 100644
index 0000000..5839ae6
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/create_employee/create_employee.json
@@ -0,0 +1,19 @@
+{
+ "action": "Create Entry",
+ "creation": "2020-05-14 11:43:25.561152",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 1,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-05-14 12:26:28.629074",
+ "modified_by": "Administrator",
+ "name": "Create Employee",
+ "owner": "Administrator",
+ "reference_document": "Employee",
+ "show_full_form": 0,
+ "title": "Create Employee",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/onboarding_step/create_income_tax_slab/create_income_tax_slab.json b/erpnext/payroll/onboarding_step/create_income_tax_slab/create_income_tax_slab.json
new file mode 100644
index 0000000..faada7e
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/create_income_tax_slab/create_income_tax_slab.json
@@ -0,0 +1,19 @@
+{
+ "action": "Create Entry",
+ "creation": "2020-06-01 11:54:54.823796",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 0,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-06-01 11:54:54.823796",
+ "modified_by": "Administrator",
+ "name": "Create Income Tax Slab",
+ "owner": "Administrator",
+ "reference_document": "Income Tax Slab",
+ "show_full_form": 1,
+ "title": "Create Income Tax Slab",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json b/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json
new file mode 100644
index 0000000..4bae675
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/create_payroll_period/create_payroll_period.json
@@ -0,0 +1,19 @@
+{
+ "action": "Create Entry",
+ "creation": "2020-06-01 11:53:54.553947",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 1,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-06-01 11:53:54.553947",
+ "modified_by": "Administrator",
+ "name": "Create Payroll Period",
+ "owner": "Administrator",
+ "reference_document": "Payroll Period",
+ "show_full_form": 0,
+ "title": "Create Payroll Period",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/onboarding_step/create_salary_component/create_salary_component.json b/erpnext/payroll/onboarding_step/create_salary_component/create_salary_component.json
new file mode 100644
index 0000000..002d819
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/create_salary_component/create_salary_component.json
@@ -0,0 +1,19 @@
+{
+ "action": "Create Entry",
+ "creation": "2020-06-01 11:57:04.002073",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 0,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-06-01 11:57:04.002073",
+ "modified_by": "Administrator",
+ "name": "Create Salary Component",
+ "owner": "Administrator",
+ "reference_document": "Salary Component",
+ "show_full_form": 1,
+ "title": "Create Salary Component",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/onboarding_step/create_salary_slip/create_salary_slip.json b/erpnext/payroll/onboarding_step/create_salary_slip/create_salary_slip.json
new file mode 100644
index 0000000..2aa31f4
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/create_salary_slip/create_salary_slip.json
@@ -0,0 +1,19 @@
+{
+ "action": "Create Entry",
+ "creation": "2020-06-01 11:59:29.972393",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 1,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-06-01 11:59:29.972393",
+ "modified_by": "Administrator",
+ "name": "Create Salary Slip",
+ "owner": "Administrator",
+ "reference_document": "Salary Slip",
+ "show_full_form": 1,
+ "title": "Create Salary Slip",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/onboarding_step/create_salary_structure/create_salary_structure.json b/erpnext/payroll/onboarding_step/create_salary_structure/create_salary_structure.json
new file mode 100644
index 0000000..11d8327
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/create_salary_structure/create_salary_structure.json
@@ -0,0 +1,19 @@
+{
+ "action": "Create Entry",
+ "creation": "2020-06-01 11:57:54.527808",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 1,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-06-01 11:57:54.527808",
+ "modified_by": "Administrator",
+ "name": "Create Salary Structure",
+ "owner": "Administrator",
+ "reference_document": "Salary Structure",
+ "show_full_form": 1,
+ "title": "Create Salary Structure",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json b/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json
new file mode 100644
index 0000000..946b8c8
--- /dev/null
+++ b/erpnext/payroll/onboarding_step/payroll_settings/payroll_settings.json
@@ -0,0 +1,19 @@
+{
+ "action": "Go to Page",
+ "creation": "2020-06-04 16:34:29.664917",
+ "docstatus": 0,
+ "doctype": "Onboarding Step",
+ "idx": 0,
+ "is_complete": 0,
+ "is_mandatory": 0,
+ "is_single": 0,
+ "is_skipped": 0,
+ "modified": "2020-06-04 16:34:29.664917",
+ "modified_by": "Administrator",
+ "name": "Payroll Settings",
+ "owner": "Administrator",
+ "path": "#Form/Payroll Settings",
+ "show_full_form": 0,
+ "title": "Payroll Settings",
+ "validate_action": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/print_format/salary_slip_based_on_timesheet/__init__.py b/erpnext/payroll/print_format/salary_slip_based_on_timesheet/__init__.py
similarity index 100%
rename from erpnext/hr/print_format/salary_slip_based_on_timesheet/__init__.py
rename to erpnext/payroll/print_format/salary_slip_based_on_timesheet/__init__.py
diff --git a/erpnext/hr/print_format/salary_slip_based_on_timesheet/salary_slip_based_on_timesheet.json b/erpnext/payroll/print_format/salary_slip_based_on_timesheet/salary_slip_based_on_timesheet.json
similarity index 100%
rename from erpnext/hr/print_format/salary_slip_based_on_timesheet/salary_slip_based_on_timesheet.json
rename to erpnext/payroll/print_format/salary_slip_based_on_timesheet/salary_slip_based_on_timesheet.json
diff --git a/erpnext/hr/print_format/salary_slip_standard/__init__.py b/erpnext/payroll/print_format/salary_slip_standard/__init__.py
similarity index 100%
rename from erpnext/hr/print_format/salary_slip_standard/__init__.py
rename to erpnext/payroll/print_format/salary_slip_standard/__init__.py
diff --git a/erpnext/hr/print_format/salary_slip_standard/salary_slip_standard.json b/erpnext/payroll/print_format/salary_slip_standard/salary_slip_standard.json
similarity index 100%
rename from erpnext/hr/print_format/salary_slip_standard/salary_slip_standard.json
rename to erpnext/payroll/print_format/salary_slip_standard/salary_slip_standard.json
diff --git a/erpnext/hr/doctype/income_tax_slab/__init__.py b/erpnext/payroll/report/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/income_tax_slab/__init__.py
copy to erpnext/payroll/report/__init__.py
diff --git a/erpnext/hr/report/bank_remittance/__init__.py b/erpnext/payroll/report/bank_remittance/__init__.py
similarity index 100%
rename from erpnext/hr/report/bank_remittance/__init__.py
rename to erpnext/payroll/report/bank_remittance/__init__.py
diff --git a/erpnext/hr/report/bank_remittance/bank_remittance.js b/erpnext/payroll/report/bank_remittance/bank_remittance.js
similarity index 68%
rename from erpnext/hr/report/bank_remittance/bank_remittance.js
rename to erpnext/payroll/report/bank_remittance/bank_remittance.js
index 1e10f24..6482ed3 100644
--- a/erpnext/hr/report/bank_remittance/bank_remittance.js
+++ b/erpnext/payroll/report/bank_remittance/bank_remittance.js
@@ -5,12 +5,12 @@
 frappe.query_reports["Bank Remittance"] = {
 	"filters": [
 		{
-			"fieldname":"company",
-			"label": __("Company"),
-			"fieldtype": "Link",
-			"options": "Company",
-			"default": frappe.defaults.get_user_default("Company"),
-			"reqd": 1
+			fieldname:"company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			default: frappe.defaults.get_user_default("Company"),
+			reqd: 1
 		},
 		{
 			fieldname:"from_date",
diff --git a/erpnext/hr/report/bank_remittance/bank_remittance.json b/erpnext/payroll/report/bank_remittance/bank_remittance.json
similarity index 87%
rename from erpnext/hr/report/bank_remittance/bank_remittance.json
rename to erpnext/payroll/report/bank_remittance/bank_remittance.json
index b8aa4e9..2a697b2 100644
--- a/erpnext/hr/report/bank_remittance/bank_remittance.json
+++ b/erpnext/payroll/report/bank_remittance/bank_remittance.json
@@ -7,9 +7,9 @@
  "doctype": "Report",
  "idx": 0,
  "is_standard": "Yes",
- "modified": "2019-04-26 16:57:52.558895",
+ "modified": "2020-05-28 00:08:08.097494",
  "modified_by": "Administrator",
- "module": "HR",
+ "module": "Payroll",
  "name": "Bank Remittance",
  "owner": "Administrator",
  "prepared_report": 0,
diff --git a/erpnext/hr/report/bank_remittance/bank_remittance.py b/erpnext/payroll/report/bank_remittance/bank_remittance.py
similarity index 96%
rename from erpnext/hr/report/bank_remittance/bank_remittance.py
rename to erpnext/payroll/report/bank_remittance/bank_remittance.py
index b2d2c53..a35d8e5 100644
--- a/erpnext/hr/report/bank_remittance/bank_remittance.py
+++ b/erpnext/payroll/report/bank_remittance/bank_remittance.py
@@ -125,7 +125,10 @@
 
 	# appending company debit accounts
 	for slip in salary_slips:
-		slip["debit_acc_no"] = payroll_entry_map[slip.payroll_entry]['company_account']
+		if slip.payroll_entry:
+			slip["debit_acc_no"] = payroll_entry_map[slip.payroll_entry]['company_account']
+		else:
+			slip["debit_acc_no"] = None
 
 	return salary_slips
 
diff --git a/erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py b/erpnext/payroll/report/income_tax_deductions/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py
copy to erpnext/payroll/report/income_tax_deductions/__init__.py
diff --git a/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.js b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.js
new file mode 100644
index 0000000..4bbb7f6
--- /dev/null
+++ b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.js
@@ -0,0 +1,7 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.require("assets/erpnext/js/salary_slip_deductions_report_filters.js", function() {
+	frappe.query_reports["Income Tax Deductions"] = erpnext.salary_slip_deductions_report_filters;
+});
\ No newline at end of file
diff --git a/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.json b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.json
new file mode 100644
index 0000000..cf80398
--- /dev/null
+++ b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.json
@@ -0,0 +1,30 @@
+{
+ "add_total_row": 0,
+ "creation": "2020-05-30 00:07:56.744372",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2020-05-30 00:07:56.744372",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Income Tax Deductions",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Salary Slip",
+ "report_name": "Income Tax Deductions",
+ "report_type": "Script Report",
+ "roles": [
+  {
+   "role": "HR User"
+  },
+  {
+   "role": "HR Manager"
+  },
+  {
+   "role": "Employee"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.py b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.py
new file mode 100644
index 0000000..3bad587
--- /dev/null
+++ b/erpnext/payroll/report/income_tax_deductions/income_tax_deductions.py
@@ -0,0 +1,127 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe, erpnext
+from frappe import _
+
+def execute(filters=None):
+	columns = get_columns(filters)
+	data = get_data(filters)
+
+	return columns, data
+
+def get_columns(filters):
+	columns = [
+		{
+			"label": _("Employee"),
+			"options": "Employee",
+			"fieldname": "employee",
+			"fieldtype": "Link",
+			"width": 200
+		},
+		{
+			"label": _("Employee Name"),
+			"options": "Employee",
+			"fieldname": "employee_name",
+			"fieldtype": "Link",
+			"width": 160
+		}]
+
+	if erpnext.get_region() == "India":
+		columns.append({
+			"label": _("PAN Number"),
+			"fieldname": "pan_number",
+			"fieldtype": "Data",
+			"width": 140
+		})
+
+	columns += [{
+			"label": _("Income Tax Component"),
+			"fieldname": "it_comp",
+			"fieldtype": "Data",
+			"width": 170
+		},
+		{
+			"label": _("Income Tax Amount"),
+			"fieldname": "it_amount",
+			"fieldtype": "Currency",
+			"options": "currency",
+			"width": 140
+		},
+		{
+			"label": _("Gross Pay"),
+			"fieldname": "gross_pay",
+			"fieldtype": "Currency",
+			"options": "currency",
+			"width": 140
+		},
+		{
+			"label": _("Posting Date"),
+			"fieldname": "posting_date",
+			"fieldtype": "Date",
+			"width": 140
+		}
+	]
+
+	return columns
+
+def get_conditions(filters):
+	conditions = [""]
+
+	if filters.get("department"):
+		conditions.append("sal.department = '%s' " % (filters["department"]) )
+
+	if filters.get("branch"):
+		conditions.append("sal.branch = '%s' " % (filters["branch"]) )
+
+	if filters.get("company"):
+		conditions.append("sal.company = '%s' " % (filters["company"]) )
+
+	if filters.get("period"):
+		conditions.append("month(sal.start_date) = '%s' " % (filters["period"]))
+
+	return " and ".join(conditions)
+
+
+def get_data(filters):
+
+	data = []
+
+	if erpnext.get_region() == "India":
+		employee_pan_dict = frappe._dict(frappe.db.sql(""" select employee, pan_number from `tabEmployee`"""))
+
+	component_types = frappe.db.sql(""" select name from `tabSalary Component`
+		where is_income_tax_component = 1 """)
+
+	component_types = [comp_type[0] for comp_type in component_types]
+
+	conditions = get_conditions(filters)
+
+	entry = frappe.db.sql(""" select sal.employee, sal.employee_name, sal.posting_date, ded.salary_component, ded.amount,sal.gross_pay
+		from `tabSalary Slip` sal, `tabSalary Detail` ded
+		where sal.name = ded.parent
+		and ded.parentfield = 'deductions'
+		and ded.parenttype = 'Salary Slip'
+		and sal.docstatus = 1 %s
+		and ded.salary_component in (%s)
+	""" % (conditions , ", ".join(['%s']*len(component_types))), tuple(component_types), as_dict=1)
+
+	for d in entry:
+
+		employee = {
+			"employee": d.employee,
+			"employee_name": d.employee_name,
+			"it_comp": d.salary_component,
+			"posting_date": d.posting_date,
+			# "pan_number": employee_pan_dict.get(d.employee),
+			"it_amount": d.amount,
+			"gross_pay": d.gross_pay
+		}
+
+		if erpnext.get_region() == "India":
+			employee["pan_number"] = employee_pan_dict.get(d.employee)
+
+		data.append(employee)
+
+	return data
diff --git a/erpnext/hr/doctype/employee_incentive/__init__.py b/erpnext/payroll/report/salary_payments_based_on_payment_mode/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/employee_incentive/__init__.py
copy to erpnext/payroll/report/salary_payments_based_on_payment_mode/__init__.py
diff --git a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.js b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.js
new file mode 100644
index 0000000..166d982
--- /dev/null
+++ b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.js
@@ -0,0 +1,7 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.require("assets/erpnext/js/salary_slip_deductions_report_filters.js", function() {
+	frappe.query_reports["Salary Payments Based On Payment Mode"] = erpnext.salary_slip_deductions_report_filters;
+});
\ No newline at end of file
diff --git a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.json b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.json
new file mode 100644
index 0000000..c04cc32
--- /dev/null
+++ b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.json
@@ -0,0 +1,30 @@
+{
+ "add_total_row": 0,
+ "creation": "2020-06-16 18:43:43.107246",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2020-06-16 18:43:43.107246",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Salary Payments Based On Payment Mode",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Salary Slip",
+ "report_name": "Salary Payments Based On Payment Mode",
+ "report_type": "Script Report",
+ "roles": [
+  {
+   "role": "HR User"
+  },
+  {
+   "role": "HR Manager"
+  },
+  {
+   "role": "Employee"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py
new file mode 100644
index 0000000..7f0c2e2
--- /dev/null
+++ b/erpnext/payroll/report/salary_payments_based_on_payment_mode/salary_payments_based_on_payment_mode.py
@@ -0,0 +1,177 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe, erpnext
+from frappe import _
+from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import get_conditions
+
+def execute(filters=None):
+	mode_of_payments = get_payment_modes()
+
+	if not len(mode_of_payments):
+		return [], []
+
+	columns = get_columns(filters, mode_of_payments)
+	data, total_rows, report_summary = get_data(filters, mode_of_payments)
+	chart =  get_chart(mode_of_payments, total_rows)
+
+	return columns, data, None, chart, report_summary
+
+def get_columns(filters, mode_of_payments):
+	columns = [{
+		"label": _("Branch"),
+		"options": "Branch",
+		"fieldname": "branch",
+		"fieldtype": "Link",
+		"width": 200
+	}]
+
+	for mode in mode_of_payments:
+		columns.append({
+			"label": _(mode),
+			"fieldname": mode,
+			"fieldtype": "Currency",
+			"width": 160
+		})
+
+	columns.append({
+		"label": _("Total"),
+		"fieldname": "total",
+		"fieldtype": "Currency",
+		"width": 140
+	})
+
+	return columns
+
+def get_payment_modes():
+	mode_of_payments = frappe.db.sql_list("""
+		select distinct mode_of_payment from `tabSalary Slip` where docstatus = 1
+	""")
+	return mode_of_payments
+
+def prepare_data(entry):
+	branch_wise_entries = {}
+	gross_pay = 0
+
+	for d in entry:
+		gross_pay += d.gross_pay
+		if branch_wise_entries.get(d.branch):
+			branch_wise_entries[d.branch][d.mode_of_payment] = d.net_pay
+		else:
+			branch_wise_entries.setdefault(d.branch, {}).setdefault(d.mode_of_payment, d.net_pay)
+
+	return branch_wise_entries, gross_pay
+
+def get_data(filters, mode_of_payments):
+	data = []
+
+	conditions = get_conditions(filters)
+
+	entry = frappe.db.sql("""
+		select branch, mode_of_payment, sum(net_pay) as net_pay, sum(gross_pay) as gross_pay
+		from `tabSalary Slip` sal
+		where docstatus = 1 %s
+		group by branch, mode_of_payment
+		""" % (conditions), as_dict=1)
+
+	branch_wise_entries, gross_pay = prepare_data(entry)
+
+	branches = frappe.db.sql_list("""
+		select distinct branch from `tabSalary Slip` sal
+		where docstatus = 1 %s
+	""" % (conditions))
+
+	total_row = {"total": 0, "branch": "Total"}
+
+	for branch in branches:
+		total = 0
+		row = {
+			"branch": branch
+		}
+		for mode in mode_of_payments:
+			if branch_wise_entries.get(branch).get(mode):
+				row[mode] = branch_wise_entries.get(branch).get(mode)
+				total +=  branch_wise_entries.get(branch).get(mode)
+
+		row["total"] = total
+		data.append(row)
+
+	total_row = get_total_based_on_mode_of_payment(data, mode_of_payments)
+	total_deductions = gross_pay - total_row.get("total")
+
+	if data:
+		data.append(total_row)
+		data.append({})
+		data.append({
+			"branch": "<b>Total Gross Pay</b>",
+			mode_of_payments[0]:gross_pay
+		})
+		data.append({
+			"branch": "<b>Total Deductions</b>",
+			mode_of_payments[0]:total_deductions
+		})
+		data.append({
+			"branch": "<b>Total Net Pay</b>",
+			mode_of_payments[0]:total_row.get("total")
+		})
+
+		currency = erpnext.get_company_currency(filters.company)
+		report_summary = get_report_summary(gross_pay, total_deductions, total_row.get("total"), currency)
+
+	return data, total_row, report_summary
+
+def get_total_based_on_mode_of_payment(data, mode_of_payments):
+
+	total = 0
+	total_row = {"branch": "<b>Total</b>"}
+	for mode in mode_of_payments:
+		sum_of_payment = sum([detail[mode] for detail in data if mode in detail.keys()])
+		total_row[mode] = sum_of_payment
+		total += sum_of_payment
+
+	total_row["total"] = total
+	return total_row
+
+def get_report_summary(gross_pay, total_deductions, net_pay, currency):
+	return [
+		{
+			"value": gross_pay,
+			"label": "Total Gross Pay",
+			"indicator": "Green",
+			"datatype": "Currency",
+			"currency": currency
+		},
+		{
+			"value": total_deductions,
+			"label": "Total Deduction",
+			"datatype": "Currency",
+			"indicator": "Red",
+			"currency": currency
+		},
+		{
+			"value": net_pay,
+			"label": "Total Net Pay",
+			"datatype": "Currency",
+			"indicator": "Blue",
+			"currency": currency
+		}
+	]
+
+def get_chart(mode_of_payments, data):
+	if data:
+		values = []
+		labels = []
+
+		for mode in mode_of_payments:
+			values.append(data[mode])
+			labels.append([mode])
+
+		chart = {
+			"data": {
+				"labels": labels,
+				"datasets": [{'name': 'Mode Of Payments', "values": values}]
+			}
+		}
+		chart['type'] = "bar"
+		return chart
diff --git a/erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py b/erpnext/payroll/report/salary_payments_via_ecs/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py
copy to erpnext/payroll/report/salary_payments_via_ecs/__init__.py
diff --git a/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.js b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.js
new file mode 100644
index 0000000..e49fc11
--- /dev/null
+++ b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.js
@@ -0,0 +1,16 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.require("assets/erpnext/js/salary_slip_deductions_report_filters.js", function() {
+
+	let ecs_checklist_filter = erpnext.salary_slip_deductions_report_filters
+	ecs_checklist_filter['filters'].push({
+		fieldname: "type",
+		label: __("Type"),
+		fieldtype: "Select",
+		options:["", "Bank", "Cash", "Cheque"]
+	})
+
+	frappe.query_reports["Salary Payments via ECS"] = ecs_checklist_filter
+});
diff --git a/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.json b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.json
new file mode 100644
index 0000000..dd0ac7c
--- /dev/null
+++ b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.json
@@ -0,0 +1,27 @@
+{
+ "add_total_row": 0,
+ "creation": "2020-06-16 18:35:30.508143",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2020-06-16 18:38:23.680185",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Salary Payments via ECS",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Salary Slip",
+ "report_name": "Salary Payments via ECS",
+ "report_type": "Script Report",
+ "roles": [
+  {
+   "role": "HR Manager"
+  },
+  {
+   "role": "HR User"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.py b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.py
new file mode 100644
index 0000000..afd5c13
--- /dev/null
+++ b/erpnext/payroll/report/salary_payments_via_ecs/salary_payments_via_ecs.py
@@ -0,0 +1,146 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe, erpnext
+from frappe import _
+
+def execute(filters=None):
+	columns = get_columns(filters)
+	data = get_data(filters)
+
+	return columns, data
+
+def get_columns(filters):
+	columns = [
+		{
+			"label": _("Branch"),
+			"options": "Branch",
+			"fieldname": "branch",
+			"fieldtype": "Link",
+			"width": 200
+		},
+		{
+			"label": _("Employee Name"),
+			"options": "Employee",
+			"fieldname": "employee_name",
+			"fieldtype": "Link",
+			"width": 160
+		},
+		{
+			"label": _("Employee"),
+			"options":"Employee",
+			"fieldname": "employee",
+			"fieldtype": "Link",
+			"width": 140
+		},
+		{
+			"label": _("Gross Pay"),
+			"fieldname": "gross_pay",
+			"fieldtype": "Currency",
+			"options": "currency",
+			"width": 140
+		},
+		{
+			"label": _("Bank"),
+			"fieldname": "bank",
+			"fieldtype": "Data",
+			"width": 140
+		},
+		{
+			"label": _("Account No"),
+			"fieldname": "account_no",
+			"fieldtype": "Data",
+			"width": 140
+		},
+	]
+	if erpnext.get_region() == "India":
+		columns += [
+			{
+				"label": _("IFSC"),
+				"fieldname": "ifsc",
+				"fieldtype": "Data",
+				"width": 140
+			},
+			{
+				"label": _("MICR"),
+				"fieldname": "micr",
+				"fieldtype": "Data",
+				"width": 140
+			}
+		]
+
+	return columns
+
+def get_conditions(filters):
+	conditions = [""]
+
+	if filters.get("department"):
+		conditions.append("department = '%s' " % (filters["department"]) )
+
+	if filters.get("branch"):
+		conditions.append("branch = '%s' " % (filters["branch"]) )
+
+	if filters.get("company"):
+		conditions.append("company = '%s' " % (filters["company"]) )
+
+	if filters.get("period"):
+		conditions.append("month(start_date) = '%s' " % (filters["period"]))
+
+	return " and ".join(conditions)
+
+def get_data(filters):
+
+	data = []
+
+	fields = ["employee", "branch", "bank_name", "bank_ac_no", "salary_mode"]
+	if erpnext.get_region() == "India":
+		fields += ["ifsc_code", "micr_code"]
+
+
+	employee_details = frappe.get_list("Employee", fields = fields)
+	employee_data_dict = {}
+
+	for d in employee_details:
+		employee_data_dict.setdefault(
+			d.employee,{
+				"bank_ac_no" : d.bank_ac_no,
+				"ifsc_code" : d.ifsc_code or None,
+				"micr_code" : d.micr_code or  None,
+				"branch" : d.branch,
+				"salary_mode" : d.salary_mode,
+				"bank_name": d.bank_name
+			}
+		)
+
+	conditions = get_conditions(filters)
+
+	entry = frappe.db.sql(""" select employee, employee_name, gross_pay
+		from `tabSalary Slip`
+		where docstatus = 1 %s """
+		%(conditions), as_dict =1)
+
+	for d in entry:
+
+		employee = {
+			"branch" : employee_data_dict.get(d.employee).get("branch"),
+			"employee_name" : d.employee_name,
+			"employee" : d.employee,
+			"gross_pay" : d.gross_pay,
+		}
+
+		if employee_data_dict.get(d.employee).get("salary_mode") == "Bank":
+			employee["bank"] = employee_data_dict.get(d.employee).get("bank_name")
+			employee["account_no"] = employee_data_dict.get(d.employee).get("bank_ac_no")
+			if erpnext.get_region() == "India":
+				employee["ifsc"] = employee_data_dict.get(d.employee).get("ifsc_code")
+				employee["micr"] = employee_data_dict.get(d.employee).get("micr_code")
+		else:
+			employee["account_no"] = employee_data_dict.get(d.employee).get("salary_mode")
+
+		if filters.get("type") and employee_data_dict.get(d.employee).get("salary_mode") == filters.get("type"):
+			data.append(employee)
+		elif not filters.get("type"):
+			data.append(employee)
+
+	return data
diff --git a/erpnext/hr/report/salary_register/__init__.py b/erpnext/payroll/report/salary_register/__init__.py
similarity index 100%
rename from erpnext/hr/report/salary_register/__init__.py
rename to erpnext/payroll/report/salary_register/__init__.py
diff --git a/erpnext/hr/report/salary_register/salary_register.html b/erpnext/payroll/report/salary_register/salary_register.html
similarity index 100%
rename from erpnext/hr/report/salary_register/salary_register.html
rename to erpnext/payroll/report/salary_register/salary_register.html
diff --git a/erpnext/hr/report/salary_register/salary_register.js b/erpnext/payroll/report/salary_register/salary_register.js
similarity index 100%
rename from erpnext/hr/report/salary_register/salary_register.js
rename to erpnext/payroll/report/salary_register/salary_register.js
diff --git a/erpnext/payroll/report/salary_register/salary_register.json b/erpnext/payroll/report/salary_register/salary_register.json
new file mode 100644
index 0000000..5a70c32
--- /dev/null
+++ b/erpnext/payroll/report/salary_register/salary_register.json
@@ -0,0 +1,27 @@
+{
+ "add_total_row": 1,
+ "creation": "2017-01-10 17:36:58.153863",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 2,
+ "is_standard": "Yes",
+ "modified": "2020-05-28 00:07:18.576661",
+ "modified_by": "Administrator",
+ "module": "Payroll",
+ "name": "Salary Register",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Salary Slip",
+ "report_name": "Salary Register",
+ "report_type": "Script Report",
+ "roles": [
+  {
+   "role": "HR User"
+  },
+  {
+   "role": "HR Manager"
+  }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/salary_register/salary_register.py b/erpnext/payroll/report/salary_register/salary_register.py
similarity index 96%
rename from erpnext/hr/report/salary_register/salary_register.py
rename to erpnext/payroll/report/salary_register/salary_register.py
index ea7fc06..8701085 100644
--- a/erpnext/hr/report/salary_register/salary_register.py
+++ b/erpnext/payroll/report/salary_register/salary_register.py
@@ -55,8 +55,8 @@
 	columns = [
 		_("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140",
 		_("Date of Joining") + "::80", _("Branch") + ":Link/Branch:-1", _("Department") + ":Link/Department:-1",
-		_("Designation") + ":Link/Designation:-1", _("Company") + ":Link/Company:120", _("Start Date") + "::80",
-		_("End Date") + "::80", _("Leave Without Pay") + ":Float:-1", _("Payment Days") + ":Float:120"
+		_("Designation") + ":Link/Designation:120", _("Company") + ":Link/Company:120", _("Start Date") + "::80",
+		_("End Date") + "::80", _("Leave Without Pay") + ":Float:50", _("Payment Days") + ":Float:120"
 	]
 
 	salary_components = {_("Earning"): [], _("Deduction"): []}
diff --git a/erpnext/projects/doctype/timesheet/test_timesheet.py b/erpnext/projects/doctype/timesheet/test_timesheet.py
index cbc624c..03b67b1 100644
--- a/erpnext/projects/doctype/timesheet/test_timesheet.py
+++ b/erpnext/projects/doctype/timesheet/test_timesheet.py
@@ -11,7 +11,7 @@
 from erpnext.projects.doctype.timesheet.timesheet import OverlapError
 from erpnext.projects.doctype.timesheet.timesheet import make_salary_slip, make_sales_invoice
 from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
-from erpnext.hr.doctype.salary_structure.test_salary_structure \
+from erpnext.payroll.doctype.salary_structure.test_salary_structure \
 	import make_salary_structure, create_salary_structure_assignment
 from erpnext.hr.doctype.employee.test_employee import make_employee
 
diff --git a/erpnext/public/js/salary_slip_deductions_report_filters.js b/erpnext/public/js/salary_slip_deductions_report_filters.js
new file mode 100644
index 0000000..2420379
--- /dev/null
+++ b/erpnext/public/js/salary_slip_deductions_report_filters.js
@@ -0,0 +1,47 @@
+frappe.provide("erpnext.salary_slip_deductions_report_filters");
+
+erpnext.salary_slip_deductions_report_filters = {
+	"filters": [
+		{
+			fieldname: "company",
+			label: __("Company"),
+			fieldtype: "Link",
+			options: "Company",
+			reqd:1,
+			default: frappe.defaults.get_user_default("Company"),
+		},
+		{
+			fieldname: "period",
+			label: __("Period"),
+			fieldtype: "Select",
+			reqd: 1 ,
+			options: [
+				{ "value": 1, "label": __("Jan") },
+				{ "value": 2, "label": __("Feb") },
+				{ "value": 3, "label": __("Mar") },
+				{ "value": 4, "label": __("Apr") },
+				{ "value": 5, "label": __("May") },
+				{ "value": 6, "label": __("June") },
+				{ "value": 7, "label": __("July") },
+				{ "value": 8, "label": __("Aug") },
+				{ "value": 9, "label": __("Sep") },
+				{ "value": 10, "label": __("Oct") },
+				{ "value": 11, "label": __("Nov") },
+				{ "value": 12, "label": __("Dec") },
+			],
+			default: frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth() + 1
+		},
+		{
+			fieldname: "department",
+			label: __("Department"),
+			fieldtype: "Link",
+			options: "Department",
+		},
+		{
+			fieldname: "branch",
+			label: __("Barnch"),
+			fieldtype: "Link",
+			options: "Branch",
+		}
+	]
+}
\ No newline at end of file
diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py
index 8593966..290694a 100644
--- a/erpnext/regional/india/setup.py
+++ b/erpnext/regional/india/setup.py
@@ -60,6 +60,19 @@
 				]
 			)).insert()
 
+	for report_name in ('Professional Tax Deductions', 'Provident Fund Deductions'):
+
+		if not frappe.db.get_value('Custom Role', dict(report=report_name)):
+			frappe.get_doc(dict(
+				doctype='Custom Role',
+				report=report_name,
+				roles= [
+					dict(role='HR User'),
+					dict(role='HR Manager'),
+					dict(role='Employee')
+				]
+			)).insert()
+
 def add_permissions():
 	for doctype in ('GST HSN Code', 'GST Settings', 'GSTR 3B Report', 'Lower Deduction Certificate'):
 		add_permission(doctype, 'All', 0)
@@ -402,10 +415,45 @@
 		'Purchase Receipt Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
 		'Purchase Invoice Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
 		'Material Request Item': [hsn_sac_field, nil_rated_exempt, is_non_gst],
+		'Salary Component': [
+			dict(fieldname=  'component_type',
+				label= 'Component Type',
+				fieldtype=  'Select',
+				insert_after= 'description',
+				options= "\nProvident Fund\nAdditional Provident Fund\nProvident Fund Loan\nProfessional Tax",
+				depends_on = 'eval:doc.type == "Deduction"'
+			)
+		],
 		'Employee': [
-			dict(fieldname='ifsc_code', label='IFSC Code',
-				fieldtype='Data', insert_after='bank_ac_no', print_hide=1,
-				depends_on='eval:doc.salary_mode == "Bank"')
+			dict(fieldname='ifsc_code',
+				label='IFSC Code',
+				fieldtype='Data',
+				insert_after='bank_ac_no',
+				print_hide=1,
+				depends_on='eval:doc.salary_mode == "Bank"'
+				),
+			dict(
+				fieldname =  'pan_number',
+				label = 'PAN Number',
+				fieldtype = 'Data',
+				insert_after = 'payroll_cost_center',
+				print_hide = 1
+			),
+			dict(
+				fieldname =  'micr_code',
+				label = 'MICR Code',
+				fieldtype = 'Data',
+				insert_after = 'ifsc_code',
+				print_hide = 1,
+				depends_on='eval:doc.salary_mode == "Bank"'
+			),
+			dict(
+				fieldname = 'provident_fund_account',
+				label = 'Provident Fund Account',
+				fieldtype = 'Data',
+				insert_after = 'pan_number'
+			)
+
 		],
 		'Company': [
 			dict(fieldname='hra_section', label='HRA Settings',
diff --git a/erpnext/regional/india/utils.py b/erpnext/regional/india/utils.py
index 9fe29eb..05ffa87 100644
--- a/erpnext/regional/india/utils.py
+++ b/erpnext/regional/india/utils.py
@@ -6,7 +6,7 @@
 from erpnext.controllers.taxes_and_totals import get_itemised_tax, get_itemised_taxable_amount
 from erpnext.controllers.accounts_controller import get_taxes_and_charges
 from erpnext.hr.utils import get_salary_assignment
-from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
+from erpnext.payroll.doctype.salary_structure.salary_structure import make_salary_slip
 from erpnext.regional.india import number_state_mapping
 from six import string_types
 from erpnext.accounts.general_ledger import make_gl_entries
diff --git a/erpnext/hr/doctype/additional_salary/__init__.py b/erpnext/regional/report/professional_tax_deductions/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/additional_salary/__init__.py
copy to erpnext/regional/report/professional_tax_deductions/__init__.py
diff --git a/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.js b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.js
new file mode 100644
index 0000000..29c7dbf
--- /dev/null
+++ b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.js
@@ -0,0 +1,7 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.require("assets/erpnext/js/salary_slip_deductions_report_filters.js", function() {
+	frappe.query_reports["Professional Tax Deductions"] = erpnext.salary_slip_deductions_report_filters;
+});
\ No newline at end of file
diff --git a/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.json b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.json
new file mode 100644
index 0000000..9938e9d
--- /dev/null
+++ b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.json
@@ -0,0 +1,20 @@
+{
+ "add_total_row": 0,
+ "creation": "2020-06-02 00:37:44.537355",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2020-06-16 19:02:26.306348",
+ "modified_by": "Administrator",
+ "module": "Regional",
+ "name": "Professional Tax Deductions",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Salary Slip",
+ "report_name": "Professional Tax Deductions",
+ "report_type": "Script Report",
+ "roles": []
+}
\ No newline at end of file
diff --git a/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.py b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.py
new file mode 100644
index 0000000..900fe96
--- /dev/null
+++ b/erpnext/regional/report/professional_tax_deductions/professional_tax_deductions.py
@@ -0,0 +1,69 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+from erpnext.regional.report.provident_fund_deductions.provident_fund_deductions import get_conditions
+
+def execute(filters=None):
+	columns = get_columns(filters)
+	data = get_data(filters)
+
+	return columns, data
+
+def get_columns(filters):
+	columns = [
+		{
+			"label": _("Employee"),
+			"options": "Employee",
+			"fieldname": "employee",
+			"fieldtype": "Link",
+			"width": 200
+		},
+		{
+			"label": _("Employee Name"),
+			"options": "Employee",
+			"fieldname": "employee_name",
+			"fieldtype": "Link",
+			"width": 160
+		},
+		{
+			"label": _("Amount"),
+			"fieldname": "amount",
+			"fieldtype": "Currency",
+			"width": 140
+		}
+	]
+
+	return columns
+
+def get_data(filters):
+
+	data = []
+
+	component_type_dict = frappe._dict(frappe.db.sql(""" select name, component_type from `tabSalary Component`
+		where component_type = 'Professional Tax' """))
+
+	conditions = get_conditions(filters)
+
+	entry = frappe.db.sql(""" select sal.employee, sal.employee_name, ded.salary_component, ded.amount
+		from `tabSalary Slip` sal, `tabSalary Detail` ded
+		where sal.name = ded.parent
+		and ded.parentfield = 'deductions'
+		and ded.parenttype = 'Salary Slip'
+		and sal.docstatus = 1 %s
+		and ded.salary_component in (%s)
+	""" % (conditions , ", ".join(['%s']*len(component_type_dict))), tuple(component_type_dict.keys()), as_dict=1)
+
+	for d in entry:
+
+		employee = {
+			"employee": d.employee,
+			"employee_name": d.employee_name,
+			"amount": d.amount
+		}
+
+		data.append(employee)
+
+	return data
\ No newline at end of file
diff --git a/erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py b/erpnext/regional/report/provident_fund_deductions/__init__.py
similarity index 100%
copy from erpnext/hr/doctype/income_tax_slab_other_charges/__init__.py
copy to erpnext/regional/report/provident_fund_deductions/__init__.py
diff --git a/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.js b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.js
new file mode 100644
index 0000000..b4dc28d
--- /dev/null
+++ b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.js
@@ -0,0 +1,7 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+/* eslint-disable */
+
+frappe.require("assets/erpnext/js/salary_slip_deductions_report_filters.js", function() {
+	frappe.query_reports["Provident Fund Deductions"] = erpnext.salary_slip_deductions_report_filters;
+});
\ No newline at end of file
diff --git a/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.json b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.json
new file mode 100644
index 0000000..e25d335
--- /dev/null
+++ b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.json
@@ -0,0 +1,20 @@
+{
+ "add_total_row": 0,
+ "creation": "2020-06-01 23:44:07.919117",
+ "disable_prepared_report": 0,
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 0,
+ "is_standard": "Yes",
+ "modified": "2020-06-16 18:54:19.305763",
+ "modified_by": "Administrator",
+ "module": "Regional",
+ "name": "Provident Fund Deductions",
+ "owner": "Administrator",
+ "prepared_report": 0,
+ "ref_doctype": "Salary Slip",
+ "report_name": "Provident Fund Deductions",
+ "report_type": "Script Report",
+ "roles": []
+}
\ No newline at end of file
diff --git a/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py
new file mode 100644
index 0000000..9f58957
--- /dev/null
+++ b/erpnext/regional/report/provident_fund_deductions/provident_fund_deductions.py
@@ -0,0 +1,153 @@
+# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+import frappe
+from frappe import _
+
+def execute(filters=None):
+	columns = get_columns(filters)
+	data = get_data(filters)
+
+	return columns, data
+
+def get_columns(filters):
+	columns = [
+		{
+			"label": _("Employee"),
+			"options": "Employee",
+			"fieldname": "employee",
+			"fieldtype": "Link",
+			"width": 200
+		},
+		{
+			"label": _("Employee Name"),
+			"options": "Employee",
+			"fieldname": "employee_name",
+			"fieldtype": "Link",
+			"width": 160
+		},
+		{
+			"label": _("PF Account"),
+			"fieldname": "pf_account",
+			"fieldtype": "Data",
+			"width": 140
+		},
+		{
+			"label": _("PF Amount"),
+			"fieldname": "pf_amount",
+			"fieldtype": "Currency",
+			"width": 140
+		},
+		{
+			"label": _("Additional PF"),
+			"fieldname": "additional_pf",
+			"fieldtype": "Currency",
+			"width": 140
+		},
+		{
+			"label": _("PF Loan"),
+			"fieldname": "pf_loan",
+			"fieldtype": "Currency",
+			"width": 140
+		},
+		{
+			"label": _("Total"),
+			"fieldname": "total",
+			"fieldtype": "Currency",
+			"width": 140
+		}
+	]
+
+	return columns
+
+def get_conditions(filters):
+	conditions = [""]
+
+	if filters.get("department"):
+		conditions.append("sal.department = '%s' " % (filters["department"]) )
+
+	if filters.get("branch"):
+		conditions.append("sal.branch = '%s' " % (filters["branch"]) )
+
+	if filters.get("company"):
+		conditions.append("sal.company = '%s' " % (filters["company"]) )
+
+	if filters.get("period"):
+		conditions.append("month(sal.start_date) = '%s' " % (filters["period"]))
+
+	if filters.get("mode_of_payment"):
+		conditions.append("sal.mode_of_payment = '%s' " % (filters["mode_of_payment"]))
+
+	return " and ".join(conditions)
+
+def prepare_data(entry,component_type_dict):
+	data_list = {}
+
+	employee_account_dict = frappe._dict(frappe.db.sql(""" select name, provident_fund_account from `tabEmployee`"""))
+
+	for d in entry:
+
+		component_type = component_type_dict.get(d.salary_component)
+
+		if data_list.get(d.name):
+			data_list[d.name][component_type] = d.amount
+		else:
+			data_list.setdefault(d.name,{
+				"employee": d.employee,
+				"employee_name": d.employee_name,
+				"pf_account": employee_account_dict.get(d.employee),
+				"component_type": d.amount
+			})
+
+	return data_list
+
+def get_data(filters):
+	data = []
+
+	conditions = get_conditions(filters)
+
+	salary_slips = frappe.db.sql(""" select sal.name from `tabSalary Slip` sal
+		where docstatus = 1 %s
+		""" % (conditions), as_dict=1)
+
+	component_type_dict = frappe._dict(frappe.db.sql(""" select name, component_type from `tabSalary Component`
+		where component_type in ('Provident Fund', 'Additional Provident Fund', 'Provident Fund Loan')"""))
+
+	entry = frappe.db.sql(""" select sal.name, sal.employee, sal.employee_name, ded.salary_component, ded.amount
+		from `tabSalary Slip` sal, `tabSalary Detail` ded
+		where sal.name = ded.parent
+		and ded.parentfield = 'deductions'
+		and ded.parenttype = 'Salary Slip'
+		and sal.docstatus = 1 %s
+		and ded.salary_component in (%s)
+	""" % (conditions, ", ".join(['%s']*len(component_type_dict))), tuple(component_type_dict.keys()), as_dict=1)
+
+	data_list = prepare_data(entry,component_type_dict)
+
+	for d in salary_slips:
+		total = 0
+		if data_list.get(d.name):
+			employee = {
+				"employee": data_list.get(d.name).get("employee"),
+				"employee_name": data_list.get(d.name).get("employee_name"),
+				"pf_account": data_list.get(d.name).get("pf_account")
+			}
+
+			if data_list.get(d.name).get("Provident Fund"):
+				employee["pf_amount"] = data_list.get(d.name).get("Provident Fund")
+				total += data_list.get(d.name).get("Provident Fund")
+
+			if data_list.get(d.name).get("Additional Provident Fund"):
+				employee["additional_pf"] = data_list.get(d.name).get("Additional Provident Fund")
+				total += data_list.get(d.name).get("Additional Provident Fund")
+
+			if data_list.get(d.name).get("Provident Fund Loan"):
+				employee["pf_loan"] = data_list.get(d.name).get("Provident Fund Loan")
+				total += data_list.get(d.name).get("Provident Fund Loan")
+
+			employee["total"] = total
+
+			data.append(employee)
+
+	return data
\ No newline at end of file
diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py
index 0d70d91..ad063cf 100644
--- a/erpnext/setup/setup_wizard/operations/install_fixtures.py
+++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py
@@ -50,7 +50,7 @@
 			'is_group': 0, 'parent_item_group': _('All Item Groups') },
 
 		# salary component
-		{'doctype': 'Salary Component', 'salary_component': _('Income Tax'), 'description': _('Income Tax'), 'type': 'Deduction'},
+		{'doctype': 'Salary Component', 'salary_component': _('Income Tax'), 'description': _('Income Tax'), 'type': 'Deduction', 'is_income_tax_component': 1},
 		{'doctype': 'Salary Component', 'salary_component': _('Basic'), 'description': _('Basic'), 'type': 'Earning'},
 		{'doctype': 'Salary Component', 'salary_component': _('Arrear'), 'description': _('Arrear'), 'type': 'Earning'},
 		{'doctype': 'Salary Component', 'salary_component': _('Leave Encashment'), 'description': _('Leave Encashment'), 'type': 'Earning'},