| Line 9964... |
Line 9964... |
| 9964 |
return userCounterMap, loan_os_result
|
9964 |
return userCounterMap, loan_os_result
|
| 9965 |
except Exception as e:
|
9965 |
except Exception as e:
|
| 9966 |
print e
|
9966 |
print e
|
| 9967 |
|
9967 |
|
| 9968 |
def fetch_outstanding_credits(userId,limit):
|
9968 |
def fetch_outstanding_credits(userId,limit):
|
| - |
|
9969 |
userCounterMap={}
|
| - |
|
9970 |
try:
|
| 9969 |
credit_hs_query = CreditHistory.query(CreditHistory.user_id,CreditHistory.creditor_id,CreditHistory.payment_id,CreditHistory.amount,CreditHistory.created)
|
9971 |
credit_os_query = session.query(CreditHistory.user_id,CreditHistory.creditor_id,CreditHistory.payment_id,func.sum(CreditHistory.amount).label('totalAmount'),(CreditHistory.created).label('createdDate'))
|
| - |
|
9972 |
user_client = UserClient().get_client()
|
| 9970 |
if userId>0:
|
9973 |
if userId>0:
|
| 9971 |
credit_hs_query = credit_hs_query.filter(CreditHistory.user_id==userId)
|
9974 |
credit_os_query = credit_os_query.filter(CreditHistory.user_id==userId)
|
| 9972 |
credit_hs_query = credit_hs_query.group_by(CreditHistory.payment_id).having(func.sum(CreditHistory.amount)>0).order_by(func.max(CreditHistory.id)).all()
|
9975 |
credit_os_result = credit_os_query.group_by(CreditHistory.payment_id).having(func.sum(CreditHistory.amount)>0).order_by(func.max(CreditHistory.id)).all()
|
| - |
|
9976 |
if credit_os_result is not None or len(credit_os_result)>0:
|
| - |
|
9977 |
userIds=[]
|
| - |
|
9978 |
for r in credit_os_result:
|
| - |
|
9979 |
userIds.append(r.user_id)
|
| - |
|
9980 |
userCounterMap = user_client.getCounterName(userIds)
|
| - |
|
9981 |
return userCounterMap, credit_os_result
|
| - |
|
9982 |
except Exception as e:
|
| - |
|
9983 |
print e
|
| 9973 |
|
9984 |
|
| 9974 |
def set_order_attribute_for_master_order_id(logisticsTransactionId, attributes):
|
9985 |
def set_order_attribute_for_master_order_id(logisticsTransactionId, attributes):
|
| 9975 |
orders = get_group_orders_by_logistics_txn_id(logisticsTransactionId)
|
9986 |
orders = get_group_orders_by_logistics_txn_id(logisticsTransactionId)
|
| 9976 |
for order in orders:
|
9987 |
for order in orders:
|
| 9977 |
for attribute in attributes :
|
9988 |
for attribute in attributes :
|