Subversion Repositories SmartDukaan

Rev

Rev 8007 | Rev 8020 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6147 rajveer 1
#!/usr/bin/python
2
'''
3
It is used to process transactions for which the payment 
4
was received but the order was not processed.
5
 
6
@author: Rajveer
7
'''
8
import optparse
9
import sys
6219 rajveer 10
import datetime
7141 rajveer 11
from datetime import timedelta
6235 rajveer 12
from elixir import *
7141 rajveer 13
from sqlalchemy.sql import func
14
import urllib
15
import httplib
7175 rajveer 16
from shop2020.utils.EmailAttachmentSender import mail, mail_html
6147 rajveer 17
 
18
 
19
 
20
if __name__ == '__main__' and __package__ is None:
21
    import os
22
    sys.path.insert(0, os.getcwd())
7986 anupam.sin 23
from datetime import date, timedelta
7967 anupam.sin 24
from shop2020.clients.HelperClient import HelperClient
7167 rajveer 25
from shop2020.thriftpy.model.v1.order.ttypes import RechargeOrderStatus,\
26
    OrderType
6254 rajveer 27
from shop2020.model.v1.order.impl.DataAccessors import get_recharge_orders_for_status, update_recharge_order_status,\
7147 rajveer 28
    update_recharge_transaction_status, get_next_invoice_number
7128 rajveer 29
from shop2020.model.v1.order.impl import DataService
7147 rajveer 30
from shop2020.model.v1.order.impl.DataService import RechargeTransaction, HotspotStore,\
7967 anupam.sin 31
    WalletForCompany, WalletHistoryForCompany, RechargeCollection, Company, HotspotServiceMatrix
6235 rajveer 32
from shop2020.model.v1.order.impl.model.RechargeOrder import RechargeOrder
7983 rajveer 33
from shop2020.model.v1.order.impl.RechargeService import checkTransactionStatus, getRefunds, getBalance 
6147 rajveer 34
 
35
 
36
def main():
37
    parser = optparse.OptionParser()
38
    parser.add_option("-H", "--host", dest="hostname",
39
                      default="localhost",
40
                      type="string", help="The HOST where the DB server is running",
41
                      metavar="HOST")
6235 rajveer 42
    parser.add_option("-r", "--refund", dest="refund",
43
                      action="store_true",
44
                      help="")
45
    parser.add_option("-u", "--unknown", dest="unknown",
46
                      action="store_true",
47
                      help="")
6452 rajveer 48
    parser.add_option("-a", "--authorized", dest="authorized",
6451 rajveer 49
                      action="store_true",
50
                      help="")
7141 rajveer 51
    parser.add_option("-c", "--collection", dest="collection",
52
                      action="store_true",
53
                      help="")
7147 rajveer 54
    parser.add_option("-T", "--topup", dest="topup",
55
                      action="store_true",
56
                      help="")    
6451 rajveer 57
    parser.add_option("-t", "--txn-id", dest="txn_id",
58
                   type="int",
59
                   help="mark the transaction(recharge order id) TXN_ID as successful",
60
                   metavar="TXN_ID")
6235 rajveer 61
 
6147 rajveer 62
    (options, args) = parser.parse_args()
63
    if len(args) != 0:
64
        parser.error("You've supplied extra arguments. Are you sure you want to run this program?")
6254 rajveer 65
    DataService.initialize(db_hostname=options.hostname, echoOn=True)
66
 
6235 rajveer 67
    if options.refund:
68
        processRefunds()
69
    if options.unknown:
70
        processUnknownTransactions()
6451 rajveer 71
    if options.authorized:
72
        processAuthorizedTransactions(options.txn_id)
7141 rajveer 73
    if options.collection:
7983 rajveer 74
        wallet = WalletForCompany.query.filter(WalletForCompany.id == 3).one()
75
        oldBalance = wallet.amount
76
        newBalance = getBalance()  
77
        wallet.amount = newBalance
78
        session.commit()
79
 
7141 rajveer 80
        d = datetime.datetime.now()
7144 rajveer 81
        d = d + timedelta(days = -1)
7141 rajveer 82
        compute_recharge_collection(d)
7983 rajveer 83
        compute_website_recharge_collection(d, oldBalance, newBalance)
7147 rajveer 84
    if options.topup:
85
        topup_company_wallet(1,100000)
6235 rajveer 86
 
87
def processRefunds():
88
    todate = datetime.datetime.now()
89
    for i in range(15):
90
        orderDate = todate + datetime.timedelta(days= -i)
91
        refunds = getRefunds(orderDate)
92
        for key in refunds.keys():
93
            refund = refunds.get(key)
94
            refundAmount = refund[0]
95
            refundDate = refund[1]
96
            order = RechargeOrder.get_by(spiceTID = key)
7127 rajveer 97
            if order:
98
                amount = order.totalAmount
99
                isStoreOrder = False
100
            else:
101
                order = RechargeTransaction.get_by(spiceTID = key)
7188 rajveer 102
                if not order:
103
                    continue
7127 rajveer 104
                isStoreOrder = True
105
                amount = order.amount
6235 rajveer 106
            if order.status == RechargeOrderStatus.RECHARGE_FAILED_REFUNDED:
107
                print "Refund is already processed."
108
                continue
7188 rajveer 109
            if order.status not in (RechargeOrderStatus.RECHARGE_SUCCESSFUL, RechargeOrderStatus.PAYMENT_SUCCESSFUL, RechargeOrderStatus.RECHARGE_UNKNOWN):
7075 rajveer 110
                print "Recharge/Payment is not successful. There is something wrong."
6235 rajveer 111
                continue
7127 rajveer 112
            if amount != refundAmount:
6235 rajveer 113
                print "Refund amount is not same as transaction amount"
114
                continue
7127 rajveer 115
            if isStoreOrder:
7244 rajveer 116
                update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED)
7127 rajveer 117
            else:
7780 rajveer 118
                update_recharge_order_status(order.id, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED)
6235 rajveer 119
 
120
def processUnknownTransactions():    
121
    orders = get_recharge_orders_for_status(RechargeOrderStatus.PAYMENT_SUCCESSFUL)
6219 rajveer 122
    for order in orders:
6276 rajveer 123
        try:
124
            if order.creationTimestamp + datetime.timedelta(minutes=10) < datetime.datetime.now():
125
                status, description = checkTransactionStatus('', str(order.id))
126
                print status, description
127
                if status:
128
                    update_recharge_order_status(order.id, RechargeOrderStatus.RECHARGE_SUCCESSFUL)
129
                else:
130
                    update_recharge_order_status(order.id, RechargeOrderStatus.RECHARGE_FAILED)
131
        except:
132
            print "Do Nothing"
6451 rajveer 133
 
7163 rajveer 134
    ## For store transactions
7245 rajveer 135
    rorders = RechargeTransaction.query.filter(RechargeTransaction.status.in_([RechargeOrderStatus.RECHARGE_UNKNOWN, RechargeOrderStatus.INIT])).all()
7166 rajveer 136
    for order in rorders:
7163 rajveer 137
        try:
138
            if order.transactionTime + datetime.timedelta(minutes=10) < datetime.datetime.now():
139
                status, description = checkTransactionStatus('', str(order.id))
140
                print status, description
141
                if status:
142
                    update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_SUCCESSFUL)
7245 rajveer 143
                elif order.status == RechargeOrderStatus.INIT:
144
                    update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_FAILED)
7163 rajveer 145
                else:
7244 rajveer 146
                    update_recharge_transaction_status(order.id, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED)
7163 rajveer 147
        except:
148
            print "Do Nothing"
149
 
150
 
6451 rajveer 151
def processAuthorizedTransactions(txn_id):
152
    update_recharge_order_status(txn_id, RechargeOrderStatus.PAYMENT_SUCCESSFUL)
6235 rajveer 153
 
7141 rajveer 154
 
155
def compute_recharge_collection(cdate):
156
    todate = datetime.datetime(cdate.year, cdate.month, cdate.day)
157
    tomorrow = todate + timedelta(days=1)
7244 rajveer 158
    txns = session.query(RechargeTransaction.storeId, RechargeTransaction.payMethod, RechargeTransaction.status, func.sum(RechargeTransaction.amount), func.sum(RechargeTransaction.discount)).filter(RechargeTransaction.status.in_([RechargeOrderStatus.RECHARGE_SUCCESSFUL, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED, RechargeOrderStatus.RECHARGE_UNKNOWN])).filter(RechargeTransaction.transactionTime >= todate).filter(RechargeTransaction.transactionTime < tomorrow).group_by(RechargeTransaction.storeId, RechargeTransaction.payMethod, RechargeTransaction.status).order_by(RechargeTransaction.storeId).all()
7141 rajveer 159
    storeData = {}
160
    for txn in txns:
161
        print txn
162
        if not storeData.has_key(txn[0]):
163
            data = [0,0,0,0,0]
164
            storeData[txn[0]] = data
165
        else:
166
            data = storeData[txn[0]]
7155 rajveer 167
        if txn[1] == 1:
7141 rajveer 168
            data[0] += int(txn[3]) - int(txn[4])
7155 rajveer 169
        if txn[1] == 2:
7141 rajveer 170
            data[1] += int(txn[3]) - int(txn[4])
7244 rajveer 171
        if txn[2] in (RechargeOrderStatus.RECHARGE_SUCCESSFUL, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED, RechargeOrderStatus.RECHARGE_UNKNOWN):
7141 rajveer 172
            data[2] += int(txn[3])
173
            data[3] += int(txn[4])
174
            data[4] += int(txn[3]) - int(txn[4])
175
        storeData[txn[0]] = data
176
 
177
    reftxns = session.query(RechargeTransaction.storeId, RechargeTransaction.payMethod, RechargeTransaction.status, func.sum(RechargeTransaction.amount), func.sum(RechargeTransaction.discount)).filter(RechargeTransaction.status == RechargeOrderStatus.RECHARGE_FAILED_REFUNDED).filter(RechargeTransaction.responseTime >= todate).filter(RechargeTransaction.responseTime < tomorrow).group_by(RechargeTransaction.storeId, RechargeTransaction.payMethod, RechargeTransaction.status).order_by(RechargeTransaction.storeId).all()  
178
    for txn in reftxns:
179
        print txn
180
        if not storeData.has_key(txn[0]):
181
            data = [0,0,0,0,0]
182
            storeData[txn[0]] = data
183
        else:
184
            data = storeData[txn[0]]
7155 rajveer 185
        if txn[1] == 1:
7148 rajveer 186
            data[0] -= int(txn[3]) - int(txn[4])
7155 rajveer 187
        if txn[1] == 2:
7148 rajveer 188
            data[1] -= int(txn[3]) - int(txn[4])
7141 rajveer 189
        data[2] -= int(txn[3])
190
        data[3] -= int(txn[4])
191
        data[4] -= int(txn[3]) - int(txn[4])
192
    print storeData
7163 rajveer 193
 
7175 rajveer 194
    wallet = WalletForCompany.query.filter(WalletForCompany.id == 1).one()    
195
 
196
    dt = session.query(func.sum(RechargeTransaction.amount)).filter(RechargeTransaction.status.in_([RechargeOrderStatus.RECHARGE_SUCCESSFUL])).one()
197
 
7511 rajveer 198
#    if int(dt[0]) != wallet.amount:
199
#        mail("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in", "anupam.singh@shop2020.in"], "Wallet amount: " + str(wallet.amount) + " does not match with transaction amount: " + str(int(dt[0])) , "", [], [], [])    
7250 rajveer 200
 
7175 rajveer 201
    maildata = "<html><body><table border='1'><thead><th>StoreId</th><th>Gross</th><th>Discount</th><th>Net</th></thead><tbody>"
202
    trecharge = 0
7967 anupam.sin 203
    hotspotServiceMatrices = HotspotServiceMatrix.query.all()
204
    hotspotServiceMatrixMap = {}
205
 
206
    for hotspotServiceMatrix in hotspotServiceMatrices:
207
        hotspotServiceMatrixMap[hotspotServiceMatrix.storeId] = hotspotServiceMatrix
208
 
7141 rajveer 209
    for storeId in storeData.keys():
210
        store = HotspotStore.get_by(id = storeId)
7967 anupam.sin 211
        if hotspotServiceMatrixMap.has_key(storeId):
212
            del hotspotServiceMatrixMap[storeId]
7141 rajveer 213
        store.collectedAmount = 0
214
        store.availableLimit = store.creditLimit
7142 rajveer 215
        session.commit()
216
 
7141 rajveer 217
        data = storeData.get(storeId)
7250 rajveer 218
        rc = RechargeCollection()
219
        rc.hotspotId = store.hotspotId
220
        rc.reconDate = int(todate.strftime("%Y%m%d"))
221
        rc.cash = data[0]
222
        rc.hdfc = data[1]
223
        rc.grossAmount = data[2]
224
        rc.discount = data[3]
225
        rc.netCollection = data[4]
226
        rc.addedAt = datetime.datetime.now()
227
        rc.pushedToOcr = False
228
        session.commit()
229
 
7175 rajveer 230
        maildata += "<tr><td>" + store.hotspotId + "</td><td>" + str(data[2]) + "</td><td>" + str(data[3]) + "</td><td>" + str(data[4]) + "</td></tr>"
231
        trecharge +=  data[2]
7250 rajveer 232
 
7276 rajveer 233
    dit = session.query(func.sum(RechargeCollection.grossAmount)).one()
7821 rajveer 234
    dit2 = session.query(func.sum(WalletHistoryForCompany.amount)).filter(WalletHistoryForCompany.walletId == 1).filter(WalletHistoryForCompany.amount >= 100000).one()
7276 rajveer 235
    wamt = int(dit2[0])- int(dit[0])
236
    wallet.amount = wamt
237
    session.commit()
238
 
7250 rajveer 239
    maildata += "</tbody></table></body></html>"
7821 rajveer 240
    mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "Ashwani.Kumar@spiceretail.co.in","parveen.mittal@spiceretail.co.in","pardeep.panwar@spiceretail.co.in","gagan.sharma@spiceretail.co.in","j.p.gupta@shop2020.in", "rajneesh.arora@shop2020.in", "amit.tyagi@spiceretail.co.in"], "MIS :- SpiceRetail  (Date - " + todate.strftime("%d-%m-%Y") + ")   (Wallet Amount - " + str(wallet.amount) + ")    (Total Recharge - " + str(trecharge) + ")", maildata, []) 
7252 rajveer 241
    try:
242
        push_recharge_collection_to_ocr()
243
    except:
244
        mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "rajneesh.arora@shop2020.in"], "Problem while pushing recharge collection to OCR", "", [])
7967 anupam.sin 245
    finally:
7986 anupam.sin 246
        msg = "<html><body>"
7967 anupam.sin 247
        for storeId in hotspotServiceMatrixMap.keys():
248
            if hotspotServiceMatrixMap.get(storeId).rechargeService:
249
                store = HotspotStore.get_by(id = storeId)
7986 anupam.sin 250
                msg = msg + str(store.hotspotId) + ' - ' + str(store.email) + '<br>'
251
        msg = msg + '</body></html>'
252
        helper_client = HelperClient().get_client()
7990 anupam.sin 253
        helper_client.saveUserEmailForSending(["gagan.sharma@spiceretail.co.in"], "cnc.center@shop2020.in", "No Recharge happened for these stores on " + str(date.today()-timedelta(days=1)), msg, "NRM", "NoRechargeMail", ["anupam.singh@shop2020.in"], ["anupam.singh@shop2020.in"])
7986 anupam.sin 254
 
7967 anupam.sin 255
 
7250 rajveer 256
 
257
def push_recharge_collection_to_ocr():
258
    rcs = RechargeCollection.query.filter(RechargeCollection.pushedToOcr == False).all()
259
 
260
    for rc in rcs:
261
        store_string = "<Store>" + rc.hotspotId + "</Store>"
262
        date_string = "<ReconDate>" + str(rc.reconDate) + "</ReconDate>"
263
        cash_string = "<Cash>" + str(rc.cash) + "</Cash>"
264
        card_string = "<Hdfc>" + str(rc.hdfc) + "</Hdfc>"
265
        type_string = "<Type>RechargeSale</Type>"
266
        amount_string = "<GrossRechargeAmount>" + str(rc.grossAmount) + "</GrossRechargeAmount><Discount>" + str(rc.discount) +  "</Discount><NetCollection>" + str(rc.netCollection) + "</NetCollection>";
267
 
7141 rajveer 268
        #SaholicRechargeSaleTransfer(string Store, int ReconDate, decimal Cash, decimal Hdfc, string Type, decimal GrossRechargeAmount, decimal Discount, decimal NetCollection)
269
 
7253 rajveer 270
        conn = httplib.HTTPConnection("182.71.104.186")
7141 rajveer 271
        XML="""
272
        <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
273
          <soap:Body>
274
            <SaholicRechargeSaleTransfer xmlns="http://tempuri.org/">
275
        """
276
 
277
        XML = XML + store_string + date_string + cash_string + card_string + type_string + amount_string 
278
 
279
        footer = """
280
            </SaholicRechargeSaleTransfer>
281
          </soap:Body>
282
        </soap:Envelope>
283
        """
284
        XML = XML + footer
285
 
286
        print XML
287
        params = urllib.urlencode({'op': 'SaholicRechargeSaleTransfer'})
288
        headers = { "Content-type": "text/xml", "Content-Length": "%d" % len(XML)}
289
        conn.request("POST", "/loaddetect/Service.asmx?"+params, "", headers)
290
        conn.send(XML)
291
        response = conn.getresponse()
292
        print response.status, response.reason
293
        resp = response.read()
294
        conn.close()
295
        print resp
7250 rajveer 296
        if "Saved Successfully" in resp:
297
            rc.pushedAt = datetime.datetime.now()
298
            rc.pushedToOcr = True
299
            session.commit()
300
        elif "Error in Saving Data" in resp:
7252 rajveer 301
            mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "rajneesh.arora@shop2020.in"], "Problem while pushing recharge collection to OCR", resp, [])
7250 rajveer 302
        else: 
7252 rajveer 303
            mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "rajneesh.arora@shop2020.in"], "Problem while pushing recharge collection to OCR", resp, [])
7250 rajveer 304
 
7141 rajveer 305
 
7175 rajveer 306
 
7147 rajveer 307
def topup_company_wallet(companyId, amount):
308
    wallet = WalletForCompany.query.filter(WalletForCompany.id == companyId).with_lockmode("update").one()
7285 rajveer 309
    company = Company.get_by(id = companyId)
7147 rajveer 310
    wh = WalletHistoryForCompany()
311
    wh.walletId = wallet.id
312
    wh.openingBal = wallet.amount
313
    wh.closingBal = wallet.amount +  amount
314
    wh.amount = amount
315
    wh.transactionTime = datetime.datetime.now()
7167 rajveer 316
    wh.referenceNumber =  get_next_invoice_number(OrderType.WALLETCREDIT)
7147 rajveer 317
    wh.description = "Wallet Credited"
318
 
319
    wallet.amount += amount
320
    session.commit()
7285 rajveer 321
    mail("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "Ashwani.Kumar@spiceretail.co.in","parveen.mittal@spiceretail.co.in","pardeep.panwar@spiceretail.co.in","gagan.sharma@spiceretail.co.in","j.p.gupta@shop2020.in", "rajneesh.arora@shop2020.in", "amit.tyagi@spiceretail.co.in"] , company.name + " wallet topped up by " +  str(amount) + " rupees.", "", [], [], [])
7821 rajveer 322
 
7983 rajveer 323
def compute_website_recharge_collection(cdate, oldBalance, newBalance):
7821 rajveer 324
    todate = datetime.datetime(cdate.year, cdate.month, cdate.day)
325
    tomorrow = todate + timedelta(days=1)
7147 rajveer 326
 
7823 rajveer 327
    txns = session.query(RechargeOrder.status, func.sum(RechargeOrder.totalAmount)).filter(RechargeOrder.status.in_([RechargeOrderStatus.RECHARGE_SUCCESSFUL, RechargeOrderStatus.RECHARGE_FAILED_REFUNDED, RechargeOrderStatus.PAYMENT_SUCCESSFUL])).filter(RechargeOrder.creationTimestamp >= todate).filter(RechargeOrder.creationTimestamp < tomorrow).group_by(RechargeOrder.status).all()
7821 rajveer 328
 
329
    tamount = 0
330
    for txn in txns:
331
        tamount += int(txn[1])
332
 
333
 
7823 rajveer 334
    reftxns = session.query(RechargeOrder.status, func.sum(RechargeOrder.totalAmount)).filter(RechargeOrder.status == RechargeOrderStatus.RECHARGE_FAILED_REFUNDED).filter(RechargeOrder.responseTimestamp >= todate).filter(RechargeOrder.responseTimestamp < tomorrow).group_by(RechargeOrder.status).all()  
7821 rajveer 335
    for txn in reftxns:
336
        tamount -= int(txn[1])
337
 
338
    wallet = WalletForCompany.query.filter(WalletForCompany.id == 2).with_lockmode("update").one()
7823 rajveer 339
 
340
 
341
    d = datetime.datetime.now()
342
    wh = WalletHistoryForCompany()
343
    wh.walletId = wallet.id
344
    wh.openingBal = wallet.amount
345
    wh.closingBal = wallet.amount - tamount
7982 rajveer 346
    wh.amount = -tamount
7823 rajveer 347
    wh.transactionTime = d
348
    wh.referenceNumber =  int(d.strftime("%Y%m%d"))
349
    wh.description = "Wallet Credited"
350
    wallet.amount = wallet.amount - tamount
7821 rajveer 351
    session.commit()
352
 
7823 rajveer 353
 
8007 rajveer 354
    maildata = ""
7982 rajveer 355
    mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["pardeep.panwar@spiceretail.co.in>", "amit.tyagi@spiceretail.co.in", "rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "j.p.gupta@shop2020.in", "rajneesh.arora@shop2020.in"], "MIS :- Saholic (Date - " + todate.strftime("%d-%m-%Y") + ")   (Wallet Amount - " + str(wallet.amount) + ")    (Total Recharge - " + str(tamount) + ")", maildata, []) 
7821 rajveer 356
 
8012 rajveer 357
    rAmount = 0
8007 rajveer 358
    ramount = session.query(func.sum(WalletHistoryForCompany.amount)).filter(WalletHistoryForCompany.transactionTime >= todate).filter(WalletHistoryForCompany.amount >= 100000).one()
8012 rajveer 359
    if ramount[0]:
360
        rAmount = int(ramount[0])
361
    rcs = session.query(func.sum(RechargeCollection.grossAmount)).filter(RechargeCollection.reconDate == int(todate.strftime("%Y%m%d"))).one()
8007 rajveer 362
    hamount = int(rcs[0])
363
 
8012 rajveer 364
    maildata = "(A) Old Wallet Amount is : " + str(oldBalance) + "<br>(B) New Wallet Amount is : " + str(newBalance) + "<br>(C) Recharge Amount is : " + str(rAmount) + "<br>---------------------------<br>(D) Total Debit Amount for Recharge(A-B+C) is : " + str(oldBalance - newBalance + rAmount) + "<br><br><br>(E) Saholic Recharge Amount is :" + str(tamount) + "<br>(F) Hotspot Recharge Amount is :" + str(hamount) + "<br>---------------------------<br>(G) Total Recharge Amount (E+F) is : " + str(tamount + hamount)
8007 rajveer 365
    mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["pardeep.panwar@spiceretail.co.in>", "amit.tyagi@spiceretail.co.in", "rajveer.singh@shop2020.in", "anupam.singh@shop2020.in", "j.p.gupta@shop2020.in", "rajneesh.arora@shop2020.in"], "MIS :- Wallet and Recharge (Date - " + todate.strftime("%d-%m-%Y") + ")", maildata, [])
366
 
367
 
6147 rajveer 368
if __name__ == '__main__':
7967 anupam.sin 369
    main()
370