fix: add employee leave balance report to the dashboard
This commit is contained in:
		
							parent
							
								
									8d19faa598
								
							
						
					
					
						commit
						80fb0bf520
					
				| @ -30,14 +30,6 @@ frappe.ui.form.on("Leave Allocation", { | |||||||
| 					frm.trigger("expire_allocation"); | 					frm.trigger("expire_allocation"); | ||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
| 
 |  | ||||||
| 			// opens leave balance report for employee
 |  | ||||||
| 			frm.add_custom_button(__('Leave Balance'), function() { |  | ||||||
| 				frappe.route_options = { |  | ||||||
| 					employee: frm.doc.employee, |  | ||||||
| 				}; |  | ||||||
| 				frappe.set_route("query-report", "Employee Leave Balance"); |  | ||||||
| 			}); |  | ||||||
| 		} | 		} | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -12,4 +12,9 @@ def get_data(): | |||||||
|                 'items': ['Leave Encashment'] |                 'items': ['Leave Encashment'] | ||||||
|             } |             } | ||||||
|         ], |         ], | ||||||
|  |         'reports': [ | ||||||
|  | 			{ | ||||||
|  | 				'items': ['Employee Leave Balance'] | ||||||
|  | 			} | ||||||
|  | 		] | ||||||
|     } |     } | ||||||
| @ -85,16 +85,6 @@ frappe.ui.form.on("Leave Application", { | |||||||
| 				frm.set_value('employee', perm['Employee'].map(perm_doc => perm_doc.doc)[0]); | 				frm.set_value('employee', perm['Employee'].map(perm_doc => perm_doc.doc)[0]); | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 |  | ||||||
| 		if (frm.doc.docstatus === 1) { |  | ||||||
| 			frm.add_custom_button(__('Leave Balance'), function() { |  | ||||||
| 				frappe.route_options = { |  | ||||||
| 					employee: frm.doc.employee, |  | ||||||
| 					group_by: "" |  | ||||||
| 				}; |  | ||||||
| 				frappe.set_route("query-report", "Employee Leave Balance"); |  | ||||||
| 			}); |  | ||||||
| 		} |  | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
| 	employee: function(frm) { | 	employee: function(frm) { | ||||||
|  | |||||||
| @ -438,7 +438,7 @@ def get_leave_details(employee, date): | |||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def get_leave_balance_on(employee, leave_type, date, to_date=nowdate(), consider_all_leaves_in_the_allocation_period=False): | def get_leave_balance_on(employee, leave_type, date, to_date=nowdate(), consider_all_leaves_in_the_allocation_period=False): | ||||||
| 	''' | 	''' | ||||||
| 		Returns leave balance on date | 		Returns leave balance till date | ||||||
| 		:param employee: employee name | 		:param employee: employee name | ||||||
| 		:param leave_type: leave type | 		:param leave_type: leave type | ||||||
| 		:param date: date to check balance on | 		:param date: date to check balance on | ||||||
|  | |||||||
| @ -0,0 +1,14 @@ | |||||||
|  | from __future__ import unicode_literals | ||||||
|  | 
 | ||||||
|  | from frappe import _ | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | def get_data(): | ||||||
|  | 	return { | ||||||
|  |         'reports': [ | ||||||
|  | 			{ | ||||||
|  |                 'label': _('Reports'), | ||||||
|  | 				'items': ['Employee Leave Balance'] | ||||||
|  | 			} | ||||||
|  | 		] | ||||||
|  |     } | ||||||
| @ -606,7 +606,6 @@ execute:frappe.delete_doc_if_exists("Page", "support-analytics") | |||||||
| erpnext.patches.v12_0.make_custom_fields_for_bank_remittance #14-06-2019 | erpnext.patches.v12_0.make_custom_fields_for_bank_remittance #14-06-2019 | ||||||
| execute:frappe.delete_doc_if_exists("Page", "support-analytics") | execute:frappe.delete_doc_if_exists("Page", "support-analytics") | ||||||
| erpnext.patches.v12_0.make_item_manufacturer | erpnext.patches.v12_0.make_item_manufacturer | ||||||
| erpnext.patches.v12_0.generate_leave_ledger_entries |  | ||||||
| erpnext.patches.v11_1.move_customer_lead_to_dynamic_column | erpnext.patches.v11_1.move_customer_lead_to_dynamic_column | ||||||
| erpnext.patches.v11_1.set_default_action_for_quality_inspection | erpnext.patches.v11_1.set_default_action_for_quality_inspection | ||||||
| erpnext.patches.v11_1.delete_bom_browser | erpnext.patches.v11_1.delete_bom_browser | ||||||
| @ -617,3 +616,4 @@ erpnext.patches.v11_1.set_missing_opportunity_from | |||||||
| erpnext.patches.v12_0.set_quotation_status | erpnext.patches.v12_0.set_quotation_status | ||||||
| erpnext.patches.v12_0.set_priority_for_support | erpnext.patches.v12_0.set_priority_for_support | ||||||
| erpnext.patches.v12_0.delete_priority_property_setter | erpnext.patches.v12_0.delete_priority_property_setter | ||||||
|  | erpnext.patches.v12_0.generate_leave_ledger_entries # | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user