Class: LedgerSummaryAccount

Inherits:
LedgerAccount show all
Defined in:
app/models/ledger_summary_account.rb

Overview

== Schema Information

Table name: ledger_accounts
Database name: primary

id :integer not null, primary key
classification :string(255)
closed :boolean default(FALSE), not null
description :text
name :string(50) not null
number :integer not null
type :string(255) not null
visible :boolean default(TRUE), not null
created_at :datetime
updated_at :datetime
parent_id :integer

Indexes

idx_id_type (id,type)
idx_la_parent_id (parent_id)
index_ledger_accounts_on_number (number)

Constant Summary

Constants included from Models::Auditable

Models::Auditable::ALWAYS_IGNORED

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LedgerAccount

available, #budgets, company_account_array, #ledger_company_accounts, #ledger_entries, #requires_business_unit?, select_account, select_bank_balance_account, select_options, #summary_name, types_for_select

Methods included from Models::Auditable

#all_skipped_columns, #audit_reference_data, #creator, #should_not_save_version, #stamp_record, #updater

Methods included from Models::Lineage

#ancestors, #ancestors_ids, #children_and_roots, #descendants, #descendants_ids, #ensure_non_recursive_lineage, #family_members, #generate_full_name, #generate_full_name_array, #lineage, #lineage_array, #lineage_simple, #root, #root_id, #self_ancestors_and_descendants, #self_ancestors_and_descendants_ids, #self_and_ancestors, #self_and_ancestors_ids, #self_and_children, #self_and_descendants, #self_and_descendants_ids, #self_and_siblings, #self_and_siblings_ids, #siblings, #siblings_ids

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.readable_typeObject



27
28
29
# File 'app/models/ledger_summary_account.rb', line 27

def self.readable_type
  "Summary"
end

Instance Method Details

#company_account_ids_for(company) ⇒ Object



37
38
39
40
41
# File 'app/models/ledger_summary_account.rb', line 37

def (company)
  accounts = []
  children.each {|c| accounts.concat(c.(company))}
  return accounts
end

#company_accounts_for(company) ⇒ Object



31
32
33
34
35
# File 'app/models/ledger_summary_account.rb', line 31

def company_accounts_for(company)
	accounts = []
  children.each {|c| accounts.concat(c.company_accounts_for(company))}
  return accounts
end