public int buyStockFromSettlement(StockType type, int volume)
	{
		int maxVolume = 0;
		if(this.warehouse.storedGoods.containsKey(type))
		{
			Stock stock = this.warehouse.storedGoods.get(type);
			
			if(volume <= stock.getVolume())
			{
				maxVolume = volume;
			}
			else
			{
				maxVolume = stock.getVolume();
			}
			
			stock.removeVolume(maxVolume);
			warehouse.usedSpace -= type.getThickness()*maxVolume;
			warehouse.availableSpace = Warehouse.capacity - warehouse.usedSpace;
		}
		
		return maxVolume;
	}