imp:timeclock: improve overlapping sessions error [#2417]
This commit is contained in:
parent
04e6c140c0
commit
8bd9d92981
@ -112,9 +112,14 @@ pairClockEntries (entry : rest) actives sessions
|
|||||||
inentries = case filter ((== tlaccount entry) . tlaccount) actives of
|
inentries = case filter ((== tlaccount entry) . tlaccount) actives of
|
||||||
[] -> entry : actives
|
[] -> entry : actives
|
||||||
activesinthisacct -> error' $ T.unpack $ makeTimeClockErrorExcerpt entry $ T.unlines $ [
|
activesinthisacct -> error' $ T.unpack $ makeTimeClockErrorExcerpt entry $ T.unlines $ [
|
||||||
"Simultaneous sessions with the same account name are not supported."
|
""
|
||||||
,"This clockin overlaps with:"
|
,"overlaps with session beginning at:"
|
||||||
] <> map (flip makeTimeClockErrorExcerpt "") activesinthisacct
|
,""
|
||||||
|
]
|
||||||
|
<> map (flip makeTimeClockErrorExcerpt "") activesinthisacct
|
||||||
|
<> [
|
||||||
|
"Overlapping sessions with the same account name are not supported."
|
||||||
|
]
|
||||||
-- XXX better to show full session(s)
|
-- XXX better to show full session(s)
|
||||||
-- <> map T.show (filter ((`elem` activesinthisacct).in') sessions)
|
-- <> map T.show (filter ((`elem` activesinthisacct).in') sessions)
|
||||||
|
|
||||||
@ -123,7 +128,6 @@ makeTimeClockErrorExcerpt e@TimeclockEntry{tlsourcepos=pos} msg = T.unlines [
|
|||||||
T.pack (sourcePosPretty pos) <> ":"
|
T.pack (sourcePosPretty pos) <> ":"
|
||||||
,l <> " | " <> T.show e
|
,l <> " | " <> T.show e
|
||||||
-- ,T.replicate (T.length l) " " <> " |" -- <> T.replicate c " " <> "^")
|
-- ,T.replicate (T.length l) " " <> " |" -- <> T.replicate c " " <> "^")
|
||||||
,""
|
|
||||||
] <> msg
|
] <> msg
|
||||||
where
|
where
|
||||||
l = T.show $ unPos $ sourceLine $ tlsourcepos e
|
l = T.show $ unPos $ sourceLine $ tlsourcepos e
|
||||||
|
|||||||
@ -2,8 +2,12 @@ $$$ hledger check -f tcorderedactions.timeclock
|
|||||||
>>>2 /Error: .*tcorderedactions.timeclock:8:1:
|
>>>2 /Error: .*tcorderedactions.timeclock:8:1:
|
||||||
8 \| i 2022-01-01 00:01:00 a
|
8 \| i 2022-01-01 00:01:00 a
|
||||||
|
|
||||||
Simultaneous sessions with the same account name are not supported.
|
overlaps with session beginning at:
|
||||||
This clockin overlaps with:
|
|
||||||
|
.*
|
||||||
|
7 \| i 2022-01-01 00:00:00 a
|
||||||
|
|
||||||
|
Overlapping sessions with the same account name are not supported.
|
||||||
/
|
/
|
||||||
>>>= 1
|
>>>= 1
|
||||||
|
|
||||||
|
|||||||
@ -200,7 +200,7 @@ i 2024-01-01 14:00:00 a
|
|||||||
o 2024-01-01 15:00:00
|
o 2024-01-01 15:00:00
|
||||||
|
|
||||||
$ hledger -f timeclock:- print
|
$ hledger -f timeclock:- print
|
||||||
>2 /Simultaneous sessions with the same account name are not supported./
|
>2 /Overlapping sessions with the same account name are not supported./
|
||||||
>=!0
|
>=!0
|
||||||
|
|
||||||
# ** OLD:
|
# ** OLD:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user