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