merge with report
This commit is contained in:
@@ -18,6 +18,139 @@
|
|||||||
//= require cable
|
//= require cable
|
||||||
//= require settings/processing_items
|
//= require settings/processing_items
|
||||||
|
|
||||||
|
$(document).on("focus", "[data-behaviour~='datepicker']", function(e){
|
||||||
|
$(this).datepicker({"format": "yyyy-M-dd", "weekStart": 1, "autoclose": true});
|
||||||
|
$('.dropdown-toggle').dropdown();
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ToDo Move to here from pages
|
||||||
|
*
|
||||||
|
*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$('#custom_excel').hide();
|
||||||
|
|
||||||
|
$('#custom_excel').click(function(){
|
||||||
|
var url = $('#custom_excel').attr('data-url');
|
||||||
|
$('#frm_report').attr('action',url)
|
||||||
|
$('#frm_report').submit();
|
||||||
|
// window.location = url;
|
||||||
|
});
|
||||||
|
|
||||||
|
var item = $('#item').val();
|
||||||
|
var payment_type = $('#payment_type');
|
||||||
|
|
||||||
|
if(item == 'order'){
|
||||||
|
$('#cashier').hide();
|
||||||
|
$('#waiter').show();
|
||||||
|
if(payment_type){
|
||||||
|
$('#payment_type').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(item == 'sale'){
|
||||||
|
$('#waiter').hide();
|
||||||
|
$('#cashier').show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#waiter').hide();
|
||||||
|
$('#cashier').show();
|
||||||
|
$("#item").val('sale');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//Reset the form to pervious values
|
||||||
|
$("#branch").val(<%=params[:branch]%>);
|
||||||
|
$("#waiter").val("<%=params[:waiter]%>");
|
||||||
|
$("#cashier").val(<%=params[:cashier]%>);
|
||||||
|
$("#product").val(<%=params[:product]%>);
|
||||||
|
$("#singer").val(<%=params[:singer]%>);
|
||||||
|
$("#item").val('<%=params[:item]%>');
|
||||||
|
$("#guest_role").val('<%=params[:guest_role]%>');
|
||||||
|
|
||||||
|
|
||||||
|
$("#from").val("<%=params[:from]%>");
|
||||||
|
$("#to").val("<%=params[:to]%>");
|
||||||
|
$("#sel_period").val(<%=params[:period]%>);
|
||||||
|
$("#sel_sale_type").val(<%=params[:sale_type]%>);
|
||||||
|
|
||||||
|
<% if params[:period_type] == 1 || params[:period_type] == "1" %>
|
||||||
|
$("#rd_period_type_1").attr("checked","checked");
|
||||||
|
<% else %>
|
||||||
|
$("#rd_period_type_0").attr("checked","checked");
|
||||||
|
<% end %>
|
||||||
|
$(".btn-group button").removeClass("active");
|
||||||
|
<% report_type = params[:report_type].blank? ? "0" : params[:report_type] %>
|
||||||
|
$("#btn_report_type_<%= report_type %>").addClass("active");
|
||||||
|
|
||||||
|
$('#item').change(function(){
|
||||||
|
var item = $('#item').val();
|
||||||
|
var payment_type = $('#payment_type');
|
||||||
|
|
||||||
|
if(item == 'sale'){
|
||||||
|
$('#waiter').hide();
|
||||||
|
$('#cashier').show();
|
||||||
|
if(payment_type){
|
||||||
|
$('#payment_type').show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#cashier').hide();
|
||||||
|
$('#waiter').show();
|
||||||
|
if(payment_type){
|
||||||
|
$('#payment_type').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
var check_arr = [];
|
||||||
|
var search = '<%= params[:period_type] %>';
|
||||||
|
if(search){
|
||||||
|
if(parseInt(search) == 0){
|
||||||
|
search_by_period();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
search_by_date();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
search_by_period();
|
||||||
|
}
|
||||||
|
$('#sel_period').change(function(){
|
||||||
|
search_by_period();
|
||||||
|
});
|
||||||
|
function search_by_period(){
|
||||||
|
var period = $('#sel_period').val();
|
||||||
|
var period_type = 0;
|
||||||
|
var from = "";
|
||||||
|
var to = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#from').change(function(){
|
||||||
|
search_by_date();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#to').change(function(){
|
||||||
|
search_by_date();
|
||||||
|
});
|
||||||
|
function search_by_date(){
|
||||||
|
var from = $('#from').val();
|
||||||
|
var to = $('#to').val();
|
||||||
|
var period = 0;
|
||||||
|
var period_type = 1;
|
||||||
|
if(to != '' && from != ''){
|
||||||
|
shift_name = from + ',' + to;
|
||||||
|
check_arr.push(to);
|
||||||
|
// console.log(check_arr.length)
|
||||||
|
if(check_arr.length == 1){
|
||||||
|
}
|
||||||
|
if(check_arr.length == 3){
|
||||||
|
check_arr = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
*/
|
||||||
|
>>>>>>> d54fd19d1c18384ee6b21c43ca51587fb7fa843f
|
||||||
|
|||||||
@@ -58,3 +58,19 @@ ul.dropdown-menu li a{
|
|||||||
/*----- Header Bar -----*/
|
/*----- Header Bar -----*/
|
||||||
|
|
||||||
/*----- Header Bar -----*/
|
/*----- Header Bar -----*/
|
||||||
|
|
||||||
|
/*----- Layout ------ */
|
||||||
|
|
||||||
|
.margin-top-20 {
|
||||||
|
margin: 20px 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----- Layout ------ */
|
||||||
|
|
||||||
|
/*--- Reset --- */
|
||||||
|
|
||||||
|
select.form-control {
|
||||||
|
height: inherit !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*--- Reset --- */
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
<%= form_tag report_path, :method => :get, :id=>"frm_report" do %>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12"></div>
|
<div class="col-md-12">
|
||||||
<div class="span3">
|
<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
|
||||||
<% if defined? product_account %>
|
|
||||||
<%= select_tag "account", options_from_collection_for_select(@accounts,"id","title", :selected => params[:account])%>
|
|
||||||
<% end %>
|
|
||||||
<% if defined? shift_product_account %>
|
|
||||||
<%= select_tag "account", options_from_collection_for_select(@accounts,"id","title", :selected => params[:account]), :prompt => 'All Group'%>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="span3">
|
|
||||||
<% if period_type != false %>
|
<% if period_type != false %>
|
||||||
<label class="radio inline top-valign">
|
<div class="row">
|
||||||
<input type="radio" id="rd_period_type_0" name="period_type" value="0" checked></input>
|
<div class="form-group col-md-2">
|
||||||
</label>
|
<label>Select Period</label>
|
||||||
<select name="period" id="sel_period">
|
<select name="period" id="sel_period" class="form-control">
|
||||||
<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>
|
||||||
@@ -27,46 +17,10 @@
|
|||||||
<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>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group col-md-2">
|
||||||
<div class="span3">
|
<label>Select Type</label>
|
||||||
<div class="btn-group">
|
<select name="sale_type" id="sel_sale_type" class="form-control">
|
||||||
<a href="javascript:export_to('<%=report_path%>.xls')" class = "btn" >Export to Excel</a>
|
|
||||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
|
||||||
<span class="caret"></span>
|
|
||||||
</button>
|
|
||||||
<!-- <ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a href="javascript:export_to('<%=report_path%>.pdf')" class = "btn" >Export to Pdf</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
-->
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
<!-- <div class="span3">
|
|
||||||
<% url = url_for(:format => 'xls')%>
|
|
||||||
<div class="btn-group">
|
|
||||||
<div id="default_excel">
|
|
||||||
<a href="javascript:export_to('<%=report_path%>.xls')" class = "btn" >Export to Excel</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="custom_excel" data-url="<%= url %>">
|
|
||||||
<a href="#" class="btn">Export to Excel</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="span3">
|
|
||||||
<% if defined? show_sale_type %>
|
|
||||||
<select name="sale_type" id="sel_sale_type">
|
|
||||||
<option value="0">All Sale Type</option>
|
<option value="0">All Sale Type</option>
|
||||||
<option value="1">Revenue Only</option>
|
<option value="1">Revenue Only</option>
|
||||||
<option value="2">Discount Only</option>
|
<option value="2">Discount Only</option>
|
||||||
@@ -74,83 +28,94 @@
|
|||||||
<option value="4">Taxes Only</option>
|
<option value="4">Taxes Only</option>
|
||||||
<option value="5">Other Amount Only</option>
|
<option value="5">Other Amount Only</option>
|
||||||
</select>
|
</select>
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? promotions %>
|
|
||||||
<%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]) %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? menu_types %>
|
|
||||||
<%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]) %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? payments %>
|
|
||||||
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]) %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? shift_name %>
|
|
||||||
<select name="shift_name" id="shift_name">
|
|
||||||
</select>
|
|
||||||
<% end %>
|
|
||||||
<% if defined? cashiers %>
|
|
||||||
<%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? singer %>
|
|
||||||
<%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? bsm %>
|
|
||||||
<%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? guest_role %>
|
|
||||||
<%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List" %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? list_by_payment_type %> <!-- for report detail by credit and foc -->
|
|
||||||
<%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]) %>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% if defined? products %>
|
|
||||||
<%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products" %>
|
|
||||||
<% end %>
|
|
||||||
<% if defined? items %>
|
|
||||||
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]) %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group col-md-3">
|
||||||
<div class="span3">
|
<!-- <label class="">Select Shift Period</label> -->
|
||||||
|
<label class="">From</label>
|
||||||
<label class="radio inline top-valign">
|
<input data-behaviour='datepicker' class="form-control" name="from" id="from" type="text" placeholder="From date">
|
||||||
<input type="radio" id="rd_period_type_1" name="period_type" value="1">
|
|
||||||
<div class="input-prepend margin-left-3">
|
|
||||||
<span class="add-on">From</span>
|
|
||||||
<input data-behaviour='datepicker' class="span2" name="from" id="from" type="text" placeholder="From date">
|
|
||||||
</div>
|
</div>
|
||||||
</label>
|
<div class="form-group col-md-3">
|
||||||
<div class="input-prepend margin-left-23">
|
<label class="">To</label>
|
||||||
<span class="add-on">To    </span>
|
<input data-behaviour='datepicker' class="form-control" name="to" id="to" type="text" placeholder="To date">
|
||||||
<input data-behaviour='datepicker' class="span2" name="to" id="to" type="text" placeholder="To date">
|
</div>
|
||||||
|
<div class="form-group col-md-2 margin-top-20">
|
||||||
|
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<!-- <div class="row">
|
||||||
<% if defined? show_monthly %>
|
<% if defined? show_monthly %>
|
||||||
<div class="span3" style="margin-bottom:10px;">
|
<div class="span3" style="margin-bottom:10px;">
|
||||||
<input type="hidden" id="report_type" name="report_type" value="0">
|
<input type="hidden" id="report_type" name="report_type" value="0">
|
||||||
<div class="btn-group" data-toggle="buttons-radio">
|
<div class="btn-group" data-toggle="buttons-radio">
|
||||||
<!-- <button id="btn_report_type_0" onclick="$('#report_type').val(0)" type="button" class="btn btn-inverse active">Daily</button> -->
|
|
||||||
<button id="btn_report_type_1" onclick="$('#report_type').val(1)" type="button" class="btn btn-inverse">Monthly</button>
|
<button id="btn_report_type_1" onclick="$('#report_type').val(1)" type="button" class="btn btn-inverse">Monthly</button>
|
||||||
<button id="btn_report_type_2" onclick="$('#report_type').val(2)" type="button" class="btn btn-inverse">Yearly</button>
|
<button id="btn_report_type_2" onclick="$('#report_type').val(2)" type="button" class="btn btn-inverse">Yearly</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
<div class="span3">
|
<div class="row">
|
||||||
|
<div class="form-group">
|
||||||
|
<% if defined? promotions %>
|
||||||
|
<%= select_tag "promotion", options_for_select(@promotions, :selected => params[:promotion_type]), :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? menu_types %>
|
||||||
|
<%= select_tag "menu_type", options_for_select(@menu_types, :selected => params[:menu_type]), :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? payments %>
|
||||||
|
<%= select_tag "payment_type", options_for_select(@payments, :selected => params[:payment_type]), :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? shift_name %>
|
||||||
|
<!-- Temporary no needs
|
||||||
|
<select name="shift_name" id="shift_name"></select>
|
||||||
|
-->
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? cashiers %>
|
||||||
|
<%= select_tag "cashier", options_from_collection_for_select(@cashiers,"id","name"),:prompt => "All Cashier Stations", :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? singer %>
|
||||||
|
<%= select_tag "singer", options_from_collection_for_select(singer,"id","name"),:prompt => "All Vocal List", :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? bsm %>
|
||||||
|
<%= select_tag "singer", options_from_collection_for_select(bsm,"id","name"),:prompt => "All BSM List", :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? guest_role %>
|
||||||
|
<%= select_tag "guest_role", options_from_collection_for_select(@guest_role,"id","name"),:prompt => "Vocal/BSM List", :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? list_by_payment_type %> <!-- for report detail by credit and foc -->
|
||||||
|
<%= select_tag "payment_type_list", options_for_select(@payment_list, :selected => params[:payment_type_list]), :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? products %>
|
||||||
|
<%= select_tag "product", options_from_collection_for_select(@products,"id","name"),:prompt => "All Products", :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if defined? items %>
|
||||||
|
<%= select_tag "item", options_for_select(@items, :selected => params[:item_type]), :class => "form-control" %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
<input type="submit" value="Generate Report" class='btn btn-primary'>
|
||||||
</div>
|
</div>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<div class = "row">
|
<div class = "row">
|
||||||
|
|
||||||
@@ -167,7 +132,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|||||||
@@ -2,14 +2,25 @@
|
|||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="<%= %>">Home</a></li>
|
<li><a href="<%= %>">Home</a></li>
|
||||||
<li>Receipt List Report</li>
|
<li>Receipt List Report</li>
|
||||||
<span style="float: center">
|
|
||||||
<%= render :partial=>'shift_sale_report_filter',:locals=>{ :period_type => true,
|
|
||||||
:shift_name => true, :report_path => reports_receipt_no_index_path} %>
|
|
||||||
</span>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="container">
|
||||||
|
<%= render :partial=>'shift_sale_report_filter',
|
||||||
|
:locals=>{ :period_type => true, :shift_name => false, :report_path =>reports_receipt_no_index_path} %>
|
||||||
|
<hr />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 text-right">
|
||||||
|
<a href="javascript:export_to('<%=reports_receipt_no_index_path%>.xls')" class = "btn btn-default">Export to Excel</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container margin-top-20">
|
||||||
|
<div class="card row">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -43,8 +54,11 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= paginate @sale_data %>
|
<%= paginate @sale_data %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function(){
|
$(function(){
|
||||||
var check_arr = [];
|
var check_arr = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user