diff --git a/app/views/layouts/_header_orgiami.html.erb b/app/views/layouts/_header_orgiami.html.erb index 9fc53f02..0ae18ff5 100644 --- a/app/views/layouts/_header_orgiami.html.erb +++ b/app/views/layouts/_header_orgiami.html.erb @@ -1,7 +1,7 @@
- Cashier Station 1 - <%= Time.now.strftime('%a, %d %b %Y %H:%M:%S %p') %> + Cashier Station 1 -
<% if current_login_employee %> @@ -10,3 +10,29 @@
+ +
diff --git a/app/views/origami/home/index.html.erb b/app/views/origami/home/index.html.erb index e1e530e8..08f53998 100644 --- a/app/views/origami/home/index.html.erb +++ b/app/views/origami/home/index.html.erb @@ -94,7 +94,7 @@
- +
@@ -117,4 +117,70 @@ $(document).ready(function(){ window.location.href = '/origami/order/' + order_id; }) }); +$(function() { + var timer; + + function start() { + timer = setTimeout(function() { console.log("refresh");window.location.reload()}, 30000); //10000 + }; + + function stop() { + clearTimeout(timer); + }; + + if(localStorage.getItem("refreshflag") != null){ + if (localStorage.getItem("refreshflag") == 0) { + $('#refreshbutton').html("Refresh off"); + $('#refreshbutton').css("background-color","red"); + stop(); + } + else{ + $('#refreshbutton').html("Refresh on"); + $('#refreshbutton').css("background-color","green"); + start(); + } + } + else{ + localStorage.setItem("refreshflag", 0); + } + var url = location.href; + if (location.href.slice(-1) == "/"){ + url = url.substring(0, url.length - 1); + } + var arr = url.split("/"); + + if(arr[arr.length-1] != "origami"){ + stop(); + } + $('#refreshbutton').bind("click", function(){ + if(localStorage.getItem("refreshflag") == "0"){ + localStorage.setItem("refreshflag", 1); + $(this).html("Refresh on"); + $(this).css("background-color","green"); + // $(this).html("Auto Refresh on"); + start(); + } + else{ + stop(); + localStorage.setItem("refreshflag", 0); + $(this).html("Refresh off"); + $(this).css("background-color","red"); + } + }); + function refreshing(){ + if(localStorage.getItem("refreshflag") == "0"){ + localStorage.setItem("refreshflag", 1); + $(this).html("Refresh on"); + $(this).css("background-color","green"); + // $(this).html("Auto Refresh on"); + start(); + } + else{ + stop(); + localStorage.setItem("refreshflag", 0); + $(this).html("Refresh off"); + $(this).css("background-color","red"); + } + } +}); diff --git a/app/views/origami/jcb/index.html.erb b/app/views/origami/jcb/index.html.erb index ac4b2438..e9cc09fa 100644 --- a/app/views/origami/jcb/index.html.erb +++ b/app/views/origami/jcb/index.html.erb @@ -134,6 +134,7 @@ $(document).on('click', '.cashier_number', function(event){ case 'del' : var cash=$('#amount').text(); $('#amount').text(cash.substr(0,cash.length-1)); + break; case 'nett': var remain_amount = $('#validamount').val(); $('#amount').text(remain_amount); diff --git a/app/views/origami/master/index.html.erb b/app/views/origami/master/index.html.erb index 09fe02b1..6afc1081 100644 --- a/app/views/origami/master/index.html.erb +++ b/app/views/origami/master/index.html.erb @@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){ case 'del' : var cash=$('#amount').text(); $('#amount').text(cash.substr(0,cash.length-1)); + break; case 'nett': var remain_amount = $('#validamount').val(); $('#amount').text(remain_amount); diff --git a/app/views/origami/mpu/index.html.erb b/app/views/origami/mpu/index.html.erb index eb2267e7..e8e25b2f 100644 --- a/app/views/origami/mpu/index.html.erb +++ b/app/views/origami/mpu/index.html.erb @@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){ case 'del' : var cash=$('#amount').text(); $('#amount').text(cash.substr(0,cash.length-1)); + break; case 'nett': var remain_amount = $('#validamount').val(); $('#amount').text(remain_amount); diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index fe36277b..ae642a9d 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -106,14 +106,14 @@
<%= @other %>
<% else %> -
+
Other Payments
<% end %> <% if @other != 0.0 %> -
+
MPU
<%= @other %>
@@ -127,7 +127,7 @@ <% end %> <% if @ppamount != 0.0 %> -
+
Paypar
<%= @ppamount %>
@@ -141,7 +141,7 @@ <% end %> <% if @visacount != 0.0 %> -
+
Visa
<%= @visacount %>
@@ -155,7 +155,7 @@ <% end %> <% if @jcbcount != 0.0 %> -
+
JCB
<%= @jcbcount %>
@@ -169,7 +169,7 @@ <% end %> <% if @mastercount != 0.0 %> -
+
Master
<%= @mastercount %>
diff --git a/app/views/origami/redeem_payments/index.html.erb b/app/views/origami/redeem_payments/index.html.erb index 7789480f..023912ca 100644 --- a/app/views/origami/redeem_payments/index.html.erb +++ b/app/views/origami/redeem_payments/index.html.erb @@ -129,6 +129,7 @@ $(document).on('click', '.cashier_number', function(event){ case 'del' : var cash=$('#used_amount').text(); $('#used_amount').text(cash.substr(0,cash.length-1)); + break; case 'nett': alert($('#valid_amount').text()) $('#used_amount').text($('#valid_amount').text()); diff --git a/app/views/origami/visa/index.html.erb b/app/views/origami/visa/index.html.erb index 49f1290a..1589ca1b 100644 --- a/app/views/origami/visa/index.html.erb +++ b/app/views/origami/visa/index.html.erb @@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){ case 'del' : var cash=$('#amount').text(); $('#amount').text(cash.substr(0,cash.length-1)); + break; case 'nett': var remain_amount = $('#validamount').val(); $('#amount').text(remain_amount);