booking status changed
This commit is contained in:
@@ -40,9 +40,14 @@
|
||||
<th> <%= t("views.right_panel.detail.checkout_by") %></th>
|
||||
<th><%= t("views.right_panel.detail.booking_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.booking_date") %></th>
|
||||
<%if (@booking.sale_id.nil?) && (current_login_employee.role == "administrator") && (!@order.nil?) %>
|
||||
<%if current_login_employee.role == "administrator" %>
|
||||
<th>
|
||||
<%if (!@order.nil?) && (@booking.sale_id.nil?) %>
|
||||
<button id="request_bill" class="btn bg-blue btn-md waves-effect">Req. Bill</button>
|
||||
<% end %>
|
||||
<%if @order.nil? && @booking.booking_status == 'assign' && (@booking.sale_id.nil?) %>
|
||||
<button id="change_booking_status" class="btn bg-blue btn-md waves-effect">Update Status</button>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
@@ -59,8 +64,14 @@
|
||||
<td><%= @booking.checkout_by rescue '-' %></td>
|
||||
<td><%= @booking.booking_status %> </td>
|
||||
<td><%= @booking.created_at.utc.getlocal.strftime("%d-%m-%Y %I:%M %p") %> </td>
|
||||
<%if (@booking.sale_id.nil?) && (current_login_employee.role == "administrator") && (!@order.nil?) %>
|
||||
<td></td>
|
||||
<%if current_login_employee.role == "administrator" %>
|
||||
<%if (!@order.nil?) && (@booking.sale_id.nil?) %>
|
||||
<td></td>
|
||||
<% end %>
|
||||
<%if @order.nil? %>
|
||||
<td></td>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -175,6 +186,35 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#change_booking_status").on("click", function(){
|
||||
$('#change_booking_status').prop("disabled",true);
|
||||
var booking_id = '<%= @booking.booking_id %>';
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/transactions/bookings/update_status/"+booking_id,
|
||||
success: function (result) {
|
||||
if (!result.status) {
|
||||
$('#change_booking_status').prop("disabled",false);
|
||||
swal("Opps",result.error_message,"warning");
|
||||
}
|
||||
else {
|
||||
swal({
|
||||
title: "Information",
|
||||
text: result.message,
|
||||
type: "success",
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function() {
|
||||
// Redirect the user
|
||||
window.location.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -41,21 +41,22 @@
|
||||
<th><%= t :cashier %></th>
|
||||
<th><%= t("views.right_panel.detail.sales_status") %></th>
|
||||
<th><%= t("views.right_panel.detail.receipt_generated_at") %></th>
|
||||
<% if @sale.sale_status == "completed" %>
|
||||
<% if @sale.sale_status == "new" || @sale.sale_status == "completed" %>
|
||||
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" %>
|
||||
<th>
|
||||
<button type="button" class="btn btn-block bg-red waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button>
|
||||
</th>
|
||||
<div class="form-group">
|
||||
<button type="button" class="btn btn-block bg-red waves-effect col-md-5" style="margin-top: 8px;" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button>
|
||||
<% end %>
|
||||
<% elsif @sale.sale_status == "new" %>
|
||||
<% end %>
|
||||
<% if @sale.sale_status == "new" %>
|
||||
<% if current_login_employee.role == "administrator" %>
|
||||
<%if @membership.discount && @sale.customer.membership_id %>
|
||||
<th>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#paymentModal">Pay</button>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect col-md-5" data-toggle="modal" data-target="#paymentModal">Pay</button>
|
||||
</div>
|
||||
</th>
|
||||
<%else%>
|
||||
<th>
|
||||
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
||||
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect col-md-5">Pay</button>
|
||||
</div>
|
||||
</th>
|
||||
<%end%>
|
||||
<%end%>
|
||||
|
||||
Reference in New Issue
Block a user