Class TaskJuggler::AccountScenario
In: lib/taskjuggler/AccountScenario.rb
Parent: ScenarioData

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

Methods

Public Class methods

[Source]

# 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

[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

[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

[Validate]