Vendor autopay re-instated.
This commit is contained in:
@@ -141,10 +141,13 @@
|
||||
::editing
|
||||
(fn [db [_ which]]
|
||||
(let [accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id (:client which)])
|
||||
vendor (get @(re-frame/subscribe [::subs/vendors-by-id]) (:id (:vendor which)))
|
||||
edit-invoice (update which :date #(date->str % standard))
|
||||
edit-invoice (update edit-invoice :due #(date->str % standard))
|
||||
edit-invoice (update edit-invoice :scheduled-payment #(date->str % standard))
|
||||
edit-invoice (assoc edit-invoice :original edit-invoice)
|
||||
edit-invoice (assoc edit-invoice :vendor-autopay? (boolean ((set (map :id (:automatically-paid-when-due vendor)))
|
||||
(:id (:client which)))))
|
||||
locations @(re-frame/subscribe [::subs/locations-for-client (:id (:client which))])
|
||||
]
|
||||
(-> db
|
||||
@@ -153,6 +156,8 @@
|
||||
:status (:status edit-invoice)
|
||||
:date (:date edit-invoice)
|
||||
:due (:due edit-invoice)
|
||||
:vendor-autopay? (boolean ((set (map :id (:automatically-paid-when-due vendor)))
|
||||
(:id (:client which))))
|
||||
:scheduled-payment (:scheduled-payment edit-invoice)
|
||||
:invoice-number (:invoice-number edit-invoice)
|
||||
:total (:total edit-invoice)
|
||||
|
||||
Reference in New Issue
Block a user