41 lines
957 B
Ruby
41 lines
957 B
Ruby
class Origami::TableInvoicesController < BaseOrigamiController
|
|
def index
|
|
@table = DiningFacility.find(params[:table_id])
|
|
puts "table bookig lenght"
|
|
@sale_array = Array.new
|
|
@table.bookings.each do |booking|
|
|
puts booking.sale_id
|
|
|
|
if booking.sale_id.nil?
|
|
else
|
|
sale = Sale.find(booking.sale_id)
|
|
|
|
if sale.sale_status != "completed"
|
|
@sale_array.push(sale)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
def show
|
|
@table = DiningFacility.find(params[:table_id])
|
|
@sale_array = Array.new
|
|
@table.bookings.each do |booking|
|
|
if booking.sale_id.nil?
|
|
else
|
|
sale = Sale.find(booking.sale_id)
|
|
|
|
if sale.sale_status != "completed"
|
|
@sale_array.push(sale)
|
|
end
|
|
end
|
|
end
|
|
|
|
@sale = Sale.find(params[:invoice_id])
|
|
@date = @sale.created_at
|
|
@status_sale = 'sale'
|
|
@customer = @sale.customer
|
|
end
|
|
|
|
end
|