~luciano/reconciler

83e11abeda055507e2e7e5fa1db79957c8edc351 — Luciano Laratelli 2 years ago 15e94a0
fix bug with memos on split transactions

closes [#1](https://todo.sr.ht/~luciano/Reconciler/1)
1 files changed, 1 insertions(+), 2 deletions(-)

M src/reconciler/parse.cljs
M src/reconciler/parse.cljs => src/reconciler/parse.cljs +1 -2
@@ 26,7 26,6 @@
(defn op-on-money
  "Do beautiful, precise, exact operations instead of floating point math."
  [op & money]
  (println money)
  (/ (apply op (map #(* 1000 %) money)) 1000))

(defn get-cost [outflow inflow]


@@ 58,7 57,7 @@
           ;; and they don't provide an option to merge the splits before
           ;; generating the CSV, so we handle that here.
           ;; split? false
           split? (when memo (re-matches #"Split \(\d+\\/\d+\)" (str/trim memo)))
           split? (when memo (re-matches #"Split \(\d+/\d+\).*" (str/trim memo)))
           last-key (if split? "SPLIT" cost)
           map-key (map-key payee date last-key)]
       (if (and split? (contains? result map-key))