Adding ability to choose comparison date for balance sheet
This commit is contained in:
@@ -547,7 +547,8 @@
|
||||
:balance_sheet {:type :balance_sheet
|
||||
:args {:client_id {:type :id}
|
||||
:include_comparison {:type 'Boolean}
|
||||
:date {:type :iso_date}}
|
||||
:date {:type :iso_date}
|
||||
:comparison_date {:type :iso_date}}
|
||||
:resolve :get-balance-sheet}
|
||||
|
||||
:profit_and_loss {:type :profit_and_loss_report
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
(let [client-id (:client_id args)
|
||||
_ (assert-can-see-client (:id context) client-id)
|
||||
end-date (coerce/to-date (:date args))
|
||||
comparable-date (coerce/to-date (time/minus (:date args) (time/years 1)))
|
||||
comparable-date (coerce/to-date (:comparison_date args))
|
||||
all-ledger-entries (full-ledger-for-client client-id)
|
||||
lookup-account (build-account-lookup client-id)]
|
||||
(log/info "Running balance sheet with " args)
|
||||
|
||||
Reference in New Issue
Block a user