huge number of changes to start making all usages of expense accounts dynamic.

This commit is contained in:
Bryce Covert
2019-04-12 15:39:32 -07:00
parent e64820d71a
commit b6e73f0bfb
21 changed files with 103 additions and 181 deletions

View File

@@ -45,14 +45,11 @@
:journal-entry/line-items (into [{:journal-entry-line/account (a/get-account-by-numeric-code-and-sets 2110 ["default"])
:journal-entry-line/credit (:invoice/total entity)}]
(map (fn [ea]
{:journal-entry-line/account (a/get-account-by-numeric-code-and-sets
(:invoice-expense-account/expense-account-id ea)
["default"])
{:journal-entry-line/account (:db/id (:invoice-expense-account/account ea))
:journal-entry-line/location (:invoice-expense-account/location ea)
:journal-entry-line/debit (:invoice-expense-account/amount ea)})
(:invoice/expense-accounts entity)))
#_#_:general-ledger/from-expense-account 2110
#_#_:general-ledger/to-expense-account (:invoice-expense-account/expense-account-id ea)
:journal-entry/cleared (and (< (:invoice/outstanding-balance entity) 0.01)
(every? #(= :payment-status/cleared (:payment/status %)) (:invoice/payments entity))
)})))
@@ -76,8 +73,7 @@
:journal-entry-line/location "HQ"
:journal-entry-line/credit (Math/abs (:transaction/amount entity))}
]
#_#_:general-ledger/from-expense-account 2110
#_#_:general-ledger/to-expense-account (:invoice-expense-account/expense-account-id ea)
:journal-entry/cleared true})))
(defmethod entity-change->ledger :invoice-expense-account