bunch of small fixes. balance sheet has optional comparison and titles. trying to make payment unlinkable more easily.
This commit is contained in:
@@ -468,6 +468,7 @@
|
||||
:resolve :get-transaction-rule-matches}
|
||||
:balance_sheet {:type :balance_sheet
|
||||
:args {:client_id {:type :id}
|
||||
:include_comparison {:type 'Boolean}
|
||||
:date {:type :iso_date}}
|
||||
:resolve :get-balance-sheet}
|
||||
|
||||
|
||||
@@ -180,10 +180,11 @@
|
||||
comparable-date (coerce/to-date (time/minus (:date args) (time/years 1)))
|
||||
all-ledger-entries (full-ledger-for-client client-id)
|
||||
lookup-account (build-account-lookup client-id)]
|
||||
(log/info "Running balance sheet with " args)
|
||||
|
||||
(->graphql
|
||||
{:balance-sheet-accounts (roll-up-until lookup-account all-ledger-entries end-date)
|
||||
:comparable-balance-sheet-accounts (roll-up-until lookup-account all-ledger-entries comparable-date)})))
|
||||
(cond-> {:balance-sheet-accounts (roll-up-until lookup-account all-ledger-entries end-date)}
|
||||
(:include_comparison args) (assoc :comparable-balance-sheet-accounts (roll-up-until lookup-account all-ledger-entries comparable-date))
|
||||
true ->graphql)))
|
||||
|
||||
(defn get-profit-and-loss [context args value]
|
||||
(let [client-id (:client_id args)
|
||||
|
||||
Reference in New Issue
Block a user