tax profiles
This commit is contained in:
@@ -6,6 +6,8 @@ class Settings::TaxProfilesController < ApplicationController
|
||||
# GET /settings/tax_profiles.json
|
||||
def index
|
||||
@settings_tax_profiles = TaxProfile.all
|
||||
tax_profiles = Lookup.collection_of("tax_profiles")
|
||||
|
||||
end
|
||||
|
||||
# GET /settings/tax_profiles/1
|
||||
@@ -73,6 +75,6 @@ class Settings::TaxProfilesController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def settings_tax_profile_params
|
||||
params.require(:tax_profile).permit(:name, :rate, :inclusive, :order_by, :created_by)
|
||||
params.require(:tax_profile).permit(:name, :group_type, :rate, :inclusive, :order_by, :created_by)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class TaxProfile < ApplicationRecord
|
||||
default_scope { order('order_by asc') }
|
||||
# validations
|
||||
validates_presence_of :name, :rate
|
||||
validates_presence_of :name, :rate, :group_type
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs p-l-15">
|
||||
<%= f.input :group_type, :collection => Lookup.collection_of("tax_profiles"),:input_html=>{:class=>"col-md-10"},:required=>true %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :rate %>
|
||||
<%= f.input :inclusive %>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.group_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.rate") %></th>
|
||||
<th><%= t("views.right_panel.detail.inclusive") %></th>
|
||||
@@ -29,6 +30,9 @@
|
||||
<tbody>
|
||||
<% @settings_tax_profiles.each do |settings_tax_profile| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= settings_tax_profile.group_type %>
|
||||
</td>
|
||||
<td><%= settings_tax_profile.name %></td>
|
||||
<td><%= settings_tax_profile.rate %></td>
|
||||
<td><%= settings_tax_profile.inclusive %></td>
|
||||
|
||||
Reference in New Issue
Block a user