add customer at first
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
}
|
||||
</style>
|
||||
<%= javascript_include_tag 'custom', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'foodcourt/addorder', 'data-turbolinks-track': 'reload' %>
|
||||
|
||||
<div class="container-fluid h-100" style="padding:0px 3px 0px 3px;margin-top:20px">
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
@@ -355,19 +356,19 @@
|
||||
<%else%>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<%end%>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @sale.total_discount rescue 0%>)</strong></td>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @pending.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @sale.total_tax rescue 0%></strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @pending.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr"><strong id="order-round-adj"><%= @sale.rounding_adjustment rescue 0%></strong></td>
|
||||
<td class="item-attr"><strong id="order-round-adj"><%= @pending.rounding_adjustment rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @sale.grand_total rescue 0%></strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @pending.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr class="rebate_amount"></tr>
|
||||
<% else%>
|
||||
@@ -415,9 +416,10 @@
|
||||
<% if @status != "sale"%>
|
||||
<!-- <button type="button" id="request_bills" class="btn btn-block bg-blue waves-effect">Req.Bill</button> -->
|
||||
<% order_id = @pending.try(:orders).try(:first).try(:order_id) if @status == 'order' %>
|
||||
<%= link_to 'Req.Bill', "/foodcourt/food_court/#{order_id}/request_bill", class: 'btn btn-block bg-blue waves-effect' %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect req_bill" >Req.Bill</button>
|
||||
<input type="hidden" id="save_order_id" value="<%=order_id%>">
|
||||
<%end%>
|
||||
|
||||
|
||||
<% elsif @pending && params[:active] == 'completed' %>
|
||||
<% if current_user.role != "waiter" %>
|
||||
<% if @pending.sale_status != 'void' && @pending.sale_status != 'waste' && @pending.sale_status != 'spoile' %>
|
||||
@@ -494,20 +496,40 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="sxModal">
|
||||
<div id="sxModal-Content">
|
||||
<h3>Card Tap</h3>
|
||||
</div>
|
||||
<div style="position: absolute; bottom: 0; margin-left: 45%; margin-bottom: 60px;">
|
||||
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
var cashier_type = 'food_court';
|
||||
$(document).ready( function() {
|
||||
if ("<%= @pending %>" || "<%= @booking %>") { // adjust column gap
|
||||
$('.card-columns').css('column-gap', '0.3rem')
|
||||
}
|
||||
})
|
||||
|
||||
$('#pay').on('click', function () {
|
||||
var cashier_type = 'food_court';
|
||||
|
||||
$('#pay, .req_bill').on('click', function () {
|
||||
$("#sxModal").show();
|
||||
$("#sxModal").attr('data-for', 'member');
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/foodcourt/sale/' + sale_id + "/"+cashier_type+"/payment";
|
||||
getCardNo();
|
||||
});
|
||||
|
||||
// $('#pay').on('click', function () {
|
||||
// // var sale_id = $('#sale_id').text();
|
||||
// getCardNo();
|
||||
// });
|
||||
|
||||
$("#sxModal .btn_cancel").on('click',function(){
|
||||
if($("#order-items-table tr").length > 1){
|
||||
$( "#create_pay_order" ).prop( "disabled", false );
|
||||
}
|
||||
$("#sxModal").hide();
|
||||
});
|
||||
|
||||
$('#addorder').on('click', function () {
|
||||
var status = "<%= @status %>"
|
||||
if (status == 'sale'){
|
||||
@@ -526,7 +548,7 @@
|
||||
}else{
|
||||
window.location.href = '/foodcourt/food_court/modify_order/' + booking_id + "/" + sale_id + '?update=true&order_id="'+order_id+'"'
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#back').on('click', function () {
|
||||
|
||||
Reference in New Issue
Block a user