def setUp(self): create_loan_accounts() create_loan_type( "Personal Loan", 500000, 8.4, is_term_loan=1, mode_of_payment='Cash', payment_account='Payment Account - _TC', loan_account='Loan Account - _TC', interest_income_account='Interest Income Account - _TC', penalty_income_account='Penalty Income Account - _TC') create_loan_type("Stock Loan", 2000000, 13.5, 25, 1, 5, 'Cash', 'Payment Account - _TC', 'Loan Account - _TC', 'Interest Income Account - _TC', 'Penalty Income Account - _TC') create_loan_type("Demand Loan", 2000000, 13.5, 25, 0, 5, 'Cash', 'Payment Account - _TC', 'Loan Account - _TC', 'Interest Income Account - _TC', 'Penalty Income Account - _TC') create_loan_security_type() create_loan_security() create_loan_security_price( "Test Security 1", 500, "Nos", get_datetime(), get_datetime(add_to_date(nowdate(), hours=24))) create_loan_security_price( "Test Security 2", 250, "Nos", get_datetime(), get_datetime(add_to_date(nowdate(), hours=24))) self.applicant1 = make_employee("*****@*****.**") make_salary_structure("Test Salary Structure Loan", "Monthly", employee=self.applicant1, currency='INR', company="_Test Company") if not frappe.db.exists("Customer", "_Test Loan Customer"): frappe.get_doc(get_customer_dict('_Test Loan Customer')).insert( ignore_permissions=True) if not frappe.db.exists("Customer", "_Test Loan Customer 1"): frappe.get_doc(get_customer_dict("_Test Loan Customer 1")).insert( ignore_permissions=True) self.applicant2 = frappe.db.get_value("Customer", {"name": "_Test Loan Customer"}, "name") self.applicant3 = frappe.db.get_value( "Customer", {"name": "_Test Loan Customer 1"}, "name") create_loan(self.applicant1, "Personal Loan", 280000, "Repay Over Number of Periods", 20)
def setUp(self): create_loan_accounts() create_loan_type("Demand Loan", 2000000, 13.5, 25, 0, 5, 'Cash', 'Payment Account - _TC', 'Loan Account - _TC', 'Interest Income Account - _TC', 'Penalty Income Account - _TC') create_loan_security_type() create_loan_security() create_loan_security_price( "Test Security 1", 500, "Nos", get_datetime(), get_datetime(add_to_date(nowdate(), hours=24))) create_loan_security_price( "Test Security 2", 250, "Nos", get_datetime(), get_datetime(add_to_date(nowdate(), hours=24))) if not frappe.db.exists("Customer", "_Test Loan Customer"): frappe.get_doc(get_customer_dict('_Test Loan Customer')).insert( ignore_permissions=True) self.applicant = frappe.db.get_value("Customer", {'name': '_Test Loan Customer'}, 'name')
def test_party_status_close(self): from erpnext.selling.doctype.customer.test_customer import get_customer_dict customer = frappe.get_doc( get_customer_dict('Party Status Test')).insert() self.assertEquals( frappe.db.get_value('Customer', customer.name, 'status'), 'Active') # open quotation quotation = frappe.get_doc( get_quotation_dict(customer=customer.name)).insert() self.assertEquals( frappe.db.get_value('Customer', customer.name, 'status'), 'Open') # close quotation (submit) quotation.submit() quotation1 = frappe.get_doc( get_quotation_dict(customer=customer.name)).insert() # still open self.assertEquals( frappe.db.get_value('Customer', customer.name, 'status'), 'Open') quotation.cancel() quotation.delete() quotation1.delete() customer.delete()
def setUp(self): create_loan_accounts() create_loan_type( "Demand Loan", 2000000, 13.5, 25, 0, 5, "Cash", "Disbursement Account - _TC", "Payment Account - _TC", "Loan Account - _TC", "Interest Income Account - _TC", "Penalty Income Account - _TC", ) create_loan_security_type() create_loan_security() create_loan_security_price( "Test Security 1", 500, "Nos", get_datetime(), get_datetime(add_to_date(nowdate(), hours=24))) if not frappe.db.exists("Customer", "_Test Loan Customer"): frappe.get_doc(get_customer_dict("_Test Loan Customer")).insert( ignore_permissions=True) self.applicant = frappe.db.get_value("Customer", {"name": "_Test Loan Customer"}, "name")
def test_party_status_open(self): from erpnext.selling.doctype.customer.test_customer import get_customer_dict customer = frappe.get_doc(get_customer_dict("Party Status Test")).insert() self.assertEquals(frappe.db.get_value("Customer", customer.name, "status"), "Active") quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert() self.assertEquals(frappe.db.get_value("Customer", customer.name, "status"), "Open") quotation.submit() self.assertEquals(frappe.db.get_value("Customer", customer.name, "status"), "Active") quotation.cancel() quotation.delete() customer.delete()