filtering on ledger page.

This commit is contained in:
Bryce Covert
2020-04-28 07:49:53 -07:00
parent 1f649794eb
commit edc7d50661
10 changed files with 137 additions and 111 deletions

View File

@@ -41,17 +41,17 @@
'[?client-id :client/code ?client-code]]}
:args [(:client-code args)]})
(:to-date args)
(merge-query {:query {:in ['?to-date]
:where ['[?e :journal-entry/date ?d]
'[(<= ?d ?to-date)]]}
:args [(c/to-date (:to-date args))]})
(:start (:date-range args))
(merge-query {:query {:in ['?start-date]
:where ['[?e :journal-entry/date ?date]
'[(>= ?date ?start-date)]]}
:args [(c/to-date (:start (:date-range args)))]})
(:from-date args)
(merge-query {:query {:in ['?from-date]
:where ['[?e :journal-entry/date ?d]
'[(>= ?d ?from-date)]]}
:args [(c/to-date (:from-date args))]})
(:end (:date-range args))
(merge-query {:query {:in ['?end-date]
:where ['[?e :journal-entry/date ?date]
'[(<= ?date ?end-date)]]}
:args [(c/to-date (:end (:date-range args)))]})
(:from-numeric-code args)
(merge-query {:query {:in ['?from-numeric-code]
@@ -61,6 +61,12 @@
'[(>= ?c ?from-numeric-code)]]}
:args [(:from-numeric-code args)]})
(:bank-account-id args)
(merge-query {:query {:in ['?a]
:where ['[?e :journal-entry/line-items ?li]
'[?li :journal-entry-line/account ?a]]}
:args [(:bank-account-id args)]})
(:to-numeric-code args)
(merge-query {:query {:in ['?to-numeric-code]
:where ['[?e :journal-entry/line-items ?li]