Adds the ability to filter down to unbalanced
This commit is contained in:
@@ -54,5 +54,4 @@
|
||||
(comment
|
||||
(regenerate-literals)
|
||||
|
||||
(auto-ap.datomic/install-functions)
|
||||
)
|
||||
(auto-ap.datomic/install-functions))
|
||||
@@ -12,7 +12,17 @@
|
||||
db
|
||||
(:invoice/invoice-number invoice)
|
||||
(:invoice/client invoice)
|
||||
(:invoice/vendor invoice))))]
|
||||
(if existing?
|
||||
(:invoice/vendor invoice))))
|
||||
[ locked-until] (first (dc/q '[:find ?locked-until
|
||||
:in $ ?c
|
||||
:where [?c :client/locked-until ?locked-until]]
|
||||
db
|
||||
(:invoice/client invoice)))
|
||||
is-locked? (cond
|
||||
(not locked-until) false
|
||||
(not (:invoice/date invoice)) true
|
||||
(< (compare (:invoice/date invoice) locked-until) 0) true
|
||||
:else false)]
|
||||
(if (or existing? is-locked?)
|
||||
[]
|
||||
[[:upsert-invoice invoice]])))
|
||||
|
||||
Reference in New Issue
Block a user