lib: try to pin down what isTransactionBalanced does (#931)
This commit is contained in:
parent
b2b25d2523
commit
e06e300446
@ -303,9 +303,12 @@ transactionPostingBalances t = (sumPostings $ realPostings t
|
|||||||
,sumPostings $ virtualPostings t
|
,sumPostings $ virtualPostings t
|
||||||
,sumPostings $ balancedVirtualPostings t)
|
,sumPostings $ balancedVirtualPostings t)
|
||||||
|
|
||||||
-- | Is this transaction balanced ? A balanced transaction's real
|
-- | Does this transaction appear balanced when rendered, optionally with the
|
||||||
-- (non-virtual) postings sum to 0, and any balanced virtual postings
|
-- given commodity display styles ? More precisely:
|
||||||
-- also sum to 0.
|
-- after converting amounts to cost using explicit transaction prices if any;
|
||||||
|
-- and summing the real postings, and summing the balanced virtual postings;
|
||||||
|
-- and applying the given display styles if any (maybe affecting decimal places);
|
||||||
|
-- do both totals appear to be zero when rendered ?
|
||||||
isTransactionBalanced :: Maybe (Map.Map CommoditySymbol AmountStyle) -> Transaction -> Bool
|
isTransactionBalanced :: Maybe (Map.Map CommoditySymbol AmountStyle) -> Transaction -> Bool
|
||||||
isTransactionBalanced styles t =
|
isTransactionBalanced styles t =
|
||||||
-- isReallyZeroMixedAmountCost rsum && isReallyZeroMixedAmountCost bvsum
|
-- isReallyZeroMixedAmountCost rsum && isReallyZeroMixedAmountCost bvsum
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user