diff --git a/README.md b/README.md index ee8846a0..b5d2c62b 100755 --- a/README.md +++ b/README.md @@ -8,28 +8,21 @@ Things you may want to cover: ruby 2.4.1p111 * Membership Details +Osaka => + Auth Token => wu8YvlLmah0CL => New => v3 + => rj0MJ0XI5GsKZehE => Old => v + => code2lab => Old - Osaka + Merchant account => RxzaYyAGzm7VqAZ4hKnv + Campaign Id => {"campaign_type_id": 5} - Auth Token => wu8YvlLmah0CL => New ##note : Old => rj0MJ0XI5GsKZehE +BITP + Auth Token => pZBHXEFbGNj/G => New => V3 + => rj0MJ0XI5GsKZehE => Old => V2 + => code2lab => Old - => code2lab => Old - - Merchant account => RxzaYyAGzm7VqAZ4hKnv - - Campaign Id => {"campaign_type_id": 5} - - - - BITP - - Auth Token => pZBHXEFbGNj/G => New ##note : Old => rj0MJ0XI5GsKZehE - - => code2lab => Old - - Merchant account => vWSsseoZCzxd6xcNf_uS - - Campaign Id => {"campaign_type_id": 1} + Merchant account => vWSsseoZCzxd6xcNf_uS + Campaign Id => {"campaign_type_id": 1} java -jar ~/Documents/Jade.jar http://192.168.1.88:3002 @@ -105,7 +98,12 @@ Change type in mysql For split bill 1) settings/lookups => { type:split_bill, name:SplitBill, value:1 } - + +For Sidekiq + 1) If you want to use sidekiq + => Create New Lookups => lookup_type = sidekiq, Name = sidekiq , Value = 1 or 0 + +For Check CUp status ###please open sudo cat /etc/sudoers ### cope and parse diff --git a/app/assets/images/slider/s1.jpg b/app/assets/images/slider/s1.jpg new file mode 100644 index 00000000..cf5cfb0b Binary files /dev/null and b/app/assets/images/slider/s1.jpg differ diff --git a/app/assets/images/slider/s2.jpg b/app/assets/images/slider/s2.jpg new file mode 100644 index 00000000..2e3e9332 Binary files /dev/null and b/app/assets/images/slider/s2.jpg differ diff --git a/app/assets/images/slider/s3.jpg b/app/assets/images/slider/s3.jpg new file mode 100644 index 00000000..e3b4de10 Binary files /dev/null and b/app/assets/images/slider/s3.jpg differ diff --git a/app/assets/images/slider/s4.jpg b/app/assets/images/slider/s4.jpg new file mode 100644 index 00000000..73decfb9 Binary files /dev/null and b/app/assets/images/slider/s4.jpg differ diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index b0c51031..32054b53 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -366,6 +366,10 @@ $(function() { var items = $('.selected-instance'); if (items.length >= min_qty) { + + item = get_set_item(items); + customer_display_view(item,"set_add"); + attribute_arr = [] option_arr = [] @@ -400,6 +404,7 @@ $(function() { price = $(items[i]).attr('data-price'); option = $(items[i]).attr('data-options'); sub_item = $(items[i]).attr('data-sub-item'); + option = $(items[i]).attr('data-options'); total = qty * price ; option_arr.push(option); row =" 1) { qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty; }else{ @@ -742,7 +759,7 @@ $(function() { +data.attr('data-attributes')+"' data-options ='" +data.attr('data-options')+"' data-row ='"+rowCount+ "'>" +''+rowCount+'' - +'' + data.attr('data-name')+ ' ' + instance +'' + +'' + data.attr('data-name')+ ' ' + instance +' ' + option_name +'' +'' + qty + '' +'' + parseFloat(price).toFixed(2) @@ -759,17 +776,17 @@ $(function() { e.preventDefault(); $("#oqs_loading_wrapper").show(); - type = window.location.href.indexOf("quick_service"); - if (type != -1) { + quick_service = window.location.href.indexOf("quick_service"); + if (quick_service != -1) { type = 'quick_service' - var table_type = $('#table_type').text(); + var table_type = $('#table_type').text(); var table_id = $('#table_id').val(); var customer_id = $('#customer_id').val(); var booking_id = $('#booking_id').text(); var ajax_url = 'addorders/create'; }else{ type = 'cashier' - var table_type = $('#table_type').text(); + var table_type = $('#table_type').text(); var table_id = $('#table_id').text(); var customer_id = $('#customer_id').text(); var booking_id = $('#booking_id').text(); @@ -795,17 +812,20 @@ $(function() { url: ajax_url, data: params, dataType: "json", - success:function(result){ + success:function(result){ + console.log(type) + console.log(table_type) if (type == "quick_service") { - window.location.href = "/origami/quick_service" + window.location.href = "/origami/quick_service" }else{ if(table_type == "Table"){ - window.location.href = "/origami/table/" + table_id + window.location.href = "/origami/table/" + table_id } else { - window.location.href = "/origami/room/" + table_id + window.location.href = "/origami/room/" + table_id } } + customer_display_view(null,"reload"); } }); // }else{ @@ -824,9 +844,7 @@ $(function() { type = "quick_service" modify_order = window.location.href.indexOf("modify_order"); $("#oqs_loading_wrapper").show(); - console.log(modify_order) if (modify_order !=-1) { - console.log($('#sale_id').text()) var ajax_url = '../../../quick_service/update_modify_order'; var table_type = $('#table_type').text(); var table_id = $('#table_id').text(); @@ -861,7 +879,6 @@ $(function() { data: params, dataType: "json", success:function(result){ - console.log(result) if (result.status) { if (result.data == null){ window.location.href = '/origami/quick_service/pending_order/' + $('#sale_id').text(); @@ -1152,6 +1169,67 @@ $(function() { }); //end Ajax } + + /* Get Item rows */ + function get_item(data){ + var sale_items = []; + + var sale_item = {}; + sale_item.qty = parseInt(data.attr('data-qty')) + sale_item.name = data.attr('data-name'); + sale_item.price = data.attr('data-price'); + sale_item.item_code = data.attr('data-item-code') + sale_item.instance_code = data.attr('data-instance-code') + sale_item.attributes = data.attr('data-attributes') + sale_item.options = data.attr('data-options') + sale_item.instance = data.attr('data-instance') + sale_items.push(sale_item); + + return sale_items; + } + + /* Get Item rows */ + function get_set_item(items){ + var sale_items = []; + var item = {}; + item.code = $('.set-item').attr('data-code'); + item.name = $('.set-item').attr('data-name'); + item.item_name = $('#set_name').text(); + item.qty = parseInt($('#set_count').val()); + item.item_code = $('#set_item_code').text(); + item.price = $('.set-item').attr('data-price'); + item.option = $('.set-item').attr('data-options'); + item.parent = $('.set-item').attr('data-parent'); + + sale_items.push(item); + + $(items).each(function(i){ + var sale_item = {}; + sale_item.code = $(items[i]).attr('data-code'); + sale_item.name = $(items[i]).attr('data-name'); + sale_item.item_name = $('#set_name').text(); + sale_item.qty = parseInt($('#set_count').val()); + sale_item.item_code = $('#set_item_code').text(); + sale_item.price = $(items[i]).attr('data-price'); + sale_item.option = $(items[i]).attr('data-options'); + sale_item.sub_item = $(items[i]).attr('data-sub-item'); + sale_items.push(sale_item); + }); + + + return sale_items; + } + + function customer_display_view(data,status) { + $.ajax({ + type: "POST", + url: '../../origami/customer_view', + data: {"data":data,"status":status}, + dataType: "json", + success:function(result){ + } + }); + } /* $("input").keypress(function(){ $("span").text(i += 1); });*/ diff --git a/app/assets/javascripts/channels/second_display.js b/app/assets/javascripts/channels/second_display.js new file mode 100644 index 00000000..79b59cac --- /dev/null +++ b/app/assets/javascripts/channels/second_display.js @@ -0,0 +1,38 @@ +App.checkin = App.cable.subscriptions.create('SecondDisplayChannel', { +// App.messages = App.cable.subscriptions.create('MessagesChannel', { + + connected: function() {}, + + disconnected: function() {}, + + received: function(data) { + var data_obj = data.data; + var status = data.status; + var count = 0 + var sub_total = 0 + if (data.status == "order") { + for(var i in data_obj) { + + sub_total = sub_total + (data_obj[i].price * data_obj[i].qty) + count += 1 + row ='' + +''+count+'' + +''+data_obj[i].item_name+'' + +''+data_obj[i].qty +'' + + ''+data_obj[i].qty*data_obj[i].price +'' + +'' + $(".second_display_items").append(row); + }//end looping + }else{ + $('#s_sub_total').empty(); + $('#s_sub_total').append(data_obj.total_amount); + $('#s_total_discount').empty(); + $('#s_total_discount').append(data_obj.total_discount); + $('#s_tatal_tax').empty(); + $('#s_tatal_tax').append(data_obj.total_tax); + $('#s_grand_total').empty(); + $('#s_grand_total').append(data_obj.grand_total); + } + } +}); + diff --git a/app/assets/javascripts/channels/second_display_view.js b/app/assets/javascripts/channels/second_display_view.js new file mode 100644 index 00000000..c6ac124c --- /dev/null +++ b/app/assets/javascripts/channels/second_display_view.js @@ -0,0 +1,156 @@ +App.checkin = App.cable.subscriptions.create('SecondDisplayViewChannel', { +// App.messages = App.cable.subscriptions.create('MessagesChannel', { + + connected: function() {}, + + disconnected: function() {}, + + received: function(data) { + var items = data.data; + var tax = data.tax_profiles; + var status= data.status + if (status == "reload") { + jQuery('#s_reload').click(); + } + $('#second_display_slider').addClass("hidden") + $('#second_display_items').removeClass("hidden") + + + // append items + if (status == "add") { + for(var i in items) { + qty = parseInt(items[i].qty); + append = 0; + price = items[i].price; + + instance_name = items[i].instance; + if (instance_name == "undefined"){ + instance = ''; + }else{ + instance = "("+items[i].instance+")"; + } + + d_option = items[i].options; + if (d_option){ + option_name = "-"+items[i].options; + }else{ + option_name = ''; + } + + var rowCount = $('.second_display_items tbody tr').length+1; + var item_row = $('.second_display_items tbody tr'); + + $(item_row).each(function(j){ + var item_code = $(item_row[j]).attr('data-code'); + var instance_code = $(item_row[j]).attr('data-instance-code'); + var r_option = $(item_row[j]).attr('data-options'); + if (item_code == items[i].item_code && instance_code == items[i].instance_code && r_option==d_option) { + if (qty > 1) { + qty = parseInt($(item_row[j]).children('#item_qty').text()) + qty; + }else{ + qty = parseInt($(item_row[j]).children('#item_qty').text()) + 1; + } + + $(item_row[j]).children('#item_qty').text(qty); + parseFloat($(item_row[j]).children('#item_price').text(parseFloat(price*qty).toFixed(2))); + append =1; + }else{ + if (qty > 1) { + qty = qty; + }else{ + qty = 1; + } + } + }); + if (append===0) { + row ="" + +''+rowCount+'' + +'' + items[i].name+ ' ' + instance + ' ' + option_name +'' + +'' + qty + '' + +'' + + parseFloat(price).toFixed(2) + +'' + +''; + $(".second_display_items tbody").append(row); + + } + } + } + if (status == "set_add") { + // var option_arr = []; + var attribute_arr = []; + var rowCount = $('.second_display_items tbody tr').length+1; + for(var i in items) { + code = items[i].code; + item_code = items[i].item_code; + name = items[i].name; + item_name = items[i].item_name; + qty = items[i].qty; + price = items[i].price; + option = items[i].option; + sub_item = items[i].sub_item; + total = qty * price ; + // option_arr.push(option); + row ="" + +''+rowCount+'' + +'' + item_name+ ' ' + name + ''+option+'' + +'' + qty + '' + +'' + + parseFloat(total).toFixed(2) + +'' + +''; + $(".second_display_items tbody").append(row); + rowCount = rowCount + 1; + + } + } + //end apend items + var total_price = 0; + var taxable_amount = 0; + var total_discount = 0 + var total_tax_amount = 0 + var item_row = $('.second_display_items tbody tr'); + //calculate Sub Total + $(item_row).each(function(i){ + var unit_price = parseFloat($(item_row[i]).attr('data-price')); + var qty = parseFloat($(item_row[i]).children('#item_qty').text()); + total_price += qty*unit_price; + }); + //calculate Tax Amount + for(var i in tax) { + // substract , to give after discount + var total_tax = total_price - total_discount + // include or execulive + if (tax[i].inclusive){ + rate = tax[i].rate + divided_value = (100 + rate)/rate + total_tax_amount = total_tax_amount + (total_tax / divided_value) + }else{ + total_tax_amount = total_tax_amount + (total_tax * tax[i].rate / 100) + } + } + //end calculate Tax amount + var fixed_total_price = parseFloat(total_price).toFixed(2); + var fixed_taxable_amount = parseFloat(total_tax_amount).toFixed(2); + var fixed_grand_total = parseFloat(total_price + total_tax_amount).toFixed(2); + + $('#s_sub_total').empty(); + $('#s_sub_total').append(fixed_total_price); + $('#s_tatal_tax').empty(); + $('#s_tatal_tax').append(fixed_taxable_amount); + $('#s_grand_total').empty(); + $('#s_grand_total').append(fixed_grand_total); + } + +}); + diff --git a/app/assets/javascripts/wow_script.js b/app/assets/javascripts/wow_script.js new file mode 100644 index 00000000..d15d5798 --- /dev/null +++ b/app/assets/javascripts/wow_script.js @@ -0,0 +1 @@ +jQuery("#wowslider-container").wowSlider({effect:"rotate",prev:"",next:"",duration:20*100,delay:20*100,width:580,height:212,autoPlay:true,stopOnHover:false,loop:false,bullets:true,caption:true,captionEffect:"slide",controls:true,logo:"",images:0}); \ No newline at end of file diff --git a/app/assets/javascripts/wowslider.js b/app/assets/javascripts/wowslider.js new file mode 100644 index 00000000..5179927a --- /dev/null +++ b/app/assets/javascripts/wowslider.js @@ -0,0 +1,337 @@ +// ----------------------------------------------------------------------------------- +// http://wowslider.com/ +// JavaScript Wow Slider is a free software that helps you easily generate delicious +// slideshows with gorgeous transition effects, in a few clicks without writing a single line of code. +// Generated by WOW Slider 2.7 +jQuery.fn.wowSlider = function (d) { + var e = jQuery; + var h = this; + var t = h.get(0); + d = e.extend({ + prev: "", + next: "", + duration: 1000, + delay: 20 * 100, + width: 960, + height: 360, + controls: true, + autoPlay: true, + bullets: true, + }, d); + var a = e(".ws_images", h); + var l = a.find("ul"); + + function u(D) { + l.css({ + left: -D + "00%" + }) + } + e("
") + .css({ + width: "100%", + visibility: "hidden", + "font-size": 0, + "line-height": 0 + }) + .append(a.find("li:first img:first") + .clone() + .css({ + width: "100%" + })) + .prependTo(a); + l.css({ + position: "absolute", + top: 0, + animation: "none", + "-moz-animation": "none", + "-webkit-animation": "none" + }); + var m = a.find("li"); + var v = m.length; + + function i(D) { + return ((D || 0) + v) % v + } + var C = navigator.userAgent; + if ((e.browser.msie && parseInt(e.browser.version, 10) < 8) || (/Safari/.test(C))) { + var b = Math.pow(10, Math.ceil(Math.LOG10E * Math.log(v))); + l.css({ + width: b + "00%" + }); + m.css({ + width: 100 / b + "%" + }) + } else { + l.css({ + width: v + "00%", + display: "table" + }); + m.css({ + display: "table-cell", + "float": "none", + width: "auto" + }) + } + u(0); + var k = []; + m.each(function (D) { + var F = e(">img:first,>a:first,>div:first", this) + .get(0); + var G = e("
"); + for (var E = 0; E < this.childNodes.length;) { + if (this.childNodes[E] != F) { + G.append(this.childNodes[E]) + } else { + E++ + } + } + if (!e(this) + .data("descr")) { + e(this) + .data("descr", G.html() + .replace(/^\s+|\s+$/g, "")) + } + e(this) + .css({ + "font-size": 0 + }); + k[k.length] = e(">a>img", this) + .get(0) || e(">*", this) + .get(0) + }); + k = e(k); + k.css("visibility", "visible"); + + function f(F, D, E) { + this.go = function (G) { + E.find("ul") + .stop(true) + .animate({ + left: (G ? -G + "00%" : (/Safari/.test(navigator.userAgent) ? "0%" : 0)) + }, F.duration, "easeInOutExpo"); + return G + } + } + var o = new f(d, k, a); + var c = 0; + + function r(F, E, D) { + if (isNaN(F)) { + F = c + 1 + } + F = i(F); + if (c == F) { + return + } + s(F, E, D) + } + function s(F, E, D) { + var F = o.go(F, c, E, D); + if (F < 0) { + return + } + q(F); + j(m[F]); + c = F; + z() + } + var B = h.find(".ws_bullets"); + + function q(D) { + if (B.length) { + n(D) + } + } + var p; + + function z(D) { + w(); + if (d.autoPlay) { + p = setTimeout(function () { + r() + }, d.delay + (D ? 0 : d.duration)) + } + } + function w() { + if (p) { + clearTimeout(p) + } + p = null + } + function y(G, F, E, D) { + w(); + G.preventDefault(); + r(F, E, D); + z() + } + if (d.controls) { + var x = e('' + d.next + ""); + var g = e('' + d.prev + ""); + h.append(x); + h.append(g); + x.bind("click", function (D) { + y(D, c + 1) + }); + g.bind("click", function (D) { + y(D, c - 1) + }) + } + function A() { + h.find(".ws_bullets a") + .click(function (L) { + y(L, e(this) + .index()) + }); + if (B.length) { + var F = B.find(">div"); + var K = e("a", B); + var I = K.find("IMG"); + if (I.length) { + var H = e('
') + .appendTo(F); + var E = e("
") + .css({ + width: I.length + 1 + "00%" + }) + .appendTo(e("
") + .appendTo(H)); + I.appendTo(E); + e("") + .appendTo(H); + var G = -1; + + function J(N) { + if (N < 0) { + N = 0 + } + e(K.get(G)) + .removeClass("ws_overbull"); + e(K.get(N)) + .addClass("ws_overbull"); + H.show(); + var O = { + left: K.get(N) + .offsetLeft - H.width() / 2, + "margin-top": K.get(N) + .offsetTop - K.get(0) + .offsetTop + "px", + "margin-bottom": -K.get(N) + .offsetTop + K.get(K.length - 1) + .offsetTop + "px" + }; + var M = I.get(N); + var L = { + left: -M.offsetLeft + (e(M) + .outerWidth(true) - e(M) + .outerWidth()) / 2 + }; + if (G < 0) { + H.css(O); + E.css(L) + } else { + if (!document.all) { + O.opacity = 1 + } + H.stop() + .animate(O, "fast"); + E.stop() + .animate(L, "fast") + } + G = N + } + K.hover(function () { + J(e(this) + .index()) + }); + var D; + F.hover(function () { + if (D) { + clearTimeout(D); + D = 0 + } + J(G) + }, function () { + K.removeClass("ws_overbull"); + if (document.all) { + if (!D) { + D = setTimeout(function () { + H.hide(); + D = 0 + }, 400) + } + } else { + H.stop() + .animate({ + opacity: 0 + }, { + duration: "fast", + complete: function () { + H.hide() + } + }) + } + }); + F.click(function (L) { + y(L, e(L.target) + .index()) + }) + } + } + } + function n(D) { + e("A", B) + .each(function (E) { + if (E == D) { + e(this) + .addClass("ws_selbull") + } else { + e(this) + .removeClass("ws_selbull") + } + }) + } + h.append(""); + + function j(E) { + var G = e("img", E) + .attr("title"); + var F = e(E) + .data("descr"); + var D = e(".ws-title", h); + D.stop(1, 1) + .stop(1, 1) + .fadeOut(1000 / 3, function () { + if (G || F) { + D.html((G ? "" + G + "" : "") + (F ? "
" + F + "
" : "")); + D.fadeIn(400, function () { + if (e.browser.msie) { + e(this) + .get(0) + .style.removeAttribute("filter") + } + }) + } + }) + } + if (B.length) { + A() + } + q(c); + j(m[c]); + z(1); + return this +}; +jQuery.extend(jQuery.easing, { + easeInOutExpo: function (e, f, a, h, g) { + if (f == 0) { + return a + } + if (f == g) { + return a + h + } + if ((f /= g / 2) < 1) { + return h / 2 * Math.pow(2, 10 * (f - 1)) + a + } + return h / 2 * (-Math.pow(2, - 10 * --f) + 2) + a + } +}); diff --git a/app/assets/stylesheets/wow_style.css b/app/assets/stylesheets/wow_style.css new file mode 100644 index 00000000..4080a69d --- /dev/null +++ b/app/assets/stylesheets/wow_style.css @@ -0,0 +1,220 @@ +/* + * generated by WOW Slider 2.5 + * template Quiet + */ +@import url("http://fonts.googleapis.com/css?family=Oswald"); +#wowslider-container { + zoom: 1; + position: relative; + max-width:580px; + margin:0 auto; + z-index:100; + border:none; + text-align:left; /* reset align=center */ +} +* html #wowslider-container{ width:580px } +#wowslider-container ul{ + position:relative; + width: 10000%; + height:auto; + left:0; + list-style:none; + margin:0; + padding:0; + border-spacing:0; + overflow: visible; + /*table-layout:fixed;*/ +} +#wowslider-container .ws_images ul li{ + width:1%; + line-height:0; /*opera*/ + float:left; + font-size:0; + padding:0 0 0 0; + margin:0 0 0 0; +} + +#wowslider-container .ws_images{ + position: relative; + left:0; + top:0; + width:100%; + height:100%; + overflow:hidden; +} +#wowslider-container .ws_images a{ + width:100%; + display:block; + color:transparent; +} + +#wowslider-container .ws_images img{ + width:100%; + border:none 0; + max-width: none; +} +#wowslider-container a{ + text-decoration: none; + outline: none; + border: none; +} + +#wowslider-container .ws_bullets { + font-size: 0px; + float: left; + position:absolute; + z-index:70; +} +#wowslider-container .ws_bullets div{ + position:relative; + float:left; +} +#wowslider-container a.wsl{ + display:none; +} +#wowslider-container .ws_bullets { + padding: 10px; +} +#wowslider-container .ws_bullets a { + width:15px; + height:15px; + background: url(./bullet.png) left top; + float: left; + text-indent: -4000px; + position:relative; + margin-left:3px; + color:transparent; +} +#wowslider-container .ws_bullets a:hover{ + background-position: 0 50%; +} +#wowslider-container .ws_bullets a.ws_selbull{ + background-position: 0 100%; +} +#wowslider-container a.ws_next, #wowslider-container a.ws_prev { + position:absolute; + display:none; + top:50%; + margin-top:-50px; + z-index:60; + height: 100px; + width: 60px; + background-image: url(./arrows.png); +} +#wowslider-container a.ws_next{ + background-position: 100% 0; + right:0; +} +#wowslider-container a.ws_prev { + left:0; + background-position: 0 0; +} +* html #wowslider-container a.ws_next,* html #wowslider-container a.ws_prev{display:block} +#wowslider-container:hover a.ws_next, #wowslider-container:hover a.ws_prev {display:block} +/* bottom center */ +#wowslider-container .ws_bullets { + top: 5px; + right: 10px; +} +#wowslider-container .ws_bullets .ws_bulframe { + top: 20px; +} +#wowslider-container .ws_bullets .ws_bulframe { + top: 20px; +} +#wowslider-container .ws-title{ + position: absolute; + bottom: 10%; + left: 7%; + z-index: 50; + padding:12px; + color: #000000; + background:#fff; + font-family:Oswald,Impact,Charcoal,sans-serif; + font-size: 30px; + text-shadow: 1px 1px 1px #BBBBBB; + line-height: 30px; + border-radius:5px; + -moz-border-radius:5px; + -webkit-border-radius:5px; + opacity:0.5; + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); +} +#wowslider-container .ws-title div{ + font-size: 25px; + text-shadow: 1px 1px 1px #000000; +}#wowslider-container ul{ + animation: wsBasic 12s infinite; + -moz-animation: wsBasic 12s infinite; + -webkit-animation: wsBasic 12s infinite; +} +@keyframes wsBasic{0%{left:-0%} 16.67%{left:-0%} 33.33%{left:-100%} 50%{left:-100%} 66.67%{left:-200%} 83.33%{left:-200%} } +@-moz-keyframes wsBasic{0%{left:-0%} 16.67%{left:-0%} 33.33%{left:-100%} 50%{left:-100%} 66.67%{left:-200%} 83.33%{left:-200%} } +@-webkit-keyframes wsBasic{0%{left:-0%} 16.67%{left:-0%} 33.33%{left:-100%} 50%{left:-100%} 66.67%{left:-200%} 83.33%{left:-200%} } + +#wowslider-container .ws_shadow{ + background: url(./shadow.png) left 100%; + background-repeat: no-repeat; + background-size:100%; + width:100%; + height:20%; + position: absolute; + left:0; + bottom:-20%; + z-index:-1; +} +* html #wowslider-container .ws_shadow{/*ie6*/ + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( src='wowslider/install/shadow.png', sizingMethod='scale'); +} +*+html #wowslider-container .ws_shadow{/*ie7*/ + background:none; + filter:progid:DXImageTransform.Microsoft.AlphaImageLoader( src='wowslider/install/shadow.png', sizingMethod='scale'); +} +#wowslider-container .ws_bullets a img{ + text-indent:0; + display:block; + top:15px; + left:-123px; + visibility:hidden; + position:absolute; + -moz-box-shadow: 0 0 5px #999999; + box-shadow: 0 0 5px #999999; + border: 5px solid #FFFFFF; + max-width:none; +} +#wowslider-container .ws_bullets a:hover img{ + visibility:visible; +} + +#wowslider-container .ws_bulframe div div{ + height:90px; + overflow:visible; + position:relative; +} +#wowslider-container .ws_bulframe div { + left:0; + overflow:hidden; + position:relative; + width:246px; + background-color:#FFFFFF; +} +#wowslider-container .ws_bullets .ws_bulframe{ + display:none; + overflow:visible; + position:absolute; + cursor:pointer; + -moz-box-shadow: 0 0 5px #999999; + box-shadow: 0 0 5px #999999; + border: 5px solid #FFFFFF; +} +#wowslider-container .ws_bulframe span{ + display:block; + position:absolute; + top:-11px; + margin-left:-5px; + left:123px; + background:url(./triangle.png); + width:15px; + height:6px; +} \ No newline at end of file diff --git a/app/channels/second_display_channel.rb b/app/channels/second_display_channel.rb new file mode 100644 index 00000000..90f53508 --- /dev/null +++ b/app/channels/second_display_channel.rb @@ -0,0 +1,11 @@ +class SecondDisplayChannel < ApplicationCable::Channel + def subscribed + stream_from "second_display_channel" + end + + def unsubscribed + stop_all_streams + # Any cleanup needed when channel is unsubscribed + end + +end \ No newline at end of file diff --git a/app/channels/second_display_view_channel.rb b/app/channels/second_display_view_channel.rb new file mode 100644 index 00000000..e0b6322e --- /dev/null +++ b/app/channels/second_display_view_channel.rb @@ -0,0 +1,11 @@ +class SecondDisplayViewChannel < ApplicationCable::Channel + def subscribed + stream_from "second_display_view_channel" + end + + def unsubscribed + stop_all_streams + # Any cleanup needed when channel is unsubscribed + end + +end \ No newline at end of file diff --git a/app/controllers/origami/addorders_controller.rb b/app/controllers/origami/addorders_controller.rb index 3b05856f..7dd2b3f0 100755 --- a/app/controllers/origami/addorders_controller.rb +++ b/app/controllers/origami/addorders_controller.rb @@ -1,4 +1,4 @@ -class Origami::AddordersController < ApplicationController#BaseOrigamiController +class Origami::AddordersController < BaseOrigamiController # before_action :set_dining, only: [:detail] def index @@ -161,10 +161,15 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController end @status, @booking = @order.generate + + # Order.send_customer_view(@booking) + if current_user.role != "waiter" && params[:create_type] == "create_pay" if @status && @booking && @order.source == 'quick_service' @status, @sale = Sale.request_bill(@order,current_user,current_login_employee) + # for second display + ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale" result = {:status=> @status, :data => @sale } render :json => result.to_json end diff --git a/app/controllers/origami/home_controller.rb b/app/controllers/origami/home_controller.rb index 184daca4..6a6c0c90 100755 --- a/app/controllers/origami/home_controller.rb +++ b/app/controllers/origami/home_controller.rb @@ -93,9 +93,6 @@ class Origami::HomeController < BaseOrigamiController @account_arr = Array.new if @customer.tax_profiles accounts = @customer.tax_profiles - puts accounts.to_json - puts "sssssssssss" - puts @customer.tax_profiles @account_arr =[] accounts.each do |acc| account = TaxProfile.find(acc) diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 6a726199..8c83a356 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -228,6 +228,23 @@ class Origami::PaymentsController < BaseOrigamiController @individual_total.push({'total_customer' => saleObj.equal_persons.to_i, 'per_person_amount' => per_person_amount.to_f }) end + # rounding adjustment + # if @shop.is_rounding_adj + # a = saleObj.grand_total % 25 # Modulus + # b = saleObj.grand_total / 25 # Division + # #not calculate rounding if modulus is 0 and division is even + # #calculate rounding if modulus is zero or not zero and division are not even + # if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0) + # new_total = Sale.get_rounding_adjustment(saleObj.grand_total) + # @rounding_adj = new_total-saleObj.grand_total + # else + # @rounding_adj = @sale_data.rounding_adjustment + # end + # else + # @rounding_adj = @sale_data.rounding_adjustment + # end + #end rounding adjustment + # rounding adjustment if @shop.is_rounding_adj a = saleObj.grand_total % 25 # Modulus @@ -237,6 +254,7 @@ class Origami::PaymentsController < BaseOrigamiController if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0) new_total = Sale.get_rounding_adjustment(saleObj.grand_total) @rounding_adj = new_total-saleObj.grand_total + saleObj.update_attributes(grand_total: new_total,old_grand_total: saleObj.grand_total,rounding_adjustment:@rounding_adj) else @rounding_adj = @sale_data.rounding_adjustment end diff --git a/app/controllers/origami/second_display_controller.rb b/app/controllers/origami/second_display_controller.rb new file mode 100644 index 00000000..8d2efd6f --- /dev/null +++ b/app/controllers/origami/second_display_controller.rb @@ -0,0 +1,23 @@ +class Origami::SecondDisplayController < BaseOrigamiController + + def index + + end + + def customer_view + if params[:status]!= "billed" + tax_profiles = TaxProfile.all.order("order_by asc") + else + tax_profiles = nil + end + + ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status] + end + #Shop Name in Navbor + helper_method :shop_detail + def shop_detail + @shop = Shop.first + end + + +end diff --git a/app/controllers/origami/table_invoices_controller.rb b/app/controllers/origami/table_invoices_controller.rb index f6190230..a84f6ca7 100755 --- a/app/controllers/origami/table_invoices_controller.rb +++ b/app/controllers/origami/table_invoices_controller.rb @@ -46,6 +46,7 @@ class Origami::TableInvoicesController < BaseOrigamiController if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0) new_total = Sale.get_rounding_adjustment(sale.grand_total) sale.rounding_adjustment = new_total-sale.grand_total + sale.update_attributes(grand_total: new_total,old_grand_total: sale.grand_total,rounding_adjustment:sale.rounding_adjustment) end end #end rounding adjustment diff --git a/app/controllers/reports/product_sale_controller.rb b/app/controllers/reports/product_sale_controller.rb index 38a77115..9791545e 100644 --- a/app/controllers/reports/product_sale_controller.rb +++ b/app/controllers/reports/product_sale_controller.rb @@ -18,4 +18,10 @@ class Reports::ProductSaleController < BaseReportController format.xls end end + + #Shop Name in Navbor + helper_method :shop_detail + def shop_detail + @shop = Shop.first + end end diff --git a/app/models/ability.rb b/app/models/ability.rb index 95c6005f..de43d71f 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -93,6 +93,11 @@ class Ability can :index, :home can :show, :home + #ability for split_bill + can :index, :split_bill + can :create, :split_bill + can :update_sale, :split_bill + elsif user.role == "cashier" # can :overall_void, :void @@ -191,6 +196,11 @@ class Ability can :index, :home can :show, :home + + #ability for split_bill + can :index, :split_bill + can :create, :split_bill + can :update_sale, :split_bill elsif user.role == "waiter" can :index, :home can :show, :home diff --git a/app/models/order.rb b/app/models/order.rb index 739de71a..1508c960 100755 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -290,7 +290,7 @@ class Order < ApplicationRecord cup_status = `#{"sudo service cups status"}` print_status = check_cup_status(cup_status) sidekiq = Lookup.find_by_lookup_type("sidekiq") - + if print_status if !sidekiq.nil? OrderQueueProcessorJob.perform_later(self.id, self.table_id) @@ -487,6 +487,42 @@ class Order < ApplicationRecord end end + def self.send_customer_view(booking) + @status = "" + @data_array = Array.new + if(!booking.sale_id.nil?) + sale = Sale.find(booking.sale_id) + if sale.sale_status != "completed" && sale.sale_status != 'void' + @data_array.push(sale) + @status = "sale" + @data_obj = sale + end + else + + @status = "order" + booking.booking_orders.each do |booking_order| + @data_obj = Order.find(booking_order.order_id) + if (@data_obj.status == "new") + @data_obj.order_items.each do |item| + if !item.set_menu_items.nil? + instance_item_sets = JSON.parse(item.set_menu_items) + arr_instance_item_sets = Array.new + instance_item_sets.each do |instance_item| + item_instance_name = MenuItemInstance.find_by_item_instance_code(instance_item["item_instance_code"]).item_instance_name + arr_instance_item_sets.push(item_instance_name) + item.price = item.price.to_f + instance_item["price"].to_f + end + item.set_menu_items = arr_instance_item_sets + end + @data_array.push(item) + + end + end + end + end + ActionCable.server.broadcast "second_display_channel",data: @data_array,status:@status + end + private def generate_custom_id diff --git a/app/models/sale.rb b/app/models/sale.rb index 29e32c14..f0b5aeed 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -913,15 +913,15 @@ def self.get_shift_sales_by_receipt_no(shift_sale_range,shift,from,to,payment_ty query = Sale.all if shift.present? - query = query.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sales.payment_status= 'paid' and sale_payments.payment_amount != 0", shift.to_a) + query = query.where("sales.shift_sale_id in (?) #{payment_type} and sale_status= 'completed' and sale_payments.payment_amount != 0", shift.to_a) .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") .group("sales.sale_id") elsif shift_sale_range.present? - query = query.where("sale_status='completed' #{payment_type} and sale_payments.payment_amount != 0 and sales.payment_status= 'paid' and sales.shift_sale_id in (?)",shift_sale_range.to_a) + query = query.where("sale_status='completed' #{payment_type} and sale_payments.payment_amount != 0 and sales.shift_sale_id in (?)",shift_sale_range.to_a) .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") .group("sales.sale_id") else - query = query.where("sale_status='completed' and sales.receipt_date between ? and ? #{payment_type} and sales.payment_status= 'paid' and sale_payments.payment_amount != 0",from,to) + query = query.where("sale_status='completed' and sales.receipt_date between ? and ? #{payment_type} and sale_payments.payment_amount != 0",from,to) .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") .group("sales.sale_id") end @@ -1112,7 +1112,7 @@ end " i.price as unit_price,mi.name as product_name") .joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code") .where("(i.qty > 0 and i.price > 0) and receipt_date between '#{from}' and '#{to}'"+ - "and payment_status='paid' and sale_status= 'completed'") + "and sale_status= 'completed'") .group('mi.name') .order("SUM(i.qty) DESC").limit(20) else @@ -1120,7 +1120,7 @@ end " i.price as unit_price,mi.name as product_name") .joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code") .where("(i.qty > 0 and i.price > 0) and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'"+ - "and payment_status='paid' and sale_status= 'completed'") + "and sale_status= 'completed'") .group('mi.name') .order("SUM(i.qty) DESC").limit(20) end @@ -1132,7 +1132,7 @@ end " i.price as unit_price,mi.name as product_name") .joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code") .where("(i.qty > 0 and i.price > 0) and receipt_date between '#{from}' and '#{to}'"+ - "and payment_status='paid' and sale_status= 'completed'") + "and sale_status= 'completed'") .group('mi.name') .order("SUM(i.qty) ASC").limit(20) else @@ -1140,7 +1140,7 @@ end " i.price as unit_price,mi.name as product_name") .joins("JOIN sale_items i ON i.sale_id = sales.sale_id JOIN menu_items mi ON i.product_code = mi.item_code") .where("(i.qty > 0 and i.price > 0) and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'"+ - "and payment_status='paid' and sale_status= 'completed'") + "and sale_status= 'completed'") .group('mi.name') .order("SUM(i.qty) ASC").limit(20) end @@ -1149,12 +1149,12 @@ end def self.hourly_sales(today,from,to) if !from.nil? && !to.nil? query= Sale.select("grand_total") - .where('payment_status="paid" and sale_status = "completed" and receipt_date between ? and ?',from,to) + .where('sale_status = "completed" and receipt_date between ? and ?',from,to) .group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')") .order('receipt_date') else query= Sale.select("grand_total") - .where('payment_status="paid" and sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today) + .where('sale_status = "completed" and DATE_FORMAT(receipt_date,"%Y-%m-%d") = ?',today) .group("date_format(CONVERT_TZ(receipt_date,'+00:00', 'SYSTEM'), '%I %p')") .order('receipt_date') end diff --git a/app/views/oqs/home/index.html.erb b/app/views/oqs/home/index.html.erb index 585f9968..ee73d560 100644 --- a/app/views/oqs/home/index.html.erb +++ b/app/views/oqs/home/index.html.erb @@ -1,5 +1,5 @@ -
+
@@ -20,7 +20,6 @@