        [:div.col-md-3
         [:form {:action (format "/budgets/%s/items" budget-id)
                 :method :post}
-         (select-field item :account-id (account-options (:entity-id budget)) {:autofocus true})
+         (select-field item :account-id (account-options (:entity-id budget) {:types #{:income :expense}}) {:autofocus true})
          (number-input-field item :average)
          [:button.btn.btn-primary {:type :submit
                                    :title "Click here to save this budget item."} "Save"]

     (map #(period-heading budget %) (range 0 (:period-count budget)))
     [:th.text-right "Total"])])

(defn- budget-period-cell
  [period]
  [:td.text-right (format-number (:amount period))])

(defn- budget-item-row
  [budget item]
  [:tr
   (html
     [:td (->> item
               :account-id
               (accounts/find-by-id (env :db))
               :name)]
     (map budget-period-cell (:periods item))
     [:td.text-right (format-number (reduce + 0 (map :amount (:periods item))))])])

(defn show
  "Renders the budet details"
  [id]
  (let [budget (budgets/find-by-id (env :db) id)]
  (layout
    (str "Budget: " (:name budget)) {}
    [:div.row

            [ring.util.response :refer :all]
            [ring.util.codec :refer [url-encode]]
            [clj-money.url :refer :all]
            [clj-money.inflection :refer [humanize]]
            [clj-money.util :refer [format-number format-date]]
            [clj-money.validation :as validation]
            [clj-money.models.accounts :as accounts]
