                     :style :summary
                     :data (->> (interleave (-> result :totals :income)
                                            (-> result :totals :expense))
-                               (map :value)
                                (partition 2)
                                (map #(apply - %))
                                (map #(hash-map :value %)))}])))

                 nil)}
   (html
     [:td (:caption item)]
     (map #(vector :td.text-right (format-number %)) (:data item))
     [:td.text-right (format-number (reduce + 0 (:data item)))])])

(defn- summarize-periods
  [items]

(defn show
  "Renders the budet details"
  [id]
  (let [budget (for-display id)]
  (layout
    (str "Budget: " (:name budget)) {}
    [:div.row
