| Line 56... |
Line 56... |
| 56 |
print cex.message
|
56 |
print cex.message
|
| 57 |
traceback.print_exc()
|
57 |
traceback.print_exc()
|
| 58 |
|
58 |
|
| 59 |
from_user = 'cnc.center@shop2020.in'
|
59 |
from_user = 'cnc.center@shop2020.in'
|
| 60 |
from_pwd = '5h0p2o2o'
|
60 |
from_pwd = '5h0p2o2o'
|
| 61 |
to = ['cnc.center@shop2020.in', "suraj.sharma@shop2020.in", "sandeep.sachdeva@shop2020.in", "manoj.kumar@shop2020.in"]
|
61 |
#to = ['cnc.center@shop2020.in', "suraj.sharma@shop2020.in", "sandeep.sachdeva@shop2020.in", "manoj.kumar@shop2020.in"]
|
| 62 |
|
- |
|
| - |
|
62 |
to=['phani.kumar@shop2020.in']
|
| 63 |
def process_dao_pickup_orders(provider):
|
63 |
def process_dao_pickup_orders(provider):
|
| 64 |
try:
|
64 |
try:
|
| 65 |
doas_tobe_picked_up = fetch_data(provider.id, [OrderStatus.DOA_PICKUP_CONFIRMED])
|
65 |
doas_tobe_picked_up = fetch_data(provider.id, [OrderStatus.DOA_PICKUP_CONFIRMED])
|
| 66 |
doa_pickup_details = read_dao_return_pickup_orders(doas_tobe_picked_up)
|
66 |
doa_pickup_details = read_dao_return_pickup_orders(doas_tobe_picked_up)
|
| 67 |
if doa_pickup_details:
|
67 |
if doa_pickup_details:
|
| Line 609... |
Line 609... |
| 609 |
statusDescription = order.statusDescription.replace(","," ")
|
609 |
statusDescription = order.statusDescription.replace(","," ")
|
| 610 |
writer.writerow([order.id, order.airwaybill_no, to_py_date(order.delivery_timestamp), statusDescription])
|
610 |
writer.writerow([order.id, order.airwaybill_no, to_py_date(order.delivery_timestamp), statusDescription])
|
| 611 |
|
611 |
|
| 612 |
def print_undelivered_orders_report(filename, orders):
|
612 |
def print_undelivered_orders_report(filename, orders):
|
| 613 |
writer = csv.writer(open(filename, "wb"), delimiter=',', quoting=csv.QUOTE_NONE)
|
613 |
writer = csv.writer(open(filename, "wb"), delimiter=',', quoting=csv.QUOTE_NONE)
|
| 614 |
writer.writerow(['Order Id', 'AWB No', 'Status', 'Status Description', 'Shipping timestamp', 'Pickup timestamp'])
|
614 |
writer.writerow(['Order Id', 'AWB No', 'Status', 'Status Description', 'Shipping timestamp', 'Pickup timestamp', 'Promised delivery date', 'Expected delivery date'])
|
| 615 |
for order in orders:
|
615 |
for order in orders:
|
| 616 |
statusDescription = ''
|
616 |
statusDescription = ''
|
| 617 |
if order.statusDescription is not None:
|
617 |
if order.statusDescription is not None:
|
| 618 |
statusDescription = order.statusDescription.replace(","," ")
|
618 |
statusDescription = order.statusDescription.replace(","," ")
|
| 619 |
writer.writerow([order.id, order.airwaybill_no, order.status, statusDescription, to_py_date(order.shipping_timestamp), to_py_date(order.pickup_timestamp)])
|
619 |
writer.writerow([order.id, order.airwaybill_no, order.status, statusDescription, to_py_date(order.shipping_timestamp), to_py_date(order.pickup_timestamp), to_py_date(order.promised_delivery_time), to_py_date(order.expected_delivery_time)])
|
| 620 |
|
620 |
|
| 621 |
def create_crm_tickets_for_delivey_attempted_orders(provider):
|
621 |
def create_crm_tickets_for_delivey_attempted_orders(provider):
|
| 622 |
try:
|
622 |
try:
|
| 623 |
tickets_tobe_created = fetch_data(provider.id, [OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE])
|
623 |
tickets_tobe_created = fetch_data(provider.id, [OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE])
|
| 624 |
userClient = UserClient().get_client()
|
624 |
userClient = UserClient().get_client()
|