diff --git a/src/clj/auto_ap/ssr/invoices.clj b/src/clj/auto_ap/ssr/invoices.clj index fdcbb901..a54499b7 100644 --- a/src/clj/auto_ap/ssr/invoices.clj +++ b/src/clj/auto_ap/ssr/invoices.clj @@ -626,32 +626,31 @@ :render (fn [i] (link-dropdown (into [] - (repeat 5 - (concat (->> i - :invoice/payments - (map :invoice-payment/payment) - (filter (fn [p] - (not= :payment-status/voided - (:payment/status p)))) - (mapcat (fn [p] - (cond-> [{:link (hu/url (bidi/path-for ssr-routes/only-routes - ::payment-route/all-page) - {:exact-match-id (:db/id p)}) - :content (str (format "$%,.2f" (:payment/amount p)) - (some-> (:payment/date p) coerce/to-date-time (atime/unparse-local atime/normal-date) (#(str " payment on " %))))}] - (:payment/transaction p) (conj {:link (hu/url (bidi/path-for client-routes/routes :transactions) - {:exact-match-id (:db/id (first (:payment/transaction p)))}) - :color :secondary - :content "Transaction"}))))) - (when (:invoice/journal-entry i) - [{:link (hu/url (bidi/path-for client-routes/routes :ledger) - {:exact-match-id (:db/id (first (:invoice/journal-entry i)))}) - :color :yellow - :content "Ledger entry"}]) - (when (:invoice/source-url i) - [{:link (:invoice/source-url i) - :color :secondary - :content "File"}]))))))}]})) + (concat (->> i + :invoice/payments + (map :invoice-payment/payment) + (filter (fn [p] + (not= :payment-status/voided + (:payment/status p)))) + (mapcat (fn [p] + (cond-> [{:link (hu/url (bidi/path-for ssr-routes/only-routes + ::payment-route/all-page) + {:exact-match-id (:db/id p)}) + :content (str (format "$%,.2f" (:payment/amount p)) + (some-> (:payment/date p) coerce/to-date-time (atime/unparse-local atime/normal-date) (#(str " payment on " %))))}] + (:payment/transaction p) (conj {:link (hu/url (bidi/path-for client-routes/routes :transactions) + {:exact-match-id (:db/id (first (:payment/transaction p)))}) + :color :secondary + :content "Transaction"}))))) + (when (:invoice/journal-entry i) + [{:link (hu/url (bidi/path-for client-routes/routes :ledger) + {:exact-match-id (:db/id (first (:invoice/journal-entry i)))}) + :color :yellow + :content "Ledger entry"}]) + (when (:invoice/source-url i) + [{:link (:invoice/source-url i) + :color :secondary + :content "File"}])))))}]})) (def row* (partial helper/row* grid-page))