| Line 623... |
Line 623... |
| 623 |
statusDescription = order.statusDescription.replace(","," ")
|
623 |
statusDescription = order.statusDescription.replace(","," ")
|
| 624 |
writer.writerow([order.id, order.airwaybill_no, to_py_date(order.delivery_timestamp), statusDescription])
|
624 |
writer.writerow([order.id, order.airwaybill_no, to_py_date(order.delivery_timestamp), statusDescription])
|
| 625 |
|
625 |
|
| 626 |
def print_undelivered_orders_report(filename, orders):
|
626 |
def print_undelivered_orders_report(filename, orders):
|
| 627 |
writer = csv.writer(open(filename, "wb"), delimiter=',', quoting=csv.QUOTE_NONE)
|
627 |
writer = csv.writer(open(filename, "wb"), delimiter=',', quoting=csv.QUOTE_NONE)
|
| 628 |
writer.writerow(['Order Id', 'AWB No', 'Status', 'Status Description', 'Shipping timestamp', 'Pickup timestamp', 'Promised delivery date', 'Expected delivery date'])
|
628 |
writer.writerow(['Order Id', 'AWB No', 'Status', 'Status Description', 'Shipping timestamp', 'Pickup timestamp', 'Promised delivery date', 'Expected delivery date', 'OTG'])
|
| 629 |
for order in orders:
|
629 |
for order in orders:
|
| 630 |
statusDescription = ''
|
630 |
statusDescription = ''
|
| 631 |
if order.statusDescription is not None:
|
631 |
if order.statusDescription is not None:
|
| 632 |
statusDescription = order.statusDescription.replace(","," ")
|
632 |
statusDescription = order.statusDescription.replace(","," ")
|
| 633 |
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)])
|
633 |
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), 'True' if order.otg else 'False'])
|
| 634 |
|
634 |
|
| 635 |
def create_crm_tickets_for_delivey_attempted_orders(provider):
|
635 |
def create_crm_tickets_for_delivey_attempted_orders(provider):
|
| 636 |
try:
|
636 |
try:
|
| 637 |
tickets_tobe_created = fetch_data(provider.id, [OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE])
|
637 |
tickets_tobe_created = fetch_data(provider.id, [OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE])
|
| 638 |
userClient = UserClient().get_client()
|
638 |
userClient = UserClient().get_client()
|