diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb
index 4810cf13..b108c46d 100755
--- a/app/views/origami/home/show.html.erb
+++ b/app/views/origami/home/show.html.erb
@@ -488,11 +488,6 @@
<% end %>
-
- <% if current_login_employee.role != "waiter" %>
-
- <% end %>
-
@@ -511,6 +506,10 @@
<%end%>
+
+ <% if current_login_employee.role != "waiter" %>
+
+ <% end %>
<% end %>
<% end %>
diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb
index eb3eefe3..e1d35375 100755
--- a/app/views/origami/payments/show.html.erb
+++ b/app/views/origami/payments/show.html.erb
@@ -340,6 +340,8 @@
+
+
<% if @cashier_type=="quick_service" %>
@@ -1160,4 +1162,40 @@ var customer_name = "<%= @customer.name %>";
var sale_id = $("#sale_id").text() || 0;
update_sale("", customer_id, customer_name, sale_id);
});
+
+ function waste_and_spoilage(remark) {
+ var sale_id = $('#sale_id').text();
+ console.log(sale_id)
+ swal({
+ title: "Alert",
+ text: "Are you sure want to " + remark +" ?",
+ type: "warning",
+ showCancelButton: true,
+ confirmButtonColor: "#DD6B55",
+ confirmButtonText: "Yes, " +remark+ " it!",
+ closeOnConfirm: false
+ }, function (isConfirm) {
+ if (isConfirm) {
+ var url = "/origami/sale/" + sale_id +'/'+cashier_type+'/waste_and_spoilage';
+ $.ajax({
+ type: 'POST',
+ url: url,
+ data: "remark="+ remark + "&sale_id=" + sale_id,
+ success: function (result) {
+ console.log(result)
+ // For Server Print - from jade
+ if ($("#server_mode").val() == "cloud") {
+ code2lab.printFile(result.filepath.substr(6), result.printer_url);
+ }
+ if (cashier_type=="cashier") {
+ window.location.href = '/origami';
+ }else{
+ window.location.href = '/origami/quick_service';
+ customer_display_view(null,"reload");
+ }
+ }
+ });
+ }
+ });
+ }
\ No newline at end of file