bugfix.
This commit is contained in:
@@ -69,33 +69,32 @@
|
||||
credit-from-bank? decreasing?
|
||||
debit-from-bank? (not decreasing?)]
|
||||
|
||||
(when (:transaction/vendor entity)
|
||||
(remove-nils
|
||||
{:journal-entry/source "transaction"
|
||||
:journal-entry/client (:db/id (:transaction/client entity))
|
||||
:journal-entry/date (:transaction/date entity)
|
||||
:journal-entry/original-entity (:db/id entity)
|
||||
:journal-entry/vendor (:db/id (:transaction/vendor entity))
|
||||
:journal-entry/amount (Math/abs (:transaction/amount entity))
|
||||
(remove-nils
|
||||
{:journal-entry/source "transaction"
|
||||
:journal-entry/client (:db/id (:transaction/client entity))
|
||||
:journal-entry/date (:transaction/date entity)
|
||||
:journal-entry/original-entity (:db/id entity)
|
||||
:journal-entry/vendor (:db/id (:transaction/vendor entity))
|
||||
:journal-entry/amount (Math/abs (:transaction/amount entity))
|
||||
|
||||
:journal-entry/line-items (into [(remove-nils {:journal-entry-line/account (:db/id (:transaction/bank-account entity))
|
||||
:journal-entry-line/location "A"
|
||||
:journal-entry-line/credit (when credit-from-bank?
|
||||
(Math/abs (:transaction/amount entity)))
|
||||
:journal-entry-line/debit (when debit-from-bank?
|
||||
(Math/abs (:transaction/amount entity)))})
|
||||
]
|
||||
(map
|
||||
(fn [a]
|
||||
(remove-nils{:journal-entry-line/account (:db/id (:transaction-account/account a))
|
||||
:journal-entry-line/location (:transaction-account/location a)
|
||||
:journal-entry-line/debit (when credit-from-bank?
|
||||
(Math/abs (:transaction-account/amount a)))
|
||||
:journal-entry-line/credit (when debit-from-bank?
|
||||
(Math/abs (:transaction-account/amount a)))}))
|
||||
(:transaction/accounts entity)))
|
||||
|
||||
:journal-entry/cleared true}))))
|
||||
:journal-entry/line-items (into [(remove-nils {:journal-entry-line/account (:db/id (:transaction/bank-account entity))
|
||||
:journal-entry-line/location "A"
|
||||
:journal-entry-line/credit (when credit-from-bank?
|
||||
(Math/abs (:transaction/amount entity)))
|
||||
:journal-entry-line/debit (when debit-from-bank?
|
||||
(Math/abs (:transaction/amount entity)))})
|
||||
]
|
||||
(map
|
||||
(fn [a]
|
||||
(remove-nils{:journal-entry-line/account (:db/id (:transaction-account/account a))
|
||||
:journal-entry-line/location (:transaction-account/location a)
|
||||
:journal-entry-line/debit (when credit-from-bank?
|
||||
(Math/abs (:transaction-account/amount a)))
|
||||
:journal-entry-line/credit (when debit-from-bank?
|
||||
(Math/abs (:transaction-account/amount a)))}))
|
||||
(:transaction/accounts entity)))
|
||||
|
||||
:journal-entry/cleared true})))
|
||||
|
||||
(defmethod entity-change->ledger :invoice-expense-account
|
||||
[db [entity changes]]
|
||||
|
||||
Reference in New Issue
Block a user