diff --git a/resources/public/css/main.css b/resources/public/css/main.css index 6df687cb..98d8d44d 100644 --- a/resources/public/css/main.css +++ b/resources/public/css/main.css @@ -319,8 +319,8 @@ nav.navbar .navbar-item.is-active { background-color:#F5F5F5; } .table { table-layout: fixed } - .table td {text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding: 9px; } - .table td.expandable {text-overflow: ellipsis; overflow: visible; white-space: nowrap; padding: 9px; } + .table td {text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding: 9px; height: 60px; vertical-align: middle; } + .table td.expandable {text-overflow: ellipsis; overflow: visible; white-space: nowrap; padding: 9px; height: 60px; vertical-align: middle; } .table td.no-border { border: none; } .typeahead { diff --git a/src/cljs/auto_ap/views/components/invoice_table.cljs b/src/cljs/auto_ap/views/components/invoice_table.cljs index aecbb63f..4cb93c69 100644 --- a/src/cljs/auto_ap/views/components/invoice_table.cljs +++ b/src/cljs/auto_ap/views/components/invoice_table.cljs @@ -70,6 +70,8 @@ percentage-size (if selected-client "%50%" "33%") ] [:div + + [paginator {:start start :end end :count count :total total :on-change (fn [p ] (on-params-change (merge @params p) ))}] @@ -127,7 +129,7 @@ "Outstanding"] [:th { - :style {:width "15em" :cursor "pointer"} + :style {:width "20rem" :cursor "pointer"} } @@ -160,62 +162,64 @@ [:td (gstring/format "$%.2f" total )] [:td (gstring/format "$%.2f" outstanding-balance )] [:td.expandable - (when (seq expense-accounts) - - [:div.dropdown.is-right {:class (if (= id visible-expense-accounts) - "is-active" - "")} - [:div.dropdown-trigger - [:a.button.badge {:data-badge (str (clojure.core/count expense-accounts)) - :aria-haspopup true - :tab-index "0" - - :on-blur (delayed-dispatch [::toggle-expense-accounts id]) - :on-focus (dispatch-event [::toggle-expense-accounts id]) - } "Accounts"]] - [:div.dropdown-menu {:role "menu"} - [:div.dropdown-content - (for [e expense-accounts] - ^{:key (:id e)} - [:span.dropdown-item (:name (:expense-account e)) " " (gstring/format "$%.2f" (:amount e) ) ]) - - [:hr.dropdown-divider] - - (when expense-event - [:a.dropdown-item.is-primary {:on-click (dispatch-event (conj expense-event i))} "Change"])]]]) - [:span {:style {:margin-left "1em"}}] - (when (and on-edit-invoice (not= ":voided" (:status i))) - [:button.button {:on-click (fn [] (on-edit-invoice i))} [:span.icon [:i.fa.fa-pencil]]]) - (when (and on-void-invoice (= (:outstanding-balance i) (:total i)) (not= ":voided" (:status i))) - [:button.button.is-outlined {:on-click (fn [] (on-void-invoice i))} [:span.icon [:span.icon-bin-2 {:style {:font-weight "400"}}]]]) - (when (and on-unvoid-invoice (= ":voided" (:status i))) - [:button.button.is-outlined {:on-click (fn [] (on-unvoid-invoice i))} [:span [:span.icon [:i.fa.fa-undo]]]]) - (when (seq payments) + + [:div.buttons + (when (seq expense-accounts) - [:div.dropdown.is-right {:class (if (= id visible-checks) - "is-active" - "")} - [:div.dropdown-trigger - [:a.button.badge {:data-badge (str (clojure.core/count payments)) - :aria-haspopup true - :tab-index "0" - - :on-blur (delayed-dispatch [::toggle-checks id]) - :on-focus (dispatch-event [::toggle-checks id]) - } "Checks"]] - [:div.dropdown-menu {:role "menu"} - [:div.dropdown-content - (for [payment payments] + [:div.dropdown.is-right {:class (if (= id visible-expense-accounts) + "is-active" + "")} + [:div.dropdown-trigger + [:a.button.badge {:data-badge (str (clojure.core/count expense-accounts)) + :aria-haspopup true + :tab-index "0" + + :on-blur (delayed-dispatch [::toggle-expense-accounts id]) + :on-focus (dispatch-event [::toggle-expense-accounts id]) + } "Accounts"]] + [:div.dropdown-menu {:role "menu"} + [:div.dropdown-content + (for [e expense-accounts] + ^{:key (:id e)} + [:span.dropdown-item (:name (:expense-account e)) " " (gstring/format "$%.2f" (:amount e) ) ]) + + [:hr.dropdown-divider] + + (when expense-event + [:a.dropdown-item.is-primary {:on-click (dispatch-event (conj expense-event i))} "Change"])]]]) + [:span {:style {:margin-left "1em"}}] + (when (and on-edit-invoice (not= ":voided" (:status i))) + [:a.button {:on-click (fn [] (on-edit-invoice i))} [:span.icon [:i.fa.fa-pencil]]]) + (when (and on-void-invoice (= (:outstanding-balance i) (:total i)) (not= ":voided" (:status i))) + [:a.button {:on-click (fn [] (on-void-invoice i))} [:span.icon [:span.icon-bin-2 {:style {:font-weight "400"}}]]]) + (when (and on-unvoid-invoice (= ":voided" (:status i))) + [:a {:on-click (fn [] (on-unvoid-invoice i))} [:span [:span.icon [:i.fa.fa-undo]]]]) + (when (seq payments) + + [:div.dropdown.is-right {:class (if (= id visible-checks) + "is-active" + "")} + [:div.dropdown-trigger + [:a.button.badge {:data-badge (str (clojure.core/count payments)) + :aria-haspopup true + :tab-index "0" + + :on-blur (delayed-dispatch [::toggle-checks id]) + :on-focus (dispatch-event [::toggle-checks id]) + } "Checks"]] + [:div.dropdown-menu {:role "menu"} + [:div.dropdown-content + (for [payment payments] (if (:s3-url (:payment payment)) - ^{:key (:id payment)} - [:a.dropdown-item {:href (:s3-url (:payment payment)) :target "_new"} [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " (:check-number (:payment payment)) " (" (gstring/format "$%.2f" (:amount payment) ) ")")] + ^{:key (:id payment)} + [:a.dropdown-item {:href (:s3-url (:payment payment)) :target "_new"} [:i.fa.fa-money-check] [:span.icon [:i.fa.fa-money]] (str " " (:check-number (:payment payment)) " (" (gstring/format "$%.2f" (:amount payment) ) ")")] - ^{:key (:id payment)} - [:span.dropdown-item [:span.icon {:class [(when (= :cleared (:status (:payment payment))) - "has-text-success")]} - [:i.fa.fa-money]] (str " " (:check-number (:payment payment)) " (" (gstring/format "$%.2f" (:amount payment) ) ") " - (when (= :cleared (:status (:payment payment))) - (str " - " (:post-date (:transaction (:payment payment))))))]))]]]) + ^{:key (:id payment)} + [:span.dropdown-item [:span.icon {:class [(when (= :cleared (:status (:payment payment))) + "has-text-success")]} + [:i.fa.fa-money]] (str " " (:check-number (:payment payment)) " (" (gstring/format "$%.2f" (:amount payment) ) ") " + (when (= :cleared (:status (:payment payment))) + (str " - " (:post-date (:transaction (:payment payment))))))]))]]])] ]]))]]]))))