Fixes a few issues discovered
This commit is contained in:
@@ -6,24 +6,23 @@
|
||||
(str (UUID/randomUUID)))
|
||||
|
||||
(defn get-line-items-after [db journal-entry]
|
||||
(for [jel (:journal-entry/line-items journal-entry)
|
||||
:let [next-jel (->> (dc/index-pull db {:index :avet
|
||||
:selector [:db/id :journal-entry-line/client+account+location+date]
|
||||
:start [:journal-entry-line/client+account+location+date
|
||||
(:journal-entry-line/client+account+location+date jel)
|
||||
(:db/id jel)]
|
||||
})
|
||||
(take-while (fn line-must-match-client-account-location [result]
|
||||
(and
|
||||
(= (take 3 (:journal-entry-line/client+account+location+date result))
|
||||
(take 3 (:journal-entry-line/client+account+location+date jel)))
|
||||
(not= (:db/id jel)
|
||||
(:db/id result)))
|
||||
))
|
||||
first
|
||||
:db/id)]
|
||||
:when next-jel]
|
||||
next-jel))
|
||||
(for [jel (:journal-entry/line-items journal-entry)
|
||||
next-jel (->> (dc/index-pull db {:index :avet
|
||||
:selector [:db/id :journal-entry-line/client+account+location+date]
|
||||
:start [:journal-entry-line/client+account+location+date
|
||||
(:journal-entry-line/client+account+location+date jel)
|
||||
(:db/id jel)]
|
||||
})
|
||||
(take-while (fn line-must-match-client-account-location [result]
|
||||
(and
|
||||
(= (take 3 (:journal-entry-line/client+account+location+date result))
|
||||
(take 3 (:journal-entry-line/client+account+location+date jel)))
|
||||
(not= (:db/id jel)
|
||||
(:db/id result)))
|
||||
))
|
||||
(take 2))
|
||||
:when next-jel]
|
||||
(:db/id next-jel)))
|
||||
|
||||
(def extant-read '[:db/id :journal-entry/date :journal-entry/client {:journal-entry/line-items [:journal-entry-line/account :journal-entry-line/location :db/id :journal-entry-line/client+account+location+date]}])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user