| Line 49... |
Line 49... |
| 49 |
userCashback.batchCreditId = batchId
|
49 |
userCashback.batchCreditId = batchId
|
| 50 |
userCashback.creditedDate = datetimeNow.date()
|
50 |
userCashback.creditedDate = datetimeNow.date()
|
| 51 |
session.commit()
|
51 |
session.commit()
|
| 52 |
|
52 |
|
| 53 |
for key, value in userCashbacksMap.iteritems():
|
53 |
for key, value in userCashbacksMap.iteritems():
|
| - |
|
54 |
print 'User Id:- ', key, ' Credited Amount:- ', value
|
| 54 |
get_mongo_connection().Dtr.refund.insert({"userId": key, "batch":batchId, "userAmount":value, "timestamp":datetime.strftime(datetimeNow,"%Y-%m-%d %H:%M:%S"), "type":utils.CREDIT_TYPE_APP})
|
55 |
get_mongo_connection().Dtr.refund.insert({"userId": key, "batch":batchId, "userAmount":value, "timestamp":datetime.strftime(datetimeNow,"%Y-%m-%d %H:%M:%S"), "type":utils.CREDIT_TYPE_APP})
|
| 55 |
get_mongo_connection().Dtr.user.update({"userId":key}, {"$inc": { "credited": value, utils.CREDIT_TYPE_APP:value}}, upsert=True)
|
56 |
get_mongo_connection().Dtr.user.update({"userId":key}, {"$inc": { "credited": value, utils.CREDIT_TYPE_APP:value}}, upsert=True)
|
| 56 |
else:
|
57 |
else:
|
| 57 |
print 'Refund Process have been failed'
|
58 |
print 'Refund Process have been failed'
|
| 58 |
else:
|
59 |
else:
|