Subversion Repositories SmartDukaan

Rev

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

Rev 16998 Rev 16999
Line 51... Line 51...
51
            session.commit()
51
            session.commit()
52
            
52
            
53
            for key, value in userCashbacksMap.iteritems():
53
            for key, value in userCashbacksMap.iteritems():
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})
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.user.update({"userId":key}, {"$inc": { "credited": value, utils.CREDIT_TYPE_APP:value}}, upsert=True)
55
                get_mongo_connection().Dtr.user.update({"userId":key}, {"$inc": { "credited": value, utils.CREDIT_TYPE_APP:value}}, upsert=True)
-
 
56
        else:
-
 
57
            print 'Refund Process have been failed'
56
        
58
        
57
def main(argv):
59
def main(argv):
58
    runtype = 'dry'
60
    runtype = 'dry'
59
    try:
61
    try:
60
        opts, args = getopt.getopt(argv,"ht:",["runtype="])
62
        opts, args = getopt.getopt(argv,"ht:",["runtype="])