fixed conflict

This commit is contained in:
Nweni
2019-11-25 09:26:21 +06:30
109 changed files with 1082 additions and 1082 deletions

View File

@@ -19,17 +19,17 @@
<div class="active" id="tables" role="tabpanel">
<div class="tab-pane" id="rooms" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 2.2rem;">
<% @i =0 %>
<% DiningFacility.all.each do |table| %>
<% @i =0 %>
<% @tables.each do |table| %>
<div class="card assign_table <%= table.status=="available" ? "green" : "red"%>" data-id="<%= table.id %>">
<div class="card-block">
<p class="hidden queue-id"><%= @queue.id %></p>
<p class="hidden queue-id"><%= @queue.id %></p>
<p class="hidden queue-status"><%= table.status %></p>
<p style="text-align: center"><%= table.name %></p>
<p style="text-align: center">Seat : <%= table.seater %></p>
</div>
</div>
<% end %>
</div>
</div>
@@ -50,12 +50,12 @@ $(document).on('click',".assign_table",function(){
var table_id = $(this).attr('data-id');
url = '<%= crm_assign_table_path %>';
var status = $(this).find(".queue-status").text()
if (status == "available") {
assign_table(queue_id,table_id,url);
} else {
swal ( "Alert!" , "You cannot assign this table!" , "warning" );
}
}
})
function assign_table(id,table_id,url) {
@@ -63,24 +63,23 @@ function assign_table(id,table_id,url) {
title: "Confirm!",
text: "Are You Sure to assign this customer!",
}, function () {
$.ajax({
type: "POST",
$.ajax({
type: "POST",
url: url ,
data: {id:id,table_id:table_id},
dataType: "json",
success: function(data) {
if(data.status == true)
{
{
window.location.href = '<%=crm_dining_queues_path%>'
}else{
swal ( "Alert!" , "Record not found!" , "warning" );
location.reload();
}
}
}
});
});
}
</script>

View File

@@ -244,7 +244,7 @@
<script>
jQuery(function(){
id = "<%=@category[0].id%>";
id = "<%=@category_id%>";
console.log(id)
jQuery('.first_46').click();
});

View File

@@ -1,6 +1,6 @@
<!-- Column One -->
<div class="row clearfix" style="">
<div class="col-lg-7 col-md-7 col-sm-7">
<div class="col-lg-7 col-md-7 col-sm-7">
<p class="hidden filter"><%= @filter %></p>
<div class="card">
<div class="card-block">
@@ -20,7 +20,7 @@
<p class="hidden oqs-id"><%= qsi.id %></p>
<option value="<%= qsi.id %>" data-id="<%= qsi.id %>" <%=selected%> style="padding:5px 20px !important;"> <%= qsi.station_name %></option>
<% end %>
<% end %>
<% end %>
</select>
</div>
@@ -38,8 +38,8 @@
<div class="tab-content" id="custom-slimscroll" style="">
<div class="tab-pane in active" id="completed" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;column-count: ;">
<%
@queue_completed_item.each do |qid|
<%
@queue_completed_item.each do |qid|
%>
<div class="card queue_station" data-order-no="<%= qid.order_id %>">
<div class="card-block">
@@ -52,38 +52,38 @@
<span class="order-zone hidden font-13"><%= qid.zone %></span>
<span class="col-md-8"><small class="float-right font-13"><%= qid.order_id %></small></span>
</div>
</div>
<p class="m-b--10">
<span class="order-item font-16">
<%= qid.item_name %>
</span> [x
<span class="order-qty">
<%= qid.qty %>
</span> ]
</span> ]
<% if !qid.set_menu_items.nil? %>
<% qid.set_menu_items.each do |item_instance|%>
<br><span class="font-12">
<%= item_instance %>
</span>
<% end %>
<% end %>
</p>
<% end %>
</p>
<br/><p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
<br/><p class="card-text item-options"><%= qid.options == "[]"? "" : qid.options %></p>
<span class="card-text">
<span class="text-muted">Order at -
<span class="text-muted">Order at -
<span class="order-at font-13">
<%= qid.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %>
</span> <br>
</span> <br>
Order By - <span class="order-by font-13">
<%= qid.item_order_by %>
</span>
</span>
</span>
</span>
<p class="hidden order-status">completed</p>
<p class="hidden order-customer"><%= qid.customer_name %></p>
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
</div>
<% if !qid.delivery_status %>
<div class="card-footer">
@@ -91,11 +91,11 @@
<button id="assigned_queue_<%= qid.assigned_order_item_id %>" class="btn btn-primary order-item order-complete">COMPLETE</button>
</div>
<%end%>
</div>
<% end %>
</div>
<% end %>
</div>
</div>
<div class="card-columns oqs_append" id="oqs_container" style="padding-top:10px; column-gap: 1.2rem;">
<div class="card-columns oqs_append" id="oqs_container" style="padding-top:10px; column-gap: 1.2rem;">
</div>
</div>
</div>
@@ -127,7 +127,7 @@
<td id="order-customer" colspan="2"></td>
</tr> -->
<!-- </tbody>
</table>
</table>
</div>
<div class="card-text" id="order-detail-slimscroll" style="min-height:; max-height:; overflow:">
<table class="table" id="oqs-order-details-table">
@@ -137,7 +137,7 @@
<th style="width:20%; text-align:right">QTY</th>
</tr>
</thead>
<tbody>
<tbody>
</tbody>
</table>
</div>
@@ -163,7 +163,7 @@
<div class="col-lg-4 col-md-4 col-sm-4 table-float">
<button class='btn btn-lg waves-effect green tables table-width' value="<%= table.id %>" data-id="<%= table.id %>"> <%= table.name %> <br> <%= table.zone.name %></button>
</div>
<% end %>
<% end %>
</div>
<%if !@rooms.empty? %>
<div id="room" class="tab-pane fade">
@@ -171,21 +171,21 @@
<div class="col-lg-4 col-md-4 col-sm-4 table-float">
<button class='btn btn-lg waves-effect green tables table-width' value="<%= room.id %>" data-id="<%= room.id %>"> <%= room.name %> <br> <%= room.zone.name %></button>
</div>
<% end %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- OQS Buttons -->
<!-- <br> -->
<% if current_user.role != "kitchen" %>
<a href="<%= dashboard_path %>" class="btn btn-sm btn-block btn-default waves-effect" role="button" aria-haspopup="true"><i class="material-icons">reply</i> Back </a>
<%end%>
<%end%>
<button type="button" title="Print Order Item" id="print_order_item" class="btn bg-blue btn-block btn-lg waves-effect">Print</a>
<!-- <button type="button" class="btn bg-blue btn-block btn-lg waves-effect" id="print_order_summary">Print <br/>Order<br/>Summary</button>
@@ -202,12 +202,12 @@
});
});
document.getElementById("defaultOpen").click();
</script>
<style type="text/css">
.oqs-btn {
padding: .46875rem 0.25rem;color: #fff !important;position: relative;margin-bottom: .3125rem;font-size: .875rem;text-decoration: none;text-transform: uppercase;letter-spacing: 0;cursor: pointer;border: 0;
}
</style>
</style>

View File

@@ -57,14 +57,14 @@
<!--- Panel 1 - Table Orders -->
<div class="tab-pane dining active " id="tables" role="tabpanel">
<div class="card-columns">
<% @tables.each do |table| %>
<% @tables.each do |table| %>
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<% end %>
<div class="card-block">
<%= table.name %> <br>
<%= table.zone.name %>
@@ -72,12 +72,12 @@
<div style="font-size:12px;"></div>
</div>
</div>
<% else %>
<% else %>
<% if table.get_checkout_booking.nil? %>
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<% end %>
<div class="card-block">
<%= table.name %> <br>
<%= table.zone.name %>
@@ -111,7 +111,7 @@
<% end %>
<div class="card-block">
<%= room.name %> <br>
<%= room.zone.name %>
<%= room.zone.name %>
<span class="float-right font-12 new_text_<%= room.id %>"> billed</span>
</div>
</div>
@@ -123,7 +123,7 @@
<% end %>
<div class="card-block">
<%= room.name %> <br>
<%= room.zone.name %>
<%= room.zone.name %>
<span class="float-right font-12 new_text_<%= room.id %>"> new</span>
</div>
</div>
@@ -132,8 +132,8 @@
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %> <br>
<%= room.zone.name %>
<span class="float-right font-12 new_text_<%= room.id %> hide">
<%= room.zone.name %>
<span class="float-right font-12 new_text_<%= room.id %> hide">
</div>
</div>
<% end %>
@@ -160,8 +160,8 @@
<% else %>
<% order_status = order.status %>
<% end %>
<%= order.order_id %>
<% if !order_status.empty? %>| <%= order_status %>
<%= order.order_id %>
<% if !order_status.empty? %>| <%= order_status %>
<% end %>
</div>
</div>
@@ -193,7 +193,7 @@
<th><%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t :customer %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t :customer %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t("views.right_panel.detail.credit_amount") %> </th>
</thead>
<tbody class="tbd_credit_lists"></tbody>
@@ -245,7 +245,7 @@
<% else %>
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
<% end %>
</div>
</div>
<div class="card-block">
<div class="card-title">
<div class="row p-l-5 p-r-5">
@@ -335,8 +335,8 @@
<% end %>
<% if !order_item.set_menu_items.nil? && order_item.set_menu_items != '[]'
JSON.parse(order_item.set_menu_items).each do |item_instance|
set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f %>
JSON.parse(order_item.set_menu_items).each do |item_instance|
set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f %>
<br>
<span class="font-13">
<%= item_instance["item_instance_name"] %>
@@ -345,17 +345,17 @@
<br><span class="font-13"> <%= set_item_option %></span>
<% end %>
<% end %>
</span>
<% end
</span>
<% end
sub_total += set_item_prices
end %>
</td>
<td class='item-attr'><%= order_item.qty %></td>
<td class='item-attr'><%= (order_item.qty*order_item.price).to_f + set_item_prices %></td>
</tr>
</tr>
<% end %>
<% end %>
<% end %>
<% end %>
</tbody>
</table>
</div>
@@ -431,10 +431,10 @@
<% end %>
<% end %>
<% if !order_item.set_menu_items.nil?
JSON.parse(order_item.set_menu_items).each do |item_instance|
<% if !order_item.set_menu_items.nil?
JSON.parse(order_item.set_menu_items).each do |item_instance|
set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f
%>
%>
<br><span class="font-13">
<%= item_instance["item_instance_name"] %>
<% if !item_instance["options"].nil? && item_instance["options"] != "undefined" %>
@@ -444,8 +444,8 @@
</span>
<% end %>
<% end %>
</span>
<% end
</span>
<% end
sub_total += set_item_prices
end %>
</td>
@@ -456,7 +456,7 @@
end
%>
</table> -->
<!-- <button class='btn btn-primary btn-block waves-effect' id='add_invoice'> Add to existing invoice</button> -->
<% end %>
<% if @sale_array.size > 1 %>
@@ -496,7 +496,7 @@
<!-- <a href="<%=origami_second_display_index_path%>" target="_blank" id="second_view" class="btn action-btn bg-blue waves-effect" style="height: 45px">Customer View</a> -->
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
<% if @dining.status != "available" %>
<% if @dining.status != "available" %>
<% if @status_order == 'order' && @status_sale != 'sale' %>
<%if !@order_items.empty? %>
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
@@ -526,7 +526,7 @@
<!-- <button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button> -->
<% if current_login_employee.role == "cashier" %>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
<a class="btn btn-block bg-blue waves-effect access_modal" data-toggle="modal" data-type="edit">Edit</a>
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
<% else %>
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
@@ -535,9 +535,9 @@
<% end %>
<% if current_login_employee.role != "waiter" %>
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
<% end %>
<% end %>
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
<% if !@split_bill.nil? %>
<% if @split_bill == '1' && (!(@order_items.nil?) || !(@order_items.empty?)) %>
<button type="button" id="split_bills" class="btn btn-block bg-blue waves-effect">Split Bill</button>
@@ -545,19 +545,19 @@
<% end %>
<% if current_login_employee.role != "waiter" %>
<!-- first bill not used in cloud -->
<%if @membership.discount && @obj_sale.customer.membership_id %>
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal" data-order="<%= existing_order %>">First Bill</button>
<%else%>
<button type="button" id="first_bill" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">First Bill</button>
<%end%>
<%end%>
<button type="button" id="pay" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">Pay</button>
<!-- <button type="button" id="kbz_query" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">KBZ Query</button> -->
<!--<% if current_login_employee.role != "waiter" %>
<button type="button" class="btn action-btn bg-blue waves-effect" data-toggle="modal" data-target="#waste_spoileModal" > Waste & Spoile</button>
<button type="button" class="btn action-btn bg-blue waves-effect" data-toggle="modal" data-target="#waste_spoileModal" > Waste & Spoile</button>
<% end %>-->
<% end %>
<% end %>
@@ -583,7 +583,7 @@
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<button class='btn btn-md waves-effect btn-link payment-btn-box payment_btn bg-green' data-type='Credit' data-value='Credit'>Credit</button>
</div>
<% @payment_methods.each_with_index do |pay, pay_index| %>
<%if (pay_index+1)%3 == 0 %>
<div class="row clearfix"></div>
@@ -625,7 +625,7 @@
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
@@ -638,7 +638,7 @@
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">&times;</button>
</div>
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
<input type="password" id="access_code" class="access_code form-control col-md-12 ">
<div class="row bottom p-l-15 p-r-15 m-t-10">
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
@@ -657,7 +657,7 @@
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
</div>
</div>
</div>
@@ -690,7 +690,7 @@
count += 1 %>
<tr class="<%= @edit_order_origami==true ? 'edit_order' : '' %>" data-id='<%= order_item.order_items_id %>'>
<td><%= count %></td>
<td><%= count %></td>
<td class='item-name'>
<%= order_item.item_name %>
<% if !order_item.options.nil? && !order_item.options.empty? && order_item.options != "undefined" %>
@@ -701,10 +701,10 @@
<% end %>
<% end %>
<% if !order_item.set_menu_items.nil?
JSON.parse(order_item.set_menu_items).each do |item_instance|
<% if !order_item.set_menu_items.nil?
JSON.parse(order_item.set_menu_items).each do |item_instance|
set_item_prices += (item_instance["quantity"].to_f * item_instance["price"].to_f).to_f
%>
%>
<br><span class="font-13">
<%= item_instance["item_instance_name"] %>
<% if !item_instance["options"].nil? && item_instance["options"] != "undefined" %>
@@ -714,8 +714,8 @@
</span>
<% end %>
<% end %>
</span>
<% end
</span>
<% end
sub_total += set_item_prices
end %>
</td>
@@ -823,7 +823,7 @@
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim();
}
discount="<%= @membership.discount%>"
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
if (discount) {
@@ -887,7 +887,7 @@
} else {
var sale_id = "<%= @dining.id %>";
}
//var table_id = $('.tables').attr("data-id");
//var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id +"/"+cashier_type+ "/surveys"
});
@@ -989,22 +989,22 @@
}
location.reload();
}
});
});
}
});
});
});
// click select option icon for add
$(document).on('click', '.payment_btn', function(event){
// click select option icon for add
$(document).on('click', '.payment_btn', function(event){
active = $(this).hasClass('selected-payment');
value = $(this).data('value');
type = $(this).data('type');
group = $(this).data('group');
payments = $(".payment_btn");
if (active) {
if (active) {
$(this).removeClass('selected-payment');
}else{
}else{
$(this).addClass('selected-payment');
}
}); //End selecct attribute buttom
@@ -1026,7 +1026,7 @@
if(!location.pathname.includes("credit_payment")){
calculate_member_discount(sale_id,"Cash",tax_type);
}
}
}
}
var ajax_url = "/origami/sale/" + sale_id + "/first_bill";
$.ajax({
@@ -1045,7 +1045,7 @@
}
location.reload();
}
});
});
});
function calculate_member_discount(sale_id,type,tax_type) {
@@ -1060,10 +1060,10 @@
url: "/origami/" + sale_id + "/member_discount",
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':'cashier','tax_type':tax_type },
async: false,
success:function(result){
success:function(result){
}
});
}
$('#pay').on('click', function () {
@@ -1137,11 +1137,11 @@
}
});
}
else {
else {
location.reload();
}
}
});
});
}else{
swal("Opps","There is no orders!","warning");
}
@@ -1151,7 +1151,7 @@
$('#split_bills').click(function(){
var dining_id = "<%= @dining.id %>";
window.location.href = '/origami/table/' + dining_id + "/" + cashier_type +"/split_bills";
});
});
$('#move').on('click', function () {
if($('#move').is(":visible")) {
@@ -1236,7 +1236,7 @@
}else{
swal("Opps","You are not authorized for void","warning")
}
});
$('#commissions').on('click', function () {
@@ -1285,7 +1285,7 @@
}
});
}
});
});
}else{
swal("Opps","You are not authorized for void","warning")
}
@@ -1303,7 +1303,7 @@
window.location.href = '/origami/addorders/' + dining_id;
});
/* check in process */
/* check in process */
$('#check_in').on('click',function(){
var dining_id = "<%= @dining.id %>";
@@ -1394,7 +1394,7 @@
}
});
}
});
});
}
function check_emp_access_code(access_code,type) {
@@ -1460,11 +1460,11 @@
type: "POST",
url: "/origami/payment/"+cashier_type+"/change_tax",
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: tax_type},
success:function(data){
success:function(data){
if(data.status){
localStorage.setItem("tax_type", tax_type);
window.location.href = '/origami/table/'+dining_id;
}
}
}
});
}else{

View File

@@ -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>