you can now change types.
This commit is contained in:
@@ -29,3 +29,16 @@
|
||||
[:= :i.id :nonexist.invoice-id]]
|
||||
:where [:and [:= :nonexist.id nil]
|
||||
[:not= :v.default-expense-account nil]] }] })))
|
||||
|
||||
(defn replace-for-invoice [invoice-id expense-accounts]
|
||||
(j/db-do-prepared (get-conn)
|
||||
(sql/format {:delete-from [:invoices-expense-accounts :i]
|
||||
:where [:= :i.invoice-id invoice-id] }))
|
||||
|
||||
(println expense-accounts)
|
||||
(j/insert-multi! (get-conn)
|
||||
:invoices_expense_accounts
|
||||
(doto (->> expense-accounts
|
||||
(map (fn [x] (assoc x :invoice-id invoice-id)))
|
||||
(map clj->db ))
|
||||
println)) )
|
||||
|
||||
Reference in New Issue
Block a user