Subversion Repositories SmartDukaan

Rev

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

Rev 4783 Rev 4789
Line 752... Line 752...
752
        session.commit()
752
        session.commit()
753
        return True
753
        return True
754
    except:
754
    except:
755
        return False
755
        return False
756
 
756
 
757
def mark_orders_as_shipped_from_warehouse(warehouse_id, provider_id, cod):
757
def mark_orders_as_shipped_from_warehouse(warehouseId, providerId, cod, orderIds):
758
    try:
758
    try:
759
        current_timestamp = datetime.datetime.now()
759
        current_timestamp = datetime.datetime.now()
760
        orders = Order.query.filter_by(warehouse_id = warehouse_id, logistics_provider_id = provider_id, status = OrderStatus.MANIFESTED, cod = cod).all()
760
        orders = Order.query.filter_by(warehouse_id = warehouseId, logistics_provider_id = providerId, status = OrderStatus.BILLED, cod = cod).all()
761
        for order in orders:
761
        for order in orders:
-
 
762
            if order.id in orderIds:
762
            order.status = OrderStatus.SHIPPED_FROM_WH
763
                order.status = OrderStatus.SHIPPED_FROM_WH
763
            order.statusDescription = "Order shipped from warehouse"
764
                order.statusDescription = "Order shipped from warehouse"
764
            order.shipping_timestamp = current_timestamp
765
                order.shipping_timestamp = current_timestamp
765
        session.commit()
766
        session.commit()
766
        
767
        
767
        try:
768
        try:
768
            enqueue_shipping_confirmation_email(orders)
769
            enqueue_shipping_confirmation_email(orders)
769
        except Exception as e:
770
        except Exception as e: