Subversion Repositories SmartDukaan

Rev

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

Rev 4915 Rev 4920
Line 829... Line 829...
829
    return rto_orders
829
    return rto_orders
830
 
830
 
831
def update_non_delivery_reason(provider_id, undelivered_orders):
831
def update_non_delivery_reason(provider_id, undelivered_orders):
832
    for awb, reason in undelivered_orders.iteritems():
832
    for awb, reason in undelivered_orders.iteritems():
833
        order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
833
        order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
834
        if order == None:
834
        if order == None or order.status == OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE:
835
            continue
835
            continue
836
            #raise TransactionServiceException(103, "No order found for the awb:" + awb)
836
            #raise TransactionServiceException(103, "No order found for the awb:" + awb)
837
        order.statusDescription = reason
837
        order.statusDescription = reason
838
    session.commit()
838
    session.commit()
839
 
839