you can now change types.

This commit is contained in:
Bryce Covert
2018-05-31 21:57:00 -07:00
parent 4c16c06457
commit 2f744be36c
7 changed files with 162 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
(ns auto-ap.views.components.invoice-table
(:require [re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [date->str]]
[auto-ap.views.utils :refer [date->str dispatch-event]]
[auto-ap.views.components.paginator :refer [paginator]]
[auto-ap.views.components.sorter :refer [sorted-column]]
[reagent.core :as reagent]
@@ -22,7 +22,7 @@
:company-id (:id @(re-frame/subscribe [::subs/company])))
[[:invoices [:id :total :outstanding-balance :invoice-number :date
[:vendor [:name :id]]
[:expense_accounts [:amount :id
[:expense_accounts [:amount :id :expense_account_id
[:expense_account [:id :name [:parent [:id :name]]]]]]
[:company [:name :id]]
[:checks [:amount [:check [:amount :s3_url :check_number ]]]]
@@ -33,7 +33,7 @@
(defn invoice-table [{:keys [id invoice-page status on-params-change vendors params check-boxes checked on-check-changed]}]
(defn invoice-table [{:keys [id invoice-page status on-params-change vendors params check-boxes checked on-check-changed expense-event]}]
(let [state (reagent/atom (or @params {}))
opc (fn [p]
(swap! state merge p)
@@ -121,7 +121,7 @@
[:td (gstring/format "$%.2f" outstanding-balance )]
[:td (for [e expense-accounts]
^{:key (:id e)}
[:a.tag (:name (:expense-account e)) " "(gstring/format "$%.2f" (:amount e) ) ])]
[:a.tag {:on-click (dispatch-event (conj expense-event id))} (:name (:expense-account e)) " "(gstring/format "$%.2f" (:amount e) ) ])]
[:td (for [check checks]
^{:key (:id check)}
[:a.tag {:href (:s3-url (:check check)) :target "_new"} [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " (:check-number (:check check)) " (" (gstring/format "$%.2f" (:amount check) ) ")")])]]))]]]))))