Module: Backend::AccountsHelper

Defined in:
app/helpers/backend/accounts_helper.rb

Overview

License

Ekylibre - Simple agricultural ERP Copyright (C) 2008-2013 Brice Texier

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Instance Method Summary collapse

Instance Method Details

#accounts_range_critObject

Create a widget to select ranges of account See Account#range_condition


36
37
38
39
40
41
42
43
# File 'app/helpers/backend/accounts_helper.rb', line 36

def accounts_range_crit
  id = :accounts
  params[id] = Account.clean_range_condition(params[id])
  code = ''
  code << (:label, :accounts.tl, for: id)
  code << ' ' << text_field_tag(id, params[id], size: 30)
  code.html_safe
end

#major_accounts_tabs_tagObject


21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/helpers/backend/accounts_helper.rb', line 21

def major_accounts_tabs_tag
  majors = Account.majors
  if majors.count > 0
    html = (:dt, :accounts.tl)
    html << (:dd, link_to(:all_accounts.tl, params.merge(controller: :accounts, action: :index, prefix: nil)), (params[:prefix].blank? ? { class: :active } : nil))
    for  in majors
      html << (:dd, link_to(.label, params.merge(controller: :accounts, action: :index, prefix: .number)), (params[:prefix] == .number.to_s ? { class: :active } : nil))
    end
    return (:dl, html, id: 'major-accounts')
  end
  ''
end