update seed generator and remove hard-coded customer id

This commit is contained in:
Thein Lin Kyaw
2019-12-20 10:35:31 +06:30
parent 92e467d512
commit d87ffee65b
32 changed files with 184 additions and 153 deletions

View File

@@ -14,7 +14,7 @@ class Origami::PendingOrderController < BaseOrigamiController
def show
id = params[:sale_id]
if id.start_with?("SAL")
if id.include? "SAL"
@sale = Sale.find(id)
if @sale.sale_status == "new"
@bookings = @sale.bookings.first
@@ -22,7 +22,7 @@ class Origami::PendingOrderController < BaseOrigamiController
else
redirect_to "/origami/#{params[:type]}" and return
end
elsif (id.start_with?("BKI") || id.start_with?("CBKI"))
elsif id.include? "BKI"
@bookings = Booking.find(id)
@order = @bookings.orders.where(status: "new").first
@order_items = @bookings.order_items