update ui commission & commissioner

This commit is contained in:
Zin Lin Phyo
2017-08-22 09:51:08 +06:30
parent 7d60ab1a95
commit 1af178fecb
14 changed files with 315 additions and 239 deletions

View File

@@ -1,14 +1,18 @@
<%= simple_form_for([:origami,@commissioner]) do |f| %>
<%= f.error_notification %>
<div class="col-md-3">
<%= simple_form_for([:origami, @commissioner]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= 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 %>
<label><%= f.check_box :is_active %> Active </label>
</div>
<div class="form-inputs">
<%= 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"} %><br/>
<%= f.input :commission_type %>
<label><%= f.check_box :is_active %> Active </label>
</div>
<div class="form-actions">
<%= f.button :submit %>
</div>
<% end %>
<div class="form-actions">
<%= link_to 'Back', origami_commissioners_path, class: 'btn btn-success' %>
<%= f.button :submit, class: 'btn btn-info' %>
</div>
<% end %>
</div>

View File

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', commissioner: @commissioner %>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>Commissioner</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_commissioner_path ,:class => 'btn btn-primary btn-sm' %>

View File

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', commissioner: @commissioner %>
</div>
</div>

View File

@@ -1,11 +1,11 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissioners_path %>">Commissioners</a></li>
<span style="float: right">
<span style="float: right">
</span>
</ul>
</ul>
</div>
<div class="card">
<div class="card-block">
@@ -14,25 +14,37 @@
<tbody>
<tr><td style="width:20%">Name</td><td><%= @commissioner.name %></td></tr>
<tr><td style="width:20%">Employee Name</td>
<td>
<% if Employee.exists? %>
<% employee = Employee.where('emp_id=?',@commissioner.emp_id) %>
<%= employee[0].name %>
<% end %>
</td></tr>
<tr><td style="width:20%">Commission Type</td><td><%= @commissioner.commission_type %></td></tr>
<tr><td style="width:20%">Active</td><td><%= @commissioner.is_active %></td></tr>
<tr><td style="width:20%">Created By</td><td><%= Employee.find(@commissioner.created_by).name %></td></tr>
<tr><td style="width:20%"><%= link_to 'Edit', edit_origami_commissioner_path(@commissioner) %></td><td><%= link_to 'Destroy', origami_commissioner_path(@commissioner), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
<tr>
<td style="width:20%">Name</td>
<td><%= @commissioner.name %></td>
</tr>
<tr>
<td style="width:20%">Employee Name</td>
<td>
<% if Employee.exists? %>
<% employee = Employee.where('emp_id=?', @commissioner.emp_id) %>
<%= employee[0].name %>
<% end %>
</td>
</tr>
<tr>
<td style="width:20%">Commission Type</td>
<td><%= @commissioner.commission_type %></td>
</tr>
<tr>
<td style="width:20%">Active</td>
<td><%= @commissioner.is_active %></td>
</tr>
<tr>
<td style="width:20%">Created By</td>
<td><%= Employee.find(@commissioner.created_by).name %></td>
</tr>
</tbody>
</table>
<%= 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' %>
</div>
</div>

View File

@@ -1,15 +1,17 @@
<div class="col-md-3">
<%= simple_form_for([:origami,@commission]) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= 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"} %><br/>
<%= f.input :amount %>
<%= f.input :commission_type, :collection => [:percentage,:net_amount] %>
<%= f.input :commission_type, :collection => [:percentage, :net_amount] %>
<label><%= f.check_box :is_active %> Active </label>
</div>
<div class="form-actions">
<%= f.button :submit %>
<%= link_to 'Back', origami_commissions_path, class: 'btn btn-success' %>
<%= f.button :submit, class: 'btn btn-info' %>
</div>
<% end %>
</div>

View File

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<li>Edit</li>
</ul>
</div>
<%= render 'form', commission: @commission %>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= %>">Home</a></li>
<li><a href="<%= origami_root_path %>">Home</a></li>
<li>Commissions</li>
<span style="float: right">
<%= link_to t('.new', :default => t("helpers.links.new")), new_origami_commission_path ,:class => 'btn btn-primary btn-sm' %>

View File

@@ -1,10 +1,10 @@
<div class="span12">
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', commission: @commission %>
</div>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<li>New</li>
</ul>
</div>
<%= render 'form', commission: @commission %>
</div>

View File

@@ -1,43 +1,45 @@
<p id="notice"><%= notice %></p>
<%= link_to 'Edit', edit_commission_path(@commission) %> |
<%= link_to 'Back', commissions_path %>
<div class="page-header">
<ul class="breadcrumb">
<li><a href="<%= root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<ul class="breadcrumb">
<li><a href="<%= origami_root_path %>">Home</a></li>
<li><a href="<%= origami_commissions_path %>">Commissions</a></li>
<span style="float: right">
<span style="float: right">
</span>
</ul>
</ul>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Commission</h4>
<table class="table">
<tbody>
<tr><td style="width:20%">Product Name</td>
<td>
<% if Product.exists? %>
<% product = Product.find(@commission.product_id) %>
<%= product.name %>
<% end %>
</td></tr>
<tr><td style="width:20%">Amount</td><td><%= @commission.amount %></td></tr>
<tr><td style="width:20%">Commission Type</td><td><%= @commission.commission_type %></td></tr>
<tr><td style="width:20%">Active</td><td><%= @commission.is_active %></td></tr>
<tr><td style="width:20%"><%= link_to 'Edit', edit_origami_commission_path(@commission) %></td><td><%= link_to 'Destroy', origami_commission_path(@commission), method: :delete, data: { confirm: 'Are you sure?' } %></td></tr>
<tr>
<td style="width:20%">Product Name</td>
<td>
<% if Product.exists? %>
<% product = Product.find(@commission.product_id) %>
<%= product.name %>
<% end %>
</td>
</tr>
<tr>
<td style="width:20%">Amount</td>
<td><%= @commission.amount %></td>
</tr>
<tr>
<td style="width:20%">Commission Type</td>
<td><%= @commission.commission_type %></td>
</tr>
<tr>
<td style="width:20%">Active</td>
<td><%= @commission.is_active %></td>
</tr>
</tbody>
</table>
<%= 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?'} %>
</div>
</div>