| Line 1677... |
Line 1677... |
| 1677 |
try:
|
1677 |
try:
|
| 1678 |
helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
|
1678 |
helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
|
| 1679 |
helper_client.saveUserEmailForSending([user_email], SaholicHelpEmailId, subject, email_html, logisticsTxnId, "DeliverySuccess", [], [], order.source)
|
1679 |
helper_client.saveUserEmailForSending([user_email], SaholicHelpEmailId, subject, email_html, logisticsTxnId, "DeliverySuccess", [], [], order.source)
|
| 1680 |
|
1680 |
|
| 1681 |
if order.source == OrderSource.WEBSITE:
|
1681 |
if order.source == OrderSource.WEBSITE:
|
| 1682 |
send_transaction_sms(order.customer_id, order.customer_mobilenumber, "Dear Customer, Your order: " + logisticsTxnId + " has been delivered now. For any queries please call +919818116289." , SmsType.TRANSACTIONAL, True)
|
1682 |
send_transaction_sms(order.customer_id, order.customer_mobilenumber, "Dear Customer, Your order: " + logisticsTxnId + " has been delivered now. For any queries please call +918826894203." , SmsType.TRANSACTIONAL, True)
|
| 1683 |
|
1683 |
|
| 1684 |
return True
|
1684 |
return True
|
| 1685 |
except Exception as e:
|
1685 |
except Exception as e:
|
| 1686 |
print e
|
1686 |
print e
|
| 1687 |
return False
|
1687 |
return False
|
| Line 1776... |
Line 1776... |
| 1776 |
raise TransactionServiceException(108, "order: " + str(order_id) + " does not belong to customer: " + str(customer_id))
|
1776 |
raise TransactionServiceException(108, "order: " + str(order_id) + " does not belong to customer: " + str(customer_id))
|
| 1777 |
return order
|
1777 |
return order
|
| 1778 |
|
1778 |
|
| 1779 |
def get_all_orders(statuses, from_date, to_date, warehouse_id):
|
1779 |
def get_all_orders(statuses, from_date, to_date, warehouse_id):
|
| 1780 |
query = Order.query
|
1780 |
query = Order.query
|
| 1781 |
if len(statuses):
|
1781 |
if not len(statuses):
|
| - |
|
1782 |
query.filter(Order.status >= OrderStatus.COD_VERIFICATION_PENDING)
|
| - |
|
1783 |
else:
|
| 1782 |
query = query.filter(Order.status.in_(statuses))
|
1784 |
query = query.filter(Order.status.in_(statuses))
|
| 1783 |
if warehouse_id:
|
1785 |
if warehouse_id:
|
| 1784 |
query = query.filter(Order.warehouse_id == warehouse_id)
|
1786 |
query = query.filter(Order.warehouse_id == warehouse_id)
|
| 1785 |
#raise TransactionServiceException(101, "bad warehouse id")
|
1787 |
#raise TransactionServiceException(101, "bad warehouse id")
|
| 1786 |
if from_date:
|
1788 |
if from_date:
|
| Line 7918... |
Line 7920... |
| 7918 |
order.expected_shipping_time = to_py_date(date)
|
7920 |
order.expected_shipping_time = to_py_date(date)
|
| 7919 |
order.promised_shipping_time = to_py_date(date)
|
7921 |
order.promised_shipping_time = to_py_date(date)
|
| 7920 |
session.commit()
|
7922 |
session.commit()
|
| 7921 |
|
7923 |
|
| 7922 |
def get_order_for_airwayBillNo(airwaybillNo):
|
7924 |
def get_order_for_airwayBillNo(airwaybillNo):
|
| 7923 |
orders = Order.query.filter(Order.airwaybill_no==airwaybillNo).all()
|
7925 |
orders = Order.query.filter(Order.airwaybill_no==airwaybillNo).filter(Order.logisticsTransactionId != None).all()
|
| 7924 |
if not orders:
|
7926 |
if not orders:
|
| 7925 |
orders = []
|
7927 |
orders = []
|
| 7926 |
|
7928 |
|
| 7927 |
return orders
|
7929 |
return orders
|
| 7928 |
|
7930 |
|
| Line 9498... |
Line 9500... |
| 9498 |
</tr>"""
|
9500 |
</tr>"""
|
| 9499 |
|
9501 |
|
| 9500 |
html += """
|
9502 |
html += """
|
| 9501 |
</table>
|
9503 |
</table>
|
| 9502 |
<p>
|
9504 |
<p>
|
| 9503 |
For any queries please call +919818116289.
|
9505 |
For any queries please call +918826894203.
|
| 9504 |
</p>
|
9506 |
</p>
|
| 9505 |
<p>
|
9507 |
<p>
|
| 9506 |
Warm Regards,<br />
|
9508 |
Warm Regards,<br />
|
| 9507 |
Saholic Team
|
9509 |
Saholic Team
|
| 9508 |
</p>
|
9510 |
</p>
|
| Line 9514... |
Line 9516... |
| 9514 |
bcc = ["backup@saholic.com"]
|
9516 |
bcc = ["backup@saholic.com"]
|
| 9515 |
try:
|
9517 |
try:
|
| 9516 |
helper_client = HelperClient().get_client()
|
9518 |
helper_client = HelperClient().get_client()
|
| 9517 |
helper_client.saveUserEmailForSending([order.customer_email], SaholicHelpEmailId, subject, html, str(order.id), "TransactionInfo", [], bcc, order.source)
|
9519 |
helper_client.saveUserEmailForSending([order.customer_email], SaholicHelpEmailId, subject, html, str(order.id), "TransactionInfo", [], bcc, order.source)
|
| 9518 |
if order.customer_mobilenumber is not None:
|
9520 |
if order.customer_mobilenumber is not None:
|
| 9519 |
smsText = "Dear Customer, Your Order "+ str(order.id) + " have been split into two orders. Please check your account or email. For any queries please call +919818116289."
|
9521 |
smsText = "Dear Customer, Your Order "+ str(order.id) + " have been split into two orders. Please check your account or email. For any queries please call +918826894203."
|
| 9520 |
send_transaction_sms(order.customer_id, order.customer_mobilenumber, smsText, SmsType.TRANSACTIONAL, False)
|
9522 |
send_transaction_sms(order.customer_id, order.customer_mobilenumber, smsText, SmsType.TRANSACTIONAL, False)
|
| 9521 |
|
9523 |
|
| 9522 |
except Exception as e:
|
9524 |
except Exception as e:
|
| 9523 |
print e
|
9525 |
print e
|
| 9524 |
|
9526 |
|