Fixes issue where the db/id of a temporary id is different from the real one.
Cash payments always match invoices.
This commit is contained in:
@@ -33,7 +33,8 @@
|
||||
[com.walmartlabs.lacinia.util :refer [attach-resolvers]]
|
||||
[config.core :refer [env]]
|
||||
[datomic.api :as d]
|
||||
[digest])
|
||||
[digest]
|
||||
[clj-time.coerce :as coerce])
|
||||
(:import
|
||||
(java.io ByteArrayOutputStream)
|
||||
(java.text DecimalFormat)
|
||||
@@ -347,6 +348,7 @@
|
||||
invoices)))
|
||||
payment (assoc base-payment
|
||||
:payment/type :payment-type/cash
|
||||
:payment/date (coerce/to-date (last (sort (map :invoice/date invoices))))
|
||||
:payment/memo memo
|
||||
:payment/status :payment-status/cleared)
|
||||
transaction {:db/id (str "transaction-" (:db/id vendor))
|
||||
@@ -359,7 +361,7 @@
|
||||
:transaction/raw-id transaction-id
|
||||
:transaction/vendor (:db/id vendor)
|
||||
:transaction/description-original memo
|
||||
:transaction/date (:payment/date base-payment)
|
||||
:transaction/date (:payment/date payment)
|
||||
:transaction/approval-status :transaction-approval-status/approved
|
||||
:transaction/accounts [{:transaction-account/account (:db/id (a/get-account-by-numeric-code-and-sets 21000 ["default"]))
|
||||
:transaction-account/location "A"
|
||||
|
||||
Reference in New Issue
Block a user