pull origin master

This commit is contained in:
Yan
2017-09-18 13:53:28 +06:30
parent 4f3b831771
commit 8966f290b5
122 changed files with 3964 additions and 2277 deletions

View File

@@ -38,30 +38,30 @@
<div class="tab-pane dining active" id="tables" role="tabpanel">
<div class="card-columns">
<% @tables.each do |table| %>
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% else %>
<div class="card tables blue text-white" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% end %>
<% else %>
<div class="card tables blue text-white" data-id="<%= table.id %>">
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% end %>
<% else %>
<div class="card tables green text-white" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% end %>
<% end %>
</div>
</div>
@@ -70,19 +70,19 @@
<div class="tab-pane dining" id="rooms" role="tabpanel">
<div class="card-columns">
<% @rooms.each do |room| %>
<% if room.status == 'occupied' %>
<div class="card rooms red text-white" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
</div>
</div>
<% else %>
<div class="card rooms green text-white" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
</div>
</div>
<% end %>
<% if room.status == 'occupied' %>
<div class="card rooms red text-white" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
</div>
</div>
<% else %>
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
@@ -98,13 +98,13 @@
</div>
<% end %>
</div>
</div>
</div>
<!-- tabs - End -->
</div>
<div class="col-lg-2 col-md-2 col-sm-2">
<button id="refreshbutton" type="button" class="btn btn-block radius-btn"> Refresh off </button>
<!-- <button id="refreshbutton" type="button" class="btn btn-block radius-btn"> Refresh off </button> -->
<button id="cash_in" type="button" class="btn btn-block btn-primary"> Cash In </button>
<button id="cash_out" type="button" class="btn btn-block btn-primary"> Cash Out </button>
<!-- Temporary Disabled -->
@@ -146,72 +146,72 @@ $(document).ready(function(){
})
});
$(function() {
var timer;
// $(function() {
// var timer;
function start() {
timer = setTimeout(function() { console.log("refresh");window.location.reload()}, 10000); //10000
};
// function start() {
// timer = setTimeout(function() { console.log("refresh");window.location.reload()}, 10000); //10000
// };
function stop() {
clearTimeout(timer);
};
// 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(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<span class='glyphicon glyphicon-ok'></span>");
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<span class='glyphicon glyphicon-ok'></span>");
start();
}
else{
stop();
localStorage.setItem("refreshflag", 0);
$(this).html("Refresh off");
$(this).css("background-color","red");
}
}
});
// 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<span class='glyphicon glyphicon-ok'></span>");
// 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<span class='glyphicon glyphicon-ok'></span>");
// start();
// }
// else{
// stop();
// localStorage.setItem("refreshflag", 0);
// $(this).html("Refresh off");
// $(this).css("background-color","red");
// }
// }
// });
$('#cash_in').on('click',function(){
window.location.href = '/origami/cash_ins/new';

View File

@@ -43,25 +43,26 @@
<% if table.status == 'occupied' %>
<% if table.get_booking.nil? %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card-block">
<%= table.name %>
<span class="pull-right font-12"> billed</span>
<span class="pull-right font-12 new_text_<%= table.id %>"> billed</span>
<div style="font-size:12px;"></div>
</div>
</div>
<% else %>
<div class="card tables blue text-white" data-id="<%= table.id %>">
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card-block">
<%= table.name %>
<span class="pull-right font-12"> new</span>
<span class="pull-right font-12 new_text_<%= table.id %>"> new</span>
</div>
</div>
<% end %>
<% else %>
<div class="card tables green text-white" data-id="<%= table.id %>">
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
<div class="card-block">
<%= table.name %>
<span class="pull-right font-12 new_text_<%= table.id %> hide"> new</span>
</div>
</div>
<% end %>
@@ -75,20 +76,21 @@
<% @rooms.each do |room| %>
<% if room.status == 'occupied' %>
<div class="card rooms red text-white" data-id="<%= room.id %>">
<div class="card rooms red text-white table_<%= room.id %>" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
<% if room.get_booking.nil? %>
<span class="pull-right font-12"> billed</span>
<span class="pull-right font-12 new_text_<%= room.id %>"> billed</span>
<% else %>
<span class="pull-right font-12"> new</span>
<span class="pull-right font-12 new_text_<%= room.id %>"> new</span>
<% end %>
</div>
</div>
<% else %>
<div class="card rooms green text-white" data-id="<%= room.id %>">
<div class="card rooms green text-white table_<%= room.id %>" data-id="<%= room.id %>">
<div class="card-block">
<%= room.name %>
<span class="pull-right font-12 new_text_<%= room.id %> hide">
</div>
</div>
<% end %>
@@ -330,7 +332,7 @@
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
<button type="button" id="other-charges" class="btn btn-primary btn-block">Charges</button>
<button type="button" id="commissions" class="btn btn-primary btn-block">Commissions</button>
<button type="button" id="in_juties" class="btn btn-primary btn-block">In Juties</button>
<button type="button" id="in_duties" class="btn btn-primary btn-block">In Duties</button>
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</button>
@@ -577,9 +579,9 @@
window.location.href = '/origami/table/' + dining_id + "/sale/" + sale_id + "/load_commissioners";
});
$('#in_juties').on('click', function () {
$('#in_duties').on('click', function () {
var dining_id = "<%= @dining.id %>"
window.location.href = '/origami/assign_in_juty/'+ dining_id;
window.location.href = '/origami/assign_in_duty/'+ dining_id;
});
$('#void').on('click', function () {