tax profiles
This commit is contained in:
@@ -7,7 +7,17 @@ class Settings::TaxProfilesController < ApplicationController
|
||||
def index
|
||||
@settings_tax_profiles = TaxProfile.all
|
||||
tax_profiles = Lookup.collection_of("tax_profiles")
|
||||
|
||||
if !@settings_tax_profiles.nil?
|
||||
@settings_tax_profiles.each_with_index do |setting_tax_profile, tax_index|
|
||||
if !tax_profiles.nil?
|
||||
tax_profiles.each do |group|
|
||||
if setting_tax_profile.group_type == group[1]
|
||||
@settings_tax_profiles[tax_index].group_type = group[0]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# GET /settings/tax_profiles/1
|
||||
@@ -17,11 +27,19 @@ class Settings::TaxProfilesController < ApplicationController
|
||||
|
||||
# GET /settings/tax_profiles/new
|
||||
def new
|
||||
@name = nil
|
||||
@settings_tax_profile = TaxProfile.new
|
||||
@tax_profiles = TaxProfile.all
|
||||
end
|
||||
|
||||
# GET /settings/tax_profiles/1/edit
|
||||
def edit
|
||||
@settings_tax_profile = TaxProfile.find(params[:id])
|
||||
@name = nil
|
||||
if !@settings_tax_profile.nil?
|
||||
@name = @settings_tax_profile.name
|
||||
end
|
||||
@tax_profiles = TaxProfile.all
|
||||
end
|
||||
|
||||
# POST /settings/tax_profiles
|
||||
@@ -71,6 +89,16 @@ class Settings::TaxProfilesController < ApplicationController
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_settings_tax_profile
|
||||
@settings_tax_profile = TaxProfile.find(params[:id])
|
||||
tax_profiles = Lookup.collection_of("tax_profiles")
|
||||
if !@settings_tax_profile.nil?
|
||||
if !tax_profiles.nil?
|
||||
tax_profiles.each do |group|
|
||||
if @settings_tax_profile.group_type == group[1]
|
||||
@settings_tax_profile.group_type = group[0]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
|
||||
Reference in New Issue
Block a user