ENH assault user's face with all errors at once
This commit is contained in:
parent
efffda378a
commit
6926003c46
|
@ -116,9 +116,7 @@ txPair day from to cur val desc = tx
|
||||||
|
|
||||||
resolveTx :: (MonadInsertError m, MonadFinance m) => BalTx -> m KeyTx
|
resolveTx :: (MonadInsertError m, MonadFinance m) => BalTx -> m KeyTx
|
||||||
resolveTx t@Tx {txEntries = ss} =
|
resolveTx t@Tx {txEntries = ss} =
|
||||||
fmap (\kss -> t {txEntries = kss}) $
|
fmap (\kss -> t {txEntries = kss}) $ combineErrors $ fmap resolveEntry ss
|
||||||
combineErrors $
|
|
||||||
fmap resolveEntry ss
|
|
||||||
|
|
||||||
insertTx :: MonadSqlQuery m => CommitRId -> KeyTx -> m ()
|
insertTx :: MonadSqlQuery m => CommitRId -> KeyTx -> m ()
|
||||||
insertTx c Tx {txDate = d, txDescr = e, txEntries = ss} = do
|
insertTx c Tx {txDate = d, txDescr = e, txEntries = ss} = do
|
||||||
|
@ -330,7 +328,7 @@ balanceTxs
|
||||||
=> [(CommitR, RawTx)]
|
=> [(CommitR, RawTx)]
|
||||||
-> m [(CommitR, KeyTx)]
|
-> m [(CommitR, KeyTx)]
|
||||||
balanceTxs ts = do
|
balanceTxs ts = do
|
||||||
bs <- mapM balanceTx $ snd $ L.mapAccumR balanceTxTargets M.empty ts'
|
bs <- mapErrors balanceTx $ snd $ L.mapAccumR balanceTxTargets M.empty ts'
|
||||||
return $ zip cs bs
|
return $ zip cs bs
|
||||||
where
|
where
|
||||||
(cs, ts') = L.unzip $ L.sortOn (txDate . snd) ts
|
(cs, ts') = L.unzip $ L.sortOn (txDate . snd) ts
|
||||||
|
|
Loading…
Reference in New Issue