| Line 95... |
Line 95... |
| 95 |
|
95 |
|
| 96 |
today = date.today()
|
96 |
today = date.today()
|
| 97 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|
97 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|
| 98 |
filename = "/tmp/insurance-" + datestr + ".xls"
|
98 |
filename = "/tmp/insurance-" + datestr + ".xls"
|
| 99 |
wbk.save(filename)
|
99 |
wbk.save(filename)
|
| 100 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["murthy@ubiassociates.com","kashi@ubiassociates.com"], "Insurance Details for date " + datestr, "Please find attached insurance details for today.", [get_attachment_part(filename)], ["pramit.singh@shop2020.in","rajveer.singh@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@shop2020.in"], [])
|
100 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["murthy@ubiassociates.com","kashi@ubiassociates.com"], "Insurance Details for date " + datestr, "Please find attached insurance details for today.", [get_attachment_part(filename)], ["pramit.singh@shop2020.in","anikendra.das@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@shop2020.in"], [])
|
| 101 |
|
101 |
|
| 102 |
insurer = client.getInsurer(1)
|
102 |
insurer = client.getInsurer(1)
|
| 103 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["pramit.singh@shop2020.in","rajveer.singh@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@shop2020.in", "amit.tyagi@spiceretail.co.in", "pardeep.panwar@spiceretail.co.in", "j.p.gupta@shop2020.in"], "Declaration Status for insurer " + insurer.name + " as on " + datestr + " : (Declared Amount - " + str(insurer.declaredAmount) + ") (Total Amount - " + str(insurer.creditedAmount), "", [], [], [])
|
103 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["pramit.singh@shop2020.in","anikendra.das@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@shop2020.in", "amit.tyagi@spiceretail.co.in", "pardeep.panwar@spiceretail.co.in", "j.p.gupta@shop2020.in"], "Declaration Status for insurer " + insurer.name + " as on " + datestr + " : (Declared Amount - " + str(insurer.declaredAmount) + ") (Total Amount - " + str(insurer.creditedAmount), "", [], [], [])
|
| 104 |
|
104 |
|
| 105 |
def returned_orders():
|
105 |
def returned_orders():
|
| 106 |
DataService.initialize(db_hostname="192.168.190.114")
|
106 |
DataService.initialize(db_hostname="192.168.190.114")
|
| 107 |
todate = datetime.now()
|
107 |
todate = datetime.now()
|
| 108 |
todate = todate-timedelta(days = 2)
|
108 |
todate = todate-timedelta(days = 2)
|
| Line 167... |
Line 167... |
| 167 |
|
167 |
|
| 168 |
today = date.today()
|
168 |
today = date.today()
|
| 169 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|
169 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|
| 170 |
filename = "/tmp/insurance-return-" + datestr + ".xls"
|
170 |
filename = "/tmp/insurance-return-" + datestr + ".xls"
|
| 171 |
wbk.save(filename)
|
171 |
wbk.save(filename)
|
| 172 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["murthy@ubiassociates.com", "kashi@ubiassociates.com"], "Cancelled Insurance Policy Details for date " + datestr, "Please find attached orders which insurance need to be cancelled for today.", [get_attachment_part(filename)], ["pramit.singh@shop2020.in","rajveer.singh@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@shop2020.in"], [])
|
172 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["murthy@ubiassociates.com", "kashi@ubiassociates.com"], "Cancelled Insurance Policy Details for date " + datestr, "Please find attached orders which insurance need to be cancelled for today.", [get_attachment_part(filename)], ["pramit.singh@shop2020.in","anikendra.das@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@shop2020.in"], [])
|
| 173 |
|
173 |
|
| 174 |
def submitDeliveredOrdersDetails(args):
|
174 |
def submitDeliveredOrdersDetails(args):
|
| 175 |
DataService.initialize(db_hostname="192.168.190.114")
|
175 |
DataService.initialize(db_hostname="192.168.190.114")
|
| 176 |
todate = datetime.now()
|
176 |
todate = datetime.now()
|
| 177 |
todate = todate-timedelta(days = 10)
|
177 |
todate = todate-timedelta(days = 10)
|
| Line 260... |
Line 260... |
| 260 |
|
260 |
|
| 261 |
today = date.today()
|
261 |
today = date.today()
|
| 262 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|
262 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|
| 263 |
mail_body = "Number of records successfully inserted :"+str(len(successful))+"\nFollowing order id's were not processed because\nServer Side Error: "+', '.join(map(str, serverSide))+"\n"+"Data Format Error: "+', '.join(map(str, dataFormat))+"\n"+"Duplicate entry IMEI: "+', '.join(map(str, duplicateRecord))
|
263 |
mail_body = "Number of records successfully inserted :"+str(len(successful))+"\nFollowing order id's were not processed because\nServer Side Error: "+', '.join(map(str, serverSide))+"\n"+"Data Format Error: "+', '.join(map(str, dataFormat))+"\n"+"Duplicate entry IMEI: "+', '.join(map(str, duplicateRecord))
|
| 264 |
print mail_body
|
264 |
print mail_body
|
| 265 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["rajveer.singh@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@saholic.com"], "Insurance submission result for date " + datestr, mail_body, [], [], [])
|
265 |
EmailAttachmentSender.mail("cnc.center@shop2020.in", "5h0p2o2o", ["anikendra.das@shop2020.in","kshitij.sood@shop2020.in","rajneesh.arora@saholic.com"], "Insurance submission result for date " + datestr, mail_body, [], [], [])
|
| 266 |
|
266 |
|
| 267 |
if(len(args)>1):
|
267 |
if(len(args)>1):
|
| 268 |
print "Exiting.Dont want to run delivered_orders() and returned_orders() again."
|
268 |
print "Exiting.Dont want to run delivered_orders() and returned_orders() again."
|
| 269 |
sys.exit(0)
|
269 |
sys.exit(0)
|
| 270 |
|
270 |
|