139 lines
4.9 KiB
Plaintext
Executable File
139 lines
4.9 KiB
Plaintext
Executable File
<div class="page-header">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="<%= root_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
|
<li class="breadcrumb-item"><a href="<%=inventory_stock_checks_path%>"></a><%= t("views.right_panel.detail.stock_check") %></li>
|
|
<li class="breadcrumb-item active"><%= t :details %></li>
|
|
<span class="float-right">
|
|
<%= link_to t('.back', :default => t("views.btn.back")), inventory_path %>
|
|
</span>
|
|
</ol>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<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">
|
|
<%= t("views.right_panel.detail.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">
|
|
<%= t("views.right_panel.detail.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">
|
|
<%= t("views.right_panel.detail.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><%= t("views.right_panel.header.menu_category") %></th>
|
|
<th><%= t("views.right_panel.detail.product") %></th>
|
|
<th><%= t("views.right_panel.detail.stock_count") %></th>
|
|
<th><%= t("views.right_panel.detail.stock_balance") %></th>
|
|
<th><%= t("views.right_panel.detail.different") %></th>
|
|
<th><%= t("views.right_panel.detail.remark") %></th>
|
|
</tr>
|
|
<% cate_arr = Array.new %>
|
|
<%
|
|
count = 0
|
|
@stock_check_items.each do |item|
|
|
count += 1
|
|
%>
|
|
<tr>
|
|
<td><%= count %></td>
|
|
<% if !cate_arr.include?(item.menu_category_id) %>
|
|
<td><%= item.menu_category_name %></td>
|
|
<% cate_arr.push(item.menu_category_id) %>
|
|
<% else %>
|
|
<td> </td>
|
|
<% end %>
|
|
<td><%= item.item_name rescue '-' %> - <%= item.instance_name%></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-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"> <%= t("views.right_panel.button.save_to_journal") %></button> -->
|
|
<button id="print" type="button" class="btn btn-block btn-primary"> <%= t :print %></button>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
$('#save_to_journal').on('click', function () {
|
|
check_id = $('#stock_check_id').val();
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '<%= inventory_save_to_journal_path %>',
|
|
data: 'data=' + check_id,
|
|
success: function () {
|
|
swal({
|
|
title: "Information!",
|
|
text: "Successfully saved to journal",
|
|
html: true,
|
|
closeOnConfirm: false,
|
|
closeOnCancel: false,
|
|
allowOutsideClick: false
|
|
}, function () {
|
|
window.location.href = '/inventory';
|
|
});
|
|
}
|
|
})
|
|
});
|
|
|
|
$('#print').on('click', function () {
|
|
check_id = $('#stock_check_id').val();
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '<%= inventory_print_stock_check_path %>',
|
|
data: 'stock_check_id=' + check_id,
|
|
success: function(){
|
|
swal({
|
|
title: "Information!",
|
|
text: "Print successfully",
|
|
html: true,
|
|
closeOnConfirm: false,
|
|
closeOnCancel: false,
|
|
allowOutsideClick: false
|
|
}, function () {
|
|
window.location.reload();
|
|
});
|
|
}
|
|
})
|
|
});
|
|
|
|
$('#back').on('click', function () {
|
|
window.location.href = '/inventory';
|
|
});
|
|
|
|
</script>
|