mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 23:31:20 +00:00
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -660,6 +660,8 @@ def submit_salary_slips_for_employees(payroll_entry, salary_slips, publish_progr
|
|||||||
if not_submitted_ss:
|
if not_submitted_ss:
|
||||||
frappe.msgprint(_("Could not submit some Salary Slips"))
|
frappe.msgprint(_("Could not submit some Salary Slips"))
|
||||||
|
|
||||||
|
frappe.flags.via_payroll_entry = False
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
@frappe.validate_and_sanitize_search_inputs
|
@frappe.validate_and_sanitize_search_inputs
|
||||||
def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters):
|
def get_payroll_entries_for_jv(doctype, txt, searchfield, start, page_len, filters):
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ from erpnext.payroll.doctype.salary_structure.salary_structure import make_salar
|
|||||||
class TestSalarySlip(unittest.TestCase):
|
class TestSalarySlip(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
setup_test()
|
setup_test()
|
||||||
|
frappe.flags.pop("via_payroll_entry", None)
|
||||||
|
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
frappe.db.rollback()
|
frappe.db.rollback()
|
||||||
@@ -413,15 +415,17 @@ class TestSalarySlip(unittest.TestCase):
|
|||||||
"email_salary_slip_to_employee": 1
|
"email_salary_slip_to_employee": 1
|
||||||
})
|
})
|
||||||
def test_email_salary_slip(self):
|
def test_email_salary_slip(self):
|
||||||
frappe.db.sql("delete from `tabEmail Queue`")
|
frappe.db.delete("Email Queue")
|
||||||
|
|
||||||
make_employee("test_email_salary_slip@salary.com", company="_Test Company")
|
user_id = "test_email_salary_slip@salary.com"
|
||||||
ss = make_employee_salary_slip("test_email_salary_slip@salary.com", "Monthly", "Test Salary Slip Email")
|
|
||||||
|
make_employee(user_id, company="_Test Company")
|
||||||
|
ss = make_employee_salary_slip(user_id, "Monthly", "Test Salary Slip Email")
|
||||||
ss.company = "_Test Company"
|
ss.company = "_Test Company"
|
||||||
ss.save()
|
ss.save()
|
||||||
ss.submit()
|
ss.submit()
|
||||||
|
|
||||||
email_queue = frappe.db.sql("""select name from `tabEmail Queue`""")
|
email_queue = frappe.db.a_row_exists("Email Queue")
|
||||||
self.assertTrue(email_queue)
|
self.assertTrue(email_queue)
|
||||||
|
|
||||||
def test_loan_repayment_salary_slip(self):
|
def test_loan_repayment_salary_slip(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user