From 7810fc693b94a2a05a6e486e40b9eded5a231ca5 Mon Sep 17 00:00:00 2001 From: Phyo Date: Tue, 27 Jun 2017 12:06:18 +0630 Subject: [PATCH] Pending Payment --- app/views/origami/home/show.html.erb | 6 ++- app/views/origami/rooms/show.html.erb | 68 +++++++++++++++++---------- 2 files changed, 48 insertions(+), 26 deletions(-) diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 2e852b7c..be13b58c 100644 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -138,7 +138,7 @@ <%if @customer %>

Customer : <%= @customer.name rescue "" %>

- <%end%> + <%end%>
@@ -249,8 +249,10 @@ <% end %> + <% if @sale_array.size > 1 %>

Pending Payment + <% end %> <% @sale_array.each do |sale| if @sale_array.size > 1 unless sale.receipt_no == @sale_array[0].receipt_no @@ -473,7 +475,7 @@ $('#edit').on('click',function(){ var sale_id = "<%= @obj_sale.sale_id rescue "" %>" window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit"; }) - + $('#void').on('click',function () { var sure = confirm("Are you sure want to Void"); if (sure == true) { diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 584410d6..a3f52cec 100644 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -155,7 +155,7 @@ sub_total = 0 if @status == "sale" @obj.sale_items.each do |sale_item| - sub_total = sub_total + sale_item.price + sub_total = sub_total + sale_item.price %> <% unless sale_item.price == 0 %> @@ -213,32 +213,52 @@

+ <% + if @status_sale == 'sale' + unless @order_items.nil? + %> + Pending New Order + + <% + count = 0 + @order_items.each do |order_item | + count += 1 + %> - <% - if @status == 'sale' - unless @order_items.nil? - %> - Added New Order -
- <% - @order_items.each do |order_item | + + + + + + + <% + end %> +
<%= count %> + <%= order_item.item_name %><%= order_item.qty %><%= order_item.qty*order_item.price %>
+ + <% end %> + <% if @sale_array.size > 1 %> +

+ Pending Payment + <% end %> + <% @sale_array.each do |sale| + if @sale_array.size > 1 + unless sale.receipt_no == @sale_array[0].receipt_no + %> - - <%= order_item.item_name %> - <%= order_item.qty %> - <%= order_item.qty*order_item.price %> - - - <% - end - %> - - - <% - end - end - %> + + + + + +
Receipt No - <%= sale.receipt_no %>
+ <% + end + end + end + end + %>