now all payments can go through datomic, but pdfs need work.

This commit is contained in:
Bryce Covert
2018-08-23 22:39:12 -07:00
parent 2ea6ca576f
commit a9224dad22
6 changed files with 137 additions and 89 deletions

View File

@@ -155,8 +155,8 @@
[:td (:name client)])
[:td (:name vendor)]
[:td (cond
(= "cash" type) "Cash"
(= "debit" type) "Debit"
(= :cash type) "Cash"
(= :debit type) "Debit"
:else check-number)]
[:td (date->str date) ]
[:td (gstring/format "$%.2f" amount )]

View File

@@ -164,6 +164,7 @@
(re-frame/reg-event-fx
::print-checks
(fn [{:keys [db]} [_ bank-account-id type]]
(println type)
(let [invoice-amounts (by :id :outstanding-balance (get-in db [::invoice-page :invoices]))]
{:db (-> db
@@ -203,7 +204,13 @@
:amount (invoice-amounts (:id x))})
(get-in db [::advanced-print-checks :invoices]))
bank-account-id
(or type "check")
(cond (= type :check)
:check
(= type :cash)
:cash
:else
:check)
(:company db))
:on-success [::checks-created]}})))
@@ -809,11 +816,11 @@
[:div.dropdown-content
(list
(for [{:keys [id number name type]} (:bank-accounts current-company)]
(if (= "cash" type)
^{:key id} [:a.dropdown-item {:on-click (dispatch-event [::print-checks id "cash"])} "With cash"]
(if (= :cash type)
^{:key id} [:a.dropdown-item {:on-click (dispatch-event [::print-checks id :cash])} "With cash"]
(list
^{:key (str id "-check")} [:a.dropdown-item {:on-click (dispatch-event [::print-checks id "check"])} "Print checks from " name]
^{:key (str id "-debit")} [:a.dropdown-item {:on-click (dispatch-event [::print-checks id "debit"])} "Debit from " name])))
^{:key (str id "-check")} [:a.dropdown-item {:on-click (dispatch-event [::print-checks id :check])} "Print checks from " name]
^{:key (str id "-debit")} [:a.dropdown-item {:on-click (dispatch-event [::print-checks id :debit])} "Debit from " name])))
^{:key "advanced-divider"} [:hr.dropdown-divider]
(when (= 1 (count checked))