Class: RockBooks::MultidocTransactionByAccountReport

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

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(data, report_context) ⇒ MultidocTransactionByAccountReport

Returns a new instance of MultidocTransactionByAccountReport.



17
18
19
20
# File 'lib/rock_books/reports/multidoc_txn_by_account_report.rb', line 17

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

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

#dataObject (readonly)

Returns the value of attribute data.



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

def data
  @data
end

Instance Method Details

#account_total_line(account_code, account_total) ⇒ Object



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

def (, )
   = context.chart_of_accounts.name_for_code()
  sprintf("%.2f  Total for account: %s - %s", , , )
end

#generateObject



27
28
29
30
# File 'lib/rock_books/reports/multidoc_txn_by_account_report.rb', line 27

def generate
  presentation_context = template_presentation_context.merge({ fn_account_total_line: method(:account_total_line) })
  ErbHelper.render_hashes('text/multidoc_txn_by_account_report.txt.erb', data, presentation_context)
end