| Line 279... |
Line 279... |
| 279 |
raise TransactionServiceException(102, "No order found for the awb: " + awb)
|
279 |
raise TransactionServiceException(102, "No order found for the awb: " + awb)
|
| 280 |
order.status = OrderStatus.SHIPPED_TO_LOGST
|
280 |
order.status = OrderStatus.SHIPPED_TO_LOGST
|
| 281 |
order.statusDescription = "Order picked up by Courier Company"
|
281 |
order.statusDescription = "Order picked up by Courier Company"
|
| 282 |
order.pickup_timestamp = to_py_date(pickup_timestamp)
|
282 |
order.pickup_timestamp = to_py_date(pickup_timestamp)
|
| 283 |
session.commit()
|
283 |
session.commit()
|
| 284 |
#FIXME: Add a check for shipping timestamp to be of yesterday
|
- |
|
| - |
|
284 |
|
| 285 |
current_time = datetime.datetime.now()
|
285 |
current_time = datetime.datetime.now()
|
| 286 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
286 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| 287 |
from_datetime = to_datetime - datetime.timedelta(1)
|
287 |
from_datetime = to_datetime - datetime.timedelta(1)
|
| 288 |
orders_not_picked_up = Order.query.filter_by(logistics_provider_id = provider_id).filter_by(status=OrderStatus.SHIPPED_FROM_WH).filter(Order.shipping_timestamp >= from_datetime).filter(Order.shipping_timestamp <= to_datetime).all()
|
288 |
orders_not_picked_up = Order.query.filter_by(logistics_provider_id = provider_id).filter_by(status=OrderStatus.SHIPPED_FROM_WH).filter(Order.shipping_timestamp >= from_datetime).filter(Order.shipping_timestamp <= to_datetime).all()
|
| 289 |
return orders_not_picked_up
|
289 |
return orders_not_picked_up
|