Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions hrms/hr/doctype/leave_ledger_entry/leave_ledger_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ def expire_allocation(allocation: str | Document | frappe._dict, expiry_date: da
allocation = json.loads(allocation)
allocation = frappe.get_doc("Leave Allocation", allocation["name"])

if getattr(allocation, "docstatus", 0) == 2:
return

frappe.has_permission("Leave Allocation", "write", allocation.name, throw=True)

leaves = get_remaining_leaves(allocation)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"applies_to_doctype": "Attendance",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "standard_working_hours",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Attendance (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"applies_to_doctype": "Employee",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "retirement_age",
"settings_doctype": "HR Settings"
},
{
"setting_field": "emp_created_by",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"applies_to_doctype": "Employee Advance",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "unlink_payment_on_cancellation_of_employee_advance",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Advance (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"applies_to_doctype": "Employee Checkin",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "allow_employee_checkin_from_mobile_app",
"settings_doctype": "HR Settings"
},
{
"setting_field": "allow_geolocation_tracking",
"settings_doctype": "HR Settings"
},
{
"setting_field": "standard_working_hours",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee Checkin (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"applies_to_doctype": "Exit Interview",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "exit_questionnaire_web_form",
"settings_doctype": "HR Settings"
},
{
"setting_field": "exit_questionnaire_notification_template",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Exit Interview (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"applies_to_doctype": "Expense Claim",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "expense_approver_mandatory_in_expense_claim",
"settings_doctype": "HR Settings"
},
{
"setting_field": "prevent_self_expense_approval",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"applies_to_doctype": "Interview",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "send_interview_reminder",
"settings_doctype": "HR Settings"
},
{
"setting_field": "send_interview_feedback_reminder",
"settings_doctype": "HR Settings"
},
{
"setting_field": "remind_before",
"settings_doctype": "HR Settings"
},
{
"setting_field": "interview_reminder_template",
"settings_doctype": "HR Settings"
},
{
"setting_field": "feedback_reminder_notification_template",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Interview (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"applies_to_doctype": "Job Offer",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "check_vacancies",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Job Offer (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"applies_to_doctype": "Leave Application",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "leave_approver_mandatory_in_leave_application",
"settings_doctype": "HR Settings"
},
{
"setting_field": "prevent_self_leave_approval",
"settings_doctype": "HR Settings"
},
{
"setting_field": "restrict_backdated_leave_application",
"settings_doctype": "HR Settings"
},
{
"setting_field": "role_allowed_to_create_backdated_leave_application",
"settings_doctype": "HR Settings"
},
{
"setting_field": "show_leaves_of_all_department_members_in_calendar",
"settings_doctype": "HR Settings"
},
{
"setting_field": "send_leave_notification",
"settings_doctype": "HR Settings"
},
{
"setting_field": "leave_approval_notification_template",
"settings_doctype": "HR Settings"
},
{
"setting_field": "leave_status_notification_template",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Application (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"applies_to_doctype": "Leave Encashment",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "auto_leave_encashment",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Encashment (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"applies_to_doctype": "Overtime Slip",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "create_overtime_slip",
"settings_doctype": "Payroll Settings"
},
{
"setting_field": "standard_working_hours",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Overtime Slip (Standard)",
"owner": "Administrator"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"applies_to_doctype": "Shift Assignment",
"creation": "2026-07-16 00:00:00.000000",
"docstatus": 0,
"doctype": "DocType Settings Map",
"idx": 0,
"is_active": 1,
"is_standard": 1,
"mappings": [
{
"setting_field": "allow_multiple_shift_assignments",
"settings_doctype": "HR Settings"
}
],
"modified": "2026-07-16 00:00:00.000000",
"modified_by": "Administrator",
"module": "HR",
"name": "Shift Assignment (Standard)",
"owner": "Administrator"
}
22 changes: 12 additions & 10 deletions hrms/hr/report/vehicle_expenses/vehicle_expenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,18 @@ def get_period_dates(filters):


def get_service_expense(logname):
expense_amount = frappe.db.sql(
"""
SELECT sum(expense_amount)
FROM
`tabVehicle Log` log, `tabVehicle Service` service
WHERE
service.parent=log.name and log.name=%s
""",
logname,
)
from frappe.query_builder.functions import Sum

log = frappe.qb.DocType("Vehicle Log")
service = frappe.qb.DocType("Vehicle Service")

expense_amount = (
frappe.qb.from_(log)
.inner_join(service)
.on(service.parent == log.name)
.select(Sum(service.expense_amount))
.where((log.name == logname) & (log.docstatus == 1))
).run()

return flt(expense_amount[0][0]) if expense_amount else 0.0

Expand Down
19 changes: 17 additions & 2 deletions hrms/payroll/doctype/payroll_entry/payroll_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,8 +1605,23 @@ def create_salary_slips_for_employees(employees, args, publish_progress=True):

employees = list(set(employees) - set(salary_slips_exist_for))
for emp in employees:
args.update({"doctype": "Salary Slip", "employee": emp})
frappe.get_doc(args).insert()
slip_args = {
"doctype": "Salary Slip",
"employee": emp,
"salary_slip_based_on_timesheet": args.get("salary_slip_based_on_timesheet"),
"payroll_frequency": args.get("payroll_frequency"),
"start_date": args.get("start_date"),
"end_date": args.get("end_date"),
"company": args.get("company"),
"posting_date": args.get("posting_date"),
"deduct_tax_for_unsubmitted_tax_exemption_proof": args.get(
"deduct_tax_for_unsubmitted_tax_exemption_proof"
),
"payroll_entry": args.get("payroll_entry"),
"exchange_rate": args.get("exchange_rate"),
"currency": args.get("currency"),
}
frappe.get_doc(slip_args).insert()

count += 1
if publish_progress:
Expand Down
5 changes: 4 additions & 1 deletion hrms/payroll/doctype/salary_slip/salary_slip.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,12 @@ class SalarySlip(TransactionBase):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.default_series = f"Sal Slip/{self.employee}/.#####"
self.whitelisted_globals = COMPONENT_EVAL_GLOBALS.copy()

@property
def default_series(self):
return f"Sal Slip/{self.employee}/.#####"

def autoname(self):
if not self.has_custom_naming_series:
self.name = make_autoname(self.default_series)
Expand Down
Loading
Loading