| Line 9071... |
Line 9071... |
| 9071 |
if creditTxnType:
|
9071 |
if creditTxnType:
|
| 9072 |
credit_hs_query = credit_hs_query.filter(CreditHistory.credit_type==CreditTxnType._VALUES_TO_NAMES[creditTxnType])
|
9072 |
credit_hs_query = credit_hs_query.filter(CreditHistory.credit_type==CreditTxnType._VALUES_TO_NAMES[creditTxnType])
|
| 9073 |
return credit_hs_query.all()
|
9073 |
return credit_hs_query.all()
|
| 9074 |
|
9074 |
|
| 9075 |
def process_credit_transaction(paymentId, userId, creditorId, creditTxns):
|
9075 |
def process_credit_transaction(paymentId, userId, creditorId, creditTxns):
|
| - |
|
9076 |
us_query = UserSanction.query
|
| - |
|
9077 |
if userId:
|
| - |
|
9078 |
us_query = us_query.filter(UserSanction.user_id == userId)
|
| - |
|
9079 |
if creditorId:
|
| 9076 |
userSanctions = get_user_sanction_details(userId, creditorId)
|
9080 |
us_query = us_query.filter(UserSanction.creditor_id == creditorId)
|
| - |
|
9081 |
|
| - |
|
9082 |
userSanctions = us_query.all()
|
| 9077 |
if userSanctions is None or len(userSanctions)==0:
|
9083 |
if userSanctions is None or len(userSanctions)==0:
|
| 9078 |
logging.info("No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
9084 |
logging.info("No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
| 9079 |
raise TransactionServiceException(221, "No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
9085 |
raise TransactionServiceException(221, "No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
| 9080 |
|
9086 |
|
| 9081 |
userSanction = userSanctions[0]
|
9087 |
userSanction = userSanctions[0]
|
| Line 9166... |
Line 9172... |
| 9166 |
if creditTxnType:
|
9172 |
if creditTxnType:
|
| 9167 |
loan_hs_query = loan_hs_query.filter(LoanHistory.credit_type==CreditTxnType._VALUES_TO_NAMES[creditTxnType])
|
9173 |
loan_hs_query = loan_hs_query.filter(LoanHistory.credit_type==CreditTxnType._VALUES_TO_NAMES[creditTxnType])
|
| 9168 |
return loan_hs_query.all()
|
9174 |
return loan_hs_query.all()
|
| 9169 |
|
9175 |
|
| 9170 |
def process_loan_transaction(paymentId, userId, creditorId, loantxns):
|
9176 |
def process_loan_transaction(paymentId, userId, creditorId, loantxns):
|
| - |
|
9177 |
us_query = UserSanction.query
|
| - |
|
9178 |
if userId:
|
| - |
|
9179 |
us_query = us_query.filter(UserSanction.user_id == userId)
|
| - |
|
9180 |
if creditorId:
|
| 9171 |
userSanctions = get_user_sanction_details(userId, creditorId)
|
9181 |
us_query = us_query.filter(UserSanction.creditor_id == creditorId)
|
| - |
|
9182 |
|
| - |
|
9183 |
userSanctions = us_query.all()
|
| 9172 |
if userSanctions is None or len(userSanctions)==0:
|
9184 |
if userSanctions is None or len(userSanctions)==0:
|
| 9173 |
logging.info("No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
9185 |
logging.info("No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
| 9174 |
raise TransactionServiceException(227, "No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
9186 |
raise TransactionServiceException(227, "No Credit Sanction Details Availble. UserId:- "+str(userId)+ " Creditor Id:- "+ str(creditorId))
|
| 9175 |
|
9187 |
|
| 9176 |
userSanction = userSanctions[0]
|
9188 |
userSanction = userSanctions[0]
|