progress on bugs
This commit is contained in:
@@ -550,3 +550,6 @@ table.balance-sheet th.total {
|
|||||||
.table.table.grid thead tr:first-child>th:last-child {
|
.table.table.grid thead tr:first-child>th:last-child {
|
||||||
border-radius: 0px 4px 0px 0px !important;
|
border-radius: 0px 4px 0px 0px !important;
|
||||||
}
|
}
|
||||||
|
.table.grid.wrappable td {text-overflow: ""; overflow: visible; white-space: normal; }
|
||||||
|
.table.grid.wrappable td.expandable {text-overflow: ""; overflow: visible; white-space: normal; }
|
||||||
|
.table.grid.wrappable th.expandable {text-overflow: ""; overflow: visible; white-space: normal; }
|
||||||
|
|||||||
@@ -150,7 +150,7 @@
|
|||||||
conj
|
conj
|
||||||
[]
|
[]
|
||||||
transaction_ids)
|
transaction_ids)
|
||||||
transaction-rule (update (tr/get-by-id transaction_rule_id) :transaction-rule/description #(some-> % re-pattern))]
|
transaction-rule (update (tr/get-by-id transaction_rule_id) :transaction-rule/description #(some-> % rm/->pattern))]
|
||||||
(doseq [transaction transactions]
|
(doseq [transaction transactions]
|
||||||
(when (not (rm/rule-applies? transaction transaction-rule))
|
(when (not (rm/rule-applies? transaction transaction-rule))
|
||||||
(throw (ex-info "Transaction rule does not apply" {:validation-error "Transaction rule does not apply"
|
(throw (ex-info "Transaction rule does not apply" {:validation-error "Transaction rule does not apply"
|
||||||
|
|||||||
@@ -13,6 +13,9 @@
|
|||||||
[auto-ap.datomic.transaction-rules :as tr]
|
[auto-ap.datomic.transaction-rules :as tr]
|
||||||
[clojure.tools.logging :as log]))
|
[clojure.tools.logging :as log]))
|
||||||
|
|
||||||
|
(defn ->pattern [x]
|
||||||
|
(. java.util.regex.Pattern (compile x java.util.regex.Pattern/CASE_INSENSITIVE)))
|
||||||
|
|
||||||
(defn rule-applies? [transaction {:keys [:transaction-rule/description
|
(defn rule-applies? [transaction {:keys [:transaction-rule/description
|
||||||
:transaction-rule/dom-gte :transaction-rule/dom-lte
|
:transaction-rule/dom-gte :transaction-rule/dom-lte
|
||||||
:transaction-rule/amount-gte :transaction-rule/amount-lte
|
:transaction-rule/amount-gte :transaction-rule/amount-lte
|
||||||
@@ -83,8 +86,7 @@
|
|||||||
(recur rules)))
|
(recur rules)))
|
||||||
[])))
|
[])))
|
||||||
|
|
||||||
(defn ->pattern [x]
|
|
||||||
(. java.util.regex.Pattern (compile x java.util.regex.Pattern/CASE_INSENSITIVE)))
|
|
||||||
|
|
||||||
(defn group-rules-by-priority [rules]
|
(defn group-rules-by-priority [rules]
|
||||||
(->> rules
|
(->> rules
|
||||||
|
|||||||
@@ -121,11 +121,12 @@
|
|||||||
(mapv (fn [c]
|
(mapv (fn [c]
|
||||||
[:div.level-item c]) children))]]))))]))
|
[:div.level-item c]) children))]]))))]))
|
||||||
|
|
||||||
(defn table [{:keys [fullwidth]}]
|
(defn table [{:keys [fullwidth class]}]
|
||||||
|
|
||||||
(into
|
(into
|
||||||
[:table.table.compact.grid {:class (if fullwidth
|
[:table.table.compact.grid {:class (cond-> []
|
||||||
["is-fullwidth"])}]
|
fullwidth (conj "is-fullwidth")
|
||||||
|
class (into class))}]
|
||||||
(r/children (r/current-component))))
|
(r/children (r/current-component))))
|
||||||
|
|
||||||
(defn header []
|
(defn header []
|
||||||
@@ -172,7 +173,7 @@
|
|||||||
(map r/as-element (r/children (r/current-component)))))
|
(map r/as-element (r/children (r/current-component)))))
|
||||||
|
|
||||||
(defn cell [params]
|
(defn cell [params]
|
||||||
(apply r/create-element "td" #js {}
|
(apply r/create-element "td" #js {:className (:class params)}
|
||||||
(map r/as-element (r/children (r/current-component))))
|
(map r/as-element (r/children (r/current-component))))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -91,8 +91,8 @@
|
|||||||
(fn [{:keys [db]} [_ invoice]]
|
(fn [{:keys [db]} [_ invoice]]
|
||||||
{:db db}))
|
{:db db}))
|
||||||
|
|
||||||
(defn row [{:keys [invoice check-boxes selected-client overrides expense-event actions]}]
|
(defn row [{:keys [invoice check-boxes selected-client overrides checkable? expense-event actions]}]
|
||||||
(let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor checkable?] :as i} invoice
|
(let [{:keys [client payments expense-accounts invoice-number date due total outstanding-balance id vendor] :as i} invoice
|
||||||
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id client])
|
accounts-by-id @(re-frame/subscribe [::subs/accounts-by-id client])
|
||||||
account->name #(:name (accounts-by-id (:id %)))]
|
account->name #(:name (accounts-by-id (:id %)))]
|
||||||
[grid/row {:class (:class i) :id id :checkable? checkable? :entity invoice}
|
[grid/row {:class (:class i) :id id :checkable? checkable? :entity invoice}
|
||||||
@@ -179,7 +179,7 @@
|
|||||||
[buttons/fa-icon {:icon "fa-undo"
|
[buttons/fa-icon {:icon "fa-undo"
|
||||||
:event [::unvoid-invoice i]}])]]]))
|
:event [::unvoid-invoice i]}])]]]))
|
||||||
|
|
||||||
(defn invoice-table [{:keys [id check-boxes overrides actions data-page]}]
|
(defn invoice-table [{:keys [id check-boxes overrides actions data-page checkable-fn]}]
|
||||||
(let [selected-client @(re-frame/subscribe [::subs/client])
|
(let [selected-client @(re-frame/subscribe [::subs/client])
|
||||||
{:keys [data status table-params]} @(re-frame/subscribe [::data-page/page data-page])
|
{:keys [data status table-params]} @(re-frame/subscribe [::data-page/page data-page])
|
||||||
|
|
||||||
@@ -235,5 +235,8 @@
|
|||||||
^{:key id}
|
^{:key id}
|
||||||
[row {:invoice i
|
[row {:invoice i
|
||||||
:selected-client selected-client
|
:selected-client selected-client
|
||||||
|
:checkable? (if checkable-fn
|
||||||
|
(checkable-fn i)
|
||||||
|
true)
|
||||||
:actions actions
|
:actions actions
|
||||||
:overrides overrides}])]])]))
|
:overrides overrides}])]])]))
|
||||||
|
|||||||
@@ -116,44 +116,13 @@
|
|||||||
|
|
||||||
(defmethod page :admin-excel-import [_]
|
(defmethod page :admin-excel-import [_]
|
||||||
[admin-excel-import-page])
|
[admin-excel-import-page])
|
||||||
;;
|
|
||||||
;; ;; <div id="app">
|
|
||||||
;; <nav class="navbar has-shadow">
|
|
||||||
;; <div class="container">
|
|
||||||
;; <div class="navbar-brand">
|
|
||||||
;; <a class="navbar-item" href="../">
|
|
||||||
;; <img src="/img/logo.png" />
|
|
||||||
;; </a>
|
|
||||||
;; </div>
|
|
||||||
;; </div>
|
|
||||||
;; </nav>
|
|
||||||
;; <div class="has-text-centered hero is-fullheight is-vertically-centered" id="mail-app">
|
|
||||||
;; <div class="is-vertically-centered">
|
|
||||||
;; <h1 class="title"><i class="fa fa-spin fa-spinner"></i></h1>
|
|
||||||
;; </div>
|
|
||||||
;; </div>
|
|
||||||
;; <footer class="footer">
|
|
||||||
;; <div class="container">
|
|
||||||
;; <div class="content has-text-centered">
|
|
||||||
;; <p>
|
|
||||||
;; <strong>Integreat</strong>
|
|
||||||
;; by <a href="https://github.com/">Integreat</a>.
|
|
||||||
;; </p>
|
|
||||||
;; <p>
|
|
||||||
;; <a class="icon" href="https://github.com/dansup/bulma-templates">
|
|
||||||
;; <i class="fa fa-github"></i>
|
|
||||||
;; </a>
|
|
||||||
;; </p>
|
|
||||||
;; </div>
|
|
||||||
;; </div>
|
|
||||||
;; </footer>
|
|
||||||
;; </div>
|
|
||||||
|
|
||||||
(defn active-page []
|
(defn active-page []
|
||||||
(let [ap (re-frame/subscribe [::subs/active-page])
|
(let [ap (re-frame/subscribe [::subs/active-page])
|
||||||
|
current-client @(re-frame/subscribe [::subs/client])
|
||||||
is-loading? @(re-frame/subscribe [::subs/is-initial-loading?])]
|
is-loading? @(re-frame/subscribe [::subs/is-initial-loading?])]
|
||||||
(if is-loading?
|
(if is-loading?
|
||||||
[loading-layout]
|
[loading-layout]
|
||||||
|
|
||||||
[:div
|
[:div
|
||||||
^{:key @ap} [page @ap]])))
|
^{:key (str @ap "-" current-client)} [page @ap]])))
|
||||||
|
|||||||
@@ -61,16 +61,16 @@
|
|||||||
:status status
|
:status status
|
||||||
:column-count (if selected-client 5 6)}
|
:column-count (if selected-client 5 6)}
|
||||||
[grid/controls ledger-page]
|
[grid/controls ledger-page]
|
||||||
[grid/table {:fullwidth true}
|
[grid/table {:fullwidth true :class ["wrappable"]}
|
||||||
[grid/header
|
[grid/header
|
||||||
[grid/row {}
|
[grid/row {}
|
||||||
(when-not selected-client
|
(when-not selected-client
|
||||||
[grid/sortable-header-cell {:sort-key "client" :sort-name "Client"} "Client"])
|
[grid/sortable-header-cell {:sort-key "client" :sort-name "Client"} "Client"])
|
||||||
[grid/sortable-header-cell {:sort-key "vendor" :sort-name "Vendor"} "Vendor"]
|
[grid/sortable-header-cell {:sort-key "vendor" :sort-name "Vendor"} "Vendor"]
|
||||||
[grid/sortable-header-cell {:sort-key "date" :sort-name "Date" :style {:width "15em"}} "Date"]
|
[grid/sortable-header-cell {:sort-key "date" :sort-name "Date" :style {:width "8em"}} "Date"]
|
||||||
[grid/header-cell {} "Account"]
|
[grid/header-cell {} "Account"]
|
||||||
[grid/sortable-header-cell {:sort-key "amount" :sort-name "Amount" :class "has-text-right" :style {:width "12em"}} "Debit"]
|
[grid/sortable-header-cell {:sort-key "amount" :sort-name "Amount" :class "has-text-right" :style {:width "7em"}} "Debit"]
|
||||||
[grid/sortable-header-cell {:sort-key "amount" :sort-name "Amount" :class "has-text-right" :style {:width "12em"}} "Credit"]]]
|
[grid/sortable-header-cell {:sort-key "amount" :sort-name "Amount" :class "has-text-right" :style {:width "7em"}} "Credit"]]]
|
||||||
[grid/body
|
[grid/body
|
||||||
(for [{:keys [client vendor status date amount id line-items] :as i} (:journal-entries ledger-page)]
|
(for [{:keys [client vendor status date amount id line-items] :as i} (:journal-entries ledger-page)]
|
||||||
^{:key id}
|
^{:key id}
|
||||||
|
|||||||
@@ -186,6 +186,7 @@
|
|||||||
[table/invoice-table {:id (:id page)
|
[table/invoice-table {:id (:id page)
|
||||||
:data-page :invoices
|
:data-page :invoices
|
||||||
:check-boxes (= status :unpaid)
|
:check-boxes (= status :unpaid)
|
||||||
|
:checkable-fn (fn [i] (not (:automatically-paid-when-due i)))
|
||||||
:actions #{:edit :void :expense-accounts}}]]))
|
:actions #{:edit :void :expense-accounts}}]]))
|
||||||
|
|
||||||
(defn unpaid-invoices-page [params]
|
(defn unpaid-invoices-page [params]
|
||||||
|
|||||||
Reference in New Issue
Block a user