From 1c72b9a07392b45a3c14d810d78ca5355aa9d0ae Mon Sep 17 00:00:00 2001 From: krantheman Date: Mon, 30 Sep 2024 13:01:56 +0530 Subject: [PATCH 1/2] feat: show In and Out Time in Attendance even if there is only one log (cherry picked from commit 1f0e65c8d76a4b4dde220092a386480eb16402da) --- hrms/hr/doctype/employee_checkin/employee_checkin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hrms/hr/doctype/employee_checkin/employee_checkin.py b/hrms/hr/doctype/employee_checkin/employee_checkin.py index 3b1993ebd1..0ba4a9e814 100644 --- a/hrms/hr/doctype/employee_checkin/employee_checkin.py +++ b/hrms/hr/doctype/employee_checkin/employee_checkin.py @@ -241,8 +241,9 @@ def calculate_working_hours(logs, check_in_out_type, working_hours_calc_type): if last_out_log_index or last_out_log_index == 0 else None ) + in_time = getattr(first_in_log, "time", None) + out_time = getattr(last_out_log, "time", None) if first_in_log and last_out_log: - in_time, out_time = first_in_log.time, last_out_log.time total_hours = time_diff_in_hours(in_time, out_time) elif working_hours_calc_type == "Every Valid Check-in and Check-out": in_log = out_log = None From f938cffb87f42cc47f3d7fc5ea7a3936b6a22a08 Mon Sep 17 00:00:00 2001 From: krantheman Date: Mon, 30 Sep 2024 18:04:39 +0530 Subject: [PATCH 2/2] feat: allow get_first_day and get_last_day in salary slip eval (cherry picked from commit 1b4c321c0c8a5389be4e95ff8b8827685dafa382) --- hrms/payroll/doctype/salary_slip/salary_slip.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hrms/payroll/doctype/salary_slip/salary_slip.py b/hrms/payroll/doctype/salary_slip/salary_slip.py index c26b9a9d01..8e992220eb 100644 --- a/hrms/payroll/doctype/salary_slip/salary_slip.py +++ b/hrms/payroll/doctype/salary_slip/salary_slip.py @@ -20,6 +20,7 @@ flt, formatdate, get_first_day, + get_last_day, get_link_to_form, getdate, money_in_words, @@ -73,6 +74,8 @@ def __init__(self, *args, **kwargs): "rounded": rounded, "date": date, "getdate": getdate, + "get_first_day": get_first_day, + "get_last_day": get_last_day, "ceil": ceil, "floor": floor, } @@ -2158,6 +2161,8 @@ def eval_tax_slab_condition(condition, eval_globals=None, eval_locals=None): "round": round, "date": date, "getdate": getdate, + "get_first_day": get_first_day, + "get_last_day": get_last_day, } try: