you can't add an existing invoice.
This commit is contained in:
@@ -63,6 +63,15 @@
|
||||
(defn get-all []
|
||||
(query base-query))
|
||||
|
||||
(defn find-conflicting [{:keys [id invoice-number company-id vendor-id]}]
|
||||
(query
|
||||
(-> base-query
|
||||
(helpers/merge-where [:and [:not= :id id]
|
||||
[:= :invoice-number invoice-number]
|
||||
[:= :company-id company-id]
|
||||
[:= :vendor-id vendor-id]
|
||||
[:not= :status "voided"]]))))
|
||||
|
||||
(defn get-multi [ids]
|
||||
(query (-> base-query
|
||||
(helpers/merge-where [:in :id ids]))))
|
||||
|
||||
Reference in New Issue
Block a user