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

@@ -198,5 +198,20 @@ section.content {
background-color: #007d72 !important; background-color: #007d72 !important;
} }
.m-t-1{
margin-top: 1px;
}
.m-t-2{
margin-top: 2px;
}
.m-t-3{
margin-top: 3px;
}
.m-t-4{
margin-top: 4px;
}
.m-t-7{
margin-top: 7px;
}
/* End Reset Theme */ /* End Reset Theme */
/* *************************************************** */ /* *************************************************** */

View File

@@ -2,18 +2,21 @@ class Reports::CommissionController < BaseReportController
# authorize_resource :class => false # authorize_resource :class => false
def index def index
from_date = DateTime.now.beginning_of_day.utc.getlocal # from_date = DateTime.now.beginning_of_day.utc.getlocal
to_date = DateTime.now.end_of_day.utc.getlocal # to_date = DateTime.now.end_of_day.utc.getlocal
unless params[:daterange].blank? # unless params[:daterange].blank?
from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day.utc.getlocal # from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day.utc.getlocal
to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day.utc.getlocal # to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day.utc.getlocal
@daterange = params[:daterange] # @daterange = params[:daterange]
end # end
from_date, to_date = get_date_range_from_params
commissioner = params[:commissioner].to_i commissioner = params[:commissioner].to_i
@com_id = commissioner @com_id = commissioner
@commissioner = Commissioner.active.all @commissioner = Commissioner.active.all
@transaction = ProductCommission.get_transaction(from_date, to_date, commissioner) @transaction = ProductCommission.get_transaction(from_date, to_date, commissioner)
@from = from_date @from = from_date
@to = to_date @to = to_date

View File

@@ -2,13 +2,14 @@ class Reports::StockCheckController < BaseReportController
# authorize_resource :class => false # authorize_resource :class => false
def index def index
from_date = DateTime.now.beginning_of_day.utc.getlocal # from_date = DateTime.now.beginning_of_day.utc.getlocal
to_date = DateTime.now.end_of_day.utc.getlocal # to_date = DateTime.now.end_of_day.utc.getlocal
unless params[:daterange].blank? # unless params[:daterange].blank?
from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day.utc.getlocal # from_date = Date.parse(params[:daterange].split(' - ')[0]).beginning_of_day.utc.getlocal
to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day.utc.getlocal # to_date = Date.parse(params[:daterange].split(' - ')[1]).end_of_day.utc.getlocal
@daterange = params[:daterange] # @daterange = params[:daterange]
end # end
from_date, to_date = get_date_range_from_params
@item_code = params[:item_code] @item_code = params[:item_code]
@inventory_definitions = InventoryDefinition.active.all @inventory_definitions = InventoryDefinition.active.all

View File

@@ -1,48 +1,34 @@
<div class="row"> <table class="table table-striped">
<div class="col-md-8"><h2> Inventoy Product Lists</h2></div> <tr>
<div class="col-md-4"><button id='new_inventory_product' class='btn bg-blue waves-effect' style='margin-top:15px;'>New Inventory Product</button></div> <th>#</th>
</div> <th>Product</th>
<th>Min Order</th>
<th>Max Stock</th>
<th>Created by</th>
<th>Created Time</th>
</tr>
<%
count = 0
@products.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.min_order_level %></td>
<td><%= item.max_stock_level %></td>
<td><%= Employee.find(item.created_by).name rescue '-' %></td>
<td><%= item.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %></td>
</tr>
<% end %>
</table>
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<tr>
<th>#</th>
<th>Product</th>
<th>Min Order</th>
<th>Max Stock</th>
<th>Created by</th>
<th>Created Time</th>
</tr>
<%
count = 0
@products.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.min_order_level %></td>
<td><%= item.max_stock_level %></td>
<td><%= Employee.find(item.created_by).name rescue '-' %></td>
<td><%= item.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %></td>
</tr>
<% end %>
</table>
</div>
</div>
<script>
$('#new_inventory_product').on('click',function(){
window.location.href = '/inventory/inventory_definitions/new';
})
</script>

View File

@@ -1,17 +1,48 @@
<div class="container-fluid"> <div class="page-header">
<div class="row"> <ol class="breadcrumb">
<div class="col-lg-10 col-md-10 col-sm-10"> <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">Inventory</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-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="m-b-10 clearfix">
<button id="stock_check_report" type="button" class="btn bg-blue float-right waves-effect" style='margin-left:5px;'> Stock Check Report
</button>
<button id="stock_taking" type="button" class="btn bg-blue float-right waves-effect" style='margin-left:5px;'> New Stock Taking</button>
<button id='new_inventory_product' class='btn btn-primary float-right waves-effect' style='margin-left:5px;'><%= t("views.btn.new") + " " + (t :inventory) %>
</button>
</div>
<div class="card">
<%= render 'inventory_list' %> <%= render 'inventory_list' %>
</div> </div>
<div class="col-lg-2 col-md-2 col-sm-2"> </div>
<% if current_login_employee.role == "administrator" || current_login_employee.role == 'manager' %> <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<button id="back" type="button" class="btn bg-default waves-effect"> Back</button> <div class="card">
<% end %> <div class="body">
<button id="stock_taking" type="button" class="btn bg-blue waves-effect"> New Stock Taking</button> <h5><i class="material-icons md-18">list BUTTON LISTS</i> </h5>
<button id="stock_check_report" type="button" class="btn bg-blue waves-effect"> Stock Check Report</button> <p>
1) <%= t("views.btn.new") + " " + (t :inventory) %> - to create new inventory <br>
</p>
<p>
2) New Stock Taking - to create new Stock Taking <br>
</p>
<p>
3) Stock Check Report - to go Stock Check Report List <br>
</p>
<h5><i class="material-icons md-18">list LINK LISTS</i> </h5>
<p>1) Home / Back - go to dashboard</p>
</div>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
$('#stock_taking').on('click', function () { $('#stock_taking').on('click', function () {
window.location.href = '<%= inventory_stock_checks_path %>'; window.location.href = '<%= inventory_stock_checks_path %>';
@@ -21,8 +52,8 @@
window.location.href = '<%= reports_stock_check_index_path %>'; window.location.href = '<%= reports_stock_check_index_path %>';
}); });
$('#back').on('click', function () { $('#new_inventory_product').on('click',function(){
window.location.href = '<%= dashboard_path %>'; window.location.href = '/inventory/inventory_definitions/new';
}); })
</script> </script>

View File

@@ -1,5 +1,5 @@
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9"> <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8">
<div class="p-l-10"> <div class="p-l-10">
<%= simple_form_for([:inventory, @inventory_definition]) do |f| %> <%= simple_form_for([:inventory, @inventory_definition]) do |f| %>
<%= f.error_notification %> <%= f.error_notification %>
@@ -10,8 +10,8 @@
<% Product.order("name desc").pluck(:name, :item_code).each do |p| %> <% Product.order("name desc").pluck(:name, :item_code).each do |p| %>
<% arr.push(p) %> <% arr.push(p) %>
<% end %> <% end %>
<div class="col-md-3"> <div class="col-md-4">
<label class="control-label"><abbr title="required">*</abbr> Item</label> <label class="control-label"><abbr title="required">*</abbr>Select Item</label>
<select class="form-control item_code_place" id="item"> <select class="form-control item_code_place" id="item">
<% if !@inventory_definition.item_code.nil? %> <% if !@inventory_definition.item_code.nil? %>
<% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@inventory_definition.item_code) %> <% menuiteminstance = MenuItemInstance.find_by_item_instance_code(@inventory_definition.item_code) %>
@@ -21,7 +21,7 @@
<% code = menuiteminstance.menu_item.item_code %> <% code = menuiteminstance.menu_item.item_code %>
<% end %> <% end %>
<% end %> <% end %>
<option value=""></option> <option value="">Select Item</option>
<% arr.each do |a| %> <% arr.each do |a| %>
<% if a[1] == code %> <% if a[1] == code %>
<option value="<%= a[1] %>" selected><%= a[0] %></option> <option value="<%= a[1] %>" selected><%= a[0] %></option>
@@ -48,19 +48,32 @@
</div> </div>
<div class="form-actions"> <div class="form-actions">
<%= f.submit 'Submit', class: 'btn bg-blue waves-effect' %> <%= f.submit t("views.btn.submit"), class: 'btn bg-blue waves-effect' %>
</div> </div>
<% end %> <% end %>
</div> </div>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4">
<div class="card"> <div class="card">
<div class="body"> <div class="body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod <h5><i class="material-icons md-18">list INPUT LISTS</i> </h5>
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, <p>
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 1) Select Item - select to create for new inventory <br>
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse </p>
<p>
2) Min Order Level - to write minimun number with type Integer/Numeric <br>
</p>
<p>
3) Max Stock Level - to write minimun number with type Integer/Numeric for check stock<br>
</p>
<h5><i class="material-icons md-18">list BUTTON LISTS</i> </h5>
<p>
1) <%= t("views.btn.submit") %> - to create new inventory <br>
</p>
<h5><i class="material-icons md-18">list LINK LISTS</i> </h5>
<p>1) Home / Back - go to dashboard</p>
</div> </div>
</div> </div>
</div> </div>
@@ -70,10 +83,10 @@
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$(".item_code_place").select2({ // $(".item_code_place").select2({
placeholder: 'Select Item' // placeholder: 'Select Item'
}); // });
$("select#inventory_definition_item_code").select2(); // $("select#inventory_definition_item_code").select2();
$(".item_code_place").on('change', function (event) { $(".item_code_place").on('change', function (event) {
var ajax_url = "<%= settings_find_item_instance_path %>"; var ajax_url = "<%= settings_find_item_instance_path %>";
@@ -90,7 +103,7 @@
$("select#inventory_definition_item_code").append(itemlist); $("select#inventory_definition_item_code").append(itemlist);
} }
// $("select#inventory_definition_item_code").append(itemlist); // $("select#inventory_definition_item_code").append(itemlist);
$("select#inventory_definition_item_code").select2(); // $("select#inventory_definition_item_code").select2();
} }
}); });
}); });

View File

@@ -2,7 +2,7 @@
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item"><a href="<%= inventory_path %>">Product Inventory</a></li> <li class="breadcrumb-item"><a href="<%= inventory_path %>">Product Inventory</a></li>
<li class="breadcrumb-item active">Edit</li> <li class="breadcrumb-item active">New</li>
<span class="float-right"> <span class="float-right">
<%= link_to t('.back', :default => t("views.btn.back")), inventory_path %> <%= link_to t('.back', :default => t("views.btn.back")), inventory_path %>
</span> </span>

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="row">
<div class="col-md-6"> <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
<div class="row"> <!-- <div class="m-b-10 clearfix">
<div class="col-md-12"> <%= 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> <div class="form-group">
</div> <div class="col-md-4">
<div class="row"> <button class="btn btn-primary form-control" id='save_to_stock_check'> Save</button>
<div class="col-md-12"> </div>
<input type='text' id='stock_check_reason' class='form-control' placeholder="Set Stock Check Reason" value=''/> </div>
</div> </div>
</div>
<br> <div class="col-md-6">
<div class="row"> <table class="table table-striped" id='stock_item'>
<div class="col-md-2"></div> <tr>
<div class="col-md-2"> <!--<th>#</th>-->
Item <th>Product</th>
</div> <th>Balance</th>
<div class="col-md-7"> <th><button class="btn btn-primary pull-right form-control" style='margin-bottom:2px;' id='finish'> Finish</button></th>
<select class='form-control' id='product_sku'> </tr>
<option value="">Select Product</option> <!-- <tr>
<% @inventory_definitions.each do |id| %> <td colspan="3">
<option value="<%= id.item_code %>"> <button class="btn btn-primary pull-right form-control" style='margin-bottom:2px;' id='finish'> Finish</button></td>
<% menu_item = MenuItemInstance.find_by_item_instance_code(id.item_code) %> </tr> -->
<% if menu_item.nil? %> </table>
<%= Product.find_by_item_code(id.item_code).name rescue "-" %> </div>
<% else %>
<%= menu_item.menu_item.name rescue '-' %> - <%= menu_item.item_instance_name rescue '-' %> </div>
<% 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> </div>
</div> </div>
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<div class="col-md-5"> <div class="card">
<div class="row"> <div class="body">
<div class="col-md-12"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
<table class="table table-striped" id='stock_item'> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
<tr> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
<!--<th>#</th>--> consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
<th>Product</th> cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
<th>Balance</th> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<th></th>
</tr>
</table>
</div> </div>
</div> </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> <script>
$(document).ready(function () {
$('#product_sku').select2({
allowClear: true,
placeholder: 'Select Product'
})
});
var count = 0; var count = 0;
@@ -92,8 +102,8 @@
//+ '<td>' + count + '</td>' //+ '<td>' + count + '</td>'
+ '<td><input type=hidden value="' + product_sku + '" id="item_sku_' + count + '" name=' + count + '/>' + '<td><input type=hidden value="' + product_sku + '" id="item_sku_' + count + '" name=' + count + '/>'
+ product_name + '</td>' + product_name + '</td>'
+ '<td><input type=text value="' + product_qty + '" id="item_qty_' + count + '" name=' + 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" id="item_remove_' + count + '" name=' + count + ' onclick="remove_row('+ 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>'; + '</tr>';
$('#stock_item').append(tr); $('#stock_item').append(tr);
// $('#product_sku').val(''); // $('#product_sku').val('');
@@ -124,10 +134,6 @@
}) })
}); });
$('#back').on('click', function () {
window.location.href = '/inventory';
});
function remove_row(row) { function remove_row(row) {
$("#item_remove_"+row).parent().parent().remove(); $("#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"> <div class="row">
<input type='hidden' id='stock_check_id' value='<%= @check.id %>'/> <div class="col-xs-12 col-sm-12 col-md-10 col-lg-10">
<div class="col-md-10"> <div class="card">
<div class="row"> <input type='hidden' id='stock_check_id' value='<%= @check.id %>'/>
<div class="col-md-2"> <div class="p-l-20 p-t-15">
Check by <div class="row">
</div> <div class="col-md-2">
<div class="col-md-8"> Check by
<%= Employee.find(@check.check_by).name rescue '' %> </div>
</div> <div class="col-md-8">
</div> <%= Employee.find(@check.check_by).name rescue '' %>
<div class="row"> </div>
<div class="col-md-2"> </div>
Check At <div class="row">
</div> <div class="col-md-2">
<div class="col-md-8"> Check At
<%= @check.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %></div> </div>
</div> <div class="col-md-8">
<div class="row"> <%= @check.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %>
<div class="col-md-2"> </div>
Reason </div>
</div> <div class="row">
<div class="col-md-8"> <div class="col-md-2">
<%= @check.reason %> Reason
</div> </div>
</div> <div class="col-md-8">
<br> <%= @check.reason %>
<div class="row"> </div>
<table class="table table-striped col-md-12"> </div>
<tr> </div>
<th>#</th> <br>
<th>Product</th> <div class="table-responsive">
<th>Stock Count</th> <table class="table table-striped col-md-12">
<th>Stock Balance</th> <tr>
<th>Different</th> <th>#</th>
<th>Remark</th> <th>Product</th>
</tr> <th>Stock Count</th>
<% <th>Stock Balance</th>
count = 0 <th>Different</th>
@check.stock_check_items.each do |item| <th>Remark</th>
count += 1 </tr>
%> <%
<tr> count = 0
<td><%= count %></td> @check.stock_check_items.each do |item|
<td> count += 1
<% menu_item = MenuItemInstance.find_by_item_instance_code(item.item_code)%> %>
<% if menu_item.nil? %> <tr>
<%= Product.find_by_item_code(item.item_code).name rescue "-" %> <td><%= count %></td>
<% else %> <td>
<%= menu_item.menu_item.name rescue "-" %> <% menu_item = MenuItemInstance.find_by_item_instance_code(item.item_code)%>
- <%= menu_item.item_instance_name rescue "-" %> <% if menu_item.nil? %>
<% end %> <%= Product.find_by_item_code(item.item_code).name rescue "-" %>
</td> <% else %>
<td><%= item.stock_count %></td> <%= menu_item.menu_item.name rescue "-" %>
<td><%= item.stock_balance %></td> - <%= menu_item.item_instance_name rescue "-" %>
<td><%= item.different %></td> <% end %>
<td><%= item.remark %></td> </td>
</tr> <td><%= item.stock_count %></td>
<% end %> <td><%= item.stock_balance %></td>
</table> <td><%= item.different %></td>
<td><%= item.remark %></td>
</tr>
<% end %>
</table>
</div>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="col-xs-12 col-sm-12 col-md-2 col-lg-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> <div class="body">
<button id="print" type="button" class="btn btn-block btn-primary"> Print</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>
</div> </div>
</div> </div>
<script> <script>
$('#save_to_journal').on('click', function () { $('#save_to_journal').on('click', function () {

View File

@@ -1,41 +1,50 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %> <%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
<% if period_type != false %> <% if period_type != false %>
<div class="row"> <div class="row">
<div class="col-lg-2 col-md-2 col-sm-2"> <!-- <div class="col-lg-2 col-md-2 col-sm-2">
<label class="">Select Date Range</label> <label class="">Select Date Range</label>
<% if @daterange %> <% if @daterange %>
<input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true"> <input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true">
<% else %> <% else %>
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true"> <input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
<% end %> <% end %>
</div> -->
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14">From</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14">To</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">Commissioner</label>
<select class="form-control" name="commissioner" id="commissioner">
<option value=""></option>
<% @commissioner.each do |c| %>
<% if @com_id == c.id %>
<option value="<%= c.id %>" selected><%= c.name %></option>
<% else %>
<option value="<%= c.id %>"><%= c.name %></option>
<% end %> %>
<% end %>
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<br>
<input type="submit" value="Generate Report" class='btn btn-info wave-effects'>
</div>
<!-- <div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
</div> -->
</div> </div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="">Commissioner</label>
<select class="form-control" name="commissioner" id="commissioner">
<option value=""></option>
<% @commissioner.each do |c| %>
<% if @com_id == c.id %>
<option value="<%= c.id %>" selected><%= c.name %></option>
<% else %>
<option value="<%= c.id %>"><%= c.name %></option>
<% end %> %>
<% end %>
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
</div>
</div>
<% end %> <% end %>
<% end %> <% end %>
</div>
<script type="text/javascript"> <!-- <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
@@ -80,3 +89,4 @@
}); });
</script> </script>
-->

View File

@@ -18,7 +18,7 @@
<!-- <div class="container"> --> <!-- <div class="container"> -->
<!-- <div class="row"> --> <!-- <div class="row"> -->
<div class="text-right"> <div class="text-right">
<a href="javascript:export_to('<%= reports_commission_index_path %>.xls')" class="btn btn-default">Export to <a href="javascript:export_to('<%= reports_commission_index_path %>.xls')" class="btn btn-info wave-effects">Export to
Excel</a> Excel</a>
</div> </div>
<!-- </div> --> <!-- </div> -->
@@ -30,7 +30,7 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %></th> <th colspan="9"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %></th>
</tr> </tr>
<tr> <tr>
<th>Sale</th> <th>Sale</th>

View File

@@ -1,45 +1,46 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="form-group col-md-2">
<label class="font-20">Select Period</label>
<select name="period" id="sel_period" class="form-control">
<option value="">Select Period</option>
<option value="0">Today</option>
<option value="1">Yesterday</option>
<option value="2">This week</option>
<option value="3">Last week</option>
<option value="4">Last 7 days</option>
<option value="5">This month</option>
<option value="6">Last month</option>
<option value="7">Last 30 days</option>
<option value="8">This year</option>
<option value="9">Last year</option>
</select>
</div>
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <div class="form-group col-md-2">
<% if period_type != false %> <!-- <label class="">Select Shift Period</label> -->
<div class="row"> <label class="font-20">From</label>
<div class="form-group col-md-2"> <input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
<label>Select Period</label> </div>
<select name="period" id="sel_period" class="form-control"> <div class="form-group col-md-2">
<option value="">Select Period</option> <label class="font-20">To</label>
<option value="0">Today</option> <input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
<option value="1">Yesterday</option> </div>
<option value="2">This week</option> <div class="form-group col-md-3">
<option value="3">Last week</option> <label class="font-20">All Shift</label>
<option value="4">Last 7 days</option> <select class="form-control select" name="shift_name" id="shift_name" >
<option value="5">This month</option> </select>
<option value="6">Last month</option> </div>
<option value="7">Last 30 days</option> <div class="form-group col-md-1 ">
<option value="8">This year</option> <br>
<option value="9">Last year</option> <input type="submit" value="Generate Report" class='btn btn-primary'>
</select> </div>
</div> </div>
<% end %>
<div class="form-group col-md-2">
<!-- <label class="">Select Shift Period</label> -->
<label class="">From</label>
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="form-group col-md-2">
<label class="">To</label>
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="form-group col-md-3">
<label class="">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="form-group col-md-1 margin-top-20">
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
<% end %> <% end %>
</div>
<% end %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){

View File

@@ -1,10 +1,12 @@
<div class="page-header"> <div class="page-header">
<ul class="breadcrumb"> <ol class="breadcrumb">
<li><a href="<%= dashboard_path %>">Home</a></li> <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li>Credit Payment List Report</li> <li class="breadcrumb-item active">Credit Payment Report</li>
</ul> <span class="float-right">
<%= link_to 'Back', dashboard_path %>
</span>
</ol>
</div> </div>
<!-- <div class="container"> --> <!-- <div class="container"> -->
<%= render :partial=>'shift_sale_report_filter', <%= render :partial=>'shift_sale_report_filter',
:locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %> :locals=>{ :period_type => true, :shift_name => true, :report_path =>reports_credit_payment_index_path} %>
@@ -14,7 +16,7 @@
<!-- <div class="container"> --> <!-- <div class="container"> -->
<!-- <div class="row"> --> <!-- <div class="row"> -->
<div class="text-right"> <div class="text-right">
<a href="javascript:export_to('<%=reports_credit_payment_index_path%>.xls')" class = "btn btn-default">Export to Excel</a> <a href="javascript:export_to('<%=reports_credit_payment_index_path%>.xls')" class = "btn btn-info wave-effects">Export to Excel</a>
</div> </div>
<!-- </div> --> <!-- </div> -->
<!-- </div> --> <!-- </div> -->
@@ -32,7 +34,7 @@
<% end %> <% end %>
<tr> <tr>
<th> Shift Name </th> <th> Shift Name </th>
<th> Receive No</th> <th> Receipt No</th>
<th> Cashier Name</th> <th> Cashier Name</th>
<th> Customer Name</th> <th> Customer Name</th>
<th> Credit Amount </th> <th> Credit Amount </th>

View File

@@ -1,9 +1,10 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %> <% if period_type != false %>
<div class="row"> <div class="row">
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="col-lg-2 col-md-2 col-sm-2">
<label>Select Period</label> <label class="font-14">Select Period</label>
<select name="period" id="sel_period" class="form-control"> <select name="period" id="sel_period" class="form-control">
<option value="">Select Period</option> <option value="">Select Period</option>
<option value="0">Today</option> <option value="0">Today</option>
@@ -22,14 +23,15 @@
<div class="col-lg-3 col-md-3 col-sm-3"> <div class="col-lg-3 col-md-3 col-sm-3">
<!-- <label class="">Select Shift Period</label> --> <!-- <label class="">Select Shift Period</label> -->
<label class="">From</label> <label class="font-14">From</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date"> <input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
</div> </div>
<div class="col-lg-3 col-md-3 col-sm-3"> <div class="col-lg-3 col-md-3 col-sm-3">
<label class="">To</label> <label class="font-14">To</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date"> <input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div> </div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20"> <div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<label></label><br>
<input type="submit" value="Generate Report" class='btn btn-primary'> <input type="submit" value="Generate Report" class='btn btn-primary'>
</div> </div>
</div> </div>
@@ -85,6 +87,7 @@
</div> </div>
<% end %> <% end %>
</div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){

View File

@@ -1,33 +1,22 @@
<div class="page-header"> <div class="page-header">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li> <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
<li class="breadcrumb-item active">Daily Sale Report</li> <li class="breadcrumb-item active">Daily Sale Report</li>
<span class="float-right"> <span class="float-right">
<%= link_to 'Back', dashboard_path %> <%= link_to 'Back', dashboard_path %>
</span> </span>
</ol> </ol>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12 col-lg-12 col-sm-12 ">
<!-- <div class="row"> <%= render :partial=>'shift_sale_report_filter',
<div class="col-md-12 col-lg-12"> --> :locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %>
<!-- <div class="container"> --> <hr />
<%= render :partial=>'shift_sale_report_filter', <div class=" text-right">
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_dailysale_index_path} %> <a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-info wave-effects">Export to Excel</a>
<hr /> </div>
<!-- </div> -->
<!-- </div>
</div> -->
<!-- <div class="row"> -->
<!-- <div class="container"> -->
<div class=" text-right">
<a href="javascript:export_to('<%=reports_dailysale_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
</div>
<!-- </div> -->
<!-- </div> -->
<div class="row"> <div class="row">
<div class="col-md-12 col-lg-12"> <div class="col-md-12 col-lg-12">

View File

@@ -1,50 +1,52 @@
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <div class="p-l-15">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %> <% if period_type != false %>
<div class="row"> <div class="row">
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="col-lg-2 col-md-2 col-sm-2">
<label>Select Period</label> <label class="font-14">Select Period</label>
<select name="period" id="sel_period" class="form-control"> <select name="period" id="sel_period" class="form-control">
<option value="">Select Period</option> <option value="">Select Period</option>
<option value="0">Today</option> <option value="0">Today</option>
<option value="1">Yesterday</option> <option value="1">Yesterday</option>
<option value="2">This week</option> <option value="2">This week</option>
<option value="3">Last week</option> <option value="3">Last week</option>
<option value="4">Last 7 days</option> <option value="4">Last 7 days</option>
<option value="5">This month</option> <option value="5">This month</option>
<option value="6">Last month</option> <option value="6">Last month</option>
<option value="7">Last 30 days</option> <option value="7">Last 30 days</option>
<option value="8">This year</option> <option value="8">This year</option>
<option value="9">Last year</option> <option value="9">Last year</option>
</select> </select>
</div>
<% if defined? payments %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label>Select Payments</label>
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<!-- <label class="">Select Shift Period</label> -->
<label class="">From</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="">To</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div> </div>
<% if defined? payments %>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">Select Payments</label>
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
</div>
<% end %>
<div class="col-lg-2 col-md-2 col-sm-2">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14">From</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">To</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
<% end %> <% end %>
<% end %> <% end %>
</div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){

View File

@@ -19,7 +19,7 @@
<!-- <div class="container"> --> <!-- <div class="container"> -->
<!-- <div class="row"> --> <!-- <div class="row"> -->
<div class="text-right"> <div class="text-right">
<a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-default">Export to Excel</a> <a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-info wave-effects">Export to Excel</a>
</div> </div>
<!-- </div> --> <!-- </div> -->
<!-- </div> --> <!-- </div> -->
@@ -30,14 +30,14 @@
<thead> <thead>
<tr> <tr>
<th colspan="7"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th> <th colspan="9"> From Date : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - To Date : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
</tr> </tr>
<% if @shift_from %> <% if @shift_from %>
<tr> <tr>
<% if @shift_data.employee %> <% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %> <% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %> <% end %>
<th colspan="7">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th> <th colspan="9">Shift Name = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr> </tr>
<% end %> <% end %>

View File

@@ -1,130 +1,120 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">Select Period</label>
<select name="period" id="sel_period" class="form-control">
<option value="">Select Period</option>
<option value="0">Today</option>
<option value="1">Yesterday</option>
<option value="2">This week</option>
<option value="3">Last week</option>
<option value="4">Last 7 days</option>
<option value="5">This month</option>
<option value="6">Last month</option>
<option value="7">Last 30 days</option>
<option value="8">This year</option>
<option value="9">Last year</option>
</select>
</div>
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- <label class="">Select Shift Period</label> -->
<label class="font-14">From</label>
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14">To</label>
<input data-behaviour='datepicker' class="form-control m-t-3 datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
<% end %>
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <% end %>
<% if period_type != false %> </div>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label>Select Period</label>
<select name="period" id="sel_period" class="form-control">
<option value="">Select Period</option>
<option value="0">Today</option>
<option value="1">Yesterday</option>
<option value="2">This week</option>
<option value="3">Last week</option>
<option value="4">Last 7 days</option>
<option value="5">This month</option>
<option value="6">Last month</option>
<option value="7">Last 30 days</option>
<option value="8">This year</option>
<option value="9">Last year</option>
</select>
</div>
<!-- <input type="hidden" name="report_type" value="sale_item" id="sel_sale_type"> -->
<!-- <div class="form-group col-md-2">
<label>Select Type</label>
<select name="sale_type" id="sel_sale_type" class="form-control">
<option value="0">All Sale Type</option>
<option value="1">Revenue Only</option>
<option value="2">Discount Only</option>
<option value="3">Void Only</option>
<option value="4">Taxes Only</option>
<option value="5">Other Amount Only</option>
</select>
</div> -->
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- <label class="">Select Shift Period</label> -->
<label class="">From</label>
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="">To</label>
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
<% end %>
<% end %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();
$('#custom_excel').click(function(){ $('#custom_excel').click(function(){
var url = $('#custom_excel').attr('data-url'); var url = $('#custom_excel').attr('data-url');
$('#frm_report').attr('action',url) $('#frm_report').attr('action',url)
$('#frm_report').submit(); $('#frm_report').submit();
// window.location = url; // window.location = url;
}); });
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'order'){ if(item == 'order'){
$('#cashier').hide(); $('#cashier').hide();
$('#waiter').show(); $('#waiter').show();
if(payment_type){ if(payment_type){
$('#payment_type').hide(); $('#payment_type').hide();
}
} }
} else if(item == 'sale'){
else if(item == 'sale'){ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); }
} else{
else{ $('#waiter').hide();
$('#waiter').hide(); $('#cashier').show();
$('#cashier').show(); $("#item").val('sale');
$("#item").val('sale'); }
} });
});
<% if params[:shift_name].to_i > 0%> <% if params[:shift_name].to_i > 0%>
shift_id = '<%= params[:shift_name] %>' shift_id = '<%= params[:shift_name] %>'
local_date = '<%= @shift_from %> - <%= @shift_to %> ' local_date = '<%= @shift_from %> - <%= @shift_to %> '
var shift = $('#shift_name'); var shift = $('#shift_name');
str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>'; str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
shift.append(str); shift.append(str);
<% end %> <% end %>
$("#from").val("<%=params[:from] rescue '-'%>"); $("#from").val("<%=params[:from] rescue '-'%>");
$("#to").val("<%=params[:to] rescue '-'%>"); $("#to").val("<%=params[:to] rescue '-'%>");
$("#sel_period").val(<%=params[:period] rescue '-'%>); $("#sel_period").val(<%=params[:period] rescue '-'%>);
$("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>); $("#sel_sale_type").val(<%=params[:sale_type] rescue '-'%>);
<% if params[:period_type] == 1 || params[:period_type] == "1" %> <% if params[:period_type] == 1 || params[:period_type] == "1" %>
$("#rd_period_type_1").attr("checked","checked"); $("#rd_period_type_1").attr("checked","checked");
<% else %> <% else %>
$("#rd_period_type_0").attr("checked","checked"); $("#rd_period_type_0").attr("checked","checked");
<% end %> <% end %>
$(".btn-group button").removeClass("active"); $(".btn-group button").removeClass("active");
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %> <% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
$("#btn_report_type_<%= report_type %>").addClass("active"); $("#btn_report_type_<%= report_type %>").addClass("active");
$('#item').change(function(){ $('#item').change(function(){
var item = $('#item').val(); var item = $('#item').val();
var payment_type = $('#payment_type'); var payment_type = $('#payment_type');
if(item == 'sale'){ if(item == 'sale'){
$('#waiter').hide(); $('#waiter').hide();
$('#cashier').show(); $('#cashier').show();
if(payment_type){ if(payment_type){
$('#payment_type').show(); $('#payment_type').show();
}
} }
} else{
else{ $('#cashier').hide();
$('#cashier').hide(); $('#waiter').show();
$('#waiter').show(); if(payment_type){
if(payment_type){ $('#payment_type').hide();
$('#payment_type').hide(); }
} }
} });
});
</script> </script>

View File

@@ -20,7 +20,7 @@
<!-- <div class="container"> --> <!-- <div class="container"> -->
<!-- <div class="row"> --> <!-- <div class="row"> -->
<div class="text-right"> <div class="text-right">
<a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-default">Export to Excel</a> <a href="javascript:export_to('<%=reports_saleitem_index_path%>.xls')" class = "btn btn-info wave-effects ">Export to Excel</a>
</div> </div>
<!-- </div> --> <!-- </div> -->
<!-- </div> --> <!-- </div> -->

View File

@@ -1,44 +1,44 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="font-14">Select Period</label>
<select name="period" id="sel_period" class="form-control">
<option value="0">Today</option>
<option value="1">Yesterday</option>
<option value="2">This week</option>
<option value="3">Last week</option>
<option value="4">Last 7 days</option>
<option value="5">This month</option>
<option value="6">Last month</option>
<option value="7">Last 30 days</option>
<option value="8">This year</option>
<option value="9">Last year</option>
</select>
</div>
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <div class="col-lg-3 col-md-3 col-sm-3">
<% if period_type != false %> <!-- <label class="font-14">Select Shift Period</label> -->
<div class="row"> <label class="font-14">From</label>
<div class="col-lg-2 col-md-2 col-sm-2"> <input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
<label>Select Period</label> </div>
<select name="period" id="sel_period" class="form-control"> <div class="col-lg-3 col-md-3 col-sm-3">
<option value="0">Today</option> <label class="font-14">To</label>
<option value="1">Yesterday</option> <input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
<option value="2">This week</option> </div>
<option value="3">Last week</option> <div class="col-lg-2 col-md-2 col-sm-2">
<option value="4">Last 7 days</option> <label class="font-14">All Shift</label>
<option value="5">This month</option> <select class="form-control select" name="shift_name" id="shift_name" >
<option value="6">Last month</option> </select>
<option value="7">Last 30 days</option> </div>
<option value="8">This year</option> <div class="col-lg-2 col-md-2 col-sm-2 margin-top-20"><br>
<option value="9">Last year</option> <input type="submit" value="Generate Report" class='btn btn-primary'>
</select> </div>
</div> </div>
<% end %>
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- <label class="">Select Shift Period</label> -->
<label class="">From</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="">To</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<label class="">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" >
</select>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 margin-top-20"><br>
<input type="submit" value="Generate Report" class='btn btn-primary'>
</div>
</div>
<% end %> <% end %>
</div>
<% end %>
<script type="text/javascript"> <script type="text/javascript">

View File

@@ -19,7 +19,7 @@
<!-- <div class="container"> --> <!-- <div class="container"> -->
<!-- <div class="row"> --> <!-- <div class="row"> -->
<div class="text-right"> <div class="text-right">
<a href="javascript:export_to('<%=reports_shiftsale_index_path%>.xls')" class = "btn btn-default">Export to Excel</a> <a href="javascript:export_to('<%=reports_shiftsale_index_path%>.xls')" class = "btn btn-info wave-effects">Export to Excel</a>
</div> </div>
<!-- </div> --> <!-- </div> -->
<!-- </div> --> <!-- </div> -->

View File

@@ -1,86 +1,95 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %> <%= form_tag report_path, :method => :get, :id => "frm_report", :class => "form" do %>
<% if period_type != false %> <% if period_type != false %>
<div class="row"> <div class="row">
<div class="form-group col-md-3"> <!-- <div class="form-group col-md-3">
<label class="">Select Date Range</label> <label class="">Select Date Range</label>
<% if @daterange %> <% if @daterange %>
<input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true"> <input class="form-control" name="daterange" id="daterange" value="<%= @daterange %>" type="text" placeholder="Date Range" readonly="true">
<% else %> <% else %>
<input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true"> <input class="form-control" name="daterange" id="daterange" type="text" placeholder="Date Range" readonly="true">
<% end %> <% end %>
</div> </div> -->
<div class="form-group col-md-4"> <div class="col-lg-3 col-md-3 col-sm-3">
<label class="">Definition Item</label> <!-- <label class="">Select Shift Period</label> -->
<label class="font-14">From</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<label class="font-14">To</label>
<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
</div>
<div class="form-group col-md-4">
<label class="font-14">Definition Item</label>
<select class="form-control" name="item_code" id="item_code"> <select class="form-control" name="item_code" id="item_code">
<option value="">Select Product</option> <option value="">Select Product</option>
<% @inventory_definitions.each do |id| %> <% @inventory_definitions.each do |id| %>
<option value="<%= id.item_code %>"> <option value="<%= id.item_code %>">
<% menu_item = MenuItemInstance.find_by_item_instance_code(id.item_code) %> <% menu_item = MenuItemInstance.find_by_item_instance_code(id.item_code) %>
<% if menu_item.nil? %> <% if menu_item.nil? %>
<%= Product.find_by_item_code(id.item_code).name rescue "-" %> <%= Product.find_by_item_code(id.item_code).name rescue "-" %>
<% else %> <% else %>
<%= menu_item.menu_item.name rescue '-' %> - <%= menu_item.item_instance_name rescue '-' %> <%= menu_item.menu_item.name rescue '-' %> - <%= menu_item.item_instance_name rescue '-' %>
<% end %> <% end %>
</option> </option>
<% end %> <% end %>
</select> </select>
</div> </div>
<div class="form-group col-md-2 margin-top-20"> <div class="form-group col-md-2 margin-top-20"><br>
<input type="submit" value="Generate Report" class='btn btn-primary'> <input type="submit" value="Generate Report" class='btn btn-primary'>
</div> </div>
<div class="form-group col-md-2 margin-top-20"> <!-- <div class="form-group col-md-2 margin-top-20">
<input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'> <input type="button" value="Clear Filter" id="clear_filter" class='btn btn-danger'>
</div> </div> -->
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
</div>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
$('#item_code').select2({ /* $('#item_code').select2({
placeholder: 'Select Product', placeholder: 'Select Product',
allowClear: true allowClear: true
}); });*/
$('#clear_filter').click(function () { // $('#clear_filter').click(function () {
$('#daterange').val(''); // $('#daterange').val('');
$('#item_code').val('').text(''); // $('#item_code').val('').text('');
}); // });
$('input[name="daterange"]').daterangepicker({ // $('input[name="daterange"]').daterangepicker({
autoUpdateInput: false, // autoUpdateInput: false,
ranges: { // ranges: {
'Today': [moment(), moment()], // 'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], // 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()], // 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()], // 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')], // 'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] // 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
}, // },
locale: { // locale: {
format: 'YYYY-MM-DD' // format: 'YYYY-MM-DD'
} // }
}, // },
function (start, end, label) { // function (start, end, label) {
$('input[name="daterange"]').val(start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD')); // $('input[name="daterange"]').val(start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD'));
}); // });
$('input[name="daterange"]').on('apply.daterangepicker', function (ev, picker) { // $('input[name="daterange"]').on('apply.daterangepicker', function (ev, picker) {
$('input[name="daterange"]').val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD')); // $('input[name="daterange"]').val(picker.startDate.format('YYYY-MM-DD') + ' - ' + picker.endDate.format('YYYY-MM-DD'));
from_date = picker.startDate.format('YYYY-MM-DD 00:00:00'); // from_date = picker.startDate.format('YYYY-MM-DD 00:00:00');
to_date = picker.endDate.format('YYYY-MM-DD 23:59:59'); // to_date = picker.endDate.format('YYYY-MM-DD 23:59:59');
}); // });
$('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) { // $('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) {
$('input[name="daterange"]').val(''); // $('input[name="daterange"]').val('');
}); // });
}); });

View File

@@ -19,7 +19,7 @@
<!-- <div class="container"> --> <!-- <div class="container"> -->
<!-- <div class="row"> --> <!-- <div class="row"> -->
<div class="text-right"> <div class="text-right">
<a href="javascript:export_to('<%= reports_stock_check_index_path %>.xls')" class="btn btn-default">Export to <a href="javascript:export_to('<%= reports_stock_check_index_path %>.xls')" class="btn btn-info wave-effects">Export to
Excel</a> Excel</a>
</div> </div>
<!-- </div> --> <!-- </div> -->

View File

@@ -1,9 +1,9 @@
<div class="p-l-15">
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %> <%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
<% if period_type != false %> <% if period_type != false %>
<div class="row"> <div class="row">
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="form-group col-lg-2 col-md-2 col-sm-2">
<label>Select Period</label> <label class="font-20">Select Period</label>
<select name="period" id="sel_period" class="form-control"> <select name="period" id="sel_period" class="form-control">
<option value="">Select Period</option> <option value="">Select Period</option>
<option value="0">Today</option> <option value="0">Today</option>
@@ -19,27 +19,28 @@
</select> </select>
</div> </div>
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="form-group col-lg-2 col-md-2 col-sm-2">
<!-- <label class="">Select Shift Period</label> --> <!-- <label class="">Select Shift Period</label> -->
<label class="">From</label> <label class="font-20">From</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date"> <input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date">
</div> </div>
<div class="col-lg-2 col-md-2 col-sm-2"> <div class="form-group col-lg-2 col-md-2 col-sm-2">
<label class="">To</label> <label class="font-20">To</label>
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date"> <input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date">
</div> </div>
<div class="col-lg-3 col-md-3 col-sm-3"> <div class="form-group col-lg-3 col-md-3 col-sm-3">
<label class="">All Shift</label> <label class="font-20">All Shift</label>
<select class="form-control select" name="shift_name" id="shift_name" > <select class="form-control select" name="shift_name" id="shift_name" >
</select> </select>
</div> </div>
<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20"> <div class=" col-lg-1 col-md-1 col-sm-1 margin-top-20">
<br>
<input type="submit" value="Generate Report" class='btn btn-primary'> <input type="submit" value="Generate Report" class='btn btn-primary'>
</div> </div>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
</div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$('#custom_excel').hide(); $('#custom_excel').hide();

View File

@@ -36,7 +36,7 @@ en:
category: "Category" category: "Category"
processed: "Processed" processed: "Processed"
competed: "Completed" competed: "Completed"
tax_profile: "Tad Profile" tax_profile: "Tax Profile"
payment_methods: "Payment Methods" payment_methods: "Payment Methods"
accounts: "Accounts" accounts: "Accounts"