Sales orders works correctly now.

This commit is contained in:
Bryce Covert
2020-12-11 11:40:17 -08:00
parent 173242f229
commit e2ae7a6d4f
8 changed files with 75 additions and 28 deletions

View File

@@ -117,6 +117,13 @@
(re-frame/reg-event-fx
::authenticated
(fn [{:keys [db]} [_ authentication]]
{:db (-> db
(assoc-in [::yodlee :authentication] authentication)
(assoc-in [::yodlee :loading?] false))}))
(re-frame/reg-event-fx
::authenticated-mfa
(fn [{:keys [db]} [_ provider-account-id authentication]]
{:db (-> db
(assoc-in [::yodlee :authentication] authentication)
@@ -221,7 +228,7 @@
"value" v})
(:mfa (:data (get-in db [::forms/forms [::mfa-form provider-account-id]]))))}
:on-success [::authenticated provider-account-id]
:on-success [::authenticated-mfa provider-account-id]
:on-error [::forms/save-error [::mfa-form provider-account-id] ]}}))
(re-frame/reg-event-fx

View File

@@ -26,9 +26,9 @@
:total-lte (:amount-lte (:total-range params))
:date-range (:date-range params)
:client-id (:id @(re-frame/subscribe [::subs/client]))}
[[:sales-orders [:id :total :tax :tip :date
[[:sales-orders [:id :total :tax :tip :discount :service-charge :returns :date
[:charges [:type-name :total]]
[:line-items [:item-name :total]]
[:line-items [:item-name :total :category]]
[:client [:name :id]]]]
:total
:start

View File

@@ -63,6 +63,21 @@
[money-field {:type "money"
:field [:tax]
:disabled true}])
(field "Discount"
[money-field {:type "money"
:field [:discount]
:disabled true}])
(field "Returns"
[money-field {:type "money"
:field [:returns]
:disabled true}])
(field "Service Charge"
[money-field {:type "money"
:field [:service-charge]
:disabled true}])
(field "Tip"
[money-field {:type "money"
:field [:tip]
@@ -76,6 +91,6 @@
[:h1.subtitle.is-4 "Line Items"]
[:ul
(for [line-item (:line-items data)]
[:li (:item-name line-item) ": " (:total line-item)])]])
[:li (:item-name line-item) ": " (:total line-item) [:span.tag (:category line-item)]])]])
{:key (:id data)}))])