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

@@ -2,14 +2,14 @@ class Origami::SurveysController < BaseOrigamiController
def new
@webview = false
if check_mobile
@webview = true
@webview = true
end
@survey = Survey.new
@id = params[:id]
@cashier_type = params[:type]
if(@id[0,3] == "SAL")
if @id.include? "SAL"
@sale = Sale.find(@id)
@receipt_no = @sale.receipt_no
@grand_total = @sale.grand_total
@@ -27,14 +27,14 @@ class Origami::SurveysController < BaseOrigamiController
@dining_facility = nil
@table_type = nil
end
else
@dining_facility = DiningFacility.find(@id)
@table_type = @dining_facility.type
@receipt_no = nil
@grand_total = nil
@survey_data = Survey.find_by_dining_name_and_receipt_no(@dining_facility.name,nil)
end
end
end
def create
@@ -63,13 +63,13 @@ class Origami::SurveysController < BaseOrigamiController
shift = ShiftSale.find(sale.shift_sale_id)
shift_by_terminal = ShiftSale.find_by_cashier_terminal_id_and_shift_closed_at(shift.cashier_terminal_id,nil)
end
if @type == "quick_service" || @type == "food_court"
@url = "/origami/sale/"+@sale_id+"/"+@type+"/payment"
else
@url = "/origami/"+@dining_facility.type.downcase+"/"+params[:table_id]
end
if params[:survey_id].nil? || params[:survey_id] == ""
@survey = Survey.new(survey_params)
@@ -106,5 +106,5 @@ class Origami::SurveysController < BaseOrigamiController
def survey_params
params.require(:survey).permit(:child, :adult,:male,:female,:local,:foreigner, :dining_name,:receipt_no,:shift_id,:created_by,:total_customer,:total_amount,:survey_id)
end
end