From df3be920e368b5f4349e97d2430e72045e95c8ee Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Mon, 10 Jun 2019 19:45:42 -0700 Subject: [PATCH 1/2] use rough rounding --- src/clj/auto_ap/datomic/checks.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/clj/auto_ap/datomic/checks.clj b/src/clj/auto_ap/datomic/checks.clj index ba32b9bc..4fff451c 100644 --- a/src/clj/auto_ap/datomic/checks.clj +++ b/src/clj/auto_ap/datomic/checks.clj @@ -53,7 +53,8 @@ (:bank-account-id args) (add-arg '?bank-account-id (:bank-account-id args) '[?e :payment/bank-account ?bank-account-id]) (:amount args) (add-arg '?amount (:amount args) - '[?e :payment/amount ?amount]) + '[?e :payment/amount ?transaction-amount] + '[(auto-ap.utils/dollars= ?transaction-amount ?amount)]) (:status args) (add-arg '?status (:status args) '[?e :payment/status ?status]) check-number-like (add-arg '?check-number-like check-number-like From 032646f59176cd33c8e806ae48b56172d9a93307 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Mon, 30 Sep 2019 20:40:19 -0700 Subject: [PATCH 2/2] fixing a few production issues. --- src/cljs/auto_ap/views/pages/checks.cljs | 14 ++++++-------- src/cljs/auto_ap/views/pages/unpaid_invoices.cljs | 3 ++- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/cljs/auto_ap/views/pages/checks.cljs b/src/cljs/auto_ap/views/pages/checks.cljs index cad7dac5..a17ea0b4 100644 --- a/src/cljs/auto_ap/views/pages/checks.cljs +++ b/src/cljs/auto_ap/views/pages/checks.cljs @@ -183,7 +183,7 @@ "Status"] - [:th {:style {:width "10em"}} "" ]]] + [:th {:style {:width "8em"}} "" ]]] [:tbody (if (:loading @status) [:tr @@ -199,7 +199,10 @@ [:td (cond (= :cash type) "Cash" (= :debit type) "Debit" - :else check-number)] + :else (if s3-url + [:a {:href s3-url :target "_new"} [:a.button [:span.icon [:i.fa.fa-share-square-o]] + [:span (str " " check-number )]]] + check-number))] [:td (date->str date) ] [:td.has-text-right (nf amount )] [:td status] @@ -207,12 +210,7 @@ (when (or (= :pending status) (and (#{":cash" ":debit" :cash :debit} type) (not= :voided status))) - [:button.button.is-warning.is-outlined {:on-click (dispatch-event [::void-check i])} [:span [:span.icon [:i.fa.fa-minus-circle]]]]) - (if s3-url - [:a.tag {:href s3-url :target "_new"} [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " check-number " (" (gstring/format "$%.2f" amount ) ")")] - [:span.tag [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " check-number " (" (gstring/format "$%.2f" amount ) ")")]) - ] - ]))]]])))) + [:button.button.is-warning.is-outlined {:on-click (dispatch-event [::void-check i])} [:span [:span.icon [:i.fa.fa-minus-circle]]]])]]))]]])))) (def checks-content diff --git a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs index ee83c8f0..6f8774a3 100644 --- a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs +++ b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs @@ -955,7 +955,8 @@ ")")) [:span " "] [:span.icon.is-small [:i.fa.fa-angle-down {:aria-hidden "true"}]]] - :id ::print-checks} + :id ::print-checks + :is-right? true} [:div (list (for [{:keys [id number name type]} (->> (:bank-accounts current-client) (filter :visible) (sort-by :sort-order))]