From 3a529f40710158fcbc9193f801a21392915256df Mon Sep 17 00:00:00 2001 From: nek0 Date: Thu, 26 Dec 2019 21:36:06 +0100 Subject: [PATCH] add journal on cash purchase --- src/Control/Buy.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Control/Buy.hs b/src/Control/Buy.hs index de76176..6f4a5e9 100644 --- a/src/Control/Buy.hs +++ b/src/Control/Buy.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE OverloadedStrings #-} module Control.Buy where import Control.Monad (void, foldM) @@ -48,7 +49,13 @@ buy auth pds = do else PurchaseOK ) missing - Nothing -> + Nothing -> do + void $ insertNewJournalEntry + (JournalSubmit + ("Cash purchase") + price + ) + conn return $ PurchaseResult (PayAmount price) missing