payments ssr
voiding supports bulk void. exact match id linking voidnig payments works. minor tweak.
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
(ns auto-ap.ssr.components.aside
|
||||
(:require [auto-ap.ssr.svg :as svg]
|
||||
[hiccup2.core :as hiccup]
|
||||
[bidi.bidi :as bidi]
|
||||
[auto-ap.ssr-routes :as ssr-routes]
|
||||
[auto-ap.client-routes :as client-routes]
|
||||
[auto-ap.ssr.hx :as hx]
|
||||
[auto-ap.routes.admin.transaction-rules :as transaction-rules]
|
||||
[auto-ap.ssr.hiccup-helper :as hh]
|
||||
[auto-ap.routes.admin.import-batch :as ib-routes]
|
||||
(:require [auto-ap.client-routes :as client-routes]
|
||||
[auto-ap.routes.admin.clients :as ac-routes]
|
||||
[auto-ap.routes.admin.excel-invoices :as ei-routes]
|
||||
[auto-ap.routes.admin.import-batch :as ib-routes]
|
||||
[auto-ap.routes.admin.transaction-rules :as transaction-rules]
|
||||
[auto-ap.routes.admin.vendors :as v-routes]
|
||||
[auto-ap.graphql.clients :as clients]))
|
||||
[auto-ap.routes.payments :as payment-routes]
|
||||
[auto-ap.ssr-routes :as ssr-routes]
|
||||
[auto-ap.ssr.hiccup-helper :as hh]
|
||||
[auto-ap.ssr.hx :as hx]
|
||||
[auto-ap.ssr.svg :as svg]
|
||||
[bidi.bidi :as bidi]
|
||||
[hiccup.util :as hu]))
|
||||
|
||||
(defn menu-button- [params & children]
|
||||
[:div
|
||||
@@ -118,14 +118,21 @@
|
||||
:icon svg/payments}
|
||||
"Payments")
|
||||
(sub-menu- (hx/alpine-appear {:x-show "open"})
|
||||
(menu-button- {:href (bidi/path-for client-routes/routes
|
||||
:payments)} "All")
|
||||
(menu-button- {:href (bidi/path-for client-routes/routes
|
||||
:payments)} "Pending")
|
||||
(menu-button- {:href (bidi/path-for client-routes/routes
|
||||
:payments)} "Cleared")
|
||||
(menu-button- {:href (bidi/path-for client-routes/routes
|
||||
:payments)} "Voided"))]
|
||||
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
|
||||
::payment-routes/page)
|
||||
{ :date-range "month"})} "All")
|
||||
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
|
||||
::payment-routes/page)
|
||||
{:status "pending"
|
||||
:date-range "month"})} "Pending")
|
||||
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
|
||||
::payment-routes/page)
|
||||
{:status "cleared"
|
||||
:date-range "month"})} "Cleared")
|
||||
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
|
||||
::payment-routes/page)
|
||||
{:status "voided"
|
||||
:date-range "month"})} "Voided"))]
|
||||
|
||||
[:li {:x-data (hx/json {:open false})}
|
||||
(menu-button- {"@click" "open = !open"
|
||||
|
||||
31
src/clj/auto_ap/ssr/components/bank_account_icon.clj
Normal file
31
src/clj/auto_ap/ssr/components/bank_account_icon.clj
Normal file
@@ -0,0 +1,31 @@
|
||||
(ns auto-ap.ssr.components.bank-account-icon
|
||||
(:require [auto-ap.ssr.hiccup-helper :as hh]
|
||||
[auto-ap.ssr.svg :as svg]))
|
||||
|
||||
(defmulti icon :bank-account/type)
|
||||
(defmethod icon :bank-account-type/cash [_]
|
||||
[:div.grow-0.flex.flex-col.justify-center
|
||||
[:div.p-1.m-2.rounded-full
|
||||
{:class
|
||||
"bg-blue-50"}
|
||||
[:div {:class
|
||||
(hh/add-class "p-1.5 w-8 h-8" "text-green-600")}
|
||||
svg/dollar]]])
|
||||
|
||||
(defmethod icon :bank-account-type/credit [_]
|
||||
[:div.grow-0.flex.flex-col.justify-center
|
||||
[:div.p-1.m-2.rounded-full
|
||||
{:class
|
||||
"bg-purple-50"}
|
||||
[:div {:class
|
||||
(hh/add-class "p-1.5 w-8 h-8" "text-purple-600")}
|
||||
svg/credit-card]]])
|
||||
|
||||
(defmethod icon :bank-account-type/check [_]
|
||||
[:div.grow-0.flex.flex-col.justify-center
|
||||
[:div.p-1.m-2.rounded-full
|
||||
{:class
|
||||
"bg-blue-50"}
|
||||
[:div {:class
|
||||
(hh/add-class "p-1.5 w-8 h-8" "text-blue-600")}
|
||||
svg/check]]])
|
||||
@@ -11,6 +11,9 @@
|
||||
(= :secondary color)
|
||||
"blue"
|
||||
|
||||
(= :red color)
|
||||
"red"
|
||||
|
||||
(nil? color)
|
||||
"white"
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
(defn checkbox-header- [params & rest]
|
||||
[:th {:scope "col", :class "p-4"}
|
||||
[:div {:class "flex items-center"}
|
||||
[:input {:id "checkbox-all", :type "checkbox", :class inputs/default-checkbox-classes :name (:name params) :value (:value params)}]
|
||||
[:input (merge {:id "checkbox-all", :type "checkbox", :class inputs/default-checkbox-classes :name (:name params) :value (:value params)} params)]
|
||||
[:label {:for "checkbox-all", :class "sr-only"} "checkbox"]]])
|
||||
|
||||
(defn data-grid- [{:keys [headers thead-params id]} & rest]
|
||||
|
||||
@@ -201,8 +201,8 @@
|
||||
rest
|
||||
(errors- {:errors (:errors params)})))
|
||||
|
||||
(defn hidden- [{:keys [name value]}]
|
||||
[:input {:type "hidden" :value value :name name}])
|
||||
(defn hidden- [{:keys [name value] :as params}]
|
||||
[:input (merge {:type "hidden" :value value :name name} params)])
|
||||
|
||||
(defn checkbox- [params & rest]
|
||||
(if (seq rest)
|
||||
|
||||
Reference in New Issue
Block a user