;journal: a test for inclusive balance assignment, disabled (#1207)
[ci skip]
This commit is contained in:
		
							parent
							
								
									5ed6fe586a
								
							
						
					
					
						commit
						f18c74fff7
					
				| @ -753,6 +753,7 @@ addOrAssignAmountAndCheckAssertionB p@Posting{paccount=acc, pamount=amt, pbalanc | ||||
|       return p | ||||
| 
 | ||||
|   -- no explicit posting amount, but there is a balance assignment | ||||
|   -- TODO this doesn't yet handle inclusive assignments right, #1207 | ||||
|   | Just BalanceAssertion{baamount,batotal} <- mba = do | ||||
|       (diff,newbal) <- case batotal of | ||||
|         -- a total balance assignment (==, all commodities) | ||||
| @ -814,7 +815,6 @@ checkBalanceAssertionOneCommodityB p@Posting{paccount=assertedacct} assertedamt | ||||
|     if isinclusive | ||||
|     then | ||||
|       -- sum the running balances of this account and any of its subaccounts seen so far | ||||
|       -- XXX something wrong here, #1207 | ||||
|       withRunningBalance $ \BalancingState{bsBalances} -> | ||||
|         H.foldM | ||||
|           (\ibal (acc, amt) -> return $ ibal + | ||||
|  | ||||
| @ -139,7 +139,7 @@ hledger -f - stats | ||||
| # >>>2 | ||||
| # >>>=0 | ||||
| 
 | ||||
| # 8. resetting a balance | ||||
| # 8. Using balance assignment to set balances. | ||||
| hledger -f - stats | ||||
| <<< | ||||
| 2013/1/1 | ||||
| @ -431,3 +431,22 @@ hledger -f- print | ||||
| 
 | ||||
| >>>2 | ||||
| >>>=0 | ||||
| 
 | ||||
| ## 25. Inclusive balance assignments also work (#1207). | ||||
| #hledger -f- print -x | ||||
| #<<< | ||||
| #2020-01-25 | ||||
| #    (a:aa)   1 | ||||
| # | ||||
| #2020-01-31 | ||||
| #    (a)        ==* 1 | ||||
| # | ||||
| #>>> | ||||
| #2020-01-25 | ||||
| #    (a:aa)               1 | ||||
| # | ||||
| #2020-01-31 | ||||
| #    (a)               0 ==* 1 | ||||
| # | ||||
| #>>>2 | ||||
| #>>>=0 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user