remove excluded from ledger.

This commit is contained in:
Bryce Covert
2019-05-19 08:06:21 -07:00
parent 9396bbb7eb
commit cf2319b681
19 changed files with 3508 additions and 144 deletions

View File

@@ -58,6 +58,7 @@
[db [type id]]
(let [entity (d/pull db ['* {:transaction/vendor '[*]
:transaction/client '[*]
:transaction/approval-status '[*]
:transaction/bank-account '[* {:bank-account/type [:db/ident]}]
:transaction/accounts '[*
{:transaction-account/account [*]}] }] id)
@@ -65,7 +66,7 @@
decreasing? (< (:transaction/amount entity) 0.0)
credit-from-bank? decreasing?
debit-from-bank? (not decreasing?)]
(when-not (:transaction/exclude-from-ledger entity)
(when-not (= :transaction-approval-status/excluded (:db/ident (:transaction/approval-status entity)))
(remove-nils
{:journal-entry/source "transaction"
:journal-entry/client (:db/id (:transaction/client entity))