;csv: mention doc url in too many amounts error (#1226)
This commit is contained in:
parent
a016a43785
commit
3693fd4eb6
@ -898,13 +898,16 @@ getAmount rules record currency p1IsVirtual n =
|
|||||||
[] -> Nothing
|
[] -> Nothing
|
||||||
[(f,a)] | "-out" `isSuffixOf` f -> Just (-a) -- for -out fields, flip the sign
|
[(f,a)] | "-out" `isSuffixOf` f -> Just (-a) -- for -out fields, flip the sign
|
||||||
[(_,a)] -> Just a
|
[(_,a)] -> Just a
|
||||||
fs -> error' $
|
fs -> error' $ unlines $ [
|
||||||
"more than one non-zero amount for this record, or multiple zeros - please ensure just one\n"
|
"more than one non-zero amount for this record, or multiple zeros"
|
||||||
++ " " ++ showRecord record ++ "\n"
|
,"- please ensure just one. (https://hledger.org/csv.html#amount)"
|
||||||
++ unlines [" rule: " ++ f ++ " " ++
|
," " ++ showRecord record
|
||||||
|
]
|
||||||
|
++ [" rule: " ++ f ++ " " ++
|
||||||
fromMaybe "" (hledgerField rules record f) ++
|
fromMaybe "" (hledgerField rules record f) ++
|
||||||
" amount parsed: " ++ showMixedAmount a -- XXX not sure this is showing all the right info
|
" amount parsed: " ++ showMixedAmount a -- XXX not sure this is showing all the right info
|
||||||
| (f,a) <- fs]
|
| (f,a) <- fs]
|
||||||
|
|
||||||
where
|
where
|
||||||
-- | Given a non-empty amount string to parse, along with a possibly
|
-- | Given a non-empty amount string to parse, along with a possibly
|
||||||
-- non-empty currency symbol to prepend, parse as a hledger amount (as
|
-- non-empty currency symbol to prepend, parse as a hledger amount (as
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user