check first bill or not

This commit is contained in:
phyusin
2017-12-21 15:11:11 +06:30
parent 9b037f9daf
commit 11b8466e10
4 changed files with 91 additions and 14 deletions

View File

@@ -447,6 +447,19 @@ $(document).ready(function(){
// window.location.href = '/origami/order/' + order_id;
// })
/* start check first bill or not*/
var receipt_no = "";
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
receipt_no = ($("#receipt_no").html()).trim();
}
// console.log(checkReceiptNoInFirstBillData(receipt_no));
if(checkReceiptNoInFirstBillData(receipt_no)){
$("#pay").show();
}else{
$("#pay").hide();
}
/* end check first bill or not*/
$('.invoicedetails').on('click',function(){
var dining_id = "<%= @room.id %>";
var sale_id = this.id;
@@ -569,6 +582,10 @@ $("#first_bill").on('click', function(){
type: "GET",
url: ajax_url,
success:function(result){
receipt_no = ($("#receipt_no").html()).trim();
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no);
location.reload();
}
});