you can now edit invoices.
This commit is contained in:
@@ -33,6 +33,17 @@
|
||||
(->graphql))))
|
||||
|
||||
|
||||
(defn edit-invoice [context {{:keys [id] :as in} :invoice} value]
|
||||
(let [invoice (invoices/get-by-id id)
|
||||
paid-amount (- (:total invoice) (:outstanding-balance invoice))
|
||||
_ (assert-can-see-company (:id context) (:company-id invoice))
|
||||
updated-invoice (invoices/update (-> in
|
||||
(update :date parse iso-date)
|
||||
(assoc :outstanding_balance (- (:total in) paid-amount))))]
|
||||
(-> updated-invoice
|
||||
(->graphql))))
|
||||
|
||||
|
||||
(defn get-invoices-expense-accounts [context args value]
|
||||
(->graphql
|
||||
(invoices-expense-accounts/get-for-invoice (:id value))))
|
||||
|
||||
Reference in New Issue
Block a user