dates on checks corrected.
This commit is contained in:
@@ -11,16 +11,23 @@
|
||||
[amazonica.aws.s3 :as s3]
|
||||
[hiccup.core :refer [html]]
|
||||
[auto-ap.routes.utils :refer [wrap-secure]]
|
||||
[auto-ap.time :refer [local-now]]
|
||||
[config.core :refer [env]]
|
||||
[compojure.core :refer [GET POST context defroutes
|
||||
wrap-routes]]
|
||||
[clojure.string :as str]
|
||||
[clj-pdf.core :as pdf]
|
||||
[clj-time.format :as f]
|
||||
[clj-time.core :as time]
|
||||
[clojure.java.io :as io])
|
||||
(:import [java.text DecimalFormat]
|
||||
[java.util UUID]
|
||||
[java.io ByteArrayOutputStream]))
|
||||
|
||||
(def parser (f/formatter "MM/dd/YYYY"))
|
||||
(defn date->str [t]
|
||||
(f/unparse parser t))
|
||||
|
||||
(defn make-check-pdf [check]
|
||||
(let [output-stream (ByteArrayOutputStream.)]
|
||||
(pdf/pdf
|
||||
@@ -178,11 +185,11 @@
|
||||
:amount (reduce + 0 (map :total invoices))
|
||||
:check (str (+ index (:check-number bank-account)))
|
||||
:memo memo
|
||||
:date "5/10/2018"
|
||||
:date (date->str (local-now))
|
||||
:company {:name (:name company)
|
||||
:address (:address company)
|
||||
:bank {:name "Bank of America, NA"
|
||||
:acct "11-35/2010"
|
||||
:bank {:name (:bank-name bank-account)
|
||||
:acct (:bank-code bank-account)
|
||||
:acct-number (:number bank-account)}}}
|
||||
:invoices (map :id invoices)}))
|
||||
|
||||
|
||||
5
src/clj/auto_ap/time.clj
Normal file
5
src/clj/auto_ap/time.clj
Normal file
@@ -0,0 +1,5 @@
|
||||
(ns auto-ap.time
|
||||
(:require [clj-time.core :as time]))
|
||||
|
||||
(defn local-now []
|
||||
(time/to-time-zone (time/now) (time/time-zone-for-id "America/Los_Angeles")))
|
||||
Reference in New Issue
Block a user