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:
@@ -425,7 +425,7 @@
|
||||
|
||||
(defn transact-with-ledger [transaction id]
|
||||
(let [db (d/db conn)
|
||||
tx (d/with db transaction)
|
||||
tx (audit-transact transaction id)
|
||||
affected-entities (->> (:tx-data tx)
|
||||
(map (fn [^datomic.db.Datum x]
|
||||
{:e (:e x)
|
||||
@@ -439,9 +439,11 @@
|
||||
(map #(entity-change->ledger (:db-after tx) %))
|
||||
(filter seq))
|
||||
retractions (map (fn [[_ e]] [:db/retractEntity [:journal-entry/original-entity e]]) affected-entities)]
|
||||
(audit-transact retractions id)
|
||||
(audit-transact (into transaction ledger-txs) id)))
|
||||
|
||||
(when (seq retractions)
|
||||
(audit-transact retractions id))
|
||||
(when (seq ledger-txs)
|
||||
(audit-transact ledger-txs id))
|
||||
tx))
|
||||
|
||||
(defn transact-batch-with-ledger [txes id]
|
||||
(let [batch-id (.toString (java.util.UUID/randomUUID))]
|
||||
|
||||
Reference in New Issue
Block a user