a number of small bug fixes.

This commit is contained in:
2022-03-02 11:50:03 -08:00
parent d766d758f0
commit 223a3749ec
5 changed files with 18 additions and 10 deletions

View File

@@ -413,8 +413,8 @@
(map ->graphql )) (map ->graphql ))
:total checks-count :total checks-count
:count (count payments) :count (count payments)
:start (:start args 0) :start (-> args :filters (:start 0) )
:end (+ (:start args 0) (count payments))}])) :end (+ (-> args :filters (:start 0) ) (count payments))}]))
(defn get-potential-payments [context args _] (defn get-potential-payments [context args _]
(let [transaction (d-transactions/get-by-id (:transaction_id args)) (let [transaction (d-transactions/get-by-id (:transaction_id args))

View File

@@ -42,8 +42,8 @@
:total_amount total-amount :total_amount total-amount
:total invoice-count :total invoice-count
:count (count invoices) :count (count invoices)
:start (:start args 0) :start (-> args :filters (:start 0))
:end (+ (:start args 0) (count invoices))}])) :end (+ (-> args :filters (:start 0)) (count invoices))}]))
(defn get-all-invoices [context args _] (defn get-all-invoices [context args _]
(assert-admin (:id context)) (assert-admin (:id context))

View File

@@ -348,8 +348,7 @@
[:table.table.compact.balance-sheet [:table.table.compact.balance-sheet
[:tr [:tr
[:td.has-text-right "Period ending"] [:td.has-text-right "Period ending"]
(when (:include-comparison params) [:td.has-text-right (date->str (str->date (:date params) standard))]
[:td.has-text-right (date->str (str->date (:date params) standard))])
(when (:include-comparison params) (when (:include-comparison params)
[:td.has-text-right (when (:date params) [:td.has-text-right (when (:date params)
(date->str (str->date (:comparison-date params) standard)))]) (date->str (str->date (:comparison-date params) standard)))])

View File

@@ -812,6 +812,16 @@
(local-today)]) (local-today)])
[:selected-period] "Year to date"])} [:selected-period] "Year to date"])}
"Year to date"]] "Year to date"]]
[:div.control
[:a.button
{:class (when (= selected-period "Full year") "is-active")
:on-click (dispatch-event
[::forms/change ::form
[:periods]
[[(t/local-date (dec (t/year (local-today))) 1 1)
(t/local-date (dec (t/year (local-today))) 12 31)]]
[:selected-period] "Last Calendar year"])}
"Last calendar year"]]
[:div.control [:div.control
[:a.button [:a.button
{:class (when (= selected-period "Full year") "is-active") {:class (when (= selected-period "Full year") "is-active")
@@ -864,8 +874,7 @@
(defn profit-and-loss-content [] (defn profit-and-loss-content []
(let [user @(re-frame/subscribe [::subs/user]) (let [status @(re-frame/subscribe [::status/single ::page])
status @(re-frame/subscribe [::status/single ::page])
unresolved-accounts @(re-frame/subscribe [::uncategorized-accounts]) unresolved-accounts @(re-frame/subscribe [::uncategorized-accounts])
{:keys [data report active? error id]} @(re-frame/subscribe [::forms/form ::form]) {:keys [data report active? error id]} @(re-frame/subscribe [::forms/form ::form])
{:keys [form-inline field raw-field error-notification submit-button ]} pnl-form {:keys [form-inline field raw-field error-notification submit-button ]} pnl-form

View File

@@ -34,14 +34,14 @@
(re-frame/reg-event-db (re-frame/reg-event-db
::payment-voided ::payment-voided
(fn [db [_ {:keys [void-payment]}]] (fn [db [_ _]]
db)) db))
(defn row [{check :check (defn row [{check :check
selected-client :selected-client selected-client :selected-client
states :states states :states
}] }]
(let [{:keys [client s3-url bank-account payments type check-number date amount id vendor status invoices transaction] :as check} check] (let [{:keys [client s3-url bank-account type check-number date amount id vendor status invoices transaction] :as check} check]
[grid/row {:class (:class check) :id id :entity check} [grid/row {:class (:class check) :id id :entity check}
(when-not selected-client (when-not selected-client
[grid/cell {} (:name client)]) [grid/cell {} (:name client)])