| Line 560... |
Line 560... |
| 560 |
statusDescription = order.statusDescription.replace(","," ")
|
560 |
statusDescription = order.statusDescription.replace(","," ")
|
| 561 |
writer.writerow([order.id, order.airwaybill_no, to_py_date(order.delivery_timestamp), statusDescription])
|
561 |
writer.writerow([order.id, order.airwaybill_no, to_py_date(order.delivery_timestamp), statusDescription])
|
| 562 |
|
562 |
|
| 563 |
def print_undelivered_orders_report(filename, orders):
|
563 |
def print_undelivered_orders_report(filename, orders):
|
| 564 |
writer = csv.writer(open(filename, "wb"), delimiter=',', quoting=csv.QUOTE_NONE)
|
564 |
writer = csv.writer(open(filename, "wb"), delimiter=',', quoting=csv.QUOTE_NONE)
|
| 565 |
writer.writerow(['Order Id', 'AWB No', 'Status', 'Status Description', 'Shipping timestamp', 'Pickup timestamp', 'Promised delivery date', 'Expected delivery date'])
|
565 |
writer.writerow(['Order Id', 'AWB No', 'Status', 'Status Description', 'Shipping timestamp', 'Pickup timestamp', 'Promised delivery date', 'Expected delivery date', 'OTG'])
|
| 566 |
for order in orders:
|
566 |
for order in orders:
|
| 567 |
statusDescription = ''
|
567 |
statusDescription = ''
|
| 568 |
if order.statusDescription is not None:
|
568 |
if order.statusDescription is not None:
|
| 569 |
statusDescription = order.statusDescription.replace(","," ")
|
569 |
statusDescription = order.statusDescription.replace(","," ")
|
| 570 |
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)])
|
570 |
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'])
|
| 571 |
|
571 |
|
| 572 |
def create_crm_tickets_for_delivey_attempted_orders(provider):
|
572 |
def create_crm_tickets_for_delivey_attempted_orders(provider):
|
| 573 |
try:
|
573 |
try:
|
| 574 |
tickets_tobe_created = fetch_data(provider.id, [OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE])
|
574 |
tickets_tobe_created = fetch_data(provider.id, [OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE])
|
| 575 |
userClient = UserClient().get_client()
|
575 |
userClient = UserClient().get_client()
|