Subversion Repositories SmartDukaan

Rev

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

Rev 6927 Rev 6943
Line 1427... Line 1427...
1427
def mark_orders_as_returned_from_store(providerId, orderIds, awbs):
1427
def mark_orders_as_returned_from_store(providerId, orderIds, awbs):
1428
    try:
1428
    try:
1429
        current_timestamp = datetime.datetime.now()
1429
        current_timestamp = datetime.datetime.now()
1430
        orders = Order.query.filter(Order.id.in_(orderIds)).filter_by(logistics_provider_id = providerId, status = OrderStatus.RET_PICKUP_REQUEST_RAISED).all()
1430
        orders = Order.query.filter(Order.id.in_(orderIds)).filter_by(logistics_provider_id = providerId, status = OrderStatus.RET_PICKUP_REQUEST_RAISED).all()
1431
        for order in orders:
1431
        for order in orders:
1432
            order.status = OrderStatus.RET_RETURN_IN_TRANSIT
1432
            order.status = OrderStatus.RTO_IN_TRANSIT
1433
            order.statusDescription = "Order returned from store"
1433
            order.statusDescription = "Order returned from store"
1434
            order.doa_pickup_timestamp = current_timestamp
1434
            order.doa_pickup_timestamp = current_timestamp
1435
            #order.airwaybill_no = awbs[orderIds.index(order.id)]
1435
            #order.airwaybill_no = awbs[orderIds.index(order.id)]
1436
            order.tracking_id = awbs[orderIds.index(order.id)]
1436
            order.tracking_id = awbs[orderIds.index(order.id)]
1437
        session.commit()
1437
        session.commit()