merge with report
This commit is contained in:
@@ -18,6 +18,139 @@
|
||||
//= require cable
|
||||
//= 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
|
||||
|
||||
Reference in New Issue
Block a user