             [clojure.java.io :as io]
             [clj-time.core :as t]
             [clj-time.format :as f]
+            [clj-time.coerce :as c]
             [clojure.pprint :as pprint]
             [clojure.string :as string])
   (:gen-class))

                        "payments" [])))

(defn data [options]
  (println (json/write-str (map add-convenience-fields
                                (filter (options-to-filter options)
                                        (read-all-invoices))))))

(defn list_ [options]
  (pprint/print-table (map pretty-print-invoice
                           (filter (options-to-filter options)
                                   (read-all-invoices)))))

(defn record-payment [options arguments]
  (let [id (get arguments 1)

(defn parse-date [date-string]
  (f/parse date-formatter date-string))

(defn compare-invoices-by-issue-date [a b]
  (compare (c/to-long (get a "issue-date"))
           (c/to-long (get b "issue-date"))))

(defn format-amount [amount currency]
  (format "%.2f %s" (float amount) currency))

