diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index 9918266a..f2919cce 100644 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -85,6 +85,7 @@ class Origami::PaymentsController < BaseOrigamiController @sale_data = Sale.find_by_sale_id(sale_id) @balance = 0.00 @accountable_type = '' + @table_no = '' #get customer amount @customer = Customer.find(@sale_data.customer_id) @@ -105,6 +106,12 @@ class Origami::PaymentsController < BaseOrigamiController #end customer amount + @sale_data.bookings.each do |sbk| + df = DiningFacility.find(sbk.dining_facility_id) + @table_no = df.type + ' ' + df.name + break + end + @sale_data.sale_payments.each do |spay| if spay.payment_method == "cash" @cash = spay.payment_amount diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 7c608fcb..1a325800 100644 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -10,11 +10,12 @@ Receipt Date : <%=@sale_data.receipt_date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%> - Table No <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %> + Table No - <%=@table_no%> Sale Id <% if @sale_data %><%=@sale_data.sale_id %><% end %> - Customer : <%= @sale_data.customer.name%> + Customer : <%= @sale_data.customer.name%> + Customer ID : <%= @sale_data.customer.customer_id%>