diff --git a/.idea/.generators b/.idea/.generators index 8893e668..98526fe7 100644 --- a/.idea/.generators +++ b/.idea/.generators @@ -5,4 +5,4 @@ You are allowed to: 2. Remove generators 3. Add installed generators To add new installed generators automatically delete this file and reload the project. ---> +--> diff --git a/.idea/sxrestaurant.iml b/.idea/sxrestaurant.iml index f88608e6..e1c0cfaa 100644 --- a/.idea/sxrestaurant.iml +++ b/.idea/sxrestaurant.iml @@ -181,6 +181,7 @@ + diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b41a365d..fdfb3e9b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,26 +2,20 @@ - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + @@ -38,21 +32,11 @@ - - + + - - - - - - - - - - - - + + @@ -61,28 +45,38 @@ - - + + - - - - - - - - - - - + - - + + + + + + + + + + + + + + + + + + + + + + @@ -91,48 +85,48 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -179,9 +173,16 @@ @@ -192,10 +193,10 @@ DEFINITION_ORDER - @@ -215,22 +216,8 @@ - - - - - - - - - - - + @@ -347,6 +334,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -784,22 +811,23 @@ - + + - - + - + - + @@ -826,10 +854,6 @@ - - - - @@ -867,14 +891,6 @@ - - - - - - - - @@ -925,6 +941,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -945,90 +984,106 @@ - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - + - - + + - + + + + + + + + + - + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/controllers/origami/commissions_controller.rb b/app/controllers/origami/commissions_controller.rb index f0f07d2a..fdd1bf73 100644 --- a/app/controllers/origami/commissions_controller.rb +++ b/app/controllers/origami/commissions_controller.rb @@ -1,5 +1,5 @@ class Origami::CommissionsController < BaseOrigamiController - # before_action :set_commission, only: [:show, :edit, :update, :destroy] + before_action :set_commission, only: [:show, :edit, :update, :destroy] # GET /commissions # GET /commissions.json diff --git a/app/views/origami/commissioners/_form.html.erb b/app/views/origami/commissioners/_form.html.erb index 6386b0f7..4c2a17f8 100644 --- a/app/views/origami/commissioners/_form.html.erb +++ b/app/views/origami/commissioners/_form.html.erb @@ -1,14 +1,18 @@ -<%= simple_form_for([:origami,@commissioner]) do |f| %> - <%= f.error_notification %> +
+ <%= simple_form_for([:origami, @commissioner]) do |f| %> + <%= f.error_notification %> -
- <%= f.input :name %> - <%= f.collection_select :emp_id, Employee.all.order('name asc'), :emp_id, :name, {prompt: "Select an Employee"}, {class: "form-control"} %> - <%= f.input :commission_type %> - -
+
+ <%= f.input :name %> + <%= f.label :emp_id %> + <%= f.collection_select :emp_id, Employee.all.order('name asc'), :emp_id, :name, {prompt: "Select an Employee"}, {class: "form-control"} %>
+ <%= f.input :commission_type %> + +
-
- <%= f.button :submit %> -
-<% end %> +
+ <%= link_to 'Back', origami_commissioners_path, class: 'btn btn-success' %> + <%= f.button :submit, class: 'btn btn-info' %> +
+ <% end %> +
diff --git a/app/views/origami/commissioners/edit.html.erb b/app/views/origami/commissioners/edit.html.erb index 0a2edab4..ea5c44cd 100644 --- a/app/views/origami/commissioners/edit.html.erb +++ b/app/views/origami/commissioners/edit.html.erb @@ -1,10 +1,10 @@
<%= render 'form', commissioner: @commissioner %> -
\ No newline at end of file + diff --git a/app/views/origami/commissioners/index.html.erb b/app/views/origami/commissioners/index.html.erb index e7230fd9..baadb225 100644 --- a/app/views/origami/commissioners/index.html.erb +++ b/app/views/origami/commissioners/index.html.erb @@ -1,6 +1,6 @@ diff --git a/app/views/origami/commissioners/show.html.erb b/app/views/origami/commissioners/show.html.erb index 579c9c0d..83d5442b 100644 --- a/app/views/origami/commissioners/show.html.erb +++ b/app/views/origami/commissioners/show.html.erb @@ -1,11 +1,11 @@
@@ -14,25 +14,37 @@ - Name<%= @commissioner.name %> - Employee Name - - <% if Employee.exists? %> - <% employee = Employee.where('emp_id=?',@commissioner.emp_id) %> - <%= employee[0].name %> - <% end %> - - - Commission Type<%= @commissioner.commission_type %> - Active<%= @commissioner.is_active %> - Created By<%= Employee.find(@commissioner.created_by).name %> - - - <%= link_to 'Edit', edit_origami_commissioner_path(@commissioner) %><%= link_to 'Destroy', origami_commissioner_path(@commissioner), method: :delete, data: { confirm: 'Are you sure?' } %> - + + Name + <%= @commissioner.name %> + + + Employee Name + + <% if Employee.exists? %> + <% employee = Employee.where('emp_id=?', @commissioner.emp_id) %> + <%= employee[0].name %> + <% end %> + + + + Commission Type + <%= @commissioner.commission_type %> + + + Active + <%= @commissioner.is_active %> + + + Created By + <%= Employee.find(@commissioner.created_by).name %> + + <%= link_to 'Back', origami_commissioners_path, class: 'btn btn-success' %> + <%= link_to 'Edit', edit_origami_commissioner_path(@commissioner), class: 'btn btn-info' %> + <%= link_to 'Destroy', origami_commissioner_path(@commissioner), method: :delete, data: {confirm: 'Are you sure?'}, class: 'btn btn-danger' %>
diff --git a/app/views/origami/commissions/_form.html.erb b/app/views/origami/commissions/_form.html.erb index 826dbf78..a5c0d2c0 100644 --- a/app/views/origami/commissions/_form.html.erb +++ b/app/views/origami/commissions/_form.html.erb @@ -1,15 +1,17 @@ +
<%= simple_form_for([:origami,@commission]) do |f| %> <%= f.error_notification %>
- <%= f.collection_select :product_id, Product.all.order('name asc'), :id, :name, {prompt: "Select a Product"}, {class: "form-control"} %> + <%= f.label :product_id %> + <%= f.collection_select :product_id, Product.all.order('name asc'), :id, :name, {prompt: "Select a Product"}, {class: "form-control"} %>
<%= f.input :amount %> - <%= f.input :commission_type, :collection => [:percentage,:net_amount] %> + <%= f.input :commission_type, :collection => [:percentage, :net_amount] %>
-
- <%= f.button :submit %> + <%= link_to 'Back', origami_commissions_path, class: 'btn btn-success' %> + <%= f.button :submit, class: 'btn btn-info' %>
<% end %> - \ No newline at end of file +
diff --git a/app/views/origami/commissions/edit.html.erb b/app/views/origami/commissions/edit.html.erb index da73332f..f3b72f3d 100644 --- a/app/views/origami/commissions/edit.html.erb +++ b/app/views/origami/commissions/edit.html.erb @@ -1,10 +1,10 @@
<%= render 'form', commission: @commission %> -
\ No newline at end of file + diff --git a/app/views/origami/commissions/index.html.erb b/app/views/origami/commissions/index.html.erb index 420920b9..e5a83639 100644 --- a/app/views/origami/commissions/index.html.erb +++ b/app/views/origami/commissions/index.html.erb @@ -1,6 +1,6 @@ diff --git a/app/views/origami/commissions/show.html.erb b/app/views/origami/commissions/show.html.erb index 6eb399af..da04710e 100644 --- a/app/views/origami/commissions/show.html.erb +++ b/app/views/origami/commissions/show.html.erb @@ -1,43 +1,45 @@

<%= notice %>

-<%= link_to 'Edit', edit_commission_path(@commission) %> | -<%= link_to 'Back', commissions_path %> - -

Commission

- - - - - - - - - - - - + + + + + + + + + + + + + + + +
Product Name - <% if Product.exists? %> - <% product = Product.find(@commission.product_id) %> - <%= product.name %> - <% end %> - -
Amount<%= @commission.amount %>
Commission Type<%= @commission.commission_type %>
Active<%= @commission.is_active %>
<%= link_to 'Edit', edit_origami_commission_path(@commission) %><%= link_to 'Destroy', origami_commission_path(@commission), method: :delete, data: { confirm: 'Are you sure?' } %>
Product Name + <% if Product.exists? %> + <% product = Product.find(@commission.product_id) %> + <%= product.name %> + <% end %> +
Amount<%= @commission.amount %>
Commission Type<%= @commission.commission_type %>
Active<%= @commission.is_active %>
+ <%= link_to 'Back', origami_commissions_path, class: 'btn btn-success' %> + <%= link_to 'Edit', edit_origami_commission_path(@commission), class: 'btn btn-info' %> + <%= link_to 'Destroy', origami_commission_path(@commission), method: :delete, class: 'btn btn-danger', data: {confirm: 'Are you sure?'} %>