fixed conflix payment page

This commit is contained in:
Aung Myo
2018-03-11 16:37:33 +06:30
24 changed files with 948 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -684,6 +684,8 @@ $(function() {
$('.add_to_order').attr('data-attributes',JSON.stringify(attribute_arr));
$('.add_to_order').attr('data-options',JSON.stringify(option_arr));
var item_data = $(this);
item = get_item(item_data);
customer_display_view(item,"add");
show_item_detail(item_data);
calculate_sub_total();
@@ -692,6 +694,8 @@ $(function() {
// click plus icon for add
$(document).on('click', '.add_icon', function(event){
var item_data = $(this);
item = get_item(item_data);
customer_display_view(item,"add");
show_item_detail(item_data);
calculate_sub_total();
}); //End Add Icon Click
@@ -795,7 +799,8 @@ $(function() {
url: ajax_url,
data: params,
dataType: "json",
success:function(result){
success:function(result){
customer_display_view(null,"reload");
if (type == "quick_service") {
window.location.href = "/origami/quick_service"
}else{
@@ -824,9 +829,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 +864,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 +1154,35 @@ $(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;
}
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);
});*/

View File

@@ -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 ='<tr>'
+'<td>'+count+'</td>'
+'<td class="item-name">'+data_obj[i].item_name+'</td>'
+'<td class="item-attr">'+data_obj[i].qty +'</td>'
+ '<td class="item-attr">'+data_obj[i].qty*data_obj[i].price +'</td>'
+'</tr>'
$(".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);
}
}
});

View File

@@ -0,0 +1,112 @@
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") {
window.location.reload();
}
$('#second_display_slider').addClass("hidden")
$('#second_display_items').removeClass("hidden")
// append items
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+")";
}
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');
if (item_code == items[i].item_code && instance_code == items[i].instance_code) {
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 ="<tr class='item_box' data-price ='"
+price+ "' 'data-instance ='"
+instance+ "' data-code='"+items[i].item_code+"' data-instance-code='"
+items[i].instance_code+"' data-attributes='"
+items[i].attributes+"' data-options ='"
+items[i].options+"' data-row ='"+rowCount+ "'>"
+'<td class="item-cell-no">'+rowCount+'</td>'
+'<td class="item-cell-name" id="item_name" >' + items[i].name+ ' ' + instance +'</td>'
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
+'<td class="item-cell-price" id="item_price">'
+ parseFloat(price).toFixed(2)
+'</td>'
+'</tr>';
$(".second_display_items tbody").append(row);
}
}
//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);
}
});

View File

@@ -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});

View File

@@ -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("<div>")
.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("<div></div>");
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('<a href="#" class="ws_next">' + d.next + "</a>");
var g = e('<a href="#" class="ws_prev">' + d.prev + "</a>");
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('<div class="ws_bulframe"/>')
.appendTo(F);
var E = e("<div/>")
.css({
width: I.length + 1 + "00%"
})
.appendTo(e("<div/>")
.appendTo(H));
I.appendTo(E);
e("<span/>")
.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("<div class='ws-title' style='display:none'></div>");
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 ? "<span>" + G + "</span>" : "") + (F ? "<div>" + F + "</div>" : ""));
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
}
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -332,10 +332,10 @@
<td class="charges-name"><strong>Tax:
(<% @i = 0
@account_arr.each do |ct| %>
<%=ct.name%>
<% if @account_arr.count != @i+1%>
+ <% @i =+1 %>
<%end%>
<%=ct.name%>
<% if @account_arr.count != @i+1%>
+ <% @i =+1 %>
<%end%>
<%end %>)
</strong></td>
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0 %></strong></td>
@@ -424,6 +424,7 @@
<i class="material-icons">reply</i>
<%= t("views.btn.back") %>
</button>
<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" %>

View File

@@ -501,6 +501,7 @@ var customer_name = "<%= @customer.name %>";
$("#back").on('click', function() {
localStorage.removeItem('cash');
customer_display_view(null,"reload");
if (cashier_type=="cashier") {
window.location.href = '/origami/table/'+ dining_id;
}else{
@@ -608,6 +609,7 @@ var customer_name = "<%= @customer.name %>";
$("#changed_amount").text('Changed amount ' + parseFloat($('#balance').text() * (-1)));
<% end %>
}
customer_display_view(null,"reload");
//PDF lightbox data
// if($('#balance').text() < 0){
// swal({
@@ -684,6 +686,7 @@ var customer_name = "<%= @customer.name %>";
url: ajax_url,
data: "remark="+ remark + "&sale_id=" + sale_id,
success: function () {
customer_display_view(null,"reload");
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
@@ -841,6 +844,7 @@ var customer_name = "<%= @customer.name %>";
}
});
function update_balance(){
var cash = $('#cash').text();
var credit = $('#credit').text();
@@ -884,7 +888,8 @@ var customer_name = "<%= @customer.name %>";
type: "POST",
url: "<%= origami_payment_foc_path %>",
data: params,
success:function(result){
success:function(result){
customer_display_view(null,"reload");
if (cash >= 0) {
swal({
title: "Information!",
@@ -907,6 +912,16 @@ var customer_name = "<%= @customer.name %>";
}
});
function customer_display_view(data,status) {
$.ajax({
type: "POST",
url: '../../../customer_view',
data: {"data":data,"status":status},
dataType: "json",
success:function(result){
}
});
}
function calculate_member_discount(sale_id) {
var sub_total = $('#sub-total').text();
var member_id = $('#membership_id').text();

View File

@@ -0,0 +1,60 @@
<div class="row clearfix">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="card">
<div class="card-block">
<div class="card-text" >
<div id="order-detail-slimscroll" data-height="150">
<table class="table table-striped second_display_items" id="order-items-table">
<thead>
<tr>
<th>#</th>
<th class="item-name">Items</th>
<th class="item-">QTY</th>
<th class="item-">Price</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<div class="card-footer">
<table class="table" border="0">
<tr>
<td class="charges-name"><strong>Sub Total:</strong></td>
<td></td>
<td></td>
<td class="item-attr"><strong id="s_sub_total">0.00</strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Discount Amount:</strong></td>
<td></td>
<td></td>
<td class="item-attr"><strong id="s_total_discount">0.00</strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Tax Amount:</strong></td>
<td></td>
<td></td>
<td class="item-attr"><strong id="s_tatal_tax">0.00</strong></td>
</tr>
<tr>
<td class="charges-name"><strong>Grand:</strong></td>
<td></td>
<td></td>
<td class="item-attr"><strong id="s_grand_total">0.00</strong></td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
<%= image_tag("slider/s2.jpg", :alt => "rss feed") %>
</div>
</div>

View File

@@ -0,0 +1,18 @@
<%= stylesheet_link_tag 'wow_style', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'wowslider', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'wow_script', 'data-turbolinks-track': 'reload' %>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div id="wowslider-container" style="max-width: 100%;height: 530px ;">
<div class="ws_images full_screen">
<ul>
<li><%= image_tag("slider/s1.jpg", :alt => "rss feed") %></li>
<li><%= image_tag("slider/s2.jpg", :alt => "rss feed") %></li>
<li><%= image_tag("slider/s4.jpg", :alt => "rss feed") %></li>
</ul>
</div>
<div class="ws_bullets"></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,11 @@
<div class="container-fluid">
<div class="slider" id="second_display_slider">
<%= render 'slider' %>
</div>
<div class="item hidden" id="second_display_items">
<%= render 'second_display' %>
</div>
</div>

View File

@@ -41,6 +41,11 @@ Rails.application.config.assets.precompile += %w( fileinput.min.js )
Rails.application.config.assets.precompile += %w( addorder.css )
Rails.application.config.assets.precompile += %w( addorder.js )
# --- Customer/ Customer - Crm ----
Rails.application.config.assets.precompile += %w( wow_style.css )
Rails.application.config.assets.precompile += %w( wowslider.js )
Rails.application.config.assets.precompile += %w( wow_script.js )
# --- Custom SX Themem ----
Rails.application.config.assets.precompile += %w( sx-sidebar.css )

View File

@@ -95,6 +95,9 @@ scope "(:locale)", locale: /en|mm/ do
get "quick_service/modify_order/:sale_id" => "quick_service#modify_order"
post 'quick_service/update_modify_order' => "quick_service#update_modify_order", :defaults => { :format => 'json' }
resources :second_display
post '/customer_view' => "second_display#customer_view",:as => "customer_view", :defaults => { :format => 'json' }
resources :cash_ins, only: [:new, :create]
resources :cash_outs, only: [:new, :create]