; comments
This commit is contained in:
parent
6948b05db6
commit
654ab4243a
@ -89,7 +89,7 @@ type MonthDay = Int -- 1-31
|
|||||||
type WeekDay = Int -- 1-7
|
type WeekDay = Int -- 1-7
|
||||||
|
|
||||||
-- Typical report periods (spans of time), both finite and open-ended.
|
-- Typical report periods (spans of time), both finite and open-ended.
|
||||||
-- A richer abstraction than DateSpan.
|
-- A higher-level abstraction than DateSpan.
|
||||||
data Period =
|
data Period =
|
||||||
DayPeriod Day
|
DayPeriod Day
|
||||||
| WeekPeriod Day
|
| WeekPeriod Day
|
||||||
|
|||||||
@ -69,9 +69,9 @@ type BudgetReport = PeriodicReport DisplayName BudgetCell
|
|||||||
|
|
||||||
type BudgetDisplayCell = ((String, Int), Maybe ((String, Int), Maybe (String, Int)))
|
type BudgetDisplayCell = ((String, Int), Maybe ((String, Int), Maybe (String, Int)))
|
||||||
|
|
||||||
-- | Calculate budget goals from all periodic transactions,
|
-- | Calculate per-account, per-period budget (balance change) goals
|
||||||
-- actual balance changes from the regular transactions,
|
-- from all periodic transactions, calculate actual balance changes
|
||||||
-- and compare these to get a 'BudgetReport'.
|
-- from the regular transactions, and compare these to get a 'BudgetReport'.
|
||||||
-- Unbudgeted accounts may be hidden or renamed (see journalWithBudgetAccountNames).
|
-- Unbudgeted accounts may be hidden or renamed (see journalWithBudgetAccountNames).
|
||||||
budgetReport :: ReportSpec -> Bool -> DateSpan -> Journal -> BudgetReport
|
budgetReport :: ReportSpec -> Bool -> DateSpan -> Journal -> BudgetReport
|
||||||
budgetReport rspec assrt reportspan j = dbg4 "sortedbudgetreport" budgetreport
|
budgetReport rspec assrt reportspan j = dbg4 "sortedbudgetreport" budgetreport
|
||||||
@ -103,7 +103,7 @@ budgetReport rspec assrt reportspan j = dbg4 "sortedbudgetreport" budgetreport
|
|||||||
budgetreport = combineBudgetAndActual ropts j budgetgoalreport' actualreport
|
budgetreport = combineBudgetAndActual ropts j budgetgoalreport' actualreport
|
||||||
|
|
||||||
-- | Use all periodic transactions in the journal to generate
|
-- | Use all periodic transactions in the journal to generate
|
||||||
-- budget goal transactions in the specified report period.
|
-- budget goal transactions in the specified date span.
|
||||||
-- Budget goal transactions are similar to forecast transactions except
|
-- Budget goal transactions are similar to forecast transactions except
|
||||||
-- their purpose and effect is to define balance change goals, per account and period,
|
-- their purpose and effect is to define balance change goals, per account and period,
|
||||||
-- for BudgetReport.
|
-- for BudgetReport.
|
||||||
|
|||||||
@ -105,7 +105,7 @@ instance Num b => Semigroup (PeriodicReportRow a b) where
|
|||||||
sumPadded as [] = as
|
sumPadded as [] = as
|
||||||
sumPadded [] bs = bs
|
sumPadded [] bs = bs
|
||||||
|
|
||||||
-- | Figure out the overall date span of a PeridicReport
|
-- | Figure out the overall date span of a PeriodicReport
|
||||||
periodicReportSpan :: PeriodicReport a b -> DateSpan
|
periodicReportSpan :: PeriodicReport a b -> DateSpan
|
||||||
periodicReportSpan (PeriodicReport [] _ _) = DateSpan Nothing Nothing
|
periodicReportSpan (PeriodicReport [] _ _) = DateSpan Nothing Nothing
|
||||||
periodicReportSpan (PeriodicReport colspans _ _) = DateSpan (spanStart $ head colspans) (spanEnd $ last colspans)
|
periodicReportSpan (PeriodicReport colspans _ _) = DateSpan (spanStart $ head colspans) (spanEnd $ last colspans)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user