second display
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
var role = $('#role').val();
|
var role = $('#role').val();
|
||||||
var second_display_lookup = $("#display_type").val();
|
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");
|
type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court");
|
||||||
modify_order = window.location.href.indexOf("modify_order");
|
modify_order = window.location.href.indexOf("modify_order");
|
||||||
|
|
||||||
@@ -25,7 +24,6 @@ $(function() {
|
|||||||
if (type ==-1 && modify_order == -1){
|
if (type ==-1 && modify_order == -1){
|
||||||
url_item = url_item
|
url_item = url_item
|
||||||
}
|
}
|
||||||
console.log(url_item)
|
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@@ -773,7 +771,7 @@ $(function() {
|
|||||||
}); //End Add Icon Click
|
}); //End Add Icon Click
|
||||||
|
|
||||||
function show_item_detail(data,click_type){
|
function show_item_detail(data,click_type){
|
||||||
|
testqty = parseInt($('.item_box').children('data_qty').text());
|
||||||
qty = parseInt(data.attr('data-qty'));
|
qty = parseInt(data.attr('data-qty'));
|
||||||
append = 0;
|
append = 0;
|
||||||
price = data.attr('data-price');
|
price = data.attr('data-price');
|
||||||
@@ -820,8 +818,8 @@ $(function() {
|
|||||||
});
|
});
|
||||||
if (append===0) {
|
if (append===0) {
|
||||||
row ="<tr class='item_box' data-price ='"
|
row ="<tr class='item_box' data-price ='"
|
||||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
+price+ " 'data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||||
+instance+ "' data-code='"+data.attr('data-item-code')+"' data-instance-code='"
|
+instance+ "' data-qty='"+qty +"' data-code='"+data.attr('data-item-code')+"' data-instance-code='"
|
||||||
+data.attr('data-instance-code')+"' data-attributes='"
|
+data.attr('data-instance-code')+"' data-attributes='"
|
||||||
+data.attr('data-attributes')+"' data-options ='"
|
+data.attr('data-attributes')+"' data-options ='"
|
||||||
+data_option+"' data-opt ='"
|
+data_option+"' data-opt ='"
|
||||||
@@ -985,6 +983,7 @@ $(function() {
|
|||||||
$('.summary-items tr').filter(function(){
|
$('.summary-items tr').filter(function(){
|
||||||
if ($(this).attr('data-active') == 'true'){
|
if ($(this).attr('data-active') == 'true'){
|
||||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2) {
|
||||||
|
var item_data = $(this);
|
||||||
item = get_item(item_data,"remove_icon");
|
item = get_item(item_data,"remove_icon");
|
||||||
customer_display_view(item,"remove");
|
customer_display_view(item,"remove");
|
||||||
}
|
}
|
||||||
@@ -1007,6 +1006,7 @@ $(function() {
|
|||||||
if ($('#modal-qty').val()>0) {
|
if ($('#modal-qty').val()>0) {
|
||||||
summary_items_filter();
|
summary_items_filter();
|
||||||
calculate_sub_total();
|
calculate_sub_total();
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
swal("Opps", "Please enter number for qty ","warning");
|
swal("Opps", "Please enter number for qty ","warning");
|
||||||
}
|
}
|
||||||
@@ -1046,6 +1046,7 @@ $(function() {
|
|||||||
$('.summary-items tr').filter(function(){
|
$('.summary-items tr').filter(function(){
|
||||||
if ($(this).attr('data-active') == 'true'){
|
if ($(this).attr('data-active') == 'true'){
|
||||||
qty = $('#modal-qty').val();
|
qty = $('#modal-qty').val();
|
||||||
|
$(this).attr('data-qty',qty);
|
||||||
price = parseFloat($(this).attr('data-price'));
|
price = parseFloat($(this).attr('data-price'));
|
||||||
total_price = parseFloat(price*qty).toFixed(2);
|
total_price = parseFloat(price*qty).toFixed(2);
|
||||||
|
|
||||||
@@ -1295,7 +1296,7 @@ $(function() {
|
|||||||
var sale_items = [];
|
var sale_items = [];
|
||||||
|
|
||||||
var sale_item = {};
|
var sale_item = {};
|
||||||
sale_item.qty = parseInt(data.attr('data-qty'))
|
sale_item.qty = parseInt(data.attr('data-qty'));
|
||||||
sale_item.name = data.attr('data-name');
|
sale_item.name = data.attr('data-name');
|
||||||
sale_item.price = data.attr('data-price');
|
sale_item.price = data.attr('data-price');
|
||||||
sale_item.item_code = data.attr('data-item-code')
|
sale_item.item_code = data.attr('data-item-code')
|
||||||
@@ -1306,8 +1307,8 @@ $(function() {
|
|||||||
sale_item.click_type = click_type
|
sale_item.click_type = click_type
|
||||||
sale_item.instance = data.attr('data-instance')
|
sale_item.instance = data.attr('data-instance')
|
||||||
sale_items.push(sale_item);
|
sale_items.push(sale_item);
|
||||||
|
|
||||||
return sale_items;
|
return sale_items;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get Item rows */
|
/* Get Item rows */
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (append===0) {
|
if (append===0) {
|
||||||
row ="<tr class='item_box_"+items[i].item_code+"' data-price ='"
|
row ="<tr class='item_box_"+items[i].instance_code+"' data-price ='"
|
||||||
+price+ "' 'data-instance ='"
|
+price+ "' 'data-instance ='"
|
||||||
+instance+ "' data-code='"+items[i].item_code+"' data-instance-code='"
|
+instance+ "' data-code='"+items[i].item_code+"' data-instance-code='"
|
||||||
+items[i].instance_code+"' data-attributes='"
|
+items[i].instance_code+"' data-attributes='"
|
||||||
@@ -130,15 +130,16 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
//remove item
|
//remove item
|
||||||
if(status == "remove"){
|
if(status == "remove"){
|
||||||
for(var i in items) {
|
for(var i in items) {
|
||||||
var item_code = items[i].item_code;
|
var item_code = items[i].instance_code;
|
||||||
$("#order-items-table tbody > tr.item_box_"+item_code+"").remove();
|
$("#order-items-table tbody > tr.item_box_"+item_code+"").remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//remove item
|
//remove item
|
||||||
//update item qty
|
//update item qty
|
||||||
if(status == "update_qty"){
|
if(status == "update_qty"){
|
||||||
|
|
||||||
for(var i in items) {
|
for(var i in items) {
|
||||||
var item_code = items[i].item_code;
|
var item_code = items[i].instance_code;
|
||||||
var item_qty = parseInt(items[i].qty);
|
var item_qty = parseInt(items[i].qty);
|
||||||
var item_price = parseFloat(items[i].price);
|
var item_price = parseFloat(items[i].price);
|
||||||
var item_total = parseFloat(item_qty * item_price).toFixed(2);
|
var item_total = parseFloat(item_qty * item_price).toFixed(2);
|
||||||
@@ -186,4 +187,3 @@ App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -278,6 +278,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
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
|
||||||
path = request.fullpath
|
path = request.fullpath
|
||||||
sale_id = params[:sale_id]
|
sale_id = params[:sale_id]
|
||||||
@trans_flag = true
|
@trans_flag = true
|
||||||
|
|||||||
@@ -139,7 +139,16 @@
|
|||||||
<span class="font-15 shopinfo" >Team Viewer</span>
|
<span class="font-15 shopinfo" >Team Viewer</span>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
<%if current_login_employee.role =="cashier" %>
|
||||||
<li>
|
<li>
|
||||||
|
<p class="waves-effect waves-block p-l-30 m-b-5">
|
||||||
|
<a href="/origami/second_display" onclick="window.open('/origami/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
|
||||||
|
<i class="material-icons font-7 logout_icon shopinfo">info</i>
|
||||||
|
<span class="font-15 shopinfo" >Second Display</span>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
|
||||||
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
<i class="material-icons font-10 logout_icon">exit_to_app</i>
|
||||||
<span class="font-18">Logout</span>
|
<span class="font-18">Logout</span>
|
||||||
|
|||||||
@@ -796,8 +796,21 @@
|
|||||||
$(".summary-items tbody").empty();
|
$(".summary-items tbody").empty();
|
||||||
$('#sub_total').text("0.00");
|
$('#sub_total').text("0.00");
|
||||||
$(".create").attr("disabled","disabled");
|
$(".create").attr("disabled","disabled");
|
||||||
|
customer_display_view(null,"reload");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function customer_display_view(data,status) {
|
||||||
|
url = '../../../../origami/customer_view';
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {"data":data,"status":status},
|
||||||
|
dataType: "json",
|
||||||
|
success:function(result){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$(document).on('click', '.cashier_number', function(event){
|
$(document).on('click', '.cashier_number', function(event){
|
||||||
if(event.handled !== true) {
|
if(event.handled !== true) {
|
||||||
var original_value;
|
var original_value;
|
||||||
|
|||||||
@@ -387,6 +387,8 @@
|
|||||||
<div class="cashier_number border-top border- border-left payment-long" data-value="10000" data-type="add">10000</div>
|
<div class="cashier_number border-top border- border-left payment-long" data-value="10000" data-type="add">10000</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row bottom">
|
<div class="row bottom">
|
||||||
|
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||||
|
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
|
||||||
<div class="pay border-top border- border-left purple payment-left" id="pay">Pay</div>
|
<div class="pay border-top border- border-left purple payment-left" id="pay">Pay</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -930,8 +932,24 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var second_display_lookup = $("#display_type").val();
|
||||||
|
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){
|
||||||
|
customer_display_view(null,"reload");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function customer_display_view(data,status) {
|
||||||
|
url = '../../../../origami/customer_view';
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: {"data":data,"status":status},
|
||||||
|
dataType: "json",
|
||||||
|
success:function(result){
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// $('#void').on('click',function () {
|
// $('#void').on('click',function () {
|
||||||
// if ($(this).attr('active') === "true") {
|
// if ($(this).attr('active') === "true") {
|
||||||
// var sale_id = $('#sale_id').text();
|
// var sale_id = $('#sale_id').text();
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
class ChangeImageToAddLimitInDisplayImages < ActiveRecord::Migration[5.1]
|
||||||
|
|
||||||
|
def up
|
||||||
|
change_column :display_images, :image, :binary, :limit => 10.megabyte
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
change_column :display_images, :image, :binary, :limit => nil
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user