forked from frappe/erpnext
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,19 @@ def test_whitespaces_in_formula_conditions_fields(self): | |
for row in salary_structure.deductions: | ||
self.assertFalse(("\n" in row.formula) or ("\n" in row.condition)) | ||
|
||
def test_salary_structures_assignment(self): | ||
salary_structure = make_salary_structure("Salary Structure Sample", "Monthly") | ||
employee = "[email protected]" | ||
employee_doc_name = make_employee(employee) | ||
# clear the already assigned stuctures | ||
frappe.db.sql('''delete from `tabSalary Structure Assignment` where employee=%s and salary_structure=%s ''', | ||
("[email protected]",salary_structure.name)) | ||
#test structure_assignment | ||
salary_structure.assign_salary_structure(employee=employee_doc_name,from_date='2013-01-01',base=5000,variable=200) | ||
salary_structure_assignment = frappe.get_doc("Salary Structure Assignment",{'employee':employee_doc_name, 'from_date':'2013-01-01'}) | ||
self.assertEqual(salary_structure_assignment.docstatus, 1) | ||
self.assertEqual(salary_structure_assignment.base, 5000) | ||
self.assertEqual(salary_structure_assignment.variable, 200) | ||
|
||
def make_salary_structure(salary_structure, payroll_frequency, employee=None, dont_submit=False, other_details=None, test_tax=False): | ||
if test_tax: | ||
|