class TaskJuggler::AccountScenario

This class handles the scenario specific features of a Account object.

Public Class Methods

new(account, scenarioIdx, attributes) click to toggle source
Calls superclass method
# File lib/taskjuggler/AccountScenario.rb, line 21
def initialize(account, scenarioIdx, attributes)
  super
  %w( credits ).each do |attr|
    @property[attr, @scenarioIdx]
  end
end

Public Instance Methods

query_balance(query) click to toggle source
# File lib/taskjuggler/AccountScenario.rb, line 28
def query_balance(query)
  # The account balance is the turnover from project start (index 0) to
  # the start of the query period. It's the start because that's what the
  # label in the column header says.
  startIdx = 0
  endIdx = @project.dateToIdx(query.start)

  query.sortable = query.numerical = amount = turnover(startIdx, endIdx)
  query.string = query.currencyFormat.format(amount)
end
query_turnover(query) click to toggle source
# File lib/taskjuggler/AccountScenario.rb, line 39
def query_turnover(query)
  startIdx = @project.dateToIdx(query.start)
  endIdx = @project.dateToIdx(query.end)

  query.sortable = query.numerical = amount = turnover(startIdx, endIdx)
  query.string = query.currencyFormat.format(amount)
end