merge origin master
This commit is contained in:
@@ -272,17 +272,19 @@
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<button type="button" class="btn btn-primary btn-block" >Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled=""> Void </button>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" >Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</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="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
@@ -416,35 +418,41 @@ $('#add_invoice').on('click',function(){
|
||||
//show cusotmer rebate amount
|
||||
function show_customer_details(customer_id){
|
||||
var url = '<%= @show_customer_details_path %>'
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#customer_name").text(data["customer"].name);
|
||||
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">' + "Rebate Balance" +'</td>'
|
||||
+'<td class="item-attr">' + balance + '</td>';
|
||||
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#customer_name").text(data["customer"].name);
|
||||
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">' + "Rebate Balance" +'</td>'
|
||||
+'<td class="item-attr">' + balance + '</td>';
|
||||
|
||||
$(".rebate_amount").html(row);
|
||||
}
|
||||
|
||||
$(".rebate_amount").html(row);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('.rebate_amount').addClass('hide');
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
//End Ajax
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('.rebate_amount').addClass('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
//End Ajax
|
||||
}
|
||||
|
||||
$('#edit').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user