| Line 17... |
Line 17... |
| 17 |
import os
|
17 |
import os
|
| 18 |
sys.path.insert(0, os.getcwd())
|
18 |
sys.path.insert(0, os.getcwd())
|
| 19 |
|
19 |
|
| 20 |
from shop2020.utils.Utils import to_py_date
|
20 |
from shop2020.utils.Utils import to_py_date
|
| 21 |
from shop2020.clients.TransactionClient import TransactionClient
|
21 |
from shop2020.clients.TransactionClient import TransactionClient
|
| 22 |
from shop2020.thriftpy.model.v1.order.ttypes import OrderStatus, Order
|
22 |
from shop2020.thriftpy.model.v1.order.ttypes import Order, DelayReason
|
| 23 |
from shop2020.utils.EmailAttachmentSender import mail, get_attachment_part
|
23 |
from shop2020.utils.EmailAttachmentSender import mail, get_attachment_part
|
| 24 |
|
24 |
|
| 25 |
def main():
|
25 |
def main():
|
| 26 |
txn_client = TransactionClient().get_client()
|
26 |
txn_client = TransactionClient().get_client()
|
| 27 |
slipped_orders = txn_client.getSlippedSippingDateOrders()
|
27 |
slipped_orders = txn_client.getSlippedSippingDateOrders()
|
| Line 70... |
Line 70... |
| 70 |
sheet.write(i, 5, lineitem.color)
|
70 |
sheet.write(i, 5, lineitem.color)
|
| 71 |
|
71 |
|
| 72 |
sheet.write(i, 6, to_py_date(order.created_timestamp), date_style)
|
72 |
sheet.write(i, 6, to_py_date(order.created_timestamp), date_style)
|
| 73 |
sheet.write(i, 7, to_py_date(order.promised_shipping_time), date_style)
|
73 |
sheet.write(i, 7, to_py_date(order.promised_shipping_time), date_style)
|
| 74 |
sheet.write(i, 8, to_py_date(order.expected_shipping_time), date_style)
|
74 |
sheet.write(i, 8, to_py_date(order.expected_shipping_time), date_style)
|
| 75 |
sheet.write(i, 9, order.delayReason)
|
75 |
if order.delayReason:
|
| - |
|
76 |
sheet.write(i, 9, DelayReason._VALUES_TO_NAMES[order.delayReason])
|
| 76 |
|
77 |
|
| 77 |
i= i+1
|
78 |
i= i+1
|
| 78 |
|
79 |
|
| 79 |
today = datetime.date.today()
|
80 |
today = datetime.date.today()
|
| 80 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|
81 |
datestr = str(today.year) + "-" + str(today.month) + "-" + str(today.day)
|