a lot of progress on typeaheads, etc.

This commit is contained in:
Bryce Covert
2018-05-23 11:27:31 -07:00
parent 1a72859bd8
commit e445adec02
18 changed files with 214 additions and 85 deletions

View File

@@ -0,0 +1,17 @@
(ns auto-ap.graphql.invoices
(:require [auto-ap.graphql.utils :refer [->graphql]]
[auto-ap.db.invoices :as invoices]
[auto-ap.time :refer [parse normal-date]]))
(defn add-invoice [context {{:keys [total invoice_number company_id vendor_id date] :as in} :invoice} value]
(-> (invoices/insert-multi! [{:invoice-number invoice_number
:company-id company_id
:vendor-id vendor_id
:total total
:outstanding-balance total
:status "unpaid"
:imported true
:date (parse date normal-date)}])
(first)
(->graphql)))