diff --git a/src/cljs/auto_ap/views/pages/transactions/common.cljs b/src/cljs/auto_ap/views/pages/transactions/common.cljs index 8b60c3a7..19a4cb11 100644 --- a/src/cljs/auto_ap/views/pages/transactions/common.cljs +++ b/src/cljs/auto_ap/views/pages/transactions/common.cljs @@ -14,6 +14,6 @@ [:forecast-match [:id :identifier]] :status :description_original - [:payment [:check_number :s3_url]] + [:payment [:check_number :s3_url :id]] [:client [:name :id]] [:bank-account [:name :yodlee-account-id]]]) diff --git a/src/cljs/auto_ap/views/pages/transactions/table.cljs b/src/cljs/auto_ap/views/pages/transactions/table.cljs index a52f228f..0cf80298 100644 --- a/src/cljs/auto_ap/views/pages/transactions/table.cljs +++ b/src/cljs/auto_ap/views/pages/transactions/table.cljs @@ -13,7 +13,10 @@ [re-frame.core :as re-frame] [auto-ap.views.components.buttons :as buttons] [auto-ap.status :as status] - [auto-ap.views.pages.data-page :as data-page])) + [auto-ap.views.pages.data-page :as data-page] + [bidi.bidi :as bidi] + [cemerick.url :as url] + [auto-ap.routes :as routes])) (re-frame/reg-event-fx ::editing-matches-found @@ -111,6 +114,24 @@ :class (status/class-for (get states id)) :icon "fa-pencil"}] (when payment - [:a.tag {:href (:s3-url payment) :target "_new"} + [:a.button {:href (str (bidi/path-for routes/routes :payments ) + "?" + (url/map->query {:exact-match-id (:id payment)}))} + + [:span.icon + [:i.fa.fa-money]] + + #_(if (:check-number (:payment payment)) + (str "Check " (:check-number (:payment payment)) + " (" (gstring/format "$%.2f" (:amount payment) ) ")" + (when (= :cleared (:status (:payment payment))) + (str " - " (:post-date (:transaction (:payment payment)))))) + + (str "Debit (" (gstring/format "$%.2f" (:amount payment) ) ") " + (when (= :cleared (:status (:payment payment))) + (str " - " (:post-date (:transaction (:payment payment))))) + (when (= :cleared (:status (:payment payment))) + (str " - " (:post-date (:transaction (:payment payment))))))) ] + #_[:a.tag {:href (:s3-url payment) :target "_new"} [:span.icon [:i.fa.fa-money]] (str " " (:check-number payment) " (" (gstring/format "$%.2f" amount ) ")")])]]])]]]))