update report and inventory layout design

This commit is contained in:
Aung Myo
2017-10-25 14:03:15 +06:30
parent 0eea755acd
commit da6d85eaf5
25 changed files with 693 additions and 611 deletions

View File

@@ -1,85 +1,95 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">Stock Check</li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<!-- <div class="m-b-10 clearfix">
<%= link_to t("views.btn.new"),new_settings_account_path,:class => 'btn btn-primary btn-lg float-right waves-effect"' %>
</div -->
<div class="card">
<div class="p-l-15 p-r-15 p-t-10">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="col-lg-10 col-md-10 col-sm-8 col-xs-7">
<!-- <label for="remark">Remark</label> -->
<input type='text' id='stock_check_reason' class='form-control' placeholder="Set Stock Check Reason" value=''/>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-md-10 col-sm-8 col-xs-7">
<!-- <label for="password_2">Item</label> -->
<select class='form-control' id='product_sku'>
<option value="">Select Product</option>
<% @inventory_definitions.each do |id| %>
<option value="<%= id.item_code %>">
<% menu_item = MenuItemInstance.find_by_item_instance_code(id.item_code) %>
<% if menu_item.nil? %>
<%= Product.find_by_item_code(id.item_code).name rescue "-" %>
<% else %>
<%= menu_item.menu_item.name rescue '-' %> - <%= menu_item.item_instance_name rescue '-' %>
<% end %>
</option>
<% end %>
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-md-10 col-sm-8 col-xs-7">
<!-- <label for="email_address_2">Qty</label> -->
<input type='text' class='form-control' placeholder="Qty" id='product_qty' value=''/>
</div>
</div>
<div class="form-group">
<div class="col-md-4">
<button class="btn btn-primary form-control" id='save_to_stock_check'> Save</button>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<input type='text' id='stock_check_reason' class='form-control' placeholder="Set Stock Check Reason" value=''/>
</div>
</div>
<br>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-2">
Item
</div>
<div class="col-md-7">
<select class='form-control' id='product_sku'>
<option value="">Select Product</option>
<% @inventory_definitions.each do |id| %>
<option value="<%= id.item_code %>">
<% menu_item = MenuItemInstance.find_by_item_instance_code(id.item_code) %>
<% if menu_item.nil? %>
<%= Product.find_by_item_code(id.item_code).name rescue "-" %>
<% else %>
<%= menu_item.menu_item.name rescue '-' %> - <%= menu_item.item_instance_name rescue '-' %>
<% end %>
</option>
<% end %>
</select>
</div>
</div>
<br>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-2">
Qty
</div>
<div class="col-md-7">
<input type='text' class='form-control' placeholder="Qty" id='product_qty' value=''/>
</div>
</div>
<br>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-7">
<button class="btn btn-primary form-control" id='save_to_stock_check'> Save</button>
<div class="col-md-6">
<table class="table table-striped" id='stock_item'>
<tr>
<!--<th>#</th>-->
<th>Product</th>
<th>Balance</th>
<th><button class="btn btn-primary pull-right form-control" style='margin-bottom:2px;' id='finish'> Finish</button></th>
</tr>
<!-- <tr>
<td colspan="3">
<button class="btn btn-primary pull-right form-control" style='margin-bottom:2px;' id='finish'> Finish</button></td>
</tr> -->
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="row">
<div class="col-md-12">
<table class="table table-striped" id='stock_item'>
<tr>
<!--<th>#</th>-->
<th>Product</th>
<th>Balance</th>
<th></th>
</tr>
</table>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="card">
<div class="body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
</div>
<div class="col-md-1">
<div class="row">
<button class="btn btn-primary pull-right form-control" style='margin-bottom:2px;' id='back'> Back</button>
<button class="btn btn-primary pull-right form-control" style='margin-bottom:2px;' id='finish'> Finish</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('#product_sku').select2({
allowClear: true,
placeholder: 'Select Product'
})
});
var count = 0;
@@ -92,8 +102,8 @@
//+ '<td>' + count + '</td>'
+ '<td><input type=hidden value="' + product_sku + '" id="item_sku_' + count + '" name=' + count + '/>'
+ product_name + '</td>'
+ '<td><input type=text value="' + product_qty + '" id="item_qty_' + count + '" name=' + count + '/></td>'
+ '<td><input type=button value="X" id="item_remove_' + count + '" name=' + count + ' onclick="remove_row('+ count +')"/></td>'
+ '<td><input type=text value="' + product_qty + '" class="form-control col-md-9" id="item_qty_' + count + '" name=' + count + '/></td>'
+ '<td><input type=button value="X" class="btn btn-danger p-l-15 p-r-15" id="item_remove_' + count + '" name=' + count + ' onclick="remove_row('+ count +')"/></td>'
+ '</tr>';
$('#stock_item').append(tr);
// $('#product_sku').val('');
@@ -124,10 +134,6 @@
})
});
$('#back').on('click', function () {
window.location.href = '/inventory';
});
function remove_row(row) {
$("#item_remove_"+row).parent().parent().remove();
}

View File

@@ -1,72 +1,92 @@
<div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%=inventory_stock_checks_path%>"></a>Stock Check</li>
<li class="breadcrumb-item active">Detail</li>
<span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), dashboard_path %>
</span>
</ol>
</div>
<div class="row">
<input type='hidden' id='stock_check_id' value='<%= @check.id %>'/>
<div class="col-md-10">
<div class="row">
<div class="col-md-2">
Check by
</div>
<div class="col-md-8">
<%= Employee.find(@check.check_by).name rescue '' %>
</div>
</div>
<div class="row">
<div class="col-md-2">
Check At
</div>
<div class="col-md-8">
<%= @check.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %></div>
</div>
<div class="row">
<div class="col-md-2">
Reason
</div>
<div class="col-md-8">
<%= @check.reason %>
</div>
</div>
<br>
<div class="row">
<table class="table table-striped col-md-12">
<tr>
<th>#</th>
<th>Product</th>
<th>Stock Count</th>
<th>Stock Balance</th>
<th>Different</th>
<th>Remark</th>
</tr>
<%
count = 0
@check.stock_check_items.each do |item|
count += 1
%>
<tr>
<td><%= count %></td>
<td>
<% menu_item = MenuItemInstance.find_by_item_instance_code(item.item_code)%>
<% if menu_item.nil? %>
<%= Product.find_by_item_code(item.item_code).name rescue "-" %>
<% else %>
<%= menu_item.menu_item.name rescue "-" %>
- <%= menu_item.item_instance_name rescue "-" %>
<% end %>
</td>
<td><%= item.stock_count %></td>
<td><%= item.stock_balance %></td>
<td><%= item.different %></td>
<td><%= item.remark %></td>
</tr>
<% end %>
</table>
<div class="col-xs-12 col-sm-12 col-md-10 col-lg-10">
<div class="card">
<input type='hidden' id='stock_check_id' value='<%= @check.id %>'/>
<div class="p-l-20 p-t-15">
<div class="row">
<div class="col-md-2">
Check by
</div>
<div class="col-md-8">
<%= Employee.find(@check.check_by).name rescue '' %>
</div>
</div>
<div class="row">
<div class="col-md-2">
Check At
</div>
<div class="col-md-8">
<%= @check.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %>
</div>
</div>
<div class="row">
<div class="col-md-2">
Reason
</div>
<div class="col-md-8">
<%= @check.reason %>
</div>
</div>
</div>
<br>
<div class="table-responsive">
<table class="table table-striped col-md-12">
<tr>
<th>#</th>
<th>Product</th>
<th>Stock Count</th>
<th>Stock Balance</th>
<th>Different</th>
<th>Remark</th>
</tr>
<%
count = 0
@check.stock_check_items.each do |item|
count += 1
%>
<tr>
<td><%= count %></td>
<td>
<% menu_item = MenuItemInstance.find_by_item_instance_code(item.item_code)%>
<% if menu_item.nil? %>
<%= Product.find_by_item_code(item.item_code).name rescue "-" %>
<% else %>
<%= menu_item.menu_item.name rescue "-" %>
- <%= menu_item.item_instance_name rescue "-" %>
<% end %>
</td>
<td><%= item.stock_count %></td>
<td><%= item.stock_balance %></td>
<td><%= item.different %></td>
<td><%= item.remark %></td>
</tr>
<% end %>
</table>
</div>
</div>
</div>
<div class="col-md-2">
<button id="back" type="button" class="btn btn-block btn-primary"> Back</button>
<button id="save_to_journal" type="button" class="btn btn-block btn-primary"> Save to Journal</button>
<button id="print" type="button" class="btn btn-block btn-primary"> Print</button>
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2">
<div class="body">
<button id="save_to_journal" type="button" class="btn btn-block btn-primary"> Save to Journal</button>
<button id="print" type="button" class="btn btn-block btn-primary"> Print</button>
</div>
</div>
</div>
<script>
$('#save_to_journal').on('click', function () {