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

chore: release v14 #2667

Merged
merged 27 commits into from
Jan 23, 2025
Merged
Changes from 12 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5ad4c0b
fix: fetch designation in job applicant from job opening
asmitahase Jan 16, 2025
9beef69
fix: create single leave ledger entry for encashment if leave is carr…
asmitahase Jan 10, 2025
5f70e7d
chore: fixed linter issue
asmitahase Jan 10, 2025
4806510
chore: test creation of leave ledger entries depending on leave type …
asmitahase Jan 13, 2025
84060fd
chore: better test scenarios for encashments created after leave period
asmitahase Jan 15, 2025
2c0504a
fix: translation in payroll (backport #2644) (#2655)
mergify[bot] Jan 16, 2025
0a2af83
chore: resolved merge conflict for modified timestamp
asmitahase Jan 17, 2025
4968efe
chore: resolved merge conflict
asmitahase Jan 17, 2025
7c1c6a7
Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr…
asmitahase Jan 17, 2025
d4976f9
Merge pull request #2651 from frappe/mergify/bp/version-14-hotfix/pr-…
asmitahase Jan 17, 2025
5b288cf
chore: fixed leave encashment tests
asmitahase Jan 20, 2025
18bbc9b
fix: mark absense for default shift due to missing checkins when an a…
asmitahase Jan 8, 2025
0e278d0
fix: added check for 0 absent employees
asmitahase Jan 9, 2025
ecc377c
fix: removed unnecessary filter and checks for assigned shifts, mark_…
asmitahase Jan 9, 2025
20796be
fix: updated filter to exclude past and current date shift assignment
asmitahase Jan 9, 2025
1d412a9
Merge pull request #2665 from frappe/mergify/bp/version-14-hotfix/pr-…
asmitahase Jan 20, 2025
caeedf1
fix: set leave encashment amount and payable account in fnf payables …
mergify[bot] Jan 21, 2025
1ba767d
chore: fixed test
asmitahase Jan 21, 2025
1fdb923
chore: failing tests because encashable_days was changed to encashme…
asmitahase Jan 21, 2025
c59ce42
Merge branch 'version-14-hotfix' into mergify/bp/version-14-hotfix/pr…
asmitahase Jan 21, 2025
15b46cb
Merge pull request #2653 from frappe/mergify/bp/version-14-hotfix/pr-…
asmitahase Jan 21, 2025
8514864
refactor: fetch all employees that may have shift type as active shif…
asmitahase Jan 22, 2025
67cfbc8
chore: typos in the comment
asmitahase Jan 22, 2025
28d9684
chore: filter syntax
asmitahase Jan 22, 2025
391c48e
refactor: None check for process_attendance_after is unnecessary sinc…
asmitahase Jan 22, 2025
648fdf4
refactor: type check for process_attendance_date
asmitahase Jan 22, 2025
32ceaee
Merge pull request #2687 from frappe/mergify/bp/version-14-hotfix/pr-…
asmitahase Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -87,6 +87,7 @@ frappe.ui.form.on("Full and Final Outstanding Statement", {
args: {
ref_doctype: child.reference_document_type,
ref_document: child.reference_document,
company: frm.doc.company,
},
callback: function (r) {
if (r.message) {
Original file line number Diff line number Diff line change
@@ -165,7 +165,7 @@ def create_journal_entry(self):


@frappe.whitelist()
def get_account_and_amount(ref_doctype, ref_document):
def get_account_and_amount(ref_doctype, ref_document, company):
if not ref_doctype or not ref_document:
return None

@@ -215,6 +215,11 @@ def get_account_and_amount(ref_doctype, ref_document):
amount = details.paid_amount - (details.claimed_amount + details.return_amount)
return [payment_account, amount]

if ref_doctype == "Leave Encashment":
amount = frappe.db.get_value("Leave Encashment", ref_document, "encashment_amount")
payable_account = frappe.get_cached_value("Company", company, "default_payroll_payable_account")
return [payable_account, amount]


def update_full_and_final_statement_status(doc, method=None):
"""Updates FnF status on Journal Entry Submission/Cancellation"""
5 changes: 3 additions & 2 deletions hrms/hr/doctype/job_applicant/job_applicant.json
Original file line number Diff line number Diff line change
@@ -182,6 +182,7 @@
"fieldtype": "Column Break"
},
{
"fetch_from": "job_title.designation",
"fetch_if_empty": 1,
"fieldname": "designation",
"fieldtype": "Link",
@@ -193,7 +194,7 @@
"idx": 1,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-09-14 16:50:39.316079",
"modified": "2025-01-16 13:06:05.312255",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Applicant",
@@ -219,4 +220,4 @@
"states": [],
"subject_field": "notes",
"title_field": "applicant_name"
}
}
6 changes: 4 additions & 2 deletions hrms/hr/doctype/shift_type/shift_type.py
Original file line number Diff line number Diff line change
@@ -242,15 +242,16 @@ def get_assigned_employees(self, from_date=None, consider_default_shift=False) -
assigned_employees = frappe.get_all("Shift Assignment", filters=filters, pluck="employee")

if consider_default_shift:
default_shift_employees = self.get_employees_with_default_shift(filters)
default_shift_employees = self.get_employees_with_default_shift(filters, from_date)
assigned_employees = set(assigned_employees + default_shift_employees)

# exclude inactive employees
inactive_employees = frappe.db.get_all("Employee", {"status": "Inactive"}, pluck="name")

return list(set(assigned_employees) - set(inactive_employees))

def get_employees_with_default_shift(self, filters: dict) -> list:
def get_employees_with_default_shift(self, filters: dict, from_date) -> list:
filters["start_date"] = ("<=", from_date)
default_shift_employees = frappe.get_all(
"Employee", filters={"default_shift": self.name, "status": "Active"}, pluck="name"
)
@@ -259,6 +260,7 @@ def get_employees_with_default_shift(self, filters: dict) -> list:
return []

# exclude employees from default shift list if any other valid shift assignment exists
# that starts before the attendance processing date
del filters["shift_type"]
filters["employee"] = ("in", default_shift_employees)

21 changes: 21 additions & 0 deletions hrms/hr/doctype/shift_type/test_shift_type.py
Original file line number Diff line number Diff line change
@@ -612,6 +612,27 @@ def test_skip_auto_attendance_for_overlapping_shift(self):
self.assertEqual(log_in.skip_auto_attendance, 1)
self.assertEqual(log_out.skip_auto_attendance, 1)

def test_mark_attendance_for_default_shift_when_shift_assignment_is_not_overlapping(self):
shift_1 = setup_shift_type(shift_type="Deafult Shift", start_time="08:00:00", end_time="12:00:00")
shift_2 = setup_shift_type(shift_type="Not Default Shift", start_time="10:00:00", end_time="18:00:00")
employee = make_employee(
"test_employee_attendance@example.com", company="_Test Company", default_shift=shift_1.name
)
shift_assigned_date = add_days(getdate(), +1)
make_shift_assignment(shift_2.name, employee, shift_assigned_date)
from hrms.hr.doctype.attendance.attendance import mark_attendance

mark_attendance(employee, add_days(getdate(), -1), "Present", shift=shift_1.name)
shift_1.process_auto_attendance()
self.assertEqual(
frappe.db.get_value(
"Attendance",
{"employee": employee, "attendance_date": getdate(), "shift": shift_1.name},
"status",
),
"Absent",
)


def setup_shift_type(**args):
args = frappe._dict(args)
4 changes: 2 additions & 2 deletions hrms/payroll/doctype/salary_slip/salary_slip.js
Original file line number Diff line number Diff line change
@@ -287,8 +287,8 @@ frappe.ui.form.on("Salary Slip", {
const message = `
<div class="small text-muted pb-3">
${__("Note").bold()}: ${__("Payment Days calculations are based on these Payroll Settings")}:
<br><br>${__("Payroll Based On")}: ${payroll_based_on.bold()}
<br>${__("Consider Unmarked Attendance As")}: ${consider_unmarked_attendance_as.bold()}
<br><br>${__("Payroll Based On")}: ${__(payroll_based_on).bold()}
<br>${__("Consider Unmarked Attendance As")}: ${__(consider_unmarked_attendance_as).bold()}
<br>${__("Consider Marked Attendance on Holidays")}:
${
cint(include_holidays_in_total_working_days) &&