def convert_installment_to_month(installment,loan_apply_id): QUERY_STR="SELECT clear_date FROM sc_repayment_plan_detail WHERE loan_apply_id=%s " \ "AND repayment_installments='1'"%(loan_apply_id) data=db.execute(QUERY_STR).fetchall() if len(data)>0: beg_date=data[0]['clear_date'] return add_month(beg_date,installment-1)
def get_user_id_by_lai(loan_apply_id): QUERY_STR="SELECT A_loan_officer FROM sc_apply_info WHERE loan_apply_id='%s'"%(loan_apply_id) data=db.execute(QUERY_STR).fetchall() if len(data) > 0: id=data[0]['A_loan_officer'] else : id=None return id
def get_lai_by_account(account): QUERY_STR="SELECT loan_apply_id FROM sc_approval_decision WHERE loan_account='%s'"%(account) data=db.execute(QUERY_STR).fetchall() if len(data) > 0: id=data[0]['loan_apply_id'] else : id=None return id
def get_is_overdue(loan_apply_id,installments): QUERY_STR="SELECT clear_date FROM sc_repayment_plan_detail WHERE loan_apply_id='%s' " \ "AND repayment_installments='%s'"%(loan_apply_id,installments) data=db.execute(QUERY_STR).fetchall() if len(data)>0: repayment_date=data[0]['clear_date'] now=datetime.datetime.now() if now>repayment_date: return True else: return False else: return False