Subversion Repositories SmartDukaan

Rev

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

Rev 9342 Rev 9633
Line 498... Line 498...
498
    wamt = int(dit2[0])- int(dit[0])
498
    wamt = int(dit2[0])- int(dit[0])
499
    wallet.amount = wamt
499
    wallet.amount = wamt
500
    session.commit()
500
    session.commit()
501
 
501
 
502
    maildata += "</tbody></table></body></html>"
502
    maildata += "</tbody></table></body></html>"
503
    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, []) 
503
    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","adarsh.verma@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, []) 
504
    try:
504
    try:
505
        push_recharge_collection_to_ocr()
505
        push_recharge_collection_to_ocr()
506
    except:
506
    except:
507
        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", "", [])
507
        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", "", [])
508
    finally:
508
    finally:
Line 511... Line 511...
511
            if hotspotServiceMatrixMap.get(storeId).rechargeService:
511
            if hotspotServiceMatrixMap.get(storeId).rechargeService:
512
                store = HotspotStore.get_by(id = storeId)
512
                store = HotspotStore.get_by(id = storeId)
513
                msg = msg + str(store.hotspotId) + ' - ' + str(store.email) + '<br>'
513
                msg = msg + str(store.hotspotId) + ' - ' + str(store.email) + '<br>'
514
        msg = msg + '</body></html>'
514
        msg = msg + '</body></html>'
515
        helper_client = HelperClient().get_client()
515
        helper_client = HelperClient().get_client()
516
        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"], 1)
516
        helper_client.saveUserEmailForSending(["adarsh.verma@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"], 1)
517
                
517
                
518
            
518
            
519
         
519
         
520
def push_recharge_collection_to_ocr():
520
def push_recharge_collection_to_ocr():
521
    rcs = RechargeCollection.query.filter(RechargeCollection.pushedToOcr == False).all()
521
    rcs = RechargeCollection.query.filter(RechargeCollection.pushedToOcr == False).all()
Line 579... Line 579...
579
    wh.referenceNumber =  get_next_invoice_number(OrderType.WALLETCREDIT)
579
    wh.referenceNumber =  get_next_invoice_number(OrderType.WALLETCREDIT)
580
    wh.description = "Wallet Credited"
580
    wh.description = "Wallet Credited"
581
    
581
    
582
    wallet.amount += amount
582
    wallet.amount += amount
583
    session.commit()
583
    session.commit()
584
    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.", "", [], [], [])
584
    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","adarsh.verma@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.", "", [], [], [])
585
 
585
 
586
def compute_website_recharge_collection(cdate, oldBalance, newBalance):
586
def compute_website_recharge_collection(cdate, oldBalance, newBalance):
587
    startTime = datetime.datetime(cdate.year, cdate.month, cdate.day)
587
    startTime = datetime.datetime(cdate.year, cdate.month, cdate.day)
588
    endTime = startTime + timedelta(days=1)
588
    endTime = startTime + timedelta(days=1)
589
    tamount = 0
589
    tamount = 0
Line 629... Line 629...
629
    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)
629
    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)
630
    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 - " + startTime.strftime("%d-%m-%Y") + ")", maildata, [])
630
    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 - " + startTime.strftime("%d-%m-%Y") + ")", maildata, [])
631
    
631
    
632
if __name__ == '__main__':
632
if __name__ == '__main__':
633
    main()
633
    main()
634
            
-
 
635
634
            
-
 
635