Class: Backend::CapStatementsController

Inherits:
BaseController show all
Defined in:
app/controllers/backend/cap_statements_controller.rb

Instance Attribute Summary

Attributes inherited from ApplicationController

#current_theme

Class Method Summary collapse

Methods inherited from BaseController

accounts_range_crit, crit_params, journal_entries_states_crit, journal_period_crit, journals_crit, search_conditions

Methods inherited from ApplicationController

#after_sign_in_path_for, #authorized?, human_action_name, #human_action_name

Class Method Details

.cap_land_parcel_conditionsObject


41
42
43
44
45
46
47
48
49
# File 'app/controllers/backend/cap_statements_controller.rb', line 41

def self.cap_land_parcel_conditions
  code = ''
  code = search_conditions(cap_land_parcels: [:land_parcel_number, :main_crop_code]) + " ||= []\n"
  code << "if params[:id].to_i > 0\n"
  code << "  c[0] << \" AND #{CapStatement.table_name}.id IN (?)\"\n"
  code << "  c << params[:id].to_i\n"
  code << "end\n"
  code.c
end

.list_conditionsObject

params:

:q Text search
:state State search
:campaign_id
:product_nature_id
:storage_id

31
32
33
34
35
36
37
38
39
# File 'app/controllers/backend/cap_statements_controller.rb', line 31

def self.list_conditions
  code = ''
  code = search_conditions(campaigns: [:name], entities: [:full_name]) + " ||= []\n"
  # code << "if current_campaign\n"
  # code << "  c[0] << \" AND #{CapStatement.table_name}.campaign_id IN (?)\"\n"
  # code << "  c << current_campaign.id\n"
  # code << "end\n"
  code.c
end