Dumfries Fountain is to be restored and returned to full working order.