def test_loan_repayment_salary_slip(self): from erpnext.hr.doctype.loan.test_loan import create_loan_type, create_loan applicant = make_employee("*****@*****.**") create_loan_type("Car Loan", 500000, 6.4) loan = create_loan(applicant, "Car Loan", 11000, "Repay Over Number of Periods", 20) loan.repay_from_salary = 1 loan.submit() ss = make_employee_salary_slip("*****@*****.**", "Monthly") ss.submit() self.assertEqual(ss.total_loan_repayment, 582) self.assertEqual(ss.net_pay, (flt(ss.gross_pay) - (flt(ss.total_deduction) + flt(ss.total_loan_repayment))))
def test_loan_repayment_salary_slip(self): from erpnext.hr.doctype.loan.test_loan import create_loan_type, create_loan applicant = make_employee("*****@*****.**") create_loan_type("Car Loan", 500000, 6.4) loan = create_loan(applicant, "Car Loan", 11000, "Repay Over Number of Periods", 20) loan.repay_from_salary = 1 loan.submit() ss = make_employee_salary_slip("*****@*****.**", "Monthly") ss.submit() self.assertEqual(ss.total_loan_repayment, 582) self.assertEqual(ss.net_pay, (flt(ss.gross_pay) - (flt(ss.total_deduction) + flt(ss.total_loan_repayment))))