supports new check layout, added bank account for campbell

This commit is contained in:
BC
2018-07-13 00:24:11 -07:00
parent 77eade2f15
commit 14d95dab8d
4 changed files with 16 additions and 5 deletions

View File

@@ -36,7 +36,7 @@
(defn make-check-pdf [check]
(let [output-stream (ByteArrayOutputStream.)]
(pdf/pdf
[{:left-margin 7 :right-margin 0 :top-margin 0 :bottom-margin 0 :size :letter}
[{:left-margin 17 :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)
@@ -47,12 +47,14 @@
[(let [{:keys [name bank] {:keys [street1 street2 city state zip ]} :address} company]
[:cell {:colspan 3 } [:paragraph {:leading 14} name "\n" street1 "\n" (str city ", " state " " zip)] ])
(let [{{:keys [name acct]} :bank} company]
[:cell {:colspan 7 :align :center} [:paragraph {:style :bold} name] [:paragraph acct]])
[:cell {:colspan 7 :align :center} [:paragraph {:style :bold} name] [:paragraph {:size 8 :leading 8} acct]])
[:cell {:colspan 2 :size 13}
check]]
[[:cell {:colspan 9}]
[:cell {:colspan 3} date]]
[:cell {:colspan 3 :leading -10} date]]
[[:cell {:colspan 12 :size 14}]
]
[[:cell {:size 13 :leading 13} "PAY"]
[:cell {:size 8 :leading 8 } "TO THE ORDER OF"]
@@ -62,7 +64,12 @@
[:cell {:colspan 3} amount]]
[[:cell {}]
[:cell {:colspan 8} word-amount [:line {:line-width 0.15 :color [50 50 50]}]]
[:cell {:colspan 8} (str " -- " word-amount " " (str/join "" (take (max
2
(- 100
(count word-amount)))
(repeat "-"))))
[:line {:line-width 0.15 :color [50 50 50]}]]
[:cell {:colspan 3}]]
[[:cell {:colspan 12 :leading 50} [:spacer]]]