Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: payroll attendance error #23887

Merged
merged 4 commits into from
Nov 16, 2020

Conversation

AfshanKhan
Copy link
Contributor

@AfshanKhan AfshanKhan commented Nov 11, 2020

Steps to replicate:

  • Create Employee joining July 25

  • Create attendance for employee from 25th july to 31st july

  • Run Payroll with attendance for July

Shows error that "Attendance not marked for employee" even when attendance is marked from the date of joining.

image

Now it considers start date either the "date of joining" or "start date" mentioned on basis of whichever is greater, hench solving this error.

Copy link
Contributor

@Anurag810 Anurag810 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
As we know that payroll entry is for multiple employees. So, users have to search for every employee on the list. Make the message more generic and try to list which employee is left to mark attendance.

@AfshanKhan
Copy link
Contributor Author

AfshanKhan commented Nov 13, 2020

image
As we know that payroll entry is for multiple employees. So, users have to search for every employee on the list. Make the message more generic and try to list which employee is left to mark attendance.

Screenshot 2020-11-13 at 3 36 19 PM
@Anurag810 The list of employees is shown below. Also listing all employees will make that error message unnecessarily big.

Comment on lines 365 to +367
days = frappe.db.sql("""select count(*) from tabHoliday where
parent=%s and holiday_date between %s and %s""", (holiday_list,
self.start_date, self.end_date))
start_date, self.end_date))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid Query try to use frappe.get_all or frappe.get_list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The queries are just to get count, I don't think using frappe.get_all or frappe.get_list is required here.

@Anurag810
Copy link
Contributor

image
As we know that payroll entry is for multiple employees. So, users have to search for every employee on the list. Make the message more generic and try to list which employee is left to mark attendance.

Screenshot 2020-11-13 at 3 36 19 PM
@Anurag810 The list of employees is shown below. Also listing all employees will make that error message unnecessarily big.

yeah got this.

@AfshanKhan AfshanKhan requested a review from Anurag810 November 13, 2020 11:36
@Anurag810 Anurag810 merged commit 17d5ce3 into frappe:develop Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants