Subversion Repositories SmartDukaan

Rev

Rev 21376 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21376 Rev 23132
Line 92... Line 92...
92
        wallet = WalletForCompany.query.filter(WalletForCompany.id == 3).one()
92
        wallet = WalletForCompany.query.filter(WalletForCompany.id == 3).one()
93
        oldBalance = wallet.amount
93
        oldBalance = wallet.amount
94
        try:
94
        try:
95
            newBalance = getBalance()
95
            newBalance = getBalance()
96
        except:
96
        except:
97
            mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["amit.gupta@saholic.com", "kshitij.sood@saholic.com", "manoj.bajaj@spiceretail.co.in","amit.tyagi@spiceretail.co.in","pradeep.panwar@spiceretail.co.in"], "Unable to fetch balance from spice digital api.Collection not created.", "", [])
97
            mail_html("cnc.center@shop2020.in", "5h0p2o2o", ["amit.gupta@saholic.com", "kshitij.sood@saholic.com", "manoj.bajaj@spiceretail.co.in","amit.tyagi@spiceretail.co.in"], "Unable to fetch balance from spice digital api.Collection not created.", "", [])
98
            sys.exit(1)
98
            sys.exit(1)
99
        wallet.amount = newBalance
99
        wallet.amount = newBalance
100
        session.commit()
100
        session.commit()
101
                
101
                
102
        d = datetime.datetime.now()
102
        d = datetime.datetime.now()
Line 601... Line 601...
601
    wh.referenceNumber =  get_next_invoice_number(OrderType.WALLETCREDIT)
601
    wh.referenceNumber =  get_next_invoice_number(OrderType.WALLETCREDIT)
602
    wh.description = "Wallet Credited"
602
    wh.description = "Wallet Credited"
603
    
603
    
604
    wallet.amount += amount
604
    wallet.amount += amount
605
    session.commit()
605
    session.commit()
606
    mail("cnc.center@shop2020.in", "5h0p2o2o", ["anikendra.das@saholic.com", "kshitij.sood@shop2020.in","pardeep.panwar@spiceretail.co.in","adarsh.verma@spiceretail.co.in","j.p.gupta@shop2020.in", "amit.gupta@shop2020.in", "amit.tyagi@spiceretail.co.in"] , company.name + " wallet topped up by " +  str(amount) + " rupees.", "", [], [], [])
606
    mail("cnc.center@shop2020.in", "5h0p2o2o", ["amit.gupta@shop2020.in", "amit.tyagi@spiceretail.co.in"] , company.name + " wallet topped up by " +  str(amount) + " rupees.", "", [], [], [])
607
 
607
 
608
def compute_website_recharge_collection(cdate, oldBalance, newBalance):
608
def compute_website_recharge_collection(cdate, oldBalance, newBalance):
609
    startTime = datetime.datetime(cdate.year, cdate.month, cdate.day)
609
    startTime = datetime.datetime(cdate.year, cdate.month, cdate.day)
610
    endTime = startTime + timedelta(days=1)
610
    endTime = startTime + timedelta(days=1)
611
    tamount = 0
611
    tamount = 0