| Line 449... |
Line 449... |
| 449 |
content += "<h2>Approval Requested for Price: " + str(order.total_amount) + "</h2>"
|
449 |
content += "<h2>Approval Requested for Price: " + str(order.total_amount) + "</h2>"
|
| 450 |
content += "<h2><a href='http://support.shop2020.in:8080/Support/price-approval?xszbg=" + base64.b64encode(str(order.id)) + "'>Click here for Approval</a></h2>"
|
450 |
content += "<h2><a href='http://support.shop2020.in:8080/Support/price-approval?xszbg=" + base64.b64encode(str(order.id)) + "'>Click here for Approval</a></h2>"
|
| 451 |
content += "<br><br></body></html>"
|
451 |
content += "<br><br></body></html>"
|
| 452 |
store = get_hotspot_store(order.storeId, "")
|
452 |
store = get_hotspot_store(order.storeId, "")
|
| 453 |
helper_client = HelperClient().get_client()
|
453 |
helper_client = HelperClient().get_client()
|
| 454 |
helper_client.saveUserEmailForSending(store.approvalEmail.split(';'), "", "Price approval requested for " + str(order.lineitems[0]) + " in store " + store.hotspotId , content, str(transaction_id), "PriceApproval", [], [])
|
454 |
helper_client.saveUserEmailForSending(store.approvalEmail.split(';'), "", "Price approval requested for " + str(order.lineitems[0]) + " order Id " + str(order.id) + " in store " + store.hotspotId , content, str(transaction_id), "PriceApproval", [], [])
|
| 455 |
session.commit()
|
455 |
session.commit()
|
| 456 |
except Exception as e:
|
456 |
except Exception as e:
|
| 457 |
print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
|
457 |
print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
|
| 458 |
|
458 |
|
| 459 |
return True
|
459 |
return True
|
| Line 1157... |
Line 1157... |
| 1157 |
except Exception as e:
|
1157 |
except Exception as e:
|
| 1158 |
print e
|
1158 |
print e
|
| 1159 |
|
1159 |
|
| 1160 |
return True
|
1160 |
return True
|
| 1161 |
|
1161 |
|
| 1162 |
def verify_order(self, orderId):
|
1162 |
def verify_order(orderId):
|
| 1163 |
logging.info("Verifying order no: " + str(orderId))
|
1163 |
logging.info("Verifying order no: " + str(orderId))
|
| 1164 |
order = get_order(orderId)
|
1164 |
order = get_order(orderId)
|
| 1165 |
if order.status == OrderStatus.COD_VERIFICATION_PENDING:
|
1165 |
if order.status == OrderStatus.COD_VERIFICATION_PENDING:
|
| 1166 |
order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
1166 |
order.status = OrderStatus.SUBMITTED_FOR_PROCESSING
|
| 1167 |
order.statusDescription = "Submitted for processing"
|
1167 |
order.statusDescription = "Submitted for processing"
|
| 1168 |
order.verification_timestamp = datetime.datetime.now()
|
1168 |
order.verification_timestamp = datetime.datetime.now()
|
| 1169 |
session.commit()
|
1169 |
session.commit()
|
| 1170 |
if order.source == OrderSource.STORE:
|
1170 |
if order.source == OrderSource.STORE:
|
| 1171 |
__push_collection_to_hotspot(order, "SALE", True)
|
1171 |
__push_store_collection_to_hotspot(order, 'advance', order.advanceAmount)
|
| 1172 |
logging.info("Successfully verified order no: " + str(orderId))
|
1172 |
logging.info("Successfully verified order no: " + str(orderId))
|
| 1173 |
return True
|
1173 |
return True
|
| 1174 |
else:
|
1174 |
else:
|
| 1175 |
logging.warning("Verify called for order no." + str(orderId) +" which is not in verification pending state");
|
1175 |
logging.warning("Verify called for order no." + str(orderId) +" which is not in verification pending state");
|
| 1176 |
return False
|
1176 |
return False
|