Skip to content

Commit

Permalink
Merge pull request #2147 from ruchamahabal/fix-structure
Browse files Browse the repository at this point in the history
fix(Payroll): multiline condition & formula eval failing on salary slip creation from payroll entry
  • Loading branch information
ruchamahabal authored Sep 4, 2024
2 parents f109bf3 + 0a878c7 commit c6eed77
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hrms/payroll/doctype/salary_slip/salary_slip.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def get_emp_and_working_day_details(self):
struct = self.check_sal_struct()

if struct:
self._salary_structure_doc = frappe.get_cached_doc("Salary Structure", struct)
self.set_salary_structure_doc()
self.salary_slip_based_on_timesheet = (
self._salary_structure_doc.salary_slip_based_on_timesheet or 0
)
Expand Down
3 changes: 2 additions & 1 deletion hrms/payroll/doctype/salary_slip/test_salary_slip.py
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,8 @@ def make_earning_salary_component(
"salary_component": "Special Allowance",
"abbr": "SA",
"condition": "H < 10000",
"formula": "BS*.5",
# intentional to test multiline formula
"formula": "BS\n*.5",
"type": "Earning",
"amount_based_on_formula": 1,
"depends_on_payment_days": 0,
Expand Down

0 comments on commit c6eed77

Please sign in to comment.