shop code
This commit is contained in:
@@ -14,14 +14,14 @@
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<%= f.input :adult, input_html: { value: @survey_data.adult, class: 'col-md-10', :onChange => "total_customer();", :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyAdult(this.value);" }%>
|
||||
<%= f.input :adult, input_html: { value: @survey_data.adult, class: 'col-md-10', :onChange => "total_customer();", :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyAdult(this.value);" }%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<%= f.input :male , input_html: { value: @survey_data.male, class: 'col-md-10', :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyMale(this.value);" }%>
|
||||
<%= f.input :male , input_html: { value: @survey_data.male, class: 'col-md-10', :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyMale(this.value);" }%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
@@ -29,7 +29,7 @@
|
||||
<%= f.input :female , input_html: { value: @survey_data.female, class: 'col-md-10', :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyFemale(this.value);" }%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= f.input :total_customer, input_html: { value:@survey_data.total_customer , :readonly => true, class: 'col-md-11'} %>
|
||||
<%= f.input :local , input_html: { value: @survey_data.local, class: 'col-md-11', :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyLocal(this.value);" }%>
|
||||
<!--<fieldset style="border: 1px solid #BDBDBD;padding: 20px; width: 92%;margin: 20px 0 20px 0;"> -->
|
||||
@@ -72,19 +72,19 @@
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<%= f.input :adult , input_html: { class: 'col-md-10' ,min:'1', :onChange => "total_customer();", :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyAdult(this.value);" }%>
|
||||
<%= f.input :adult , input_html: { class: 'col-md-10' ,min:'1', :onChange => "total_customer();", :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyAdult(this.value);" }%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<%= f.input :male , input_html: { min:'1',class: 'col-md-10' , :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyMale(this.value);" }%>
|
||||
<%= f.input :male , input_html: { min:'1',class: 'col-md-10' , :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyMale(this.value);" }%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<%= f.input :female , input_html: { min:'1',class: 'col-md-10' , :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyFemale(this.value);" }%>
|
||||
<%= f.input :female , input_html: { min:'1',class: 'col-md-10' , :onkeypress => "return isNumberKey(event);", :onkeyup => "surveyFemale(this.value);" }%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,7 +99,7 @@
|
||||
<label class="p-l-10">Foreigner</label>
|
||||
<!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
|
||||
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][]" style="height: " >
|
||||
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
|
||||
<% Lookup.where("lookup_type = ? and shop_code='#{@shop.shop_code}'", "country" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
@@ -116,12 +116,12 @@
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden" id="newTemplate" >
|
||||
</div>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%if !@dining_facility.nil? %>
|
||||
<input type="hidden" name="table_id" id="table_id" value="<%= @dining_facility.id %>">
|
||||
<input type="hidden" name="table_type" id="table_type" value="<%= @table_type %>">
|
||||
@@ -139,7 +139,7 @@
|
||||
<% else %>
|
||||
<input type="hidden" name="survey_id" />
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
|
||||
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
|
||||
@@ -204,11 +204,11 @@
|
||||
<div class="col-md-3 left cashier_number green" data-type="clr">CLR</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3 hidden">
|
||||
<div class="card">
|
||||
@@ -232,7 +232,7 @@
|
||||
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.account_txt") %> <br>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
|
||||
@@ -250,7 +250,7 @@
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
function surveyChild(val){
|
||||
var aa = parseInt(val);
|
||||
@@ -273,12 +273,12 @@
|
||||
if(isNaN(aa)) $("#survey_local").val("");
|
||||
}
|
||||
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function(){
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
|
||||
$('.foreignerDiv').removeClass("hidden");
|
||||
setHeaderBreadCrumb(_SURVEY_);
|
||||
<% if !@survey_data.nil? %>
|
||||
@@ -293,7 +293,7 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
+'<div class="form-group p-l-10 p-r-10">'
|
||||
+' <select class="form-control col-md-12 selectpicker show-tick" '
|
||||
+' name="survey[foreigner][]" style="height: " >'
|
||||
+'<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>'
|
||||
+'<% Lookup.where("lookup_type = ? and shop_code='#{@shop.shop_code}'", "country" ).each do |ct| %>'
|
||||
+'<option value="<%= ct.value %>">'
|
||||
+'<%= ct.name %></option>'
|
||||
+'<%end %>'
|
||||
@@ -321,7 +321,7 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
+'<div class="form-group p-l-10 p-r-10">'
|
||||
+' <select class="form-control col-md-12 selectpicker show-tick" '
|
||||
+' name="survey[foreigner][]" style="height: " >'
|
||||
+'<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>'
|
||||
+'<% Lookup.where("lookup_type = ? and shop_code='#{@shop.shop_code}'", "country" ).each do |ct| %>'
|
||||
+'<option value="<%= ct.value %>">'
|
||||
+'<%= ct.name %></option>'
|
||||
+'<%end %>'
|
||||
@@ -340,19 +340,19 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
$('#newTemplate').append(text_box);
|
||||
});
|
||||
|
||||
//click remove buttom
|
||||
//click remove buttom
|
||||
$('#newTemplate').on('click','#removeRow', function(){
|
||||
$(this).parent().parent().remove()
|
||||
});
|
||||
|
||||
$( "input" ).focusin(function() {
|
||||
$('.addfocus').removeClass('addfocus');
|
||||
$('.addfocus').removeClass('addfocus');
|
||||
$( this ).addClass('addfocus');
|
||||
});
|
||||
|
||||
$(".cashier_number").on('click', function(event){
|
||||
if(event.handled !== true) {
|
||||
|
||||
|
||||
var original_value='';
|
||||
original_value = $('.addfocus').val();
|
||||
|
||||
@@ -362,50 +362,50 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
case 'num':
|
||||
var input_value = $(this).attr("data-value");
|
||||
if (original_value == "0.0"){
|
||||
var value = $('.addfocus').val(input_value);
|
||||
var value = $('.addfocus').val(input_value);
|
||||
if ($("#survey_child").hasClass('addfocus')){
|
||||
var child = $("#survey_child").val()+value;
|
||||
var adult = $("#survey_adult").val() || 0;
|
||||
var result = parseInt(child) + parseInt(adult);
|
||||
$("#survey_total_customer").val(result);
|
||||
}
|
||||
}
|
||||
if ($("#survey_adult").hasClass('addfocus')){
|
||||
var adult = $("#survey_adult").val()+value;
|
||||
var child = $("#survey_child").val() || 0;
|
||||
var result = parseInt(child) + parseInt(adult);
|
||||
$("#survey_total_customer").val(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
var value = $('.addfocus').val(original_value + '' + input_value);
|
||||
var value = $('.addfocus').val(original_value + '' + input_value);
|
||||
if ($("#survey_child").hasClass('addfocus')){
|
||||
var child = $("#survey_child").val()+value;
|
||||
var adult = $("#survey_adult").val() || 0;
|
||||
var result = parseInt(child) + parseInt(adult);
|
||||
$("#survey_total_customer").val(result);
|
||||
}
|
||||
}
|
||||
if ($("#survey_adult").hasClass('addfocus')){
|
||||
var adult = $("#survey_adult").val()+value;
|
||||
var child = $("#survey_child").val() || 0;
|
||||
var result = parseInt(child) + parseInt(adult);
|
||||
$("#survey_total_customer").val(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value);
|
||||
$('.addfocus').val(amount);
|
||||
$('.addfocus').val(amount);
|
||||
break;
|
||||
|
||||
case 'del' :
|
||||
var discount_text=$('.addfocus').val();
|
||||
$('.addfocus').val(discount_text.substr(0,discount_text.length-1));
|
||||
$('.addfocus').val(discount_text.substr(0,discount_text.length-1));
|
||||
break;
|
||||
|
||||
case 'clr':
|
||||
$('.addfocus').val("");
|
||||
$('.addfocus').val("");
|
||||
if($("#survey_child").hasClass('addfocus')){
|
||||
$("#survey_child").val("");
|
||||
var adult = $("#survey_adult").val() || 0;
|
||||
@@ -416,7 +416,7 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
var child = $("#survey_child").val() || 0;
|
||||
var result = parseInt(child);
|
||||
$("#survey_total_customer").val(result);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
event.handled = true;
|
||||
@@ -470,10 +470,10 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
+'<div class="form-group p-l-10 p-r-10">'
|
||||
+' <select class="form-control col-md-12 selectpicker show-tick" '
|
||||
+' name="survey[foreigner][]" style="height: " >'
|
||||
+'<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>'
|
||||
+'<% Lookup.where("lookup_type = ? and shop_code='#{@shop.shop_code}'", "country" ).each do |ct| %>'
|
||||
// if (key.toString() == '<%= ct.value.to_s %>')
|
||||
// var selected = "selected";
|
||||
// else
|
||||
// var selected = "selected";
|
||||
// else
|
||||
// var selected = "";
|
||||
+'<option value="<%= ct.value %>">'
|
||||
+'<%= ct.name %></option>'
|
||||
@@ -498,8 +498,8 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
+' name="survey[foreigner][]" style="height: " >'
|
||||
+'<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>'
|
||||
// if (key.toString() == '<%= ct.value.to_s %>')
|
||||
// var selected = "selected";
|
||||
// else
|
||||
// var selected = "selected";
|
||||
// else
|
||||
// var selected = "";
|
||||
+'<option value="<%= ct.value %>">'
|
||||
+'<%= ct.name %></option>'
|
||||
@@ -517,7 +517,7 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
}
|
||||
|
||||
|
||||
$('#newTemplate').append(fgn_template);
|
||||
});
|
||||
}
|
||||
@@ -530,5 +530,5 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
$("#survey_total_customer").val(result);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user