fix: Multiple fixes for travis (#20924)

* fix: Multiple fixes for travis

* fix: Multiple fixes for travis

* fix: Run dashboard patch if table already exists

* fix: Multiple fixes for travis

* fix: deletion of auto-created batch
This commit is contained in:
Nabin Hait
2020-03-17 17:04:18 +05:30
committed by GitHub
parent 06dc6a527e
commit ddc3bb2251
18 changed files with 107 additions and 162 deletions

View File

@@ -294,18 +294,21 @@ class TestLoan(unittest.TestCase):
make_loan_disbursement_entry(loan.name, loan.loan_amount)
frappe.db.sql(""" UPDATE `tabLoan Security Price` SET loan_security_price = %s
where loan_security=%s""", (100, 'Test Security 2'))
frappe.db.sql(""" UPDATE `tabLoan Security Price` SET loan_security_price = 100
where loan_security='Test Security 2'""")
check_for_ltv_shortfall()
loan_security_shortfall = frappe.get_doc("Loan Security Shortfall", {"loan": loan.name})
self.assertTrue(loan_security_shortfall)
self.assertEquals(loan_security_shortfall.loan_amount, 1000000.00)
self.assertEquals(loan_security_shortfall.security_value, 400000.00)
self.assertEquals(loan_security_shortfall.shortfall_amount, 600000.00)
frappe.db.sql(""" UPDATE `tabLoan Security Price` SET loan_security_price = 250
where loan_security='Test Security 2'""")
def create_loan_accounts():
if not frappe.db.exists("Account", "Loans and Advances (Assets) - _TC"):
frappe.get_doc({
@@ -399,7 +402,8 @@ def create_loan_security_type():
"doctype": "Loan Security Type",
"loan_security_type": "Stock",
"unit_of_measure": "Nos",
"haircut": 50.00
"haircut": 50.00,
"loan_to_value_ratio": 50
}).insert(ignore_permissions=True)
def create_loan_security():

View File

@@ -130,9 +130,10 @@ def make_accrual_interest_entry_for_term_loans(posting_date=None):
loan.loan_account, loan.principal_amount + loan.balance_loan_amount, loan.interest_amount,
payable_principal = loan.principal_amount , posting_date=posting_date)
frappe.db.sql("""UPDATE `tabRepayment Schedule`
SET is_accrued = 1 where name in (%s)""" #nosec
% ", ".join(['%s']*len(accrued_entries)), tuple(accrued_entries))
if accrued_entries:
frappe.db.sql("""UPDATE `tabRepayment Schedule`
SET is_accrued = 1 where name in (%s)""" #nosec
% ", ".join(['%s']*len(accrued_entries)), tuple(accrued_entries))
def make_loan_interest_accrual_entry(loan, applicant_type, applicant, interest_income_account, loan_account,
pending_principal_amount, interest_amount, payable_principal=None, process_loan_interest=None, posting_date=None):