bunch of small fixes. balance sheet has optional comparison and titles. trying to make payment unlinkable more easily.

This commit is contained in:
Bryce Covert
2020-12-17 07:42:19 -08:00
parent 1534175608
commit a9da35d7b9
4 changed files with 124 additions and 85 deletions

View File

@@ -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}

View File

@@ -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)