From 27e9456891071985f33baf81f87fd331eb25d741 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Thu, 11 Apr 2019 19:48:02 -0700 Subject: [PATCH] fixing bug in master --- src/cljs/auto_ap/subs.cljs | 7 +++++++ src/cljs/auto_ap/views/pages/unpaid_invoices.cljs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cljs/auto_ap/subs.cljs b/src/cljs/auto_ap/subs.cljs index 8a12ca15..c6704cd9 100644 --- a/src/cljs/auto_ap/subs.cljs +++ b/src/cljs/auto_ap/subs.cljs @@ -28,6 +28,13 @@ [] clients)))) +(re-frame/reg-sub + ::real-bank-accounts + :<- [::client] + (fn [client] + (->> client :bank-accounts (filter #(= (:type %) :check)) (sort-by :sort-order)))) + + (re-frame/reg-sub ::clients-by-id (fn [db] diff --git a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs index f5053993..ee83c8f0 100644 --- a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs +++ b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs @@ -147,7 +147,7 @@ :db (-> db (forms/stop-form ::new-invoice) (update-in [::invoice-page :print-checks-shown?] #(not %) ) - (assoc-in [::handwrite-checks] {:bank-account-id (:id (first @(re-frame/subscribe [::subs/bank-accounts]))) + (assoc-in [::handwrite-checks] {:bank-account-id (:id (first @(re-frame/subscribe [::subs/real-bank-accounts]))) :invoices invoices } ))}))) (re-frame/reg-event-db @@ -630,7 +630,7 @@ :field :bank-account-id :event change-event :subscription handwrite-checks} - (for [{:keys [id number name]} (->> current-client :bank-accounts (filter #(= (:type %) :check)) (sort-by :sort-order))] + (for [{:keys [id number name]} @(re-frame/subscribe [::subs/real-bank-accounts])] ^{:key id} [:option {:value id} name])]]]]