update existin order
This commit is contained in:
@@ -154,9 +154,10 @@
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card">
|
||||
<% existing_class = "" %>
|
||||
<% existing_class = "" %><% existing_order = false %>
|
||||
<% if @status_sale == 'sale' && (!@order_items.nil?) %>
|
||||
<% existing_class = "existing_invoice"%>
|
||||
<% existing_order = true %>
|
||||
<% tooltip = ' data-toggle=modal title=Add_To_Existing data-target=#invoiceModal'%>
|
||||
<%end%>
|
||||
<div class="card-header <%= existing_class %>" <%= tooltip %>>
|
||||
@@ -483,12 +484,12 @@
|
||||
<!-- first bill not used in cloud -->
|
||||
|
||||
<%if @membership.discount && @obj_sale.customer.membership_id %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal">First Bill</button>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal" data-order="<%= existing_order %>">First Bill</button>
|
||||
<%else%>
|
||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||
<button type="button" id="first_bill" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||
<%end%>
|
||||
|
||||
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
||||
<button type="button" id="pay" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">Pay</button>
|
||||
|
||||
<!--<% if current_login_employee.role != "waiter" %>
|
||||
<button type="button" class="btn action-btn bg-blue waves-effect" data-toggle="modal" data-target="#waste_spoileModal" > Waste & Spoile</button>
|
||||
@@ -972,7 +973,24 @@
|
||||
|
||||
$('#pay').on('click', function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/' + sale_id + "/cashier/payment";
|
||||
var data_order = $(this).data("order");
|
||||
if (data_order) {
|
||||
swal({
|
||||
title: "Alert! This Receipt has another item",
|
||||
text: "Are you sure want to pay this receipt !",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "Yes, Pay it !",
|
||||
closeOnConfirm: false
|
||||
}, function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
window.location.href = '/origami/sale/' + sale_id + "/cashier/payment";
|
||||
}
|
||||
});
|
||||
}else{
|
||||
window.location.href = '/origami/sale/' + sale_id + "/cashier/payment";
|
||||
}
|
||||
});
|
||||
|
||||
// Bill Request
|
||||
|
||||
Reference in New Issue
Block a user