| Line 2371... |
Line 2371... |
| 2371 |
|
2371 |
|
| 2372 |
def on_get(self,req,resp):
|
2372 |
def on_get(self,req,resp):
|
| 2373 |
offset = req.get_param_as_int("offset")
|
2373 |
offset = req.get_param_as_int("offset")
|
| 2374 |
limit = req.get_param_as_int("limit")
|
2374 |
limit = req.get_param_as_int("limit")
|
| 2375 |
status = req.get_param("status")
|
2375 |
status = req.get_param("status")
|
| 2376 |
print status
|
- |
|
| 2377 |
if status:
|
2376 |
if status:
|
| 2378 |
userRefundDetails = Mongo.fetchCrmRefundUsers(status,offset,limit)
|
2377 |
userRefundDetails = Mongo.fetchCrmRefundUsers(status,offset,limit)
|
| 2379 |
else:
|
2378 |
else:
|
| 2380 |
userRefundDetails = Mongo.fetchCrmRefundUsers(None,offset,limit)
|
2379 |
userRefundDetails = Mongo.fetchCrmRefundUsers(None,offset,limit)
|
| 2381 |
if userRefundDetails is not None:
|
2380 |
if userRefundDetails is not None:
|
| Line 2401... |
Line 2400... |
| 2401 |
approved_by = jsonReq.get('approved_by')
|
2400 |
approved_by = jsonReq.get('approved_by')
|
| 2402 |
get_mongo_connection().Dtr.refund.insert({"userId": user_id, "batch":batchId, "userAmount":value, "timestamp":datetime.strftime(datetimeNow,"%Y-%m-%d %H:%M:%S"), "type":refundType})
|
2401 |
get_mongo_connection().Dtr.refund.insert({"userId": user_id, "batch":batchId, "userAmount":value, "timestamp":datetime.strftime(datetimeNow,"%Y-%m-%d %H:%M:%S"), "type":refundType})
|
| 2403 |
get_mongo_connection().Dtr.user.update({"userId":user_id}, {"$inc": { "credited": value, refundType:value}}, upsert=True)
|
2402 |
get_mongo_connection().Dtr.user.update({"userId":user_id}, {"$inc": { "credited": value, refundType:value}}, upsert=True)
|
| 2404 |
Mongo.updateCrmWalletStatus(utils.REFUND_ADJUSTMENT_MAP.get(3), _id,user_id,batchId,approved_by)
|
2403 |
Mongo.updateCrmWalletStatus(utils.REFUND_ADJUSTMENT_MAP.get(3), _id,user_id,batchId,approved_by)
|
| 2405 |
print user_id,value
|
2404 |
print user_id,value
|
| 2406 |
Mongo.sendNotification([user_id], 'Batch Credit', 'Cashback Credited for %ss'%(str(refundType)), 'Rs.%s has been added to your wallet'%(value),'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(user_id), '2999-01-01', True, "TRAN_SMS Dear Customer, Cashback Credited for %ss. Rs.%s has been added to your wallet"%(refundType,value))
|
2405 |
Mongo.sendNotification([user_id], 'Batch Credit', 'Cashback Credited for %ss'%(str(refundType)), 'Rs.%s has been added to your wallet'%(value),'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(user_id), '2999-01-01', True, "TRAN_SMS Dear Customer, Cashback Credited for %ss. Rs.%s has been added to your wallet"%(refundType,value),"45.33.50.227")
|
| 2407 |
resp.body = "{\"result\":\"success\"}"
|
2406 |
resp.body = "{\"result\":\"success\"}"
|
| 2408 |
else:
|
2407 |
else:
|
| 2409 |
resp.body = "{\"result\":\"failed\"}"
|
2408 |
resp.body = "{\"result\":\"failed\"}"
|
| 2410 |
elif status == utils.REFUND_ADJUSTMENT_MAP.get(2):
|
2409 |
elif status == utils.REFUND_ADJUSTMENT_MAP.get(2):
|
| 2411 |
Mongo.updateCrmWalletStatus(status, _id,user_id,None,None)
|
2410 |
Mongo.updateCrmWalletStatus(status, _id,user_id,None,None)
|