adding ability to choose location
This commit is contained in:
@@ -253,6 +253,7 @@
|
||||
:add_invoice
|
||||
{:fields {:id {:type 'Int}
|
||||
:invoice_number {:type 'String}
|
||||
:location {:type 'String}
|
||||
:date {:type 'String}
|
||||
:company_id {:type 'Int}
|
||||
:vendor_id {:type 'Int}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
(vendors/get-by-id vendor-id)
|
||||
(vendors/insert {:name vendor-name :default-expense-account 0})))
|
||||
|
||||
(defn add-invoice [context {{:keys [total invoice_number company_id vendor_id vendor_name date] :as in} :invoice} value]
|
||||
(defn add-invoice [context {{:keys [total invoice_number location company_id vendor_id vendor_name date] :as in} :invoice} value]
|
||||
(let [vendor (-create-or-get-vendor vendor_id vendor_name)
|
||||
_ (assert-can-see-company (:id context) company_id)
|
||||
company (companies/get-by-id company_id)
|
||||
@@ -27,7 +27,7 @@
|
||||
)]
|
||||
(invoices-expense-accounts/replace-for-invoice
|
||||
(:id invoice) [{:expense-account-id (:default-expense-account vendor)
|
||||
:location (first (:locations company))
|
||||
:location location
|
||||
:amount total}] )
|
||||
(-> invoice
|
||||
(->graphql))))
|
||||
|
||||
Reference in New Issue
Block a user