rename sumLedgerTransactions

This commit is contained in:
Simon Michael 2008-10-16 08:48:25 +00:00
parent 405f71c389
commit 17ceb9039b
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ isEntryBalanced :: Entry -> Bool
isEntryBalanced (Entry {etransactions=ts}) = isZeroAmount sum && numcommodities==1
where
realts = filter isReal ts
sum = sumLedgerTransactions realts
sum = sumRawTransactions realts
numcommodities = length $ nub $ map (symbol . commodity . tamount) realts
-- | Fill in a missing balance in this entry, if there is one,

View File

@ -34,7 +34,7 @@ autofillTransactions ts =
(reals, _) = partition isReal ts
(realamounts, missingamounts) = partition hasAmount reals
balance t = if (isReal t) && (not $ hasAmount t)
then t{tamount = -(sumLedgerTransactions realamounts)}
then t{tamount = -(sumRawTransactions realamounts)}
else t
isReal :: RawTransaction -> Bool
@ -43,5 +43,5 @@ isReal t = rttype t == RegularTransaction
hasAmount :: RawTransaction -> Bool
hasAmount = ("AUTO" /=) . symbol . commodity . tamount
sumLedgerTransactions :: [RawTransaction] -> Amount
sumLedgerTransactions = sumAmounts . map tamount
sumRawTransactions :: [RawTransaction] -> Amount
sumRawTransactions = sumAmounts . map tamount