Multiple Invoices Phase 1
This commit is contained in:
40
app/controllers/origami/table_invoices_controller.rb
Normal file
40
app/controllers/origami/table_invoices_controller.rb
Normal file
@@ -0,0 +1,40 @@
|
||||
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
|
||||
Reference in New Issue
Block a user