| Line 215... |
Line 215... |
| 215 |
trecharge += data[2]
|
215 |
trecharge += data[2]
|
| 216 |
|
216 |
|
| 217 |
maildata += "</tbody></table></body></html>"
|
217 |
maildata += "</tbody></table></body></html>"
|
| 218 |
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"], "MIS (Date - " + todate.strftime("%d-%m-%Y") + ") (Wallet Amount - " + str(wallet.amount) + ") (Total Recharge - " + str(trecharge) + ")", maildata, [])
|
218 |
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"], "MIS (Date - " + todate.strftime("%d-%m-%Y") + ") (Wallet Amount - " + str(wallet.amount) + ") (Total Recharge - " + str(trecharge) + ")", maildata, [])
|
| 219 |
|
219 |
|
| - |
|
220 |
try:
|
| 220 |
push_recharge_collection_to_ocr()
|
221 |
push_recharge_collection_to_ocr()
|
| - |
|
222 |
except:
|
| - |
|
223 |
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", "", [])
|
| 221 |
|
224 |
|
| 222 |
def push_recharge_collection_to_ocr():
|
225 |
def push_recharge_collection_to_ocr():
|
| 223 |
rcs = RechargeCollection.query.filter(RechargeCollection.pushedToOcr == False).all()
|
226 |
rcs = RechargeCollection.query.filter(RechargeCollection.pushedToOcr == False).all()
|
| 224 |
|
227 |
|
| 225 |
for rc in rcs:
|
228 |
for rc in rcs:
|
| Line 261... |
Line 264... |
| 261 |
if "Saved Successfully" in resp:
|
264 |
if "Saved Successfully" in resp:
|
| 262 |
rc.pushedAt = datetime.datetime.now()
|
265 |
rc.pushedAt = datetime.datetime.now()
|
| 263 |
rc.pushedToOcr = True
|
266 |
rc.pushedToOcr = True
|
| 264 |
session.commit()
|
267 |
session.commit()
|
| 265 |
elif "Error in Saving Data" in resp:
|
268 |
elif "Error in Saving Data" in resp:
|
| 266 |
print "Send Alert to someone"
|
269 |
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, [])
|
| 267 |
else:
|
270 |
else:
|
| 268 |
print "Send Alert to someone"
|
271 |
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, [])
|
| 269 |
|
272 |
|
| 270 |
|
273 |
|
| 271 |
|
274 |
|
| 272 |
def topup_company_wallet(companyId, amount):
|
275 |
def topup_company_wallet(companyId, amount):
|
| 273 |
wallet = WalletForCompany.query.filter(WalletForCompany.id == companyId).with_lockmode("update").one()
|
276 |
wallet = WalletForCompany.query.filter(WalletForCompany.id == companyId).with_lockmode("update").one()
|