Merge branch 'staging' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -19,8 +19,17 @@
|
||||
//= require bootstrap-datepicker
|
||||
|
||||
$(document).ready(function(){
|
||||
// auto refresh every 10 seconds
|
||||
setTimeout(function(){
|
||||
window.location.reload(1);
|
||||
}, 10000);
|
||||
|
||||
// For selected order return
|
||||
var order_status = "";
|
||||
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
|
||||
|
||||
// Enable/Disable Button
|
||||
control_button("disabled");
|
||||
control_button(order_status);
|
||||
|
||||
$(".orders").on('click', function(){
|
||||
$("#order-sub-total").text('');
|
||||
@@ -38,10 +47,6 @@ $(document).ready(function(){
|
||||
// Enable/Disable Button
|
||||
control_button(order_status);
|
||||
|
||||
//for customer button
|
||||
$("#customer").removeAttr('disabled');
|
||||
|
||||
|
||||
var customer_id=$(this).find(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
@@ -66,12 +71,15 @@ $(document).ready(function(){
|
||||
for (i = 0; i < result.length; i++) {
|
||||
var data = JSON.stringify(result[i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
var show_date = "";
|
||||
|
||||
// Receipt Header
|
||||
receipt_no = result[i].receipt_no;
|
||||
cashier = result[i].cashier_name;
|
||||
receipt_date = new Date(result[i].receipt_date);
|
||||
show_date = receipt_date.getDate() + "-" + receipt_date.getMonth() + "-" + receipt_date.getFullYear() + ' ' + receipt_date.getHours()+ ':' + receipt_date.getMinutes()
|
||||
if(result[i].receipt_date != null){
|
||||
receipt_date = new Date(result[i].receipt_date);
|
||||
show_date = receipt_date.getDate() + "-" + receipt_date.getMonth() + "-" + receipt_date.getFullYear() + ' ' + receipt_date.getHours()+ ':' + receipt_date.getMinutes()
|
||||
}
|
||||
|
||||
$("#receipt_no").text(receipt_no);
|
||||
$("#cashier").text(cashier == null ? "" : cashier);
|
||||
@@ -283,18 +291,21 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
/* Button Control by Status */
|
||||
function control_button(order_status){
|
||||
if(order_status=="billed"){
|
||||
function control_button(order_status){
|
||||
if(order_status=="billed"){
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', false);
|
||||
$("#pay-bill").prop('disabled', false);
|
||||
}
|
||||
else if(order_status=="new") {
|
||||
$("#customer").prop('disabled', false);
|
||||
$("#request_bills").prop('disabled', false);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
}
|
||||
else {
|
||||
$("#customer").prop('disabled', true);
|
||||
$("#request_bills").prop('disabled', true);
|
||||
$("#discount").prop('disabled', true);
|
||||
$("#pay-bill").prop('disabled', true);
|
||||
|
||||
Reference in New Issue
Block a user