Class: RockBooks::BalanceSheet

Inherits:
Object
  • Object
show all
Includes:
ErbHelper, TextReportHelper
Defined in:
lib/rock_books/reports/balance_sheet.rb

Overview

Reports the balance sheet as of the specified date. Unlike other reports, we need to process transactions from the beginning of time in order to calculate the correct balances, so we ignore the global $filter.

Constant Summary

Constants included from TextReportHelper

TextReportHelper::SHORT_NAME_FORMAT_STRING, TextReportHelper::SHORT_NAME_MAX_LENGTH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ErbHelper

erb_template, render_binding, render_hashes

Methods included from TextReportHelper

#account_code_format, #account_code_name_type_string, #account_code_name_type_string_for_code, #acct_name, #banner_line, #center, #end_date, #format_acct_amount, #format_multidoc_entry, #generation_info_display_string, #line_item_format_string, #max_account_code_length, #page_width, #section_heading, #start_date, #template_presentation_context, #total_with_ok_or_discrepancy

Constructor Details

#initialize(report_context, data) ⇒ BalanceSheet

Returns a new instance of BalanceSheet.



16
17
18
19
# File 'lib/rock_books/reports/balance_sheet.rb', line 16

def initialize(report_context, data)
  @context = report_context
  @data = data
end

Instance Attribute Details

#contextObject

Returns the value of attribute context.



14
15
16
# File 'lib/rock_books/reports/balance_sheet.rb', line 14

def context
  @context
end

#dataObject

Returns the value of attribute data.



14
15
16
# File 'lib/rock_books/reports/balance_sheet.rb', line 14

def data
  @data
end

Instance Method Details

#generateObject



22
23
24
# File 'lib/rock_books/reports/balance_sheet.rb', line 22

def generate
  ErbHelper.render_hashes('text/balance_sheet.txt.erb', data, template_presentation_context)
end