rename sumLedgerTransactions
This commit is contained in:
parent
405f71c389
commit
17ceb9039b
@ -24,7 +24,7 @@ isEntryBalanced :: Entry -> Bool
|
|||||||
isEntryBalanced (Entry {etransactions=ts}) = isZeroAmount sum && numcommodities==1
|
isEntryBalanced (Entry {etransactions=ts}) = isZeroAmount sum && numcommodities==1
|
||||||
where
|
where
|
||||||
realts = filter isReal ts
|
realts = filter isReal ts
|
||||||
sum = sumLedgerTransactions realts
|
sum = sumRawTransactions realts
|
||||||
numcommodities = length $ nub $ map (symbol . commodity . tamount) realts
|
numcommodities = length $ nub $ map (symbol . commodity . tamount) realts
|
||||||
|
|
||||||
-- | Fill in a missing balance in this entry, if there is one,
|
-- | Fill in a missing balance in this entry, if there is one,
|
||||||
|
|||||||
@ -34,7 +34,7 @@ autofillTransactions ts =
|
|||||||
(reals, _) = partition isReal ts
|
(reals, _) = partition isReal ts
|
||||||
(realamounts, missingamounts) = partition hasAmount reals
|
(realamounts, missingamounts) = partition hasAmount reals
|
||||||
balance t = if (isReal t) && (not $ hasAmount t)
|
balance t = if (isReal t) && (not $ hasAmount t)
|
||||||
then t{tamount = -(sumLedgerTransactions realamounts)}
|
then t{tamount = -(sumRawTransactions realamounts)}
|
||||||
else t
|
else t
|
||||||
|
|
||||||
isReal :: RawTransaction -> Bool
|
isReal :: RawTransaction -> Bool
|
||||||
@ -43,5 +43,5 @@ isReal t = rttype t == RegularTransaction
|
|||||||
hasAmount :: RawTransaction -> Bool
|
hasAmount :: RawTransaction -> Bool
|
||||||
hasAmount = ("AUTO" /=) . symbol . commodity . tamount
|
hasAmount = ("AUTO" /=) . symbol . commodity . tamount
|
||||||
|
|
||||||
sumLedgerTransactions :: [RawTransaction] -> Amount
|
sumRawTransactions :: [RawTransaction] -> Amount
|
||||||
sumLedgerTransactions = sumAmounts . map tamount
|
sumRawTransactions = sumAmounts . map tamount
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user