Subversion Repositories SmartDukaan

Rev

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

Rev 17074 Rev 17078
Line 40... Line 40...
40
    batchId = db.refund.find_one({"$query":{"type":credittype},"$orderby":{"batch":-1}}).get("batch")
40
    batchId = db.refund.find_one({"$query":{"type":credittype},"$orderby":{"batch":-1}}).get("batch")
41
    print "Batch Id recently Credited", batchId
41
    print "Batch Id recently Credited", batchId
42
    if batchId is None:
42
    if batchId is None:
43
        return
43
        return
44
    refunds = db.refund.find({"batch":batchId})
44
    refunds = db.refund.find({"batch":batchId})
45
    sendNotification([8], 'Batch Credit', 'Cashback Credited for %s'%(str(credittype)), 'Rs.%s has been added to your wallet'%(250), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(8))
45
    sendNotification([8], 'Batch Credit', 'Cashback Credited for %ss'%(str(credittype)), 'Rs.%s has been added to your wallet'%(250), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(8))
46
    sendNotification([14], 'Batch Credit', 'Cashback Credited for %s'%(str(credittype)), 'Rs.%s has been added to your wallet'%(250), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(14))
46
    sendNotification([14], 'Batch Credit', 'Cashback Credited for %ss'%(str(credittype)), 'Rs.%s has been added to your wallet'%(250), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(14))
47
    for ref in refunds:
47
    for ref in refunds:
48
        print ref.get("userId"), ref.get("userAmount")
48
        print ref.get("userId"), ref.get("userAmount")
49
        sendNotification([ref.get("userId")], 'Batch Credit', 'Cashback Credited for %s'%(str(credittype)), 'Rs.%s has been added to your wallet'%(int(ref.get("userAmount"))), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(ref.get("userId")))
49
        sendNotification([ref.get("userId")], 'Batch Credit', 'Cashback Credited for %ss'%(str(credittype)), 'Rs.%s has been added to your wallet'%(int(ref.get("userAmount"))), 'url', 'http://api.profittill.com/cashbacks/mine?user_id=%s'%(ref.get("userId")))
50
        pass
50
        pass
51
 
51
 
52
if __name__ == '__main__':
52
if __name__ == '__main__':
53
    main(sys.argv[1:])
53
    main(sys.argv[1:])
54
54