several fixes.
This commit is contained in:
@@ -94,6 +94,12 @@
|
||||
[]
|
||||
clients))))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::bank-accounts-by-id
|
||||
:<- [::bank-accounts]
|
||||
(fn [as]
|
||||
(by :id as)))
|
||||
|
||||
;; Bank accounts only, not including cash
|
||||
(re-frame/reg-sub
|
||||
::real-bank-accounts
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
[reagent.core :as reagent]
|
||||
[clojure.string :as str]
|
||||
[cljs-time.format :as format]
|
||||
[cljs-time.core :as t]
|
||||
[goog.string :as gstring]
|
||||
[goog.i18n.NumberFormat.Format])
|
||||
)
|
||||
@@ -86,8 +87,18 @@
|
||||
(:name client))])
|
||||
[:td (:name vendor)]
|
||||
[:td invoice-number]
|
||||
[:td (date->str date) ]
|
||||
[:td (date->str due) ]
|
||||
[:td (date->str date) ]
|
||||
[:td
|
||||
(when due
|
||||
(let [today (t/at-midnight (t/now))
|
||||
due (t/at-midnight due)
|
||||
due-in (if (t/after? today due)
|
||||
(- (t/in-days (t/interval (t/minus due (t/days 1)) today)))
|
||||
(t/in-days (t/interval today due )))]
|
||||
(if (> due-in 0)
|
||||
[:span.has-text-success due-in " days"]
|
||||
[:span.has-text-danger due-in " days"])
|
||||
))]
|
||||
[:td (str/join ", " (set (map :location expense-accounts)))]
|
||||
|
||||
[:td.has-text-right (nf total )]
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
{:keys [journal-entries start end count total]} @ledger-page
|
||||
selected-client @(re-frame/subscribe [::subs/client])
|
||||
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id selected-client])
|
||||
bank-accounts-by-id @(re-frame/subscribe [::subs/bank-accounts-by-id])
|
||||
percentage-size (if selected-client "25%" "33%")
|
||||
opc (fn [e]
|
||||
(re-frame/dispatch [::params-changed e]))]
|
||||
@@ -115,7 +116,8 @@
|
||||
(when status?
|
||||
[:td status])]]
|
||||
(for [{:keys [debit credit location account id]} line-items
|
||||
:let [account (accounts-by-id (:id account))]]
|
||||
:let [account (or (accounts-by-id (:id account))
|
||||
(bank-accounts-by-id (:id account)))]]
|
||||
^{:key id}
|
||||
[:tr {:class (:class i)}
|
||||
(when-not selected-client
|
||||
|
||||
Reference in New Issue
Block a user