second display
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
$(function() {
|
||||
var role = $('#role').val();
|
||||
var second_display_lookup = $("#display_type");
|
||||
console.log(second_display_lookup)
|
||||
var second_display_lookup = $("#display_type").val();
|
||||
console.log(second_display_lookup);
|
||||
type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court");
|
||||
modify_order = window.location.href.indexOf("modify_order");
|
||||
|
||||
@@ -984,6 +984,10 @@ $(function() {
|
||||
$('#sx_itemModal').on('click','#remove', function(){
|
||||
$('.summary-items tr').filter(function(){
|
||||
if ($(this).attr('data-active') == 'true'){
|
||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
||||
item = get_item(item_data,"remove_icon");
|
||||
customer_display_view(item,"remove");
|
||||
}
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
@@ -1049,6 +1053,12 @@ $(function() {
|
||||
$(this).find('.item-cell-price').text(total_price);
|
||||
|
||||
$(this).removeAttr('data-active');
|
||||
|
||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
||||
var item_data = $(this);
|
||||
item = get_item(item_data,"update_icon");
|
||||
customer_display_view(item,"update_qty");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
||||
}
|
||||
});
|
||||
if (append===0) {
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
row ="<tr class='item_box_"+items[i].item_code+"' data-price ='"
|
||||
+price+ "' 'data-instance ='"
|
||||
+instance+ "' data-code='"+items[i].item_code+"' data-instance-code='"
|
||||
+items[i].instance_code+"' data-attributes='"
|
||||
@@ -108,7 +108,7 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
||||
sub_item = items[i].sub_item;
|
||||
total = qty * price ;
|
||||
// option_arr.push(option);
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
row ="<tr class='item_box_"+item_code+"' data-price ='"
|
||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||
+name+ "' data-code='"+item_code+"' data-instance-code='"
|
||||
+code+"' data-attributes='"
|
||||
@@ -126,6 +126,27 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//remove item
|
||||
if(status == "remove"){
|
||||
for(var i in items) {
|
||||
var item_code = items[i].item_code;
|
||||
$("#order-items-table tbody > tr.item_box_"+item_code+"").remove();
|
||||
}
|
||||
}
|
||||
//remove item
|
||||
//update item qty
|
||||
if(status == "update_qty"){
|
||||
for(var i in items) {
|
||||
var item_code = items[i].item_code;
|
||||
var item_qty = parseInt(items[i].qty);
|
||||
var item_price = parseFloat(items[i].price);
|
||||
var item_total = parseFloat(item_qty * item_price).toFixed(2);
|
||||
$("#order-items-table tbody > tr.item_box_"+item_code+"").find("#item_qty").text(item_qty);
|
||||
$("#order-items-table tbody > tr.item_box_"+item_code+"").find("#item_price").text(item_total);
|
||||
}
|
||||
}
|
||||
//update item qty
|
||||
//end apend items
|
||||
var total_price = 0;
|
||||
var taxable_amount = 0;
|
||||
|
||||
@@ -20,7 +20,7 @@ class Origami::AddordersController < BaseOrigamiController
|
||||
@webview = true
|
||||
end
|
||||
display_type = Lookup.find_by_lookup_type("display_type")
|
||||
if !display_type.nil? && display_type.value==2
|
||||
if !display_type.nil? && display_type.value.to_i ==2
|
||||
@display_type = display_type.value
|
||||
else
|
||||
@display_type = nil
|
||||
|
||||
@@ -22,6 +22,13 @@ class Origami::QuickServiceController < ApplicationController
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@cashier_type = "quick_service"
|
||||
display_type = Lookup.find_by_lookup_type("display_type")
|
||||
if !display_type.nil? && display_type.value.to_i ==2
|
||||
@display_type = display_type.value
|
||||
else
|
||||
@display_type = nil
|
||||
end
|
||||
|
||||
#checked quick_service only
|
||||
@quick_service_only = true
|
||||
lookup_dine_in = Lookup.collection_of('dinein_cashier')
|
||||
|
||||
@@ -9,7 +9,7 @@ class Origami::SecondDisplayController < BaseOrigamiController
|
||||
|
||||
def customer_view
|
||||
display_type = Lookup.find_by_lookup_type("display_type")
|
||||
if !display_type.nil? && display_type.value==2
|
||||
if !display_type.nil? && display_type.value.to_i == 2
|
||||
if params[:status]!= "billed"
|
||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||
else
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
//html font-size for second display till 35px!
|
||||
// document.getElementsByTagName( "html" )[0].style[ "font-size" ] = "35px";
|
||||
|
||||
$('#s_reload').on('click', function () {
|
||||
window.location.href = '/origami/second_display';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user