Subversion Repositories SmartDukaan

Rev

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

Rev 7699 Rev 7718
Line 883... Line 883...
883
    for currentInventorySnapshot in CurrentInventorySnapshot.query.filter_by(warehouse_id=warehouseId).all():
883
    for currentInventorySnapshot in CurrentInventorySnapshot.query.filter_by(warehouse_id=warehouseId).all():
884
        currentInventorySnapshot.availability = 0
884
        currentInventorySnapshot.availability = 0
885
        clear_item_availability_cache(currentInventorySnapshot.item_id) 
885
        clear_item_availability_cache(currentInventorySnapshot.item_id) 
886
    session.commit()
886
    session.commit()
887
 
887
 
888
def get_our_warehouse_id_for_vendor(vendor_id):
888
def get_our_warehouse_id_for_vendor(vendor_id, billing_warehouse_id):
889
    try:
889
    try:
890
        warehouse = Warehouse.query.filter_by(vendor_id = vendor_id, warehouseType = 'OURS', inventoryType = 'GOOD').first()
890
        warehouse = Warehouse.query.filter_by(vendor_id = vendor_id, warehouseType = 'OURS', inventoryType = 'GOOD', billingWarehouseId = billing_warehouse_id).first()
891
        return warehouse.id
891
        return warehouse.id
892
    except Exception as e:
892
    except Exception as e:
893
        print e;
893
        print e;
894
        raise InventoryServiceException(101, 'No our warehouse found for vendorId: ' + vendor_id)
894
        raise InventoryServiceException(101, 'No our warehouse found for vendorId: ' + vendor_id)
895
    
895