lots of new features.
This commit is contained in:
@@ -96,6 +96,13 @@
|
||||
{:bank-account/type [*]}]}]}]
|
||||
ids)
|
||||
(map #(update % :journal-entry/date c/from-date))
|
||||
(filter (fn [je]
|
||||
(every?
|
||||
(fn [jel]
|
||||
(let [include-in-reports (-> jel :journal-entry-line/account :bank-account/include-in-reports)]
|
||||
(or (nil? include-in-reports)
|
||||
(true? include-in-reports))))
|
||||
(:journal-entry/line-items je))))
|
||||
(group-by :db/id))]
|
||||
(->> ids
|
||||
(map results)
|
||||
|
||||
@@ -71,6 +71,21 @@
|
||||
(seq vs) (conj {:db/id e
|
||||
a vs})))})}]])
|
||||
|
||||
(defn add-include-in-reports [conn]
|
||||
(let [existing-accounts (->> (d/query {:query {:find ['?e]
|
||||
:in ['$]
|
||||
:where ['[?e :bank-account/name]]}
|
||||
:args [(d/db conn)]})
|
||||
|
||||
(transduce
|
||||
(comp
|
||||
(map first)
|
||||
(map (fn [bank-account]
|
||||
{:db/id bank-account :bank-account/include-in-reports true})))
|
||||
conj
|
||||
[]))]
|
||||
[existing-accounts]))
|
||||
|
||||
(defn -main [& args]
|
||||
(println "Creating database ..." uri)
|
||||
(doto (d/create-database uri) println)
|
||||
@@ -257,7 +272,13 @@
|
||||
:db/doc "An identifier for this forcasted transaction, e.g., 'RENT'"
|
||||
:db/valueType :db.type/string
|
||||
:db/cardinality :db.cardinality/one}]]}
|
||||
:auto-ap/add-manager-schema {:txes [[{:db/ident :user-role/manager}]]}}
|
||||
:auto-ap/add-manager-schema {:txes [[{:db/ident :user-role/manager}]]}
|
||||
:auto-ap/add-include-in-reports1 {:txes [[{:db/ident :bank-account/include-in-reports
|
||||
:db/doc "Whether to include this bank account in balance sheet, etc."
|
||||
:db/valueType :db.type/boolean
|
||||
:db/cardinality :db.cardinality/one}]]
|
||||
:depends-on [:auto-ap/add-manager-schema]}
|
||||
:auto-ap/migrate-include-in-reports {:txes-fn `add-include-in-reports :depends-on [:auto-ap/add-include-in-reports1] }}
|
||||
]
|
||||
(println "Conforming database...")
|
||||
(c/ensure-conforms conn norms-map)
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
:number {:type 'String}
|
||||
:sort_order {:type 'Int}
|
||||
:visible {:type 'Boolean}
|
||||
:include_in_reports {:type 'Boolean}
|
||||
:routing {:type 'String}
|
||||
:code {:type 'String}
|
||||
:check_number {:type 'Int}
|
||||
@@ -531,6 +532,7 @@
|
||||
:number {:type 'String}
|
||||
:check_number {:type 'Int}
|
||||
:visible {:type 'Boolean}
|
||||
:include_in_reports {:type 'Boolean}
|
||||
:sort_order {:type 'Int}
|
||||
:name {:type 'String}
|
||||
:bank_code {:type 'String}
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
:bank-account/bank-name (:bank_name %)
|
||||
:bank-account/bank-code (:bank_code %)
|
||||
:bank-account/routing (:routing %)
|
||||
:bank-account/include-in-reports (:include_in_reports %)
|
||||
|
||||
:bank-account/name (:name %)
|
||||
:bank-account/visible (:visible %)
|
||||
|
||||
@@ -68,9 +68,9 @@
|
||||
:id (str (:db/id account) "-" location)
|
||||
:numeric-code (or (:account/numeric-code account)
|
||||
(and (#{:bank-account-type/check} (:db/ident (:bank-account/type account)))
|
||||
1100)
|
||||
11100)
|
||||
(and (#{:bank-account-type/credit} (:db/ident (:bank-account/type account)))
|
||||
2800))
|
||||
28000))
|
||||
:account-type (or (:db/ident (:account/type account))
|
||||
({:bank-account-type/check :asset
|
||||
:bank-account-type/credit :liability}
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
(->> (g-tr/run-transaction-rule context {:transaction_rule_id transaction_rule_id
|
||||
:count Integer/MAX_VALUE} nil)
|
||||
|
||||
(filter #(not (:transaction/payment %)))
|
||||
(filter #(not (:payment %)))
|
||||
(map :id ))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user