(cloud) Made invoice proposition a usable ion
This commit is contained in:
@@ -331,18 +331,4 @@
|
||||
due (assoc :invoice/due due)
|
||||
scheduled-payment (assoc :invoice/scheduled-payment scheduled-payment))))
|
||||
|
||||
(defn propose-invoice [db invoice]
|
||||
(let [existing? (boolean (seq (dc/q '[:find ?i
|
||||
:in $ ?invoice-number ?client ?vendor
|
||||
:where
|
||||
[?i :invoice/invoice-number ?invoice-number]
|
||||
[?i :invoice/client ?client]
|
||||
[?i :invoice/vendor ?vendor]
|
||||
(not [?i :invoice/status :invoice-status/voided])]
|
||||
db
|
||||
(:invoice/invoice-number invoice)
|
||||
(:invoice/client invoice)
|
||||
(:invoice/vendor invoice))))]
|
||||
(if existing?
|
||||
[]
|
||||
[(remove-nils invoice)])))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user