fix(payroll-entry): show make bank entry button (#18497)
* fix(payroll-entry): show make bank entry button when manually submitting salary slip * Update payroll_entry.py
This commit is contained in:
		
							parent
							
								
									f9fb92ebb0
								
							
						
					
					
						commit
						31c5c1e562
					
				| @ -12,6 +12,16 @@ from erpnext.accounts.utils import get_fiscal_year | |||||||
| from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee | from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee | ||||||
| 
 | 
 | ||||||
| class PayrollEntry(Document): | class PayrollEntry(Document): | ||||||
|  | 	def onload(self): | ||||||
|  | 		if not self.docstatus==1 or self.salary_slips_submitted: | ||||||
|  | 			return | ||||||
|  | 
 | ||||||
|  | 		# check if salary slips were manually submitted | ||||||
|  | 		entries = frappe.db.count("Salary Slip", {'payroll_entry': self.name, 'docstatus': 1}, ['name']) | ||||||
|  | 		if cint(entries) == len(self.employees) and not self.salary_slips_submitted: | ||||||
|  | 			self.db_set("salary_slips_submitted", 1) | ||||||
|  | 			self.reload() | ||||||
|  | 
 | ||||||
| 	def on_submit(self): | 	def on_submit(self): | ||||||
| 		self.create_salary_slips() | 		self.create_salary_slips() | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user