Merge branch 'r-1902001-01' into foodcourt

This commit is contained in:
Thein Lin Kyaw
2020-08-25 11:56:57 +06:30
8 changed files with 124 additions and 91 deletions

View File

@@ -817,10 +817,8 @@
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
if (discount) {
if(checkReceiptNoInFirstBillData(receipt_no,"")){
$("button.change_tax").hide();
$("#pay").show();
}else{
$("button.change_tax").show();
$("#pay").hide();
}
}
@@ -832,6 +830,7 @@
var sale_id = this.id;
window.location.href = '/origami/table/' + dining_id + "/table_invoice/" + sale_id;
})
$(".tables").on('click', function () {
localStorage.setItem('dinning_type','table');
var customer_id = $(".customer-id").text();
@@ -1157,32 +1156,35 @@
})
$('#add_invoice').on('click', function () {
$("#first_bill").prop('disabled',true);
$("#pay").prop('disabled',true);
var dining_id = "<%= @dining.id %>";
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
var ajax_url = "/origami/sale/append_order";
// var tax_type = localStorage.getItem("tax_type");
var tax_type = $("#check_tax").val();
$.ajax({
type: "POST",
url: ajax_url,
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
success: function (result) {
swal({
title: "Information!",
text: "Invoice updated",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
$("#first_bill").removeAttr('disabled');
$("#pay").removeAttr('disabled');
window.location.reload();
});
}
});
$("#loading_wrapper").show();
$("#add_invoice").prop('disable', true);
$("#first_bill").prop('disabled',true);
$("#pay").prop('disabled',true);
var dining_id = "<%= @dining.id %>";
var sale_id = $("#sale_id").val(); //<%= @obj_sale.sale_id rescue "" %>
var ajax_url = "/origami/sale/append_order";
// var tax_type = localStorage.getItem("tax_type");
var tax_type = $("#check_tax").val();
$.ajax({
type: "POST",
url: ajax_url,
data: 'dining_id=' + dining_id + "&sale_id=" + sale_id + "&tax_type=" + tax_type,
success: function (result) {
swal({
title: "Information!",
text: "Invoice updated",
html: true,
closeOnConfirm: false,
closeOnCancel: false,
allowOutsideClick: false
}, function () {
$("#first_bill").removeAttr('disabled');
$("#pay").removeAttr('disabled');
window.location.reload();
});
$("#loading_wrapper").hide();
}
});
})
//show cusotmer rebate amount