tracking companies by id

This commit is contained in:
Bryce Covert
2018-04-06 07:08:17 -07:00
parent 0baf1e0e65
commit 68964e2e2c
7 changed files with 31 additions and 18 deletions

View File

@@ -19,10 +19,10 @@
(defn get-unpaid [company]
(if company
(map db->clj (j/query (get-conn) ["SELECT * FROM invoices WHERE imported=true AND company = ?" company]))
(map db->clj (j/query (get-conn) ["SELECT * FROM invoices WHERE imported=true AND company_id = ?" (Integer/parseInt company)]))
(map db->clj (j/query (get-conn) "SELECT * FROM invoices WHERE imported=true"))))
(defn get-pending [company]
(if company
(map db->clj (j/query (get-conn) ["SELECT * FROM invoices WHERE (imported=false or imported is null) AND company = ?" company]))
(map db->clj (j/query (get-conn) ["SELECT * FROM invoices WHERE (imported=false or imported is null) AND company_id = ?" (Integer/parseInt company)]))
(map db->clj (j/query (get-conn) "SELECT * FROM invoices WHERE imported=false or imported is null"))))