diff --git a/.github/workflows/review-translation-changes.yaml b/.github/workflows/review-translation-changes.yaml index fe9868bc706..ec4611dac06 100644 --- a/.github/workflows/review-translation-changes.yaml +++ b/.github/workflows/review-translation-changes.yaml @@ -22,6 +22,6 @@ jobs: pull-requests: write steps: - - uses: alyf-de/po-review-action@5928f84d6bc9094f9ad6e2c5780f01c0044b800e # v1.1.1 + - uses: alyf-de/po-review-action@57fff275f4a0518a2ca55869ec6776fa3813b3d5 # v1.2.0 with: hidden-po-files: eo.po diff --git a/hrms/api/__init__.py b/hrms/api/__init__.py index 97b6028b11d..8dfa6081a88 100644 --- a/hrms/api/__init__.py +++ b/hrms/api/__init__.py @@ -680,23 +680,13 @@ def get_employee_advance_balance() -> list[dict]: # Company @frappe.whitelist() def get_company_currencies() -> dict: - Company = frappe.qb.DocType("Company") - Currency = frappe.qb.DocType("Currency") - - query = ( - frappe.qb.from_(Company) - .join(Currency) - .on(Company.default_currency == Currency.name) - .select( - Company.name, - Company.default_currency, - Currency.name.as_("currency"), - Currency.symbol.as_("symbol"), - ) - ) - - companies = query.run(as_dict=True) - return {company.name: (company.default_currency, company.symbol) for company in companies} + companies = frappe.get_list("Company", fields=["name", "default_currency"]) + symbols = get_currency_symbols() + return { + company.name: (company.default_currency, symbols.get(company.default_currency)) + for company in companies + if company.default_currency in symbols + } @frappe.whitelist() diff --git a/hrms/hr/doctype/attendance/attendance.py b/hrms/hr/doctype/attendance/attendance.py index f5e1860a488..a57ead4067e 100644 --- a/hrms/hr/doctype/attendance/attendance.py +++ b/hrms/hr/doctype/attendance/attendance.py @@ -384,6 +384,35 @@ def mark_attendance( return attendance.name +def validate_employee_access(employees: list[str], company: str | None = None) -> None: + """Single permission-aware query for all employees, run before any loop.""" + if not employees: + return + + if any(not isinstance(e, str) or not e for e in employees): + frappe.throw(_("Employee must be a non-empty string."), frappe.ValidationError) + + employees = list(dict.fromkeys(employees)) + + accessible = frappe.get_list( + "Employee", filters={"name": ["in", employees]}, fields=["name", "company"], limit=0 + ) + company_map = {d.name: d.company for d in accessible} + + if denied := [e for e in employees if e not in company_map]: + frappe.throw( + _("You do not have access to Employee {0}").format(", ".join(frappe.bold(e) for e in denied)), + frappe.PermissionError, + ) + + if company and (mismatched := [e for e, c in company_map.items() if c != company]): + frappe.throw( + _("Employee {0} does not belong to Company {1}").format( + ", ".join(frappe.bold(e) for e in mismatched), frappe.bold(company) + ) + ) + + @frappe.whitelist(methods=["POST"]) def mark_bulk_attendance(data: str | dict): import json @@ -391,6 +420,13 @@ def mark_bulk_attendance(data: str | dict): if isinstance(data, str): data = json.loads(data) data = frappe._dict(data) + if not isinstance(data.employee, str) or not data.employee: + frappe.throw(_("Employee must be a non-empty string."), frappe.ValidationError) + if not isinstance(data.unmarked_days, list): + frappe.throw(_("Unmarked days must be a list of dates."), frappe.ValidationError) + + frappe.has_permission("Attendance", "create", throw=True) + validate_employee_access([data.employee]) if not data.unmarked_days: frappe.throw(_("Please select a date.")) return diff --git a/hrms/hr/doctype/attendance/test_attendance.py b/hrms/hr/doctype/attendance/test_attendance.py index bdc404a2dcf..b52d0aba658 100644 --- a/hrms/hr/doctype/attendance/test_attendance.py +++ b/hrms/hr/doctype/attendance/test_attendance.py @@ -15,7 +15,6 @@ getdate, nowdate, ) -from frappe.utils.user import add_role from erpnext.setup.doctype.employee.test_employee import make_employee @@ -32,7 +31,7 @@ create_holiday_list_assignment, ) from hrms.tests.test_utils import get_first_sunday -from hrms.tests.utils import HRMSTestSuite +from hrms.tests.utils import HRMSTestSuite, make_company_restricted_user, make_user class TestAttendance(HRMSTestSuite): @@ -297,12 +296,10 @@ def test_get_events_returns_attendance(self): self.assertEqual(attendance_events[0].get("attendance_date"), getdate()) def test_bulk_attendance_marking_through_bg(self): - user1 = "test_bg1@example.com" - user2 = "test_bg2@example.com" - employee1 = make_employee("test_bg1@example.com", company="_Test Company") - employee2 = make_employee("test_bg2@example.com", company="_Test Company") - add_role(user1, "HR Manager") - add_role(user2, "HR Manager") + user1 = make_user("test_bg1@example.com") + user2 = make_user("test_bg2@example.com") + employee1 = make_employee("test_bg_employee1@example.com", company="_Test Company") + employee2 = make_employee("test_bg_employee2@example.com", company="_Test Company") frappe.flags.test_bg_job = True frappe.set_user(user1) data1 = frappe._dict(unmarked_days=[getdate()], employee=employee1, status="Present", shift="") @@ -326,5 +323,35 @@ def test_bulk_attendance_marking_through_bg(self): attendance_records = frappe.get_all("Attendance", {"employee": employee2}) self.assertEqual(len(attendance_records), 1) + def test_bulk_attendance_rejects_malformed_input(self): + employee = make_employee("test_bulk_input@example.com", company="_Test Company") + + for bad_employee in (None, "", 1, ["EMP-1"], {"name": employee}): + data = frappe._dict(unmarked_days=[getdate()], employee=bad_employee, status="Present") + self.assertRaises(frappe.ValidationError, mark_bulk_attendance, data) + + data = frappe._dict(unmarked_days=str(getdate()), employee=employee, status="Present") + self.assertRaises(frappe.ValidationError, mark_bulk_attendance, data) + + self.assertFalse(frappe.db.exists("Attendance", {"employee": employee})) + + def test_bulk_attendance_outside_company_scope(self): + user = make_company_restricted_user("test_scoped_bulk_user@example.com", "_Test Company") + other_company_employee = make_employee( + "test_bulk_other_company@example.com", company="_Test Company 1" + ) + + frappe.set_user(user) + try: + data = frappe._dict( + unmarked_days=[getdate()], employee=other_company_employee, status="Present", shift="" + ) + with self.assertRaises(frappe.PermissionError): + mark_bulk_attendance(data) + finally: + frappe.set_user("Administrator") + + self.assertFalse(frappe.db.exists("Attendance", {"employee": other_company_employee})) + def tearDown(self): frappe.db.rollback() diff --git a/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.py b/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.py index 92def0107ee..9d6fe7a7b00 100644 --- a/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.py +++ b/hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.py @@ -9,6 +9,8 @@ from frappe.model.document import Document from frappe.utils import getdate +from hrms.hr.doctype.attendance.attendance import validate_employee_access + class EmployeeAttendanceTool(Document): # begin: auto-generated types @@ -166,6 +168,14 @@ def _get_unmarked_attendance_with_shift(unmarked_attendance, shift, date): return shiftwise_unmarked_attendance +def get_permission_check_fields(doctype: str) -> list[str]: + """Columns needed to evaluate document permissions without loading the document.""" + link_fields = [ + df.fieldname for df in frappe.get_meta(doctype).get_link_fields() if not df.ignore_user_permissions + ] + return ["name", "owner", "docstatus", *link_fields] + + @frappe.whitelist(methods=["POST"]) def mark_employee_attendance( employee_list: list | str, @@ -183,6 +193,10 @@ def mark_employee_attendance( if isinstance(employee_list, str): employee_list = json.loads(employee_list) + if employee_list: + frappe.has_permission("Attendance", "create", throw=True) + validate_employee_access(employee_list, company) + for employee in employee_list: leave_type = None if status == "On Leave" and leave_type: @@ -207,6 +221,8 @@ def mark_employee_attendance( if isinstance(half_day_employee_list, str): half_day_employee_list = json.loads(half_day_employee_list) + validate_employee_access(half_day_employee_list, company) + eligible_attendance = frappe.get_list( "Attendance", filters={ @@ -214,20 +230,20 @@ def mark_employee_attendance( "attendance_date": date, "docstatus": 1, }, - fields=["name", "employee"], + fields=get_permission_check_fields("Attendance"), limit=0, ) - attendance_map = {d.employee: d.name for d in eligible_attendance} + if not eligible_attendance: + return + + for row in eligible_attendance: + # in-memory document, no fetch: the engine needs meta, owner and link values + attendance = frappe.get_doc(doctype="Attendance", **row) + frappe.has_permission("Attendance", "write", doc=attendance, throw=True) Attendance = frappe.qb.DocType("Attendance") - for employee in half_day_employee_list: - attendance_name = attendance_map.get(employee) - if attendance_name: - frappe.has_permission("Attendance", "write", attendance_name, throw=True) - frappe.qb.update(Attendance).where( - (Attendance.employee == employee) - & (Attendance.attendance_date == date) - & (Attendance.docstatus == 1) - ).set(Attendance.half_day_status, half_day_status).set(Attendance.shift, shift).set( - Attendance.late_entry, late_entry or 0 - ).set(Attendance.early_exit, early_exit or 0).set(Attendance.modify_half_day_status, 0).run() + frappe.qb.update(Attendance).where( + Attendance.name.isin([row.name for row in eligible_attendance]) + ).set(Attendance.half_day_status, half_day_status).set(Attendance.shift, shift).set( + Attendance.late_entry, late_entry or 0 + ).set(Attendance.early_exit, early_exit or 0).set(Attendance.modify_half_day_status, 0).run() diff --git a/hrms/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.py b/hrms/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.py index e9827bf885d..6f6c7e1edcd 100644 --- a/hrms/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.py +++ b/hrms/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.py @@ -19,7 +19,7 @@ from hrms.hr.doctype.leave_type.test_leave_type import create_leave_type from hrms.hr.doctype.shift_type.test_shift_type import setup_shift_type from hrms.payroll.doctype.salary_slip.test_salary_slip import make_leave_application -from hrms.tests.utils import HRMSTestSuite +from hrms.tests.utils import HRMSTestSuite, make_company_restricted_user class TestEmployeeAttendanceTool(HRMSTestSuite): @@ -234,6 +234,107 @@ def test_get_unmarked_attendance_with_shift(self): self.assertIn(self.employee2.name, filtered) self.assertNotIn(self.employee3.name, filtered) + def test_mark_attendance_outside_company_scope(self): + user = make_company_restricted_user("test_scoped_hr_user@example.com", "_Test Company") + + date = add_days(getdate(), -1) + while is_holiday(employee=self.employee4, date=date): + date = add_days(date, -1) + + frappe.set_user(user) + try: + # employee4 belongs to _Test Company 1, outside the user's scope + with self.assertRaises(frappe.PermissionError): + mark_employee_attendance(employee_list=[self.employee4], status="Present", date=date) + + with self.assertRaises(frappe.PermissionError): + mark_employee_attendance( + employee_list=[], + status="Present", + date=date, + mark_half_day=True, + half_day_status="Absent", + half_day_employee_list=[self.employee4], + ) + + # employee3 belongs to _Test Company but the caller claims a different company + with self.assertRaises(frappe.ValidationError): + mark_employee_attendance( + employee_list=[self.employee3], status="Present", date=date, company="_Test Company 1" + ) + finally: + frappe.set_user("Administrator") + + self.assertFalse( + frappe.db.exists("Attendance", {"employee": self.employee4, "attendance_date": date}) + ) + self.assertFalse( + frappe.db.exists("Attendance", {"employee": self.employee3, "attendance_date": date}) + ) + + def test_mark_attendance_rejects_non_string_employees(self): + date = add_days(getdate(), -1) + for bad_list in ([None], [1], [{"name": self.employee1}], [self.employee1, ""]): + self.assertRaises( + frappe.ValidationError, + mark_employee_attendance, + employee_list=bad_list, + status="Present", + date=date, + ) + self.assertFalse(frappe.db.exists("Attendance", {"attendance_date": date})) + + def test_half_day_update_requires_write_access_on_each_record(self): + hr_user = make_company_restricted_user("test_half_day_writer@example.com", "_Test Company 1") + + date = add_days(getdate(), -1) + while is_holiday(employee=self.employee1, date=date): + date = add_days(date, -1) + + attendance = frappe.get_doc( + { + "doctype": "Attendance", + "employee": self.employee1, + "attendance_date": date, + "status": "Present", + } + ).insert() + attendance.submit() + + # employee1 sits outside the user's company scope; share the records read-only so + # they are visible to the user without being editable + frappe.share.add("Employee", self.employee1, hr_user, read=1) + frappe.share.add("Attendance", attendance.name, hr_user, read=1) + + def mark_half_day(): + mark_employee_attendance( + employee_list=[], + status="Present", + date=date, + mark_half_day=True, + half_day_status="Absent", + half_day_employee_list=[self.employee1], + ) + + frappe.set_user(hr_user) + try: + self.assertRaises(frappe.PermissionError, mark_half_day) + finally: + frappe.set_user("Administrator") + + attendance.reload() + self.assertIsNone(attendance.half_day_status) + + frappe.share.add("Attendance", attendance.name, hr_user, read=1, write=1) + frappe.set_user(hr_user) + try: + mark_half_day() + finally: + frappe.set_user("Administrator") + + attendance.reload() + self.assertEqual(attendance.half_day_status, "Absent") + def test_mark_half_day_attendance_permissions(self): user_no_role = "test_no_role@example.com" diff --git a/hrms/hr/doctype/expense_claim/expense_claim.py b/hrms/hr/doctype/expense_claim/expense_claim.py index 7054c758ffe..8cde0bddb65 100644 --- a/hrms/hr/doctype/expense_claim/expense_claim.py +++ b/hrms/hr/doctype/expense_claim/expense_claim.py @@ -35,6 +35,9 @@ class ExpenseApproverIdentityError(frappe.ValidationError): pass +ROLES_ALLOWED_TO_CLAIM_FOR_OTHERS = {"HR User", "HR Manager", "Expense Approver"} + + class MismatchError(frappe.ValidationError): pass @@ -104,6 +107,7 @@ def after_insert(self): def validate(self): validate_active_employee(self.employee) + self.validate_employee_scope() set_employee_name(self) self.set_company_currency_if_multi_currency_disabled() self.validate_sanctioned_amount() @@ -156,6 +160,34 @@ def set_status(self, update=False): else: self.status = status + def validate_employee_scope(self): + if not self.employee: + return + + employee_company, employee_user = frappe.db.get_value( + "Employee", self.employee, ["company", "user_id"] + ) + if not self.company: + self.company = employee_company + elif self.company != employee_company: + frappe.throw( + _("Employee {0} does not belong to company: {1}").format(self.employee, self.company), + exc=MismatchError, + ) + + if self.flags.ignore_permissions: + return + + if employee_user != frappe.session.user and not ( + set(frappe.get_roles()) & ROLES_ALLOWED_TO_CLAIM_FOR_OTHERS + ): + frappe.throw( + _("You are not allowed to create or modify an Expense Claim for Employee {0}").format( + self.employee + ), + frappe.PermissionError, + ) + def validate_company_and_department(self): if self.department: company = frappe.db.get_value("Department", self.department, "company") diff --git a/hrms/hr/doctype/expense_claim/test_expense_claim.py b/hrms/hr/doctype/expense_claim/test_expense_claim.py index e10222cc55f..b395ff8aeb0 100644 --- a/hrms/hr/doctype/expense_claim/test_expense_claim.py +++ b/hrms/hr/doctype/expense_claim/test_expense_claim.py @@ -16,7 +16,7 @@ get_outstanding_amount_for_claim, make_expense_claim_for_delivery_trip, ) -from hrms.tests.utils import HRMSTestSuite +from hrms.tests.utils import HRMSTestSuite, make_user company_name = "_Test Company 3" @@ -858,6 +858,53 @@ def test_company_department_validation(self): expense_claim.department = "Accounts - _TC2" self.assertRaises(MismatchError, expense_claim.save) + def test_company_must_match_employee_company(self): + employee = make_employee("test_other_company_claim@example.com", company="_Test Company 3") + payable_account = get_payable_account("_Test Company") + expense_claim = make_expense_claim( + payable_account, + 300, + 200, + "_Test Company", + "Travel Expenses - _TC", + do_not_submit=True, + employee=employee, + ) + self.assertRaises(MismatchError, expense_claim.save) + + def test_employee_can_only_claim_for_self(self): + employee = make_employee("test_self_claim@example.com", company="_Test Company") + other_employee = make_employee("test_other_claim@example.com", company="_Test Company") + hr_user = make_user("test_hr_claim@example.com", "HR User") + payable_account = get_payable_account("_Test Company") + + def claim_for(claim_employee): + return make_expense_claim( + payable_account, + 300, + 200, + "_Test Company", + "Travel Expenses - _TC", + do_not_submit=True, + employee=claim_employee, + ) + + # user permissions are bypassed so that the controller check is what gets exercised + frappe.db.delete("User Permission", {"user": "test_self_claim@example.com"}) + frappe.clear_cache(user="test_self_claim@example.com") + + frappe.set_user("test_self_claim@example.com") + self.assertRaises(frappe.PermissionError, claim_for(other_employee).insert) + + own_claim = claim_for(employee).insert() + own_claim.employee = other_employee + self.assertRaises(frappe.PermissionError, own_claim.save) + + frappe.set_user(hr_user) + claim_for(other_employee).insert() + + frappe.set_user("Administrator") + def test_self_expense_approval(self): frappe.db.set_single_value("HR Settings", "prevent_self_expense_approval", 0) diff --git a/hrms/locale/main.pot b/hrms/locale/main.pot index 2911908785e..07689c3879e 100644 --- a/hrms/locale/main.pot +++ b/hrms/locale/main.pot @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Frappe HR VERSION\n" "Report-Msgid-Bugs-To: contact@frappe.io\n" -"POT-Creation-Date: 2026-09-13 10:02+0000\n" -"PO-Revision-Date: 2026-09-13 10:02+0000\n" +"POT-Creation-Date: 2026-09-20 09:36+0000\n" +"PO-Revision-Date: 2026-09-20 09:36+0000\n" "Last-Translator: contact@frappe.io\n" "Language-Team: contact@frappe.io\n" "MIME-Version: 1.0\n" @@ -47,7 +47,7 @@ msgstr "" msgid "'employee_fieldname' must be one of {0}." msgstr "" -#: hrms/hr/utils.py:251 +#: hrms/hr/utils.py:248 #: hrms/payroll/doctype/payroll_period/payroll_period.py:65 msgid ") for {0}" msgstr "" @@ -301,7 +301,7 @@ msgstr "" msgid "A friendly reminder of an important date for our team." msgstr "" -#: hrms/hr/utils.py:247 +#: hrms/hr/utils.py:244 #: hrms/payroll/doctype/payroll_period/payroll_period.py:61 msgid "A {0} exists between {1} and {2} (" msgstr "" @@ -320,7 +320,7 @@ msgstr "" #: hrms/hr/doctype/attendance/attendance.json #: hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.json #: hrms/hr/doctype/training_event_employee/training_event_employee.json -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:833 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:778 #: hrms/payroll/doctype/payroll_settings/payroll_settings.json msgid "Absent" msgstr "" @@ -344,7 +344,7 @@ msgstr "" msgid "Account No" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:155 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:160 msgid "Account type should be set {0} for payroll payable account {1}, please set and try again" msgstr "" @@ -394,7 +394,7 @@ msgstr "" msgid "Accrual Component must be set for Flexible Benefit Salary Components with accrual payout methods." msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:673 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:681 msgid "Accrual Journal Entry for salaries from {0} to {1}" msgstr "" @@ -454,7 +454,7 @@ msgstr "" msgid "Actual Overtime Duration" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:488 +#: hrms/hr/doctype/leave_application/leave_application.py:491 msgid "Actual balances aren't available because the leave application spans over different leave allocations. You can still apply for leaves which would be compensated during the next allocation." msgstr "" @@ -501,7 +501,7 @@ msgstr "" msgid "Add unused leaves from previous leave period's allocation to this allocation" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1687 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1692 msgid "Added tax components from the Salary Component master as the salary structure didn't have any tax component." msgstr "" @@ -646,7 +646,7 @@ msgstr "" #. Label of the allocated_leaves (Float) field in DocType 'Leave Adjustment' #: hrms/hr/doctype/leave_adjustment/leave_adjustment.json -#: hrms/hr/doctype/leave_application/leave_application.js:75 +#: hrms/hr/doctype/leave_application/leave_application.js:76 msgid "Allocated Leaves" msgstr "" @@ -683,11 +683,11 @@ msgstr "" msgid "Allocation to Adjust" msgstr "" -#: hrms/hr/utils.py:436 +#: hrms/hr/utils.py:433 msgid "Allocation was skipped due to exceeding annual allocation set in leave policy" msgstr "" -#: hrms/hr/utils.py:444 +#: hrms/hr/utils.py:441 msgid "Allocation was skipped due to maximum leave allocation limit set in leave type. Please increase the limit and retry failed allocation." msgstr "" @@ -1427,7 +1427,7 @@ msgstr "" msgid "Attendance for employee {0} is already marked for the date {1}: {2}" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:665 +#: hrms/hr/doctype/leave_application/leave_application.py:668 msgid "Attendance for employee {0} is already marked for the following dates: {1}" msgstr "" @@ -1505,7 +1505,7 @@ msgstr "" msgid "Automated Based on Goal Progress" msgstr "" -#: hrms/hr/utils.py:497 +#: hrms/hr/utils.py:494 msgid "Automatic Leave Allocation has failed for the following Earned Leaves: {0}. Please check {1} for more details." msgstr "" @@ -1750,7 +1750,7 @@ msgstr "" msgid "Bookkeeping for once-per-site activation telemetry. The document name is the event name, so the primary key makes claiming a milestone atomic across concurrent transactions." msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:279 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:284 msgid "Branch: {0}" msgstr "" @@ -1818,11 +1818,11 @@ msgstr "" msgid "Calculated in days" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:723 +#: hrms/hr/doctype/expense_claim/expense_claim.py:747 msgid "Cancel the Payment Entry made against it, correct the advance account to be of type Receivable, and create a new Payment Entry." msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:189 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:194 msgid "Cancellation Queued" msgstr "" @@ -1870,15 +1870,15 @@ msgstr "" msgid "Cannot cancel Shift Assignment: {0} as it is linked to Employee Checkin: {1}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:369 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:368 msgid "Cannot create Salary Slip for Employee joining after Payroll Period" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:372 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:371 msgid "Cannot create Salary Slip for Employee who has left before Payroll Period" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2651 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2656 msgid "Cannot create Salary Slip: no active Salary Structure is assigned to employee {0}." msgstr "" @@ -1890,7 +1890,7 @@ msgstr "" msgid "Cannot create or change transactions against an Appraisal Cycle with status {0}." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:682 +#: hrms/hr/doctype/leave_application/leave_application.py:685 msgid "Cannot find active Leave Period" msgstr "" @@ -1898,7 +1898,7 @@ msgstr "" msgid "Cannot mark attendance for an Inactive employee {0}" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:112 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:117 msgid "Cannot submit. Attendance is not marked for some employees." msgstr "" @@ -1946,7 +1946,7 @@ msgstr "" msgid "Changed the status from {0} to {1} via Attendance Request" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:188 +#: hrms/hr/doctype/leave_application/leave_application.js:189 msgid "Changing '{0}' to {1}." msgstr "" @@ -1958,7 +1958,7 @@ msgstr "" msgid "Check {1} for more details" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1606 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1719 msgid "Check Error Log {0} for more details." msgstr "" @@ -1983,7 +1983,7 @@ msgid "Check in to create your first log." msgstr "" #: hrms/hr/doctype/leave_policy_assignment/leave_policy_assignment.py:551 -#: hrms/hr/utils.py:965 +#: hrms/hr/utils.py:953 msgid "Check {0} for more details" msgstr "" @@ -2215,7 +2215,7 @@ msgstr "" msgid "Copy of Invitation/Announcement" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1686 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1799 msgid "Could not submit some Salary Slips: {}" msgstr "" @@ -2327,7 +2327,7 @@ msgstr "" msgid "Creating Payment Entries......" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1644 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1757 msgid "Creating Salary Slips..." msgstr "" @@ -2339,7 +2339,7 @@ msgstr "" msgid "Creation Date" msgstr "" -#: hrms/hr/utils.py:974 +#: hrms/hr/utils.py:962 msgid "Creation Failed" msgstr "" @@ -2644,7 +2644,7 @@ msgstr "" msgid "Department {0} does not belong to company: {1}" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:281 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:286 msgid "Department: {0}" msgstr "" @@ -2677,7 +2677,7 @@ msgstr "" msgid "Designation Skill" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:283 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:288 msgid "Designation: {0}" msgstr "" @@ -2945,19 +2945,19 @@ msgstr "" msgid "Employee Advance {0} has {1} available for return. {2} has already been scheduled for deduction in {3}." msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:713 +#: hrms/hr/doctype/expense_claim/expense_claim.py:737 msgid "Employee Advance {0} is in currency {1} and can only be claimed in an Expense Claim of the same currency. This Expense Claim is in {2}." msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:740 +#: hrms/hr/doctype/expense_claim/expense_claim.py:764 msgid "Employee Advance {0} is linked to account {1}, which is not of type Receivable. Please correct the account type before making a payment against it." msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:731 +#: hrms/hr/doctype/expense_claim/expense_claim.py:755 msgid "Employee Advance {0} is linked to account {1}, which is not of type Receivable. {2}" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:758 +#: hrms/hr/doctype/expense_claim/expense_claim.py:782 msgid "Employee Advance {0}'s payment does not match its Receivable account. This can happen if the account's type was changed after the payment was made. {1}" msgstr "" @@ -3459,11 +3459,11 @@ msgstr "" msgid "Employee was marked Absent for not meeting the working hours threshold." msgstr "" -#: hrms/hr/doctype/shift_type/shift_type.py:487 +#: hrms/hr/doctype/shift_type/shift_type.py:491 msgid "Employee was marked Absent for other half due to missing Employee Checkins." msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:485 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:482 msgid "Employee {0} : {1}" msgstr "" @@ -3483,7 +3483,7 @@ msgstr "" msgid "Employee {0} has already applied for Shift {1}: {2} that overlaps within this period" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:551 +#: hrms/hr/doctype/leave_application/leave_application.py:554 msgid "Employee {0} has already applied for {1} between {2} and {3} : {4}" msgstr "" @@ -3507,7 +3507,7 @@ msgstr "" msgid "Employee {0} on Half day on {1}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:728 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:727 msgid "Employee {0} relieved on {1} must be set as 'Left'" msgstr "" @@ -3569,6 +3569,7 @@ msgid "Employees working on a holiday" msgstr "" #. Option for the 'Type' (Select) field in DocType 'Salary Component' +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:777 #: hrms/payroll/doctype/salary_component/salary_component.json msgid "Employer Contribution" msgstr "" @@ -3582,6 +3583,10 @@ msgstr "" msgid "Employer Contributions" msgstr "" +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:772 +msgid "Employer contribution accrual for salaries from {0} to {1}" +msgstr "" + #. Label of the employment_type (Link) field in DocType 'Employee Attendance #. Tool' #. Name of a DocType @@ -3688,7 +3693,7 @@ msgstr "" msgid "End Date cannot be before Start Date" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:287 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:292 msgid "End date: {0}" msgstr "" @@ -3741,7 +3746,7 @@ msgstr "" msgid "Error downloading PDF" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1409 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1414 #: hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py:460 msgid "Error in formula or condition" msgstr "" @@ -4058,7 +4063,7 @@ msgstr "" #. Label of the expense_type (Data) field in DocType 'Expense Claim Type' #. Label of a Workspace Sidebar Item #: hrms/expenses/sidebar/expenses/expenses.json -#: hrms/hr/doctype/expense_claim/expense_claim.py:690 +#: hrms/hr/doctype/expense_claim/expense_claim.py:714 #: hrms/hr/doctype/expense_claim_detail/expense_claim_detail.json #: hrms/hr/doctype/expense_claim_type/expense_claim_type.json #: hrms/workspace_sidebar/expenses.json @@ -4160,7 +4165,7 @@ msgstr "" msgid "Exporting..." msgstr "" -#: hrms/hr/utils.py:962 +#: hrms/hr/utils.py:950 msgid "Failed to create/submit {0} for employees:" msgstr "" @@ -4172,7 +4177,7 @@ msgstr "" msgid "Failed to download PDF" msgstr "" -#: hrms/api/__init__.py:818 +#: hrms/api/__init__.py:815 msgid "Failed to download PDF: {0}" msgstr "" @@ -4212,7 +4217,7 @@ msgstr "" msgid "Failure Reason" msgstr "" -#: hrms/hr/utils.py:496 +#: hrms/hr/utils.py:493 msgid "Failure of Automatic Allocation of Earned Leaves" msgstr "" @@ -4306,7 +4311,7 @@ msgstr "" msgid "File Preview" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:99 +#: hrms/hr/doctype/leave_application/leave_application.js:100 #: hrms/hr/doctype/leave_encashment/leave_encashment.js:60 msgid "Fill the form and save it" msgstr "" @@ -4363,7 +4368,7 @@ msgstr "" msgid "First Name " msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1589 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1702 msgid "Fiscal Year {0} not found" msgstr "" @@ -4502,7 +4507,7 @@ msgstr "" msgid "From and to dates are madatory for recurring type additional salaries." msgstr "" -#: hrms/hr/utils.py:199 +#: hrms/hr/utils.py:196 msgid "From date can not be less than employee's joining date" msgstr "" @@ -4579,7 +4584,7 @@ msgstr "" msgid "Future Income Tax" msgstr "" -#: hrms/hr/utils.py:197 +#: hrms/hr/utils.py:194 msgid "Future dates not allowed" msgstr "" @@ -4851,7 +4856,7 @@ msgstr "" msgid "Half Day Date" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:954 +#: hrms/hr/doctype/leave_application/leave_application.py:983 msgid "Half Day Date cannot be a holiday" msgstr "" @@ -4859,7 +4864,7 @@ msgstr "" msgid "Half Day Date is mandatory" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:957 +#: hrms/hr/doctype/leave_application/leave_application.py:986 msgid "Half Day Date should be between From Date and To Date" msgstr "" @@ -5183,7 +5188,7 @@ msgstr "" msgid "In Time" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:183 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:188 msgid "In case of any error during this background process, the system will add a comment about the error on this Payroll Entry and revert to the Submitted status" msgstr "" @@ -5295,11 +5300,11 @@ msgstr "" msgid "Income Tax Slab is mandatory since the Salary Structure {0} has a tax component {1}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1966 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1971 msgid "Income Tax Slab must be effective on or before Payroll Period Start Date: {0}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1954 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1959 msgid "Income Tax Slab not set in Salary Structure Assignment: {0}" msgstr "" @@ -5307,7 +5312,7 @@ msgstr "" msgid "Income Tax Slab: " msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1962 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1967 msgid "Income Tax Slab: {0} is disabled" msgstr "" @@ -5341,11 +5346,11 @@ msgstr "" msgid "Install Frappe HR" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:501 +#: hrms/hr/doctype/leave_application/leave_application.py:504 msgid "Insufficient Balance" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:499 +#: hrms/hr/doctype/leave_application/leave_application.py:502 msgid "Insufficient leave balance for Leave Type {0}" msgstr "" @@ -5546,7 +5551,7 @@ msgstr "" msgid "Invalid Dates" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2716 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2721 msgid "Invalid LWP Days Reversed" msgstr "" @@ -5567,7 +5572,7 @@ msgstr "" msgid "Invalid employee filter: {0}" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:982 +#: hrms/hr/doctype/expense_claim/expense_claim.py:1006 msgid "Invalid parameters provided. Please pass the required arguments." msgstr "" @@ -5940,7 +5945,7 @@ msgstr "" msgid "Key Result Area" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2713 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2718 msgid "LWP Days Reversed ({0}) does not match actual Payroll Corrections total ({1}) for employee {2} from {3} to {4}" msgstr "" @@ -6011,7 +6016,7 @@ msgstr "" #. Option for the 'Calculate Payroll Working Days Based On' (Select) field in #. DocType 'Payroll Settings' -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:835 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:780 #: hrms/overrides/dashboard_overrides.py:12 #: hrms/payroll/doctype/payroll_settings/payroll_settings.json msgid "Leave" @@ -6063,7 +6068,7 @@ msgstr "" msgid "Leave Application" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:835 +#: hrms/hr/doctype/leave_application/leave_application.py:840 msgid "Leave Application period cannot be across two non-consecutive leave allocations {0} and {1}." msgstr "" @@ -6106,7 +6111,7 @@ msgstr "" msgid "Leave Approver Name" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:921 +#: hrms/hr/doctype/leave_application/leave_application.py:950 msgid "Leave Approver is mandatory" msgstr "" @@ -6167,7 +6172,7 @@ msgstr "" msgid "Leave Block List Name" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:1498 +#: hrms/hr/doctype/leave_application/leave_application.py:1544 msgid "Leave Blocked" msgstr "" @@ -6381,7 +6386,7 @@ msgstr "" msgid "Leave Without Pay" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:593 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:592 msgid "Leave Without Pay does not match with approved {} records" msgstr "" @@ -6414,7 +6419,7 @@ msgstr "" msgid "Leave for optional holiday" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:581 +#: hrms/hr/doctype/leave_application/leave_application.py:584 msgid "Leave of type {0} cannot be longer than {1}." msgstr "" @@ -6507,6 +6512,18 @@ msgctxt "Employee" msgid "Left" msgstr "" +#. Label of the liability_account (Link) field in DocType 'Salary Component +#. Account' +#: hrms/payroll/doctype/salary_component_account/salary_component_account.json +msgid "Liability Account" +msgstr "" + +#. Description of the 'Liability Account' (Link) field in DocType 'Salary +#. Component Account' +#: hrms/payroll/doctype/salary_component_account/salary_component_account.json +msgid "Liability account credited for employer contributions. Applicable only for Employer Contribution components, where Account is debited as the expense." +msgstr "" + #: hrms/overrides/dashboard_overrides.py:21 msgid "Lifecycle" msgstr "" @@ -6554,7 +6571,7 @@ msgstr "" msgid "Loan Repayment Entry" msgstr "" -#: hrms/hr/utils.py:849 +#: hrms/hr/utils.py:837 msgid "Loan cannot be repayed from salary for Employee {0} because salary is processed in currency {1}" msgstr "" @@ -6790,7 +6807,7 @@ msgstr "" msgid "Maximum Consecutive Leaves Allowed" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:591 +#: hrms/hr/doctype/leave_application/leave_application.py:594 msgid "Maximum Consecutive Leaves Exceeded" msgstr "" @@ -6903,7 +6920,7 @@ msgstr "" msgid "Missing Salary Components" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1957 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1962 msgid "Missing Tax Slab" msgstr "" @@ -6916,7 +6933,7 @@ msgstr "" msgid "Mode of Travel" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:493 +#: hrms/hr/doctype/expense_claim/expense_claim.py:496 msgid "Mode of payment is required to make a payment" msgstr "" @@ -6939,7 +6956,7 @@ msgstr "" msgid "Monthly Attendance Sheet" msgstr "" -#: hrms/hr/utils.py:277 +#: hrms/hr/utils.py:274 msgid "More than one selection for {0} not allowed" msgstr "" @@ -6976,7 +6993,7 @@ msgid "My Requests" msgstr "" #: hrms/payroll/doctype/income_tax_slab/income_tax_slab.py:123 -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1395 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1400 #: hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py:446 msgid "Name error" msgstr "" @@ -7005,7 +7022,7 @@ msgstr "" msgid "Net Pay Info" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:272 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:271 msgid "Net Pay cannot be less than 0" msgstr "" @@ -7077,11 +7094,11 @@ msgstr "" msgid "No Employee found for the given employee field value. '{}': {}" msgstr "" -#: hrms/hr/doctype/appraisal_cycle/appraisal_cycle.py:137 hrms/hr/utils.py:952 +#: hrms/hr/doctype/appraisal_cycle/appraisal_cycle.py:137 hrms/hr/utils.py:940 msgid "No Employees Selected" msgstr "" -#: hrms/utils/holiday_list.py:107 +#: hrms/utils/holiday_list.py:279 msgid "No Holiday List was found for Employee {0} or their company {1} for date {2}. Please assign through {3}" msgstr "" @@ -7117,7 +7134,7 @@ msgstr "" msgid "No Salary Structure assigned to Employee {0} on the given date {1}" msgstr "" -#: hrms/payroll/doctype/salary_component/salary_component.js:121 +#: hrms/payroll/doctype/salary_component/salary_component.js:131 msgid "No Salary Structures" msgstr "" @@ -7137,7 +7154,7 @@ msgstr "" msgid "No active employee found associated with the email ID {0}. Try logging in with your employee email ID or contact your HR manager for access." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:506 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:505 msgid "No active or default Salary Structure found for employee {0} for the given dates" msgstr "" @@ -7178,11 +7195,11 @@ msgstr "" msgid "No attendance records found for employee {0} between {1} and {2}" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:75 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:72 msgid "No attendance records found for this criteria." msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:68 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:65 msgid "No attendance records found." msgstr "" @@ -7198,11 +7215,11 @@ msgstr "" msgid "No check-ins yet" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:288 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:293 msgid "No employees found" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:271 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:276 msgid "No employees found for the mentioned criteria:
Company: {0}
Currency: {1}
Payroll Payable Account: {2}" msgstr "" @@ -7255,7 +7272,7 @@ msgstr "" msgid "No replies from" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1672 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1785 msgid "No salary slip found to submit for the above selected criteria OR salary slip already submitted" msgstr "" @@ -7322,7 +7339,7 @@ msgstr "" msgid "Note: Total allocated leaves {0} shouldn't be less than already approved leaves {1} for the period" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2266 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2271 msgid "Note: Your salary slip is password protected, the password to unlock the PDF is of the format {0}." msgstr "" @@ -7554,7 +7571,7 @@ msgstr "" msgid "Opening closed." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:688 +#: hrms/hr/doctype/leave_application/leave_application.py:691 msgid "Optional Holiday List not set for leave period {0}" msgstr "" @@ -7661,11 +7678,11 @@ msgstr "" msgid "Overtime Slip" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:486 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:483 msgid "Overtime Slip Creation Error for {0}" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:497 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:494 msgid "Overtime Slip Creation Failed" msgstr "" @@ -7674,27 +7691,27 @@ msgstr "" msgid "Overtime Slip Step" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:520 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:517 msgid "Overtime Slip Submission Error for {0}" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:531 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:528 msgid "Overtime Slip Submission Failed" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:526 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:523 msgid "Overtime Slip Submitted" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:490 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:487 msgid "Overtime Slip created for {0} employee(s)" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1298 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1411 msgid "Overtime Slip creation is queued. It may take a few minutes" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1324 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1437 msgid "Overtime Slip submission is queued. It may take a few minutes" msgstr "" @@ -7702,11 +7719,11 @@ msgstr "" msgid "Overtime Slip:{0} has been created between {1} and {2}" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:492 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:489 msgid "Overtime Slips Created" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:524 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:521 msgid "Overtime Slips submitted for {0} employee(s)" msgstr "" @@ -7872,7 +7889,7 @@ msgstr "" msgid "Payment and Accounting" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1146 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1271 msgid "Payment of {0} from {1} to {2}" msgstr "" @@ -7952,7 +7969,7 @@ msgstr "" msgid "Payroll Employee Detail" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:181 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:186 msgid "Payroll Entry cancellation is queued. It may take a few minutes" msgstr "" @@ -8121,7 +8138,7 @@ msgstr "" msgid "Please Select Company First" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:897 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:902 msgid "Please assign a Salary Structure for Employee {0} applicable from or before {1} first" msgstr "" @@ -8165,7 +8182,7 @@ msgstr "" msgid "Please reduce {0} to avoid shift time overlapping with itself" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2255 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2260 msgid "Please see attachment" msgstr "" @@ -8182,7 +8199,7 @@ msgstr "" msgid "Please select Employee first." msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:45 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:42 msgid "Please select Filter Based On" msgstr "" @@ -8215,7 +8232,7 @@ msgstr "" msgid "Please select a date." msgstr "" -#: hrms/hr/utils.py:840 +#: hrms/hr/utils.py:828 msgid "Please select an Applicant" msgstr "" @@ -8227,7 +8244,7 @@ msgstr "" msgid "Please select at least one Shift Request to perform this action." msgstr "" -#: hrms/hr/utils.py:951 +#: hrms/hr/utils.py:939 msgid "Please select at least one employee to perform this action." msgstr "" @@ -8235,7 +8252,7 @@ msgstr "" msgid "Please select at least one row to perform this action." msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:59 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:56 msgid "Please select company." msgstr "" @@ -8252,7 +8269,7 @@ msgstr "" msgid "Please select half day attendance status." msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:48 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:45 msgid "Please select month and year." msgstr "" @@ -8288,7 +8305,7 @@ msgstr "" msgid "Please set Leave Approver for the Employee: {0}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:577 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:576 msgid "Please set Payroll based on in Payroll settings" msgstr "" @@ -8297,11 +8314,11 @@ msgid "Please set Relieving Date for employee: {0}" msgstr "" #: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.js:193 -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:56 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:53 msgid "Please set a date range less than 90 days." msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:403 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:408 msgid "Please set account in Salary Component {0}" msgstr "" @@ -8309,11 +8326,11 @@ msgstr "" msgid "Please set cost to company(CTC) for employee {0} in the {1}" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:743 +#: hrms/hr/doctype/leave_application/leave_application.py:746 msgid "Please set default template for Leave Approval Notification in HR Settings." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:718 +#: hrms/hr/doctype/leave_application/leave_application.py:721 msgid "Please set default template for Leave Status Notification in HR Settings." msgstr "" @@ -8321,6 +8338,10 @@ msgstr "" msgid "Please set employee's total cost to company to see CTC breakup." msgstr "" +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:798 +msgid "Please set expense and liability accounts in Salary Component {0}" +msgstr "" + #: hrms/hr/doctype/employee_advance/employee_advance.py:81 msgid "Please set the Advance Account {0} or in {1}" msgstr "" @@ -8333,7 +8354,7 @@ msgstr "" msgid "Please set the Company" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:365 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:364 msgid "Please set the Date Of Joining for employee {0}" msgstr "" @@ -8341,7 +8362,7 @@ msgstr "" msgid "Please set the Holiday List." msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:52 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:49 msgid "Please set the date range." msgstr "" @@ -8420,7 +8441,7 @@ msgstr "" #: hrms/hr/doctype/attendance/attendance.json #: hrms/hr/doctype/employee_attendance_tool/employee_attendance_tool.json #: hrms/hr/doctype/training_event_employee/training_event_employee.json -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:834 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:779 #: hrms/payroll/doctype/payroll_settings/payroll_settings.json msgid "Present" msgstr "" @@ -8744,12 +8765,6 @@ msgstr "" msgid "Recruitment Analytics" msgstr "" -#. Option for the 'Adjustment Type' (Select) field in DocType 'Leave -#. Adjustment' -#: hrms/hr/doctype/leave_adjustment/leave_adjustment.json -msgid "Reduce" -msgstr "" - #: hrms/hr/doctype/leave_type/leave_type.py:102 msgid "Reducing maximum leaves allowed after allocation may cause scheduler to allocate incorrect number of earned leaves. Proceed with caution." msgstr "" @@ -8759,9 +8774,9 @@ msgid "Reduction is more than {0}'s available leave balance {1} for leave type { msgstr "" #: hrms/hr/doctype/leave_allocation/leave_allocation.py:414 -#: hrms/hr/doctype/leave_application/leave_application.py:585 +#: hrms/hr/doctype/leave_application/leave_application.py:588 #: hrms/payroll/doctype/additional_salary/additional_salary.py:222 -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:141 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:146 msgid "Reference: {0}" msgstr "" @@ -8880,7 +8895,7 @@ msgstr "" msgid "Repay From Salary" msgstr "" -#: hrms/hr/utils.py:855 +#: hrms/hr/utils.py:843 msgid "Repay From Salary can be selected only for term loans" msgstr "" @@ -9101,11 +9116,11 @@ msgstr "" msgid "Row #{0}: Timesheet amount will overwrite the Earning component amount for the Salary Component {1}" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:950 +#: hrms/hr/doctype/expense_claim/expense_claim.py:974 msgid "Row No {0}: Amount cannot be greater than the Outstanding Amount against Expense Claim {1}. Outstanding Amount is {2}" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:577 +#: hrms/hr/doctype/expense_claim/expense_claim.py:591 msgid "Row {0}# Allocated amount {1} cannot be greater than unclaimed amount {2}" msgstr "" @@ -9141,6 +9156,10 @@ msgstr "" msgid "Row {0}: {1} is required in the expenses table to book an expense claim." msgstr "" +#: hrms/hr/doctype/expense_claim/expense_claim.py:601 +msgid "Row {0}: {1}, {2} and {3} are required against advance {4}." +msgstr "" + #. Label of the salary_component (Link) field in DocType 'Overtime Salary #. Component' #. Label of the salary_component (Link) field in DocType 'Additional Salary' @@ -9203,7 +9222,7 @@ msgstr "" msgid "Salary Component {0} cannot be selected more than once in Employee Benefits" msgstr "" -#: hrms/payroll/doctype/salary_component/salary_component.js:119 +#: hrms/payroll/doctype/salary_component/salary_component.js:129 msgid "Salary Component {0} is currently not used in any Salary Structure." msgstr "" @@ -9319,11 +9338,11 @@ msgstr "" msgid "Salary Slip Timesheet" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:137 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:142 msgid "Salary Slip already exists for {0} for the given dates" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:336 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:341 msgid "Salary Slip creation is queued. It may take a few minutes" msgstr "" @@ -9331,19 +9350,19 @@ msgstr "" msgid "Salary Slip not found." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:399 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:398 msgid "Salary Slip of employee {0} already created for this period" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:405 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:404 msgid "Salary Slip of employee {0} already created for time sheet {1}" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:381 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:386 msgid "Salary Slip submission is queued. It may take a few minutes" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1594 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1707 msgid "Salary Slip {0} failed for Payroll Entry {1}" msgstr "" @@ -9365,11 +9384,11 @@ msgstr "" msgid "Salary Slips Submitted" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1651 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1764 msgid "Salary Slips already exist for employees {}, and will not be processed by this payroll." msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1678 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1791 msgid "Salary Slips submitted for period from {0} to {1}" msgstr "" @@ -9384,7 +9403,7 @@ msgstr "" #. Label of a Workspace Sidebar Item #: hrms/payroll/doctype/arrear/arrear.json #: hrms/payroll/doctype/bulk_salary_structure_assignment/bulk_salary_structure_assignment.json -#: hrms/payroll/doctype/salary_component/salary_component.js:37 +#: hrms/payroll/doctype/salary_component/salary_component.js:47 #: hrms/payroll/doctype/salary_slip/salary_slip.json #: hrms/payroll/doctype/salary_structure/salary_structure.json #: hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.json @@ -9416,7 +9435,7 @@ msgstr "" msgid "Salary Structure Assignment not found for employee {0} on date {1}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:509 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:508 msgid "Salary Structure Missing" msgstr "" @@ -9436,7 +9455,7 @@ msgstr "" msgid "Salary Structure: " msgstr "" -#: hrms/payroll/doctype/salary_component/salary_component.js:156 +#: hrms/payroll/doctype/salary_component/salary_component.js:166 msgid "Salary Structures updated successfully" msgstr "" @@ -9482,7 +9501,7 @@ msgstr "" msgid "Salary components should be part of the Salary Structure." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2739 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2744 msgid "Salary slip emails have been enqueued for sending. Check {0} for status." msgstr "" @@ -9499,7 +9518,7 @@ msgstr "" msgid "Sanctioned Amount (Company Currency)" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:601 +#: hrms/hr/doctype/expense_claim/expense_claim.py:625 msgid "Sanctioned Amount cannot be greater than Claim Amount in Row {0}." msgstr "" @@ -9558,7 +9577,7 @@ msgstr "" msgid "Select Payment Account to make Bank Entry" msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1830 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1943 msgid "Select Payroll Frequency." msgstr "" @@ -9599,7 +9618,7 @@ msgstr "" msgid "Select the Employee for which you want to allocate leaves." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:318 +#: hrms/hr/doctype/leave_application/leave_application.js:322 msgid "Select the Employee." msgstr "" @@ -9615,7 +9634,7 @@ msgstr "" msgid "Select the date from which this Leave Allocation will be valid." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:335 +#: hrms/hr/doctype/leave_application/leave_application.js:339 msgid "Select the end date for your Leave Application." msgstr "" @@ -9625,7 +9644,7 @@ msgstr "" msgid "Select the salary components whose total will be used from the salary slip to calculate the hourly overtime rate." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:330 +#: hrms/hr/doctype/leave_application/leave_application.js:334 msgid "Select the start date for your Leave Application." msgstr "" @@ -9635,11 +9654,11 @@ msgstr "" msgid "Select this if you want shift assignments to be automatically created indefinitely." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:323 +#: hrms/hr/doctype/leave_application/leave_application.js:327 msgid "Select type of leave the employee wants to apply for, like Sick Leave, Privilege Leave, Casual Leave, etc." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:345 +#: hrms/hr/doctype/leave_application/leave_application.js:349 msgid "Select your Leave Approver i.e. the person who approves or rejects your leaves." msgstr "" @@ -9647,7 +9666,7 @@ msgstr "" msgid "Selected employee advance is not of employee {0}" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:568 +#: hrms/hr/doctype/expense_claim/expense_claim.py:581 msgid "Selected employee advance is not of employee {}" msgstr "" @@ -9679,7 +9698,7 @@ msgstr "" msgid "Self-approval for Expense Claims is not allowed" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:940 +#: hrms/hr/doctype/leave_application/leave_application.py:969 msgid "Self-approval for leaves is not allowed" msgstr "" @@ -9801,7 +9820,7 @@ msgstr "" msgid "Set optional filters to fetch employees in the appraisee list" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:689 +#: hrms/hr/doctype/expense_claim/expense_claim.py:713 msgid "Set the default account for the {0} {1}" msgstr "" @@ -9836,7 +9855,7 @@ msgstr "" msgid "Settle all Payables and Receivables before submission" msgstr "" -#: hrms/hr/utils.py:803 +#: hrms/hr/utils.py:791 msgid "Shared document with the user {0} with 'Submit' permission" msgstr "" @@ -10224,7 +10243,7 @@ msgstr "" msgid "Standard Working Hours" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1891 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1896 msgid "Start and end dates not in a valid Payroll Period, cannot calculate {0}." msgstr "" @@ -10232,11 +10251,11 @@ msgstr "" msgid "Start date cannot be greater than end date" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:54 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:51 msgid "Start date cannot be greater than end date." msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:285 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:290 msgid "Start date: {0}" msgstr "" @@ -10312,7 +10331,7 @@ msgstr "" msgid "Submit Salary Slip" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:108 +#: hrms/hr/doctype/leave_application/leave_application.js:109 msgid "Submit this Leave Application to confirm." msgstr "" @@ -10330,7 +10349,7 @@ msgstr "" msgid "Submitting Salary Slips and creating Journal Entry..." msgstr "" -#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1733 +#: hrms/payroll/doctype/payroll_entry/payroll_entry.py:1846 msgid "Submitting Salary Slips..." msgstr "" @@ -10338,7 +10357,7 @@ msgstr "" msgid "Subsidiary companies have already planned for {1} vacancies at a budget of {2}. Staffing Plan for {0} should allocate more vacancies and budget for {3} than planned for its subsidiary companies" msgstr "" -#: hrms/hr/utils.py:979 +#: hrms/hr/utils.py:967 msgid "Successfully created {0} for employees:" msgstr "" @@ -10360,11 +10379,11 @@ msgstr "" msgid "Summarized View" msgstr "" -#: hrms/payroll/doctype/salary_component/salary_component.js:105 +#: hrms/payroll/doctype/salary_component/salary_component.js:115 msgid "Sync {0}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1402 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1407 #: hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py:453 msgid "Syntax error" msgstr "" @@ -10521,11 +10540,11 @@ msgstr "" msgid "Thank you for applying." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2670 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2675 msgid "The Assigned Salary Structure {0} for the employee {1} does not have a Salary Component configured for Salary Slip based on Timesheet." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2664 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2669 msgid "The Assigned Salary Structure {0} for the employee {1} is not configured for Salary Slip based on Timesheet." msgstr "" @@ -10548,7 +10567,7 @@ msgstr "" msgid "The day of the month when leaves should be allocated" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:457 +#: hrms/hr/doctype/leave_application/leave_application.py:459 msgid "The day(s) on which you are applying for leave are holidays. You need not apply for leave." msgstr "" @@ -10607,7 +10626,7 @@ msgstr "" msgid "Theory" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:574 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:573 msgid "There are more holidays than working days this month." msgstr "" @@ -10655,17 +10674,17 @@ msgstr "" msgid "This employee already has a log with the same timestamp.{0}" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1410 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1415 #: hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py:461 msgid "This error can be due to invalid formula or condition." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1403 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1408 #: hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py:454 msgid "This error can be due to invalid syntax." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:1396 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:1401 #: hrms/payroll/doctype/salary_structure_assignment/salary_structure_assignment.py:447 msgid "This error can be due to missing or deleted field." msgstr "" @@ -10737,7 +10756,7 @@ msgstr "" msgid "To allow this, enable {0} under {1}." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.js:340 +#: hrms/hr/doctype/leave_application/leave_application.js:344 msgid "To apply for a Half Day check 'Half Day' and select the Half Day Date" msgstr "" @@ -10749,11 +10768,11 @@ msgstr "" msgid "To date can not be greater than employee's relieving date." msgstr "" -#: hrms/hr/utils.py:195 +#: hrms/hr/utils.py:192 msgid "To date can not be less than from date" msgstr "" -#: hrms/hr/utils.py:201 +#: hrms/hr/utils.py:198 msgid "To date can not greater than employee's relieving date" msgstr "" @@ -10787,7 +10806,7 @@ msgstr "" msgid "Today {0} completed {1} {2} at our Company! 🎉" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:153 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:150 msgid "Total Absent" msgstr "" @@ -10897,7 +10916,7 @@ msgstr "" msgid "Total Deduction (Company Currency)" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:178 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:175 msgid "Total Early Exits" msgstr "" @@ -10979,7 +10998,7 @@ msgstr "" msgid "Total Interest Amount" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:172 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:169 msgid "Total Late Entries" msgstr "" @@ -10988,7 +11007,7 @@ msgstr "" msgid "Total Leave Days" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:152 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:149 msgid "Total Leaves" msgstr "" @@ -11046,7 +11065,7 @@ msgstr "" msgid "Total Payout" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:147 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:144 msgid "Total Present" msgstr "" @@ -11097,7 +11116,7 @@ msgstr "" msgid "Total Self Score" msgstr "" -#: hrms/hr/doctype/expense_claim/expense_claim.py:595 +#: hrms/hr/doctype/expense_claim/expense_claim.py:619 msgid "Total advance amount cannot be greater than total sanctioned amount" msgstr "" @@ -11157,7 +11176,7 @@ msgstr "" msgid "Total working Days Per Year" msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:242 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:241 msgid "Total working hours should not be greater than max working hours {0}" msgstr "" @@ -11267,7 +11286,7 @@ msgstr "" msgid "Trainings (This Week)" msgstr "" -#: hrms/hr/utils.py:826 +#: hrms/hr/utils.py:814 msgid "Transactions cannot be created for an Inactive Employee {0}." msgstr "" @@ -11383,7 +11402,7 @@ msgstr "" msgid "Unmarked Check-in Logs Found" msgstr "" -#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:161 +#: hrms/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py:158 #: hrms/public/js/templates/employees_with_unmarked_attendance.html:19 msgid "Unmarked Days" msgstr "" @@ -11473,7 +11492,7 @@ msgstr "" msgid "Update Response" msgstr "" -#: hrms/payroll/doctype/salary_component/salary_component.js:126 +#: hrms/payroll/doctype/salary_component/salary_component.js:136 msgid "Update Salary Structures" msgstr "" @@ -11650,11 +11669,11 @@ msgstr "" msgid "WARNING: Loan Management module has been separated from ERPNext." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:484 +#: hrms/hr/doctype/leave_application/leave_application.py:487 msgid "Warning: Insufficient leave balance for Leave Type {0} in this allocation." msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:492 +#: hrms/hr/doctype/leave_application/leave_application.py:495 msgid "Warning: Insufficient leave balance for Leave Type {0}." msgstr "" @@ -11876,7 +11895,7 @@ msgstr "" msgid "You can only submit Leave Encashment for a valid encashment amount" msgstr "" -#: hrms/api/__init__.py:768 +#: hrms/api/__init__.py:765 msgid "You can only upload JPG, PNG, PDF, TXT or Microsoft documents." msgstr "" @@ -12068,7 +12087,7 @@ msgstr "" msgid "{0} & {1} more" msgstr "" -#: hrms/hr/doctype/overtime_slip/overtime_slip.py:518 +#: hrms/hr/doctype/overtime_slip/overtime_slip.py:515 msgid "{0} : {1}" msgstr "" @@ -12104,7 +12123,7 @@ msgstr "" msgid "{0} already allocated for Employee {1} for period {2} to {3}" msgstr "" -#: hrms/hr/utils.py:268 +#: hrms/hr/utils.py:265 msgid "{0} already exists for employee {1} and period {2}" msgstr "" @@ -12160,7 +12179,7 @@ msgstr "" msgid "{0} is not allowed to submit Interview Feedback for the Interview: {1}" msgstr "" -#: hrms/hr/doctype/leave_application/leave_application.py:696 +#: hrms/hr/doctype/leave_application/leave_application.py:699 msgid "{0} is not in Optional Holiday List" msgstr "" @@ -12217,7 +12236,7 @@ msgstr "" msgid "{0} was assigned {1}" msgstr "" -#: hrms/payroll/doctype/salary_component/salary_component.js:136 +#: hrms/payroll/doctype/salary_component/salary_component.js:146 msgid "{0} will be updated for the following Salary Structures: {1}." msgstr "" @@ -12225,11 +12244,11 @@ msgstr "" msgid "{0} {1} {2}?" msgstr "" -#: hrms/hr/utils.py:469 +#: hrms/hr/utils.py:466 msgid "{0}. Check error log for more details." msgstr "" -#: hrms/payroll/doctype/salary_slip/salary_slip.py:2289 +#: hrms/payroll/doctype/salary_slip/salary_slip.py:2294 msgid "{0}: Employee email not found, hence email not sent" msgstr "" diff --git a/hrms/subscription_utils.py b/hrms/subscription_utils.py index 5554ed1a6b9..1d52ac73009 100644 --- a/hrms/subscription_utils.py +++ b/hrms/subscription_utils.py @@ -173,8 +173,8 @@ def hide_erpnext() -> bool: def has_subscription(secret_key) -> bool: - url = f"https://frappecloud.com/api/method/press.api.developer.marketplace.get_subscription_status?secret_key={secret_key}" - response = requests.request(method="POST", url=url, timeout=5) + url = "https://frappecloud.com/api/method/press.api.developer.marketplace.get_subscription_status" + response = requests.post(url, data={"secret_key": secret_key}, timeout=5) status = response.json().get("message") return True if status == "Active" else False diff --git a/hrms/telemetry.py b/hrms/telemetry.py index 15f93556da6..eaf201b2261 100644 --- a/hrms/telemetry.py +++ b/hrms/telemetry.py @@ -1,13 +1,39 @@ +"""Usage telemetry for HRMS. + +Data policy: an event describes how a feature is used, never the person it is +used for. Properties are limited to counts, booleans, durations and values from +a fixed vocabulary. Names, free text, amounts, scores, dates and anything that +could describe an individual are stripped before the event leaves the site. +""" + import frappe from frappe.database import savepoint from frappe.query_builder.functions import Count from frappe.utils import add_days, date_diff, getdate, today from frappe.utils.telemetry import capture as _capture +from frappe.utils.telemetry import is_pulse_enabled as is_enabled from frappe.utils.telemetry import site_age APP = "hrms" ACTIVATION_WINDOW_DAYS = 30 +# The only string properties that may be sent, each restricted to the standard +# Select options of the field it comes from. Anything else becomes "other". +FIXED_VOCABULARIES = { + "reason": {"Work From Home", "On Duty"}, + "log_type": {"IN", "OUT"}, + "status": { + "Awaiting Response", + "Accepted", + "Rejected", + "Cancelled", + "Pending", + "Under Review", + "Cleared", + }, + "payroll_frequency": {"Monthly", "Fortnightly", "Bimonthly", "Weekly", "Daily"}, +} + def _skip_context() -> bool: """Don't record telemetry from automated / non-interactive runs.""" @@ -20,12 +46,26 @@ def _skip_context() -> bool: ) +def _should_skip() -> bool: + return _skip_context() or not is_enabled() + + +def sanitize_properties(properties: dict | None) -> dict: + clean = {} + for key, value in (properties or {}).items(): + if value is None or isinstance(value, bool | int | float): + clean[key] = value + elif isinstance(value, str) and key in FIXED_VOCABULARIES: + clean[key] = value if value in FIXED_VOCABULARIES[key] else "other" + return clean + + def capture(event: str, properties: dict | None = None) -> None: """Record an HR usage event (fires on every occurrence).""" - if _skip_context(): + if _should_skip(): return - _capture(event, APP, properties=properties or {}) + _capture(event, APP, properties=sanitize_properties(properties)) _track_conversion() @@ -43,7 +83,7 @@ def _claim_milestone(event: str) -> bool: def capture_first(event: str, properties: dict | None = None) -> None: - if _skip_context(): + if _should_skip(): return age = site_age() @@ -96,11 +136,17 @@ def _duration_days(from_date, to_date) -> int | None: return date_diff(to_date, from_date) + 1 +LEAVE_TYPE_FLAGS = ("is_lwp", "is_ppl", "is_compensatory", "is_optional_leave", "is_earned_leave") + + def on_leave_application_submit(doc, method=None): + # The leave type's name can reveal health or family circumstances + # (e.g. "Sick Leave"), so only its configuration flags are sent. + flags = frappe.db.get_value("Leave Type", doc.leave_type, LEAVE_TYPE_FLAGS, as_dict=True) or {} capture( "leave_application_submitted", { - "leave_type": doc.leave_type, + **{flag: bool(flags.get(flag)) for flag in LEAVE_TYPE_FLAGS}, "total_leave_days": doc.total_leave_days, "half_day": bool(doc.half_day), "self_approved": doc.leave_approver == frappe.session.user, @@ -113,7 +159,6 @@ def on_expense_claim_submit(doc, method=None): capture( "expense_claim_submitted", { - "total_claimed_amount": doc.total_claimed_amount, "expense_count": len(doc.expenses or []), "is_paid": bool(doc.is_paid), "has_advances": bool(doc.get("advances")), @@ -123,17 +168,11 @@ def on_expense_claim_submit(doc, method=None): capture_first("first_expense_claimed") -# Standard `Attendance Request.reason` Select options. Anything outside this set -# (e.g. a site that customised the field into free-text) is coarsened to "other" -# so raw user-entered notes never leave the site. -ATTENDANCE_REQUEST_REASONS = {"Work From Home", "On Duty"} - - def on_attendance_request_submit(doc, method=None): capture( "attendance_request_submitted", { - "reason": doc.reason if doc.reason in ATTENDANCE_REQUEST_REASONS else "other", + "reason": doc.reason, "half_day": bool(doc.half_day), "include_holidays": bool(doc.include_holidays), "days": _duration_days(doc.from_date, doc.to_date), @@ -145,7 +184,7 @@ def on_shift_request_submit(doc, method=None): capture( "shift_request_submitted", { - "shift_type": doc.shift_type, + "has_approver": bool(doc.approver), "days": _duration_days(doc.from_date, doc.to_date), }, ) @@ -232,7 +271,6 @@ def on_appraisal_submit(doc, method=None): "kra_count": len(doc.get("appraisal_kra") or []), "rated_manually": bool(doc.rate_goals_manually), "has_self_appraisal": bool(doc.get("self_ratings")), - "final_score": doc.final_score, }, ) @@ -249,7 +287,7 @@ def on_interview_submit(doc, method=None): def capture_daily_attendance_pulse(): - if _skip_context() or not frappe.get_system_settings("enable_telemetry"): + if _should_skip(): return active_employees = frappe.db.count("Employee", {"status": "Active"}) diff --git a/hrms/tests/test_api.py b/hrms/tests/test_api.py new file mode 100644 index 00000000000..dee713a573b --- /dev/null +++ b/hrms/tests/test_api.py @@ -0,0 +1,27 @@ +import frappe + +from erpnext.setup.doctype.employee.test_employee import make_employee + +from hrms.api import get_company_currencies +from hrms.tests.utils import HRMSTestSuite, make_company_restricted_user + + +class TestAPI(HRMSTestSuite): + def test_get_company_currencies_respects_company_scope(self): + companies = get_company_currencies() + self.assertIn("_Test Company", companies) + self.assertIn("_Test Company 1", companies) + self.assertEqual( + companies["_Test Company"][0], frappe.db.get_value("Company", "_Test Company", "default_currency") + ) + + user = "test_scoped_employee@example.com" + make_employee(user, company="_Test Company") + make_company_restricted_user(user, "_Test Company", role="Employee") + frappe.set_user(user) + try: + companies = get_company_currencies() + finally: + frappe.set_user("Administrator") + + self.assertEqual(list(companies), ["_Test Company"]) diff --git a/hrms/tests/test_telemetry.py b/hrms/tests/test_telemetry.py index a366a9538ea..b5cb2492024 100644 --- a/hrms/tests/test_telemetry.py +++ b/hrms/tests/test_telemetry.py @@ -10,6 +10,16 @@ _claim_milestone, capture, capture_daily_attendance_pulse, + on_appraisal_submit, + on_attendance_request_submit, + on_employee_checkin, + on_expense_claim_submit, + on_interview_submit, + on_job_offer_submit, + on_leave_application_submit, + on_payroll_entry_submit, + on_shift_request_submit, + sanitize_properties, ) from hrms.tests.utils import HRMSTestSuite @@ -41,9 +51,9 @@ def create_checkin(employee: str, time: str): ).insert() -def create_leave_type(): +def create_leave_type(**flags): return frappe.get_doc( - {"doctype": "Leave Type", "leave_type_name": f"_Test LT {frappe.generate_hash(length=8)}"} + {"doctype": "Leave Type", "leave_type_name": f"_Test LT {frappe.generate_hash(length=8)}", **flags} ).insert() @@ -60,6 +70,7 @@ def collect(event, app, properties=None): # mid-test; `add_days`/`getdate` stay real and derive from the frozen value. patches = [ patch("hrms.telemetry._skip_context", return_value=False), + patch("hrms.telemetry.is_enabled", return_value=True), patch("hrms.telemetry._capture", side_effect=collect), patch("hrms.telemetry.site_age", return_value=3), patch("hrms.telemetry.today", return_value=FROZEN_TODAY), @@ -71,14 +82,6 @@ def collect(event, app, properties=None): def events(self, name: str) -> list[dict]: return [props for event, props in self.captured if event == name] - def telemetry_enabled(self): - """Force only `enable_telemetry` on; other settings (timezone) must pass through.""" - real = frappe.get_system_settings - return patch( - "frappe.get_system_settings", - side_effect=lambda key: 1 if key == "enable_telemetry" else real(key), - ) - def release_milestone(self, event: str): frappe.db.delete(MILESTONE_DOCTYPE, {"event": event}) @@ -126,8 +129,7 @@ def test_daily_pulse_summarises_yesterday_not_today(self): self.assertEqual(self.checkins_on(FROZEN_YESTERDAY), 3) self.assertEqual(self.checkins_on(FROZEN_TODAY), 1) - with self.telemetry_enabled(): - capture_daily_attendance_pulse() + capture_daily_attendance_pulse() summaries = self.events("attendance_daily_summary") self.assertEqual(len(summaries), 1) @@ -145,8 +147,7 @@ def test_daily_pulse_reports_zero_when_only_today_has_checkins(self): create_checkin(employee.name, f"{FROZEN_TODAY} 09:30:00") create_checkin(employee.name, f"{FROZEN_TODAY} 18:30:00") - with self.telemetry_enabled(): - capture_daily_attendance_pulse() + capture_daily_attendance_pulse() summary = self.events("attendance_daily_summary")[0] self.assertEqual(summary["checkins"], 0) @@ -156,14 +157,171 @@ def test_daily_pulse_reports_zero_when_only_today_has_checkins(self): def test_daily_pulse_weekday_describes_the_summarised_day(self): create_employee(f"_Test Pulse {frappe.generate_hash(length=8)}") - with self.telemetry_enabled(): - capture_daily_attendance_pulse() + capture_daily_attendance_pulse() summary = self.events("attendance_daily_summary")[0] # 2026-03-11 is a Wednesday; weekday() counts Monday as 0. self.assertEqual(summary["weekday"], 2) self.assertEqual(summary["weekday"], getdate(add_days(FROZEN_TODAY, -1)).weekday()) + # ---- the enable_telemetry gate ---- + + def test_nothing_is_captured_or_recorded_when_telemetry_is_disabled(self): + # Created first: on a fresh site the Employee insert hook is itself usage + # and would stamp `first_capture` before the disabled block begins. + create_employee(f"_Test Pulse {frappe.generate_hash(length=8)}") + self.release_milestone(CONVERSION_EVENT) + self.release_milestone(FIRST_CAPTURE_MILESTONE) + self.release_milestone("leave_type_configured") + self.captured.clear() + + with patch("hrms.telemetry.is_enabled", return_value=False): + capture("_test_usage", {"count": 1}) + create_leave_type() + capture_daily_attendance_pulse() + + self.assertEqual(self.captured, []) + self.assertFalse(frappe.db.exists(MILESTONE_DOCTYPE, FIRST_CAPTURE_MILESTONE)) + self.assertFalse(frappe.db.exists(MILESTONE_DOCTYPE, "leave_type_configured")) + + # ---- payload hygiene ---- + + def test_only_scalars_and_fixed_vocabulary_leave_the_site(self): + clean = sanitize_properties( + { + "count": 3, + "rate": 0.5, + "flag": True, + "missing": None, + "note": "free text typed by a user", + "employee_name": "Jane Doe", + "when": getdate(FROZEN_TODAY), + "nested": {"a": 1}, + "status": "Accepted", + "reason": "Attending a funeral", + } + ) + + self.assertEqual( + clean, + { + "count": 3, + "rate": 0.5, + "flag": True, + "missing": None, + "status": "Accepted", + "reason": "other", + }, + ) + + def test_capture_applies_the_sanitizer(self): + capture("_test_usage", {"note": "secret", "count": 2}) + + self.assertEqual(self.events("_test_usage"), [{"count": 2}]) + + def test_leave_application_sends_leave_type_flags_not_its_name(self): + leave_type = create_leave_type(is_lwp=1) + doc = frappe._dict( + leave_type=leave_type.name, total_leave_days=2.0, half_day=0, leave_approver="x@example.com" + ) + + on_leave_application_submit(doc) + + props = self.events("leave_application_submitted")[0] + self.assertNotIn("leave_type", props) + self.assertTrue(props["is_lwp"]) + self.assertFalse(props["is_compensatory"]) + self.assertEqual(props["total_leave_days"], 2.0) + self.assertFalse(props["self_approved"]) + + def test_hook_payloads_carry_no_personal_or_free_text_values(self): + hooks = [ + ( + on_expense_claim_submit, + frappe._dict(total_claimed_amount=12345, expenses=[{}, {}], is_paid=0, advances=[], taxes=[]), + ), + ( + on_attendance_request_submit, + frappe._dict( + reason="Doctor visit", + half_day=0, + include_holidays=0, + from_date=FROZEN_TODAY, + to_date=FROZEN_TODAY, + ), + ), + ( + on_shift_request_submit, + frappe._dict( + shift_type="Night Shift", + approver="a@example.com", + from_date=FROZEN_TODAY, + to_date=FROZEN_TODAY, + ), + ), + ( + on_employee_checkin, + frappe._dict(log_type="IN", shift="Day", latitude=12.9, longitude=77.6, device_id="d1"), + ), + ( + on_payroll_entry_submit, + frappe._dict( + payroll_frequency="Monthly", + number_of_employees=4, + employees=[], + validate_attendance=1, + salary_slip_based_on_timesheet=0, + start_date=FROZEN_TODAY, + end_date=FROZEN_TODAY, + ), + ), + ( + on_job_offer_submit, + frappe._dict(status="Accepted", offer_terms=[{}], job_offer_term_template=None), + ), + ( + on_appraisal_submit, + frappe._dict( + appraisal_cycle="C1", + goals=[{}], + appraisal_kra=[{}], + rate_goals_manually=0, + self_ratings=[{}], + final_score=4.7, + ), + ), + ( + on_interview_submit, + frappe._dict(status="Cleared", interview_details=[{}, {}], job_opening="JO1"), + ), + ] + + for hook, doc in hooks: + hook(doc) + + forbidden = { + "total_claimed_amount", + "shift_type", + "final_score", + "leave_type", + "latitude", + "longitude", + "device_id", + } + for event, props in self.captured: + self.assertFalse(forbidden & set(props), f"{event} leaks {forbidden & set(props)}") + for key, value in props.items(): + if isinstance(value, str): + self.assertIn( + key, ("reason", "log_type", "status", "payroll_frequency"), f"{event}.{key}" + ) + else: + self.assertTrue(value is None or isinstance(value, bool | int | float), f"{event}.{key}") + + self.assertEqual(self.events("attendance_request_submitted")[0]["reason"], "other") + self.assertEqual(self.events("job_offer_made")[0]["status"], "Accepted") + self.assertEqual(self.events("employee_checkin")[0]["has_geolocation"], True) + # ---- first-time milestones ---- def test_milestone_fires_for_doctype_seeded_at_install(self): @@ -245,8 +403,7 @@ def test_daily_pulse_does_not_start_the_conversion_clock(self): self.release_milestone(CONVERSION_EVENT) self.release_milestone(FIRST_CAPTURE_MILESTONE) - with self.telemetry_enabled(): - capture_daily_attendance_pulse() + capture_daily_attendance_pulse() self.assertEqual(len(self.events("attendance_daily_summary")), 1) self.assertFalse(frappe.db.exists(MILESTONE_DOCTYPE, FIRST_CAPTURE_MILESTONE)) @@ -255,8 +412,7 @@ def test_daily_pulse_does_not_convert_the_site(self): create_employee(f"_Test Pulse {frappe.generate_hash(length=8)}") self.start_conversion_clock(days_ago=15) - with self.telemetry_enabled(): - capture_daily_attendance_pulse() + capture_daily_attendance_pulse() self.assertEqual(self.events(CONVERSION_EVENT), []) diff --git a/hrms/tests/utils.py b/hrms/tests/utils.py index be8f5c1b285..2b80b79d92f 100644 --- a/hrms/tests/utils.py +++ b/hrms/tests/utils.py @@ -371,3 +371,32 @@ class HRMSTestSuite(ERPNextTestSuite): """Class for creating HRMS test records""" pass + + +def make_user(email: str, role: str = "HR Manager") -> str: + if not frappe.db.exists("User", email): + frappe.get_doc( + { + "doctype": "User", + "email": email, + "first_name": email.split("@")[0], + "send_welcome_email": 0, + } + ).insert() + frappe.get_doc("User", email).add_roles(role) + return email + + +def make_company_restricted_user(email: str, company: str, role: str = "HR Manager") -> str: + make_user(email, role) + if not frappe.db.exists("User Permission", {"user": email, "allow": "Company", "for_value": company}): + frappe.get_doc( + { + "doctype": "User Permission", + "user": email, + "allow": "Company", + "for_value": company, + "apply_to_all_doctypes": 1, + } + ).insert() + return email