Subversion Repositories SmartDukaan

Rev

Rev 4579 | Rev 4586 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4579 Rev 4581
Line 801... Line 801...
801
        if order == None:
801
        if order == None:
802
            continue
802
            continue
803
            #raise TransactionServiceException(103, "No order found for the awb:" + awb)
803
            #raise TransactionServiceException(103, "No order found for the awb:" + awb)
804
        order.statusDescription = reason
804
        order.statusDescription = reason
805
    session.commit()
805
    session.commit()
-
 
806
    
-
 
807
    current_time = datetime.datetime.now()
-
 
808
    today_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
-
 
809
    upto_datetime = today_datetime - datetime.timedelta(4)
-
 
810
    orders_not_delivered = Order.query.filter_by(logistics_provider_id = provider_id).filter(Order.status.in_((OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST))).filter(or_(Order.shipping_timestamp <= upto_datetime, Order.pickup_timestamp <= upto_datetime)).all()
-
 
811
    return orders_not_delivered
806
 
812
 
807
def get_alerts(type, warehouseId, status, timestamp):
813
def get_alerts(type, warehouseId, status, timestamp):
808
    query = Alert.query.filter(Alert.warehouseId == warehouseId)
814
    query = Alert.query.filter(Alert.warehouseId == warehouseId)
809
    if type != -1 :
815
    if type != -1 :
810
        query = query.filter(Alert.type == type)
816
        query = query.filter(Alert.type == type)