Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
superuser
2017-06-16 19:56:56 +06:30
30 changed files with 436 additions and 218 deletions

View File

@@ -51,6 +51,7 @@ $(document).ready(function(){
var customer_id=$(this).find(".customer-id").text();
show_customer_details(customer_id);
$("#re-print").val(unique_id);
var cashier="";
var receipt_date="";
@@ -200,6 +201,14 @@ $(document).ready(function(){
return false;
});
$('#re-print').click(function() {
var sale_id = $(".selected-item").find(".orders-id").text();
window.location.href = '/origami/'+ sale_id + "/reprint"
return false;
});
function show_customer_details(customer_id){
if(window.location.pathname.substring(0, 12) == "/origami/SAL"){
@@ -218,20 +227,24 @@ $(document).ready(function(){
dataType: "json",
success: function(data) {
$("#customer_name").text(data["customer"].name);
$.each(data["response_data"]["data"], function (i) {
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
var balance = data["response_data"]["data"][i]["balance"];
if (data["response_data"]["status"]==true) {
$('.rebate_amount').removeClass('hide');
row =
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
+'<td class="item-attr">' + balance + '</td>';
if (data["response_data"]["data"].length) {
$.each(data["response_data"]["data"], function (i) {
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
var balance = data["response_data"]["data"][i]["balance"];
if (data["response_data"]["status"]==true) {
$('.rebate_amount').removeClass('hide');
row =
'<td class="charges-name">' + data["response_data"]["data"][i]["accountable_type"] +'</td>'
+'<td class="item-attr">' + balance + '</td>';
$(".rebate_amount").html(row);
}
$(".rebate_amount").html(row);
}
}
});
}
});
}else{
$('.rebate_amount').addClass('hide');
}
}
});
//End Ajax
@@ -298,19 +311,25 @@ function control_button(order_status){
$("#request_bills").prop('disabled', true);
$("#discount").prop('disabled', false);
$("#pay-bill").prop('disabled', false);
$("#re-print").prop('disabled', true);
}
else if(order_status=="new") {
$("#customer").prop('disabled', false);
$("#request_bills").prop('disabled', false);
$("#discount").prop('disabled', true);
$("#pay-bill").prop('disabled', true);
$("#re-print").prop('disabled', true);
}else if(order_status=="completed"){
$("#re-print").prop('disabled', false);
}
else {
$("#customer").prop('disabled', true);
$("#request_bills").prop('disabled', true);
$("#discount").prop('disabled', true);
$("#pay-bill").prop('disabled', true);
$("#re-print").prop('disabled', true);
}
}
/* For Receipt - Update Balance */