Subversion Repositories SmartDukaan

Rev

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

Rev 7983 Rev 7986
Line 18... Line 18...
18
 
18
 
19
 
19
 
20
if __name__ == '__main__' and __package__ is None:
20
if __name__ == '__main__' and __package__ is None:
21
    import os
21
    import os
22
    sys.path.insert(0, os.getcwd())
22
    sys.path.insert(0, os.getcwd())
-
 
23
from datetime import date, timedelta
23
from shop2020.clients.HelperClient import HelperClient
24
from shop2020.clients.HelperClient import HelperClient
24
from shop2020.thriftpy.model.v1.order.ttypes import RechargeOrderStatus,\
25
from shop2020.thriftpy.model.v1.order.ttypes import RechargeOrderStatus,\
25
    OrderType
26
    OrderType
26
from shop2020.model.v1.order.impl.DataAccessors import get_recharge_orders_for_status, update_recharge_order_status,\
27
from shop2020.model.v1.order.impl.DataAccessors import get_recharge_orders_for_status, update_recharge_order_status,\
27
    update_recharge_transaction_status, get_next_invoice_number
28
    update_recharge_transaction_status, get_next_invoice_number
Line 240... Line 241...
240
    try:
241
    try:
241
        push_recharge_collection_to_ocr()
242
        push_recharge_collection_to_ocr()
242
    except:
243
    except:
243
        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", "", [])
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", "", [])
244
    finally:
245
    finally:
-
 
246
        msg = "<html><body>"
245
        for storeId in hotspotServiceMatrixMap.keys():
247
        for storeId in hotspotServiceMatrixMap.keys():
246
            if hotspotServiceMatrixMap.get(storeId).rechargeService:
248
            if hotspotServiceMatrixMap.get(storeId).rechargeService:
247
                store = HotspotStore.get_by(id = storeId)
249
                store = HotspotStore.get_by(id = storeId)
-
 
250
                msg = msg + str(store.hotspotId) + ' - ' + str(store.email) + '<br>'
-
 
251
        msg = msg + '</body></html>'
248
                helper_client = HelperClient().get_client()
252
        helper_client = HelperClient().get_client()
249
                helper_client.saveUserEmailForSending([store.clusterEmail], "cnc.center@shop2020.in", "No Recharge happened for store " + store.hotspotId + " yesterday", "", "NRM", "NoRechargeMail", [store.email], ["anupam.singh@shop2020.in"])
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"])
-
 
254
                
250
            
255
            
251
         
256
         
252
def push_recharge_collection_to_ocr():
257
def push_recharge_collection_to_ocr():
253
    rcs = RechargeCollection.query.filter(RechargeCollection.pushedToOcr == False).all()
258
    rcs = RechargeCollection.query.filter(RechargeCollection.pushedToOcr == False).all()
254
    
259