Fixing the math.
This commit is contained in:
@@ -68,11 +68,17 @@
|
||||
|
||||
:journal-entry/line-items [(remove-nils{:journal-entry-line/account (:db/id (:transaction/account entity))
|
||||
:journal-entry-line/location "HQ"
|
||||
:journal-entry-line/debit (Math/abs (:transaction/amount entity))})
|
||||
:journal-entry-line/debit (when (< (:transaction/amount entity) 0.0)
|
||||
(Math/abs (:transaction/amount entity)))
|
||||
:journal-entry-line/credit (when (>= (:transaction/amount entity) 0.0)
|
||||
(Math/abs (:transaction/amount entity)))})
|
||||
|
||||
(remove-nils {:journal-entry-line/account (:db/id (:transaction/bank-account entity))
|
||||
:journal-entry-line/location "HQ"
|
||||
:journal-entry-line/credit (Math/abs (:transaction/amount entity))})
|
||||
:journal-entry-line/credit (when (< (:transaction/amount entity) 0.0)
|
||||
(Math/abs (:transaction/amount entity)))
|
||||
:journal-entry-line/debit (when (>= (:transaction/amount entity) 0.0)
|
||||
(Math/abs (:transaction/amount entity)))})
|
||||
]
|
||||
|
||||
:journal-entry/cleared true}))))
|
||||
|
||||
Reference in New Issue
Block a user