remove excluded from ledger.
This commit is contained in:
@@ -21,7 +21,12 @@
|
||||
"paid" :paid-invoices
|
||||
"voided" :voided-invoices
|
||||
"new" :new-invoice}
|
||||
"transactions/" {"" :transactions}
|
||||
"transactions/" {"" :transactions
|
||||
"unapproved" :unapproved-transactions
|
||||
"approved" :approved-transactions
|
||||
"requires-feedback" :requires-feedback-transactions
|
||||
|
||||
"excluded" :excluded-transactions}
|
||||
"ledger/" {"" :ledger
|
||||
"profit-and-loss" :profit-and-loss
|
||||
"balance-sheet" :balance-sheet
|
||||
|
||||
@@ -49,7 +49,20 @@
|
||||
(checks-page))
|
||||
|
||||
(defmethod page :transactions [_]
|
||||
(transactions-page))
|
||||
(transactions-page {}))
|
||||
|
||||
(defmethod page :unapproved-transactions [_]
|
||||
[transactions-page {:approval-status :unapproved}])
|
||||
|
||||
(defmethod page :approved-transactions [_]
|
||||
[transactions-page {:approval-status :approved}])
|
||||
|
||||
(defmethod page :requires-feedback-transactions [_]
|
||||
[transactions-page {:approval-status :requires-feedback}])
|
||||
|
||||
(defmethod page :excluded-transactions [_]
|
||||
[transactions-page {:approval-status :excluded}])
|
||||
|
||||
|
||||
(defmethod page :ledger [_]
|
||||
(ledger-page))
|
||||
|
||||
@@ -299,7 +299,8 @@
|
||||
:field [:transaction-approval-status]
|
||||
:options [[:unapproved "Unapproved"]
|
||||
[:requires-feedback "Client Review"]
|
||||
[:approved "Approved"]]}]]
|
||||
[:approved "Approved"]
|
||||
[:excluded "Excluded from Ledger"]]}]]
|
||||
|
||||
|
||||
[:div.is-divider]
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
(:require [auto-ap.events :as events]
|
||||
[auto-ap.forms :as forms]
|
||||
[auto-ap.subs :as subs]
|
||||
[bidi.bidi :as bidi]
|
||||
[auto-ap.routes :as routes]
|
||||
[auto-ap.views.components.bank-account-filter :refer [bank-account-filter]]
|
||||
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
|
||||
[auto-ap.views.components.layouts :refer [appearing-side-bar side-bar-layout]]
|
||||
@@ -13,7 +15,7 @@
|
||||
[auto-ap.views.pages.transactions.common :refer [transaction-read]]
|
||||
[auto-ap.utils :refer [replace-by]]
|
||||
[auto-ap.views.pages.transactions.manual :as manual]
|
||||
[auto-ap.views.utils :refer [bind-field date->str dispatch-event nf date-picker]]
|
||||
[auto-ap.views.utils :refer [bind-field date->str dispatch-event nf date-picker active-when]]
|
||||
[goog.string :as gstring]
|
||||
[re-frame.core :as re-frame]))
|
||||
|
||||
@@ -95,7 +97,7 @@
|
||||
(fn [db]
|
||||
(-> db ::notification)))
|
||||
|
||||
(def transactions-content
|
||||
(defn content [{:keys [approval-status]}]
|
||||
(with-meta
|
||||
(fn []
|
||||
(let [notification (re-frame/subscribe [::notification])
|
||||
@@ -127,24 +129,68 @@
|
||||
:on-params-change (fn [params]
|
||||
(re-frame/dispatch [::params-change params]))}]
|
||||
]))
|
||||
{:component-will-mount #(re-frame/dispatch-sync [::params-change {}]) }))
|
||||
{:component-will-mount #(re-frame/dispatch-sync [::params-change {:approval-status approval-status}]) }))
|
||||
|
||||
(defn transactions-page []
|
||||
(let [{transaction-bar-active? :active?} @(re-frame/subscribe [::forms/form ::edit/form])]
|
||||
(def main-content {nil (content {:approval-status nil})
|
||||
:unapproved (content {:approval-status :unapproved})
|
||||
:requires-feedback (content {:approval-status :requires-feedback})
|
||||
:approved (content {:approval-status :approved})
|
||||
:excluded (content {:approval-status :excluded})})
|
||||
|
||||
|
||||
(defn transactions-page [{:keys [approval-status]}]
|
||||
(let [{transaction-bar-active? :active?} @(re-frame/subscribe [::forms/form ::edit/form])
|
||||
ap @(re-frame/subscribe [::subs/active-page])]
|
||||
[side-bar-layout
|
||||
{:side-bar [:div
|
||||
[:p.menu-label "Bank Account"]
|
||||
[:div
|
||||
[bank-account-filter
|
||||
{:on-change-event [::change-selected-bank-account]
|
||||
:value (:bank-acount-filter @(re-frame/subscribe [::transaction-page]))
|
||||
:bank-accounts @(re-frame/subscribe [::subs/bank-accounts])}]]
|
||||
[:p.menu-label "Date Range"]
|
||||
[:div
|
||||
[date-range-filter
|
||||
{:on-change-event [::change-selected-date-range]
|
||||
:value (:date-range-filter @(re-frame/subscribe [::transaction-page]))}]]]
|
||||
:main [transactions-content]
|
||||
{:side-bar
|
||||
|
||||
[:div
|
||||
[:div [:p.menu-label "Type"]
|
||||
[:ul.menu-list
|
||||
[:li.menu-item
|
||||
[:a.item {:href (bidi/path-for routes/routes :transactions)
|
||||
:class [(active-when ap = :transactions)]}
|
||||
[:span {:class "icon" :style {:font-size "25px"}}]
|
||||
[:span {:class "name"} "All"]]]
|
||||
[:li.menu-item
|
||||
[:a.item {:href (bidi/path-for routes/routes :unapproved-transactions)
|
||||
:class [(active-when ap = :unapproved-transactions)]}
|
||||
[:span {:class "icon icon-task-list-text-1" :style {:font-size "25px"}}]
|
||||
[:span {:class "name"} "Unapproved"]]]
|
||||
[:li.menu-item
|
||||
[:a.item {:href (bidi/path-for routes/routes :requires-feedback-transactions)
|
||||
:class [(active-when ap = :requires-feedback-transactions)]}
|
||||
|
||||
[:span {:class "icon icon-task-list-question" :style {:font-size "25px"}}]
|
||||
|
||||
[:span {:class "name"} "Client Review"]]]
|
||||
[:li.menu-item
|
||||
[:a.item {:href (bidi/path-for routes/routes :approved-transactions)
|
||||
:class [(active-when ap = :approved-transactions)]}
|
||||
|
||||
[:span {:class "icon icon-task-list-check-1" :style {:font-size "25px"}}]
|
||||
|
||||
[:span {:class "name"} "Approved"]]]
|
||||
[:li.menu-item
|
||||
[:a.item {:href (bidi/path-for routes/routes :excluded-transactions)
|
||||
:class [(active-when ap = :excluded-transactions)]}
|
||||
|
||||
[:span {:class "icon icon-task-list-disable" :style {:font-size "25px"}}]
|
||||
|
||||
[:span {:class "name"} "Excluded"]]]
|
||||
]]
|
||||
[:p.menu-label "Bank Account"]
|
||||
[:div
|
||||
[bank-account-filter
|
||||
{:on-change-event [::change-selected-bank-account]
|
||||
:value (:bank-acount-filter @(re-frame/subscribe [::transaction-page]))
|
||||
:bank-accounts @(re-frame/subscribe [::subs/bank-accounts])}]]
|
||||
[:p.menu-label "Date Range"]
|
||||
[:div
|
||||
[date-range-filter
|
||||
{:on-change-event [::change-selected-date-range]
|
||||
:value (:date-range-filter @(re-frame/subscribe [::transaction-page]))}]]]
|
||||
:main [(get main-content approval-status)]
|
||||
|
||||
:bottom [:div
|
||||
[manual/modal {:import-completed [::manual-import-completed ]}]]
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
[:id
|
||||
:amount
|
||||
:location
|
||||
:exclude-from-ledger
|
||||
:approval-status
|
||||
[:matched-rule [:note :id]]
|
||||
[:vendor [:name :id]]
|
||||
|
||||
@@ -15,14 +15,13 @@
|
||||
(re-frame/reg-sub
|
||||
::submit-query
|
||||
:<- [::forms/form ::form]
|
||||
(fn [{{:keys [id vendor accounts exclude-from-ledger approval-status]} :data}]
|
||||
(fn [{{:keys [id vendor accounts approval-status]} :data}]
|
||||
{:venia/operation {:operation/type :mutation
|
||||
:operation/name "EditTransaction"}
|
||||
:venia/queries [{:query/data
|
||||
[:edit-transaction
|
||||
{:transaction {:id id
|
||||
:vendor-id (:id vendor)
|
||||
:exclude-from-ledger exclude-from-ledger
|
||||
:approval-status approval-status
|
||||
:accounts (map
|
||||
(fn [{:keys [id account amount location]}]
|
||||
@@ -51,7 +50,7 @@
|
||||
(-> which
|
||||
(select-keys [:vendor :amount :payment :client :description-original
|
||||
:yodlee-merchant :id :potential-payment-matches
|
||||
:exclude-from-ledger :location :accounts :approval-status
|
||||
:location :accounts :approval-status
|
||||
:matched-rule])
|
||||
(assoc :potential-payment-matches (if (:matched-rule which)
|
||||
nil
|
||||
@@ -243,21 +242,7 @@
|
||||
:locations locations}]]
|
||||
|
||||
|
||||
[:div.field
|
||||
[:label.checkbox
|
||||
[raw-field
|
||||
[:input
|
||||
{:type "checkbox"
|
||||
:field [:exclude-from-ledger]}]]
|
||||
" Exclude from ledger"]]
|
||||
|
||||
[field "Include in ledger"
|
||||
[button-radio
|
||||
{:type "button-radio"
|
||||
:field [:exclude-from-ledger]
|
||||
:options [[true "Exclude from Ledger"]
|
||||
[false "Include in Ledger"]
|
||||
]}]]
|
||||
|
||||
|
||||
[field "Approval Status"
|
||||
[button-radio
|
||||
@@ -265,7 +250,8 @@
|
||||
:field [:approval-status]
|
||||
:options [[:unapproved "Unapproved"]
|
||||
[:requires-feedback "Client Review"]
|
||||
[:approved "Approved"]]}]]
|
||||
[:approved "Approved"]
|
||||
[:excluded "Excluded from Ledger"]]}]]
|
||||
|
||||
[:hr]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user