when adding, the balancing amount is a more useful default
This commit is contained in:
parent
468955a563
commit
522a1f4c2a
@ -112,7 +112,8 @@ getPostings bestmatchps enteredps = do
|
|||||||
where Just ps = bestmatchps
|
where Just ps = bestmatchps
|
||||||
defaultaccount = maybe Nothing (Just . paccount) bestmatch
|
defaultaccount = maybe Nothing (Just . paccount) bestmatch
|
||||||
validateaccount = Just $ \s -> not $ null s
|
validateaccount = Just $ \s -> not $ null s
|
||||||
defaultamount = maybe Nothing (Just . show . pamount) bestmatch
|
defaultamount | n==1 = maybe Nothing (Just . show . pamount) bestmatch -- previously used amount
|
||||||
|
| otherwise = Just $ show $ negate $ sum $ map pamount enteredps -- balancing amount
|
||||||
validateamount = Just $ \s ->
|
validateamount = Just $ \s ->
|
||||||
(null s && (not $ null enteredps)) ||
|
(null s && (not $ null enteredps)) ||
|
||||||
(isRight $ parse (someamount>>many spacenonewline>>eof) "" s)
|
(isRight $ parse (someamount>>many spacenonewline>>eof) "" s)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user