more check tweaks, adding real cbc accounts, export supports all transactions, fixed date parsing.

This commit is contained in:
Bryce Covert
2018-07-13 15:38:32 -07:00
parent 14d95dab8d
commit 5f1451afa4
10 changed files with 334 additions and 319 deletions

View File

@@ -79,11 +79,11 @@
(not (nil? status)) (helpers/merge-where [:= :status status])
(not (nil? amount)) (helpers/merge-where [:= :amount amount])))
(defn get-graphql [{:keys [start sort-by asc id] :as args}]
(defn get-graphql [{:keys [start sort-by asc id limit] :as args :or {limit 20}}]
(query
(cond-> (base-graphql args)
#_#_(not (nil? sort-by) ) (add-sort-by sort-by asc)
true (assoc :limit 20)
true (assoc :limit limit)
start (assoc :offset start))))
(defn count-graphql [args]

View File

@@ -25,11 +25,11 @@
(limited-companies id) (helpers/merge-where [:in :company-id (limited-companies id)])
(not (nil? company-id)) (helpers/merge-where [:= :company-id company-id])))
(defn get-graphql [{:keys [start sort-by asc] :as args}]
(defn get-graphql [{:keys [start sort-by asc limit] :as args :or {limit 20}}]
(query
(cond-> (base-graphql args)
#_#_(not (nil? sort-by) ) (add-sort-by sort-by asc)
true (assoc :limit 20)
true (assoc :limit limit)
start (assoc :offset start))))
(defn count-graphql [args]

View File

@@ -36,7 +36,7 @@
(defn make-check-pdf [check]
(let [output-stream (ByteArrayOutputStream.)]
(pdf/pdf
[{:left-margin 17 :right-margin 0 :top-margin 0 :bottom-margin 0 :size :letter}
[{:left-margin 25 :right-margin 0 :top-margin 0 :bottom-margin 0 :size :letter}
(let [{:keys [paid-to company check date amount memo] {print-as :print-as vendor-name :name :as vendor} :vendor} check
df (DecimalFormat. "#,###.00")
word-amount (num->words amount)
@@ -74,7 +74,7 @@
[[:cell {:colspan 12 :leading 50} [:spacer]]]
[[:cell "MEMO"]
[[:cell {:size 9 } "MEMO"]
[:cell {:colspan 5} memo [:line {:line-width 0.15 :color [50 50 50]}]]
[:cell {:colspan 6}]]
@@ -82,7 +82,7 @@
[:cell {:colspan 10 :leading 30}
[:phrase {:size 18 :ttf-name "public/micrenc.ttf"} (str "c" check "c a" (:acct-number (:bank company)) "a 10302c")]]]
[[:cell {:colspan 12 :leading 42} [:spacer]]]
[[:cell {:colspan 12 :leading 18} [:spacer]]]
[[:cell]
(into
@@ -97,7 +97,7 @@
[:cell {:colspan 2 :size 13}
check]]
[[:cell {:colspan 12 :leading 62} [:spacer]]]
[[:cell {:colspan 12 :leading 74} [:spacer]]]
[[:cell]
[:cell {:colspan 5} [:paragraph
@@ -120,6 +120,7 @@
[[:cell {:colspan 12} [:spacer]]]
[[:cell {:colspan 12} [:spacer]]]
[[:cell {:colspan 12} [:spacer]]]
[[:cell {:colspan 12} [:spacer]]]
[[:cell {:colspan 5}]
[:cell {:align :right :colspan 2}

View File

@@ -56,7 +56,8 @@
(vendors/get-all))
(GET "/transactions/export" {:keys [query-params identity]}
(assert-admin identity)
(let [transactions (transactions/get-graphql {:company (query-params "company")})]
(let [transactions (transactions/get-graphql {:company (query-params "company")
:limit Integer/MAX_VALUE})]
(map (fn [i]
(-> i
(update :date to-date)

View File

@@ -96,8 +96,9 @@
raw-transactions (vec (->> rows
(filter #(not (seq (:errors %))) )
(map (fn [{:keys [description-original status high-level-category amount account-id]}]
(map (fn [{:keys [description-original status high-level-category amount account-id date]}]
{:description-original description-original
:date date
:status status
:high-level-category high-level-category
:amount amount