merge master
This commit is contained in:
@@ -405,9 +405,15 @@
|
||||
<p class="hidden" id="set_item_code"></p>
|
||||
<p></p>
|
||||
|
||||
<div class="options-list">
|
||||
<div class="" id="modal-slimscroll" data-height="250">
|
||||
<div class="options-list" style="margin-top:-5px">
|
||||
</div>
|
||||
|
||||
<div class='selected-set-list'>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="instance-list row"></div>
|
||||
@@ -585,5 +591,12 @@
|
||||
//end Ajax
|
||||
}
|
||||
//end show list function
|
||||
|
||||
/* check webview loaded*/
|
||||
var webview = '';
|
||||
<%if @webview %>
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
<% end %>
|
||||
});
|
||||
</script>
|
||||
@@ -274,6 +274,9 @@
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
var page = "<%= @page %>";
|
||||
$(function() {
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
/*$('.datepicker').datepicker({
|
||||
setDate: '12-12-1999',
|
||||
format : 'dd-mm-yyyy',
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="icon" >
|
||||
<i class="material-icons">arrow_forward</i>
|
||||
</div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_order %></div>
|
||||
<div class="text font-20 m-l-5" style="line-height: 80px;"><%= t :dine_in_cashier %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -257,6 +257,9 @@
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function(){
|
||||
setHeaderBreadCrumb(_DISCOUNTS_);
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$('#back').on('click',function(){
|
||||
var id = $("#table_id").text();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||
<div class="<%= @webview==true ? 'col-lg-12 col-md-12 col-sm-12' : 'col-lg-10 col-md-10 col-sm-10' %>">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs tab-col-teal" role="tablist">
|
||||
@@ -116,7 +116,7 @@
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<div class="<%= @webview==true ? 'hidden' : 'col-lg-2 col-md-2 col-sm-2' %>">
|
||||
<!-- <button id="refreshbutton" type="button" class="btn btn-block radius-btn"> Refresh off </button> -->
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
@@ -139,6 +139,8 @@
|
||||
<!-- Column One -->
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview,"index");
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
|
||||
@@ -604,6 +604,9 @@
|
||||
<script>
|
||||
var cashier_type = "cashier";
|
||||
$(document).ready(function () {
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
/* start check first bill or not*/
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
@@ -870,6 +873,8 @@
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click', function () {
|
||||
$("#first_bill").prop('disabled',true);
|
||||
$("#pay").prop('disabled',true);
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
@@ -886,6 +891,8 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
$("#first_bill").removeAttr('disabled');
|
||||
$("#pay").removeAttr('disabled');
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -253,6 +253,10 @@
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$(".tables").on('click', function(){
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
|
||||
@@ -212,6 +212,10 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
|
||||
$(document).ready(function(){
|
||||
setHeaderBreadCrumb(_OTHER_CHARGES_);
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$(".cashier_number").on('click', function(event){
|
||||
if(event.handled !== true) {
|
||||
var original_value=0;
|
||||
|
||||
@@ -542,6 +542,9 @@
|
||||
<script>
|
||||
var cashier_type = "cashier";
|
||||
$(document).ready(function(){
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
// $(".tables").on('click', function(){
|
||||
// var customer_id=$(".customer-id").text();
|
||||
// show_customer_details(customer_id);
|
||||
@@ -838,6 +841,8 @@ $('#back').on('click',function(){
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click',function(){
|
||||
$("#first_bill").prop('disabled',true);
|
||||
$("#pay").prop('disabled',true);
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
@@ -854,6 +859,8 @@ $('#add_invoice').on('click',function(){
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
$("#first_bill").removeAttr('disabled');
|
||||
$("#pay").removeAttr('disabled');
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -336,6 +336,10 @@
|
||||
var cashier_type = '<%= @cashier_type %>';
|
||||
$(document).ready(function(){
|
||||
setHeaderBreadCrumb(_SPLIT_BILL_);
|
||||
/* check webview loaded*/
|
||||
var webview = <%= @webview %>;
|
||||
showHideNavbar(webview);
|
||||
|
||||
$('#back').on('click',function(){
|
||||
backToOrigami();
|
||||
})
|
||||
|
||||
@@ -6,73 +6,122 @@
|
||||
<%= f.error_notification %>
|
||||
<div class="form-inputs p-l-10">
|
||||
<% if !@survey_data.nil? %>
|
||||
<%= f.input :child, input_html: { value: @survey_data.child, class: 'col-md-10' }%>
|
||||
<%= f.input :adult, input_html: { value: @survey_data.adult, class: 'col-md-10' }%>
|
||||
<%= f.input :male , input_html: { value: @survey_data.male, class: 'col-md-10' }%>
|
||||
<%= f.input :female , input_html: { value: @survey_data.female, class: 'col-md-10' }%>
|
||||
<%= f.input :total_customer, input_html: { value: @survey_data.total_customer, class: 'col-md-10'} %>
|
||||
<%= f.input :local , input_html: { value: @survey_data.local, class: 'col-md-10' }%>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<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| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
<%= f.input :child, input_html: { value: @survey_data.child, class: 'col-md-10' }%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Number</label>
|
||||
<input type="number" name="survey[foreigner][]" class="form-control">
|
||||
<%= f.input :adult, input_html: { value: @survey_data.adult, class: 'col-md-10' }%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
</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' }%>
|
||||
</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: { value: @survey_data.female, class: 'col-md-10' }%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= f.input :total_customer, input_html: { value: @survey_data.total_customer, class: 'col-md-11'} %>
|
||||
<%= f.input :local , input_html: { value: @survey_data.local, class: 'col-md-11' }%>
|
||||
<!--<fieldset style="border: 1px solid #BDBDBD;padding: 20px; width: 92%;margin: 20px 0 20px 0;"> -->
|
||||
<!-- <legend style="font-size: 1.2em !important;font-weight: bold !important;text-align: left !important;border:none;width:100px;">Foreigner</legend> -->
|
||||
<fieldset class="form-group">
|
||||
<label class="bmd-label-static">Foreigner Lists</label>
|
||||
<div class="row clearfix foreignerDiv">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<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| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Number</label>
|
||||
<input type="number" name="survey[foreigner][]" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hidden" id="newTemplate" >
|
||||
</div>
|
||||
</fieldset>
|
||||
<% else %>
|
||||
<%= f.input :child , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :adult , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :male , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :female , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :total_customer, input_html: { class: 'col-md-10'} %>
|
||||
<%= f.input :local , input_html: { class: 'col-md-10' }%>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<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| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
<%= f.input :child , input_html: { class: 'col-md-10' }%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Number</label>
|
||||
<input type="number" name="survey[foreigner][]" class="form-control">
|
||||
<%= f.input :adult , input_html: { class: 'col-md-10' }%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="hidden" id="newTemplate" >
|
||||
</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: { class: 'col-md-10' }%>
|
||||
</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: { class: 'col-md-10' }%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%= f.input :total_customer, input_html: { class: 'col-md-11'} %>
|
||||
<%= f.input :local , input_html: { class: 'col-md-11' }%>
|
||||
|
||||
</div>
|
||||
<fieldset style="border: 1px solid #BDBDBD;padding: 20px; width: 92%;margin: 20px 0 20px 0;">
|
||||
<legend style="font-size: 1.2em !important;font-weight: bold !important;text-align: left !important;border:none;width:100px;">Foreigner</legend>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<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| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Number</label>
|
||||
<input type="number" name="survey[foreigner][]" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
</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 %>">
|
||||
@@ -95,8 +144,8 @@
|
||||
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
|
||||
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
|
||||
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
</div>
|
||||
<div class="form-actions form-inputs p-l-10">
|
||||
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -196,13 +245,21 @@
|
||||
<script type="text/javascript">
|
||||
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? %>
|
||||
addSurveyForeignerLists(<%= @survey_data.foreigner.to_json.html_safe %>);
|
||||
<% end %>
|
||||
//click add button for new row
|
||||
$('#addForeigner').on('click',function(){
|
||||
$('#newTemplate').removeClass('hidden');
|
||||
|
||||
var text_box = '<div id="newRow" class="row clearfix">'
|
||||
+'<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<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: " >'
|
||||
@@ -213,7 +270,35 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
+'</select>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<div class="form-group p-l-10 p-r-10">'
|
||||
+'<input type="number" name="survey[foreigner][]" class="form-control">'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">'
|
||||
+'<button type="button" class="btn btn-danger" id="removeRow">Remove</button>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
$('#newTemplate').append(text_box);
|
||||
});
|
||||
|
||||
//click add button for new row
|
||||
$('#newTemplate').on('click','#addForeigner',function(){
|
||||
$('#newTemplate').removeClass('hidden');
|
||||
|
||||
var text_box = '<div id="newRow" class="row clearfix">'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<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| %>'
|
||||
+'<option value="<%= ct.value %>">'
|
||||
+'<%= ct.name %></option>'
|
||||
+'<%end %>'
|
||||
+'</select>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<div class="form-group p-l-10 p-r-10">'
|
||||
+'<input type="number" name="survey[foreigner][]" class="form-control">'
|
||||
+'</div>'
|
||||
@@ -292,4 +377,84 @@ var cashier_type = "<%= @cashier_type %>";
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function addSurveyForeignerLists(foreigner_lists){
|
||||
if((foreigner_lists != undefined) && (foreigner_lists != null) && (foreigner_lists != "")){
|
||||
$('.foreignerDiv').remove();
|
||||
$('#newTemplate').removeClass('hidden');
|
||||
foreigner_lists = foreigner_lists.substring(1, (foreigner_lists.length - 1)).replace(new RegExp('"', "g"),'').split(",");
|
||||
var arr_foreigner = {};
|
||||
$.each(foreigner_lists,function(key,value){
|
||||
if(!value.match(/^[0-9]+$/)){
|
||||
arr_foreigner[value] = 0;
|
||||
}else{
|
||||
$.each(arr_foreigner,function(k,val){
|
||||
if(arr_foreigner[k] == 0){
|
||||
arr_foreigner[k] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// console.log(foreigner_lists);
|
||||
// console.log(arr_foreigner);
|
||||
$.each(arr_foreigner, function(key,value){
|
||||
if(Object.keys(arr_foreigner)[0] == key){
|
||||
var fgn_template = '<div id="newRow" class="row clearfix">'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<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| %>'
|
||||
// if (key.toString() == '<%= ct.value.to_s %>')
|
||||
// var selected = "selected";
|
||||
// else
|
||||
// var selected = "";
|
||||
+'<option value="<%= ct.value %>">'
|
||||
+'<%= ct.name %></option>'
|
||||
+'<%end %>'
|
||||
+'</select>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<div class="form-group p-l-10 p-r-10">'
|
||||
+'<input type="number" name="survey[foreigner][]" class="form-control" value="'+value+'">'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">'
|
||||
+'<button type="button" class="btn btn-success" id="addForeigner">Add</button>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
}else{
|
||||
var fgn_template = '<div id="newRow" class="row clearfix">'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<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| %>'
|
||||
// if (key.toString() == '<%= ct.value.to_s %>')
|
||||
// var selected = "selected";
|
||||
// else
|
||||
// var selected = "";
|
||||
+'<option value="<%= ct.value %>">'
|
||||
+'<%= ct.name %></option>'
|
||||
+'<%end %>'
|
||||
+'</select>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 ">'
|
||||
+'<div class="form-group p-l-10 p-r-10">'
|
||||
+'<input type="number" name="survey[foreigner][]" class="form-control" value="'+value+'">'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">'
|
||||
+'<button type="button" class="btn btn-danger" id="removeRow">Remove</button>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
}
|
||||
|
||||
$('#newTemplate').append(fgn_template);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -10,6 +10,9 @@
|
||||
<%= f.input :unique_code %>
|
||||
<%= f.input :template %>
|
||||
<%= f.input :font %>
|
||||
|
||||
<%= f.input :header_font_size %>
|
||||
<%= f.input :item_font_size %>
|
||||
<%
|
||||
if(@server_mode != 'cloud')
|
||||
%>
|
||||
@@ -19,7 +22,6 @@
|
||||
%>
|
||||
<%= f.input :printer_name, :as => :select, :collection => [], include_blank: false %>
|
||||
<% end %>
|
||||
|
||||
<%= f.input :brand_name %>
|
||||
<%= f.input :printer_type %>
|
||||
<%= f.input :api_settings %>
|
||||
|
||||
@@ -325,7 +325,8 @@
|
||||
var str = '';
|
||||
var param_shift = '<%= params[:shift_name]%>';
|
||||
|
||||
url = '<%= reports_get_shift_by_date_path %>';
|
||||
url = '<%= reports_get_shift_by_sale_item_path %>';
|
||||
console.log(url)
|
||||
$.get(url, {period :period, period_type :period_type, from :from, to :to, report_type :shift_item} , function(data){
|
||||
console.log(data)
|
||||
|
||||
|
||||
@@ -27,15 +27,29 @@
|
||||
|
||||
<tbody>
|
||||
<% @employees.each do |employee| %>
|
||||
<tr>
|
||||
<td><%= link_to employee.name,settings_employee_path(employee) %></td>
|
||||
<td><%= employee.role %></td>
|
||||
<td><%= employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td>
|
||||
<%= link_to t("views.btn.edit"), edit_settings_employee_path(employee),:class => 'btn btn-info btn-sm waves-effect' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% if current_login_employee.role == "administrator" %>
|
||||
<tr>
|
||||
<td><%= link_to employee.name,settings_employee_path(employee) %></td>
|
||||
<td><%= employee.role %></td>
|
||||
<td><%= employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td>
|
||||
<%= link_to t("views.btn.edit"), edit_settings_employee_path(employee),:class => 'btn btn-info btn-sm waves-effect' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<% if employee.role != "administrator" %>
|
||||
<tr>
|
||||
<td><%= link_to employee.name,settings_employee_path(employee) %></td>
|
||||
<td><%= employee.role %></td>
|
||||
<td><%= employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td>
|
||||
<%= link_to t("views.btn.edit"), edit_settings_employee_path(employee),:class => 'btn btn-info btn-sm waves-effect' %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<% total_female = 0 %>
|
||||
<% total_local = 0 %>
|
||||
<% total_customer = 0 %>
|
||||
<% total_foreigner = 0 %>
|
||||
<% if !@surveys.nil? %>
|
||||
<% @surveys.each do |survey| %>
|
||||
<% total_child = total_child.to_i + survey.child.to_i %>
|
||||
@@ -80,8 +81,11 @@
|
||||
<% foreigner_lists = foreign.split(",") %>
|
||||
<% if !foreigner_lists.empty? %>
|
||||
<% foreigner_lists.each do |fgn| %>
|
||||
<% unless fgn.match(/[^[:digit:]]+/)
|
||||
total_foreigner = total_foreigner.to_i + fgn.to_i
|
||||
end %>
|
||||
<% if !fgn.scan(/\D/).empty? %>
|
||||
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
|
||||
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -97,7 +101,8 @@
|
||||
<td><strong><%= total_male %></strong></td>
|
||||
<td><strong><%= total_female %></strong></td>
|
||||
<td><strong><%= total_customer %></strong></td>
|
||||
<td colspan="2"><strong><%= total_local %></strong></td>
|
||||
<td><strong><%= total_local %></strong></td>
|
||||
<td><strong><%= total_foreigner %></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user