Skip to content

Commit

Permalink
Merge pull request #2492 from frappe/version-15-hotfix
Browse files Browse the repository at this point in the history
chore: release v15
  • Loading branch information
ruchamahabal authored Dec 9, 2024
2 parents b5e967b + 67077ee commit e62e289
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
10 changes: 6 additions & 4 deletions hrms/hr/doctype/leave_application/leave_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ def validate_block_days(self):
frappe.throw(_("You are not authorized to approve leaves on Block Dates"), LeaveDayBlockedError)

def validate_balance_leaves(self):
precision = cint(frappe.db.get_single_value("System Settings", "float_precision")) or 2

if self.from_date and self.to_date:
self.total_leave_days = get_number_of_leave_days(
self.employee,
Expand All @@ -376,9 +378,9 @@ def validate_balance_leaves(self):
consider_all_leaves_in_the_allocation_period=True,
for_consumption=True,
)
self.leave_balance = leave_balance.get("leave_balance")
leave_balance_for_consumption = leave_balance.get("leave_balance_for_consumption")

leave_balance_for_consumption = flt(
leave_balance.get("leave_balance_for_consumption"), precision
)
if self.status != "Rejected" and (
leave_balance_for_consumption < self.total_leave_days or not leave_balance_for_consumption
):
Expand Down Expand Up @@ -848,7 +850,7 @@ def get_number_of_leave_days(
def get_leave_details(employee, date, for_salary_slip=False):
allocation_records = get_leave_allocation_records(employee, date)
leave_allocation = {}
precision = cint(frappe.db.get_single_value("System Settings", "float_precision", cache=True))
precision = cint(frappe.db.get_single_value("System Settings", "float_precision")) or 2

for d in allocation_records:
allocation = allocation_records.get(d, frappe._dict())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def execute(filters: Filters | None = None) -> tuple:
if not (filters.month and filters.year):
frappe.throw(_("Please select month and year."))

if not filters.company:
frappe.throw(_("Please select company."))

if filters.company:
filters.companies = [filters.company]
if filters.include_company_descendants:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def warn_about_missing_opening_entries(self):

@frappe.whitelist()
def are_opening_entries_required(self) -> bool:
if not get_tax_component(self.salary_structure):
return False

if self.has_emp_joined_after_payroll_period_start() and not self.has_existing_salary_slips():
return True
else:
Expand Down
7 changes: 7 additions & 0 deletions hrms/payroll/report/salary_register/salary_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def execute(filters=None):
"start_date": ss.start_date,
"end_date": ss.end_date,
"leave_without_pay": ss.leave_without_pay,
"absent_days": ss.absent_days,
"payment_days": ss.payment_days,
"currency": currency or company_currency,
"total_loan_repayment": ss.total_loan_repayment,
Expand Down Expand Up @@ -175,6 +176,12 @@ def get_columns(earning_types, ded_types):
"fieldtype": "Float",
"width": 50,
},
{
"label": _("Absent Days"),
"fieldname": "absent_days",
"fieldtype": "Float",
"width": 50,
},
{
"label": _("Payment Days"),
"fieldname": "payment_days",
Expand Down
2 changes: 1 addition & 1 deletion hrms/templates/generators/job_opening.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
{{ _("Closes On") if status == "Open" else _("Closed On") }}
</div>
<div class="font-weight-bold">
{{ frappe.format_date(closes_on if status == "Open" else closed_on, "d MMM, YYYY") }}
{{ frappe.utils.format_date(closes_on if status == "Open" else closed_on, "d MMM, YYYY") }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion hrms/www/jobs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ <h3 class="mt-0 mb-10 jobs-page">{{ _("Job Openings") }}</h3>
<p class="col-6 text-center mb-0">
{%- if jo.closes_on -%}
{{ _("Closes on:") + " " }}
<b>{{ frappe.format_date(jo.closes_on, "d MMM, YYYY") }}</b>
<b>{{ frappe.utils.format_date(jo.closes_on, "d MMM, YYYY") }}</b>
{% endif %}
</p>
</div>
Expand Down

0 comments on commit e62e289

Please sign in to comment.