Fixes issue with JFC import, fixes issue where overriden account ids did not take effect.
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
[digest]
|
||||
[iol-ion.tx :refer [random-tempid]]
|
||||
[ring.middleware.json :refer [wrap-json-response]]
|
||||
[unilog.context :as lc])
|
||||
[unilog.context :as lc]
|
||||
[auto-ap.logging :as alog])
|
||||
(:import
|
||||
(java.util UUID)))
|
||||
|
||||
@@ -105,6 +106,8 @@
|
||||
(map (c/parse-or-error :invoice-number parse-invoice-number))
|
||||
(map (c/parse-or-error :total c/parse-amount))
|
||||
(map (c/parse-or-error :date c/parse-date)))]
|
||||
(alog/info ::parsed
|
||||
:rows (take 10 rows))
|
||||
|
||||
rows))
|
||||
|
||||
@@ -179,7 +182,7 @@
|
||||
|
||||
(defn invoice-rows->transaction [rows user]
|
||||
(->> rows
|
||||
(mapcat (fn [{:keys [vendor-id total client-id date invoice-number default-location check automatically-paid-when-due]}]
|
||||
(mapcat (fn [{:keys [vendor-id total client-id date invoice-number default-location check automatically-paid-when-due account-id]}]
|
||||
(let [payment-id (.toString (java.util.UUID/randomUUID))
|
||||
transaction-id (.toString (java.util.UUID/randomUUID))
|
||||
invoice #:invoice {:db/id (.toString (java.util.UUID/randomUUID))
|
||||
@@ -234,7 +237,8 @@
|
||||
:transaction-account/amount (Math/abs (:invoice/total invoice))}]}]))
|
||||
]
|
||||
[[:propose-invoice (d-invoices/code-invoice (validate-invoice (remove-nils invoice)
|
||||
user))]
|
||||
user)
|
||||
account-id)]
|
||||
(some-> payment remove-nils)
|
||||
transaction])))
|
||||
(filter identity)))
|
||||
|
||||
Reference in New Issue
Block a user