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] | ||||
|   a <- modifiedaccountnamep | ||||
|   lift skipNonNewlineSpaces | ||||
|   hours <- | ||||
|   hrs <- | ||||
|     try (lift followingcommentp >> return 0) | ||||
|     <|> (durationp <* | ||||
|          (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), | ||||
|           tstatus    = Cleared, | ||||
|           tpostings  = [ | ||||
|             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 | ||||
|                       ,ptransaction=Just t | ||||
|                       } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user