timedot: a D default commodity (and style) is applied to timedot aounts
This means they can be priced and converted.
This commit is contained in:
parent
f00e5c25ec
commit
41bde20095
@ -171,16 +171,21 @@ entryp = do
|
|||||||
lift $ optional $ choice [orgheadingprefixp, skipNonNewlineSpaces1]
|
lift $ optional $ choice [orgheadingprefixp, skipNonNewlineSpaces1]
|
||||||
a <- modifiedaccountnamep
|
a <- modifiedaccountnamep
|
||||||
lift skipNonNewlineSpaces
|
lift skipNonNewlineSpaces
|
||||||
hours <-
|
hrs <-
|
||||||
try (lift followingcommentp >> return 0)
|
try (lift followingcommentp >> return 0)
|
||||||
<|> (durationp <*
|
<|> (durationp <*
|
||||||
(try (lift followingcommentp) <|> (newline >> return "")))
|
(try (lift followingcommentp) <|> (newline >> return "")))
|
||||||
let t = nulltransaction{
|
mcs <- getDefaultCommodityAndStyle
|
||||||
|
let
|
||||||
|
(c,s) = case mcs of
|
||||||
|
Just (defc,defs) -> (defc, defs{asprecision=max (asprecision defs) (Precision 2)})
|
||||||
|
_ -> ("", amountstyle{asprecision=Precision 2})
|
||||||
|
t = nulltransaction{
|
||||||
tsourcepos = (pos, pos),
|
tsourcepos = (pos, pos),
|
||||||
tstatus = Cleared,
|
tstatus = Cleared,
|
||||||
tpostings = [
|
tpostings = [
|
||||||
nullposting{paccount=a
|
nullposting{paccount=a
|
||||||
,pamount=mixedAmount . amountSetPrecision (Precision 2) $ num hours -- don't assume hours; do set precision to 2
|
,pamount=mixedAmount $ nullamt{acommodity=c, aquantity=hrs, astyle=s}
|
||||||
,ptype=VirtualPosting
|
,ptype=VirtualPosting
|
||||||
,ptransaction=Just t
|
,ptransaction=Just t
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user