      [:th.col-sm-2.text-right "Amount"]
      [:th.col-sm-2.text-right "Balance"]]]
    [:tbody
-    (if @items
-      (map item-row @items)
+    (if-let [items @transaction-items]
+      (map item-row items)
       [:tr [:td {:colSpan 4} [:span.inline-status "Loading..."]]])]])
 
 (defn- query-again?

           account-id
           other-account-id]
    :as quick-entry-trx}]
  (let [account (->> @*accounts*
                     (filter #(= (:id %) account-id))
                     first)
        rename-map (if (or (and (> quantity 0M)
                                (left-side? account))
                           (and (< quantity 0M)
                                (not (left-side? account))))

       (not= 0 (-> items last :index))))

(defn- next-query-range
  [[prev-start]]
  (let [latest (:latest-transaction-date account)
        start (if prev-start
                (t/minus prev-start (t/months 3))
                (t/first-day-of-the-month (or latest
                                              (t/today))))]
    [start (-> start (t/plus (t/months 2)) t/last-day-of-the-month)]))

(defn- get-items
  ([] (get-items nil))
  ([prev-date-range]
   (let [[start end :as date-range] (next-query-range prev-date-range)]
     (transaction-items/search
       {:account-id (:id @account)
        :transaction-date [:between start end]}
       (fn [result]
         (swap! transaction-items
                (fnil concat [])
                (map #(polarize-item % @account) result))
         (when (query-again? @transaction-items)
           (get-items date-range)))
       notify/danger))))

(def ^:private trx-form
