Subversion Repositories SmartDukaan

Rev

Rev 19547 | Rev 19558 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19547 Rev 19556
Line 2400... Line 2400...
2400
                approved_by = jsonReq.get('approved_by')
2400
                approved_by = jsonReq.get('approved_by')
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})
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})
2402
                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)
2403
                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)
2404
                print user_id,value                
2404
                print user_id,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")
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))
2406
                resp.body = "{\"result\":\"success\"}"
2406
                resp.body = "{\"result\":\"success\"}"
2407
            else:
2407
            else:
2408
                resp.body = "{\"result\":\"failed\"}"
2408
                resp.body = "{\"result\":\"failed\"}"
2409
        elif status == utils.REFUND_ADJUSTMENT_MAP.get(2):
2409
        elif status == utils.REFUND_ADJUSTMENT_MAP.get(2):
2410
            Mongo.updateCrmWalletStatus(status, _id,user_id,None,None)
2410
            Mongo.updateCrmWalletStatus(status, _id,user_id,None,None)