several fixes.
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
(map :a)
|
||||
(map namespace)
|
||||
set)]
|
||||
|
||||
(cond (namespaces "invoice" ) [[:invoice e]]
|
||||
(namespaces "invoice-expense-account" ) [[:invoice (:db/id (:invoice/_expense-accounts entity))]]
|
||||
(namespaces "transaction-account" ) [[:transaction (:db/id (:transaction/_accounts entity))]]
|
||||
@@ -24,7 +23,6 @@
|
||||
(map :a)
|
||||
(map namespace)
|
||||
set)]
|
||||
|
||||
(cond (namespaces "invoice" ) :invoice
|
||||
(namespaces "invoice-expense-account" ) :invoice-expense-account
|
||||
(namespaces "transaction-account" ) :transaction-account
|
||||
@@ -52,7 +50,6 @@
|
||||
:journal-entry-line/location (or (:invoice-expense-account/location ea) "HQ") ;; TODO?
|
||||
:journal-entry-line/debit (:invoice-expense-account/amount ea)}))
|
||||
(:invoice/expense-accounts entity)))
|
||||
|
||||
:journal-entry/cleared (and (< (:invoice/outstanding-balance entity) 0.01)
|
||||
(every? #(= :payment-status/cleared (:payment/status %)) (:invoice/payments entity))
|
||||
)})))
|
||||
@@ -68,7 +65,6 @@
|
||||
decreasing? (< (:transaction/amount entity) 0.0)
|
||||
credit-from-bank? decreasing?
|
||||
debit-from-bank? (not decreasing?)]
|
||||
|
||||
(when-not (:transaction/exclude-from-ledger entity)
|
||||
(remove-nils
|
||||
{:journal-entry/source "transaction"
|
||||
@@ -93,7 +89,9 @@
|
||||
(Math/abs (:transaction-account/amount a)))
|
||||
:journal-entry-line/credit (when debit-from-bank?
|
||||
(Math/abs (:transaction-account/amount a)))}))
|
||||
(:transaction/accounts entity)))
|
||||
(if (seq (:transaction/accounts entity))
|
||||
(:transaction/accounts entity)
|
||||
[{:transaction-account/amount (:transaction/amount entity)}])))
|
||||
|
||||
:journal-entry/cleared true}))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user