-
Notifications
You must be signed in to change notification settings - Fork 803
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1028 from frappe/version-14-hotfix
chore: release v14
- Loading branch information
Showing
4 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -461,7 +461,9 @@ def test_skip_absent_marking_for_a_fallback_default_shift(self): | |
|
||
default_shift = setup_shift_type() | ||
employee = make_employee( | ||
"[email protected]", company="_Test Company", default_shift=default_shift.name | ||
"[email protected]", | ||
company="_Test Company", | ||
default_shift=default_shift.name, | ||
) | ||
|
||
assigned_shift = setup_shift_type(shift_type="Test Absent with no Attendance") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,22 +9,24 @@ | |
|
||
from hrms.hr.doctype.attendance.attendance import mark_attendance | ||
from hrms.hr.doctype.leave_application.test_leave_application import make_allocation_record | ||
from hrms.hr.doctype.shift_type.test_shift_type import setup_shift_type | ||
from hrms.hr.report.monthly_attendance_sheet.monthly_attendance_sheet import execute | ||
from hrms.payroll.doctype.salary_slip.test_salary_slip import ( | ||
make_holiday_list, | ||
make_leave_application, | ||
) | ||
from hrms.tests.test_utils import get_first_day_for_prev_month | ||
|
||
test_dependencies = ["Shift Type"] | ||
|
||
|
||
class TestMonthlyAttendanceSheet(FrappeTestCase): | ||
def setUp(self): | ||
self.company = "_Test Company" | ||
self.employee = make_employee("[email protected]", company=self.company) | ||
frappe.db.delete("Attendance") | ||
|
||
if not frappe.db.exists("Shift Type", "Day Shift"): | ||
setup_shift_type(shift_type="Day Shift") | ||
|
||
date = getdate() | ||
from_date = get_year_start(date) | ||
to_date = get_year_ending(date) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
import frappe | ||
|
||
|
||
def get_holiday_dates_between(holiday_list: str, start_date: str, end_date: str) -> list: | ||
def get_holiday_dates_between( | ||
holiday_list: str, | ||
start_date: str, | ||
end_date: str, | ||
skip_weekly_offs: bool = False, | ||
) -> list: | ||
Holiday = frappe.qb.DocType("Holiday") | ||
return ( | ||
query = ( | ||
frappe.qb.from_(Holiday) | ||
.select(Holiday.holiday_date) | ||
.where((Holiday.parent == holiday_list) & (Holiday.holiday_date.between(start_date, end_date))) | ||
.orderby(Holiday.holiday_date) | ||
).run(pluck=True) | ||
) | ||
|
||
if skip_weekly_offs: | ||
query = query.where(Holiday.weekly_off == 0) | ||
|
||
return query.run(pluck=True) |