| Line 22... |
Line 22... |
| 22 |
from shop2020.clients.TransactionClient import TransactionClient
|
22 |
from shop2020.clients.TransactionClient import TransactionClient
|
| 23 |
from shop2020.clients.LogisticsClient import LogisticsClient
|
23 |
from shop2020.clients.LogisticsClient import LogisticsClient
|
| 24 |
from shop2020.clients.CatalogClient import CatalogClient
|
24 |
from shop2020.clients.CatalogClient import CatalogClient
|
| 25 |
from shop2020.thriftpy.model.v1.order.ttypes import Order, DelayReason
|
25 |
from shop2020.thriftpy.model.v1.order.ttypes import Order, DelayReason
|
| 26 |
from shop2020.utils.EmailAttachmentSender import mail, get_attachment_part
|
26 |
from shop2020.utils.EmailAttachmentSender import mail, get_attachment_part
|
| - |
|
27 |
to = ["sandeep.sachdeva@shop2020.in","ashutosh.saxena@shop2020.in","suraj.sharma@shop2020.in","pankaj.jain@spiceglobal.com", "pankaj.kankar@shop2020.in", "chaitnaya.vats@shop2020.in"]
|
| 27 |
|
28 |
|
| 28 |
def generate_delayed_orders_file():
|
29 |
def generate_delayed_orders_file():
|
| 29 |
txn_client = TransactionClient().get_client()
|
30 |
txn_client = TransactionClient().get_client()
|
| 30 |
slipped_orders = txn_client.getSlippedSippingDateOrders()
|
31 |
slipped_orders = txn_client.getSlippedSippingDateOrders()
|
| 31 |
|
32 |
|
| Line 86... |
Line 87... |
| 86 |
filename = "/tmp/SlippedOrders-" + datestr + ".xls"
|
87 |
filename = "/tmp/SlippedOrders-" + datestr + ".xls"
|
| 87 |
wbk.save(filename)
|
88 |
wbk.save(filename)
|
| 88 |
|
89 |
|
| 89 |
try:
|
90 |
try:
|
| 90 |
part = get_attachment_part(filename)
|
91 |
part = get_attachment_part(filename)
|
| 91 |
mail("cnc.center@shop2020.in", "5h0p2o2o", ["sandeep.sachdeva@shop2020.in","suraj.sharma@shop2020.in","pankaj.jain@spiceglobal.com", "pankaj.kankar@shop2020.in", "chaitnaya.vats@shop2020.in"], "Slipped Orders as on: " + datestr, "PFA attached xls files for the orders which missed the shipping date.", [part])
|
92 |
mail("cnc.center@shop2020.in", "5h0p2o2o", to, "Slipped Orders as on: " + datestr, "PFA attached xls files for the orders which missed the shipping date.", [part])
|
| 92 |
finally:
|
93 |
finally:
|
| 93 |
os.remove(filename)
|
94 |
os.remove(filename)
|
| 94 |
|
95 |
|
| 95 |
def generate_cancelled_orders_file():
|
96 |
def generate_cancelled_orders_file():
|
| 96 |
txn_client = TransactionClient().get_client()
|
97 |
txn_client = TransactionClient().get_client()
|
| Line 153... |
Line 154... |
| 153 |
filename = "/tmp/CancelledOrders-" + datestr + ".xls"
|
154 |
filename = "/tmp/CancelledOrders-" + datestr + ".xls"
|
| 154 |
wbk.save(filename)
|
155 |
wbk.save(filename)
|
| 155 |
|
156 |
|
| 156 |
try:
|
157 |
try:
|
| 157 |
part = get_attachment_part(filename)
|
158 |
part = get_attachment_part(filename)
|
| 158 |
mail("cnc.center@shop2020.in", "5h0p2o2o", ["sandeep.sachdeva@shop2020.in","suraj.sharma@shop2020.in","pankaj.jain@spiceglobal.com", "pankaj.kankar@shop2020.in", "chaitnaya.vats@shop2020.in"], "Low Inventory Cancelled Orders as on: " + datestr, "PFA attached xls files for the orders which has been cancelled.", [part])
|
159 |
mail("cnc.center@shop2020.in", "5h0p2o2o", to, "Low Inventory Cancelled Orders as on: " + datestr, "PFA attached xls files for the orders which has been cancelled.", [part])
|
| 159 |
finally:
|
160 |
finally:
|
| 160 |
os.remove(filename)
|
161 |
os.remove(filename)
|
| 161 |
|
162 |
|
| 162 |
def generate_expected_delivery_missed_orders_file():
|
163 |
def generate_expected_delivery_missed_orders_file():
|
| 163 |
to = ["sandeep.sachdeva@shop2020.in","suraj.sharma@shop2020.in","pankaj.jain@spiceglobal.com", "pankaj.kankar@shop2020.in", "chaitnaya.vats@shop2020.in"]
|
- |
|
| 164 |
|
164 |
|
| 165 |
txn_client = TransactionClient().get_client()
|
165 |
txn_client = TransactionClient().get_client()
|
| 166 |
orders_not_delivered = txn_client.getUndeliveredOrdersExpectedDeliveryDateNotMet()
|
166 |
orders_not_delivered = txn_client.getUndeliveredOrdersExpectedDeliveryDateNotMet()
|
| 167 |
|
167 |
|
| 168 |
print "orders_not_delivered"
|
168 |
print "orders_not_delivered"
|