Displaying 2 results from an estimated 2 matches for "registration_fee".
2008 Aug 25
2
maths not working (can't get this)
...def discounted_price
factor = case @duration_in_weeks
when 1..4
1.0
when 5..12
0.9
when 13..24
0.8
when 25..47
0.7
else # from 48 and up
0.6
end
total_price * factor
end
def total_price
(@duration_in_weeks * price_per_week) + registration_fee
end
def duration_in_weeks=(duration_in_weeks)
@duration_in_weeks = duration_in_weeks.to_i
end
end
CONTROLLER
------------
class InvoiceController < ApplicationController
def index
@enquiry = Enquiry.new
@courses = Course.active_courses
@courses = Course.active_cour...
2008 Aug 31
6
why's my course_duration being reset
...(true)
@enquiries = Enquiry.find_all_by_responded(false)
end
def show
@enquiry = Enquiry.find(params[:id])
end
def new
@enquiry = Enquiry.new
@courses = Course.active_courses
@accomodations = Accomodation.active_accomodation
# @enquiry.course_booking_fee = Course.registration_fee
render :layout => "welcome"
end
def create
@enquiry = Enquiry.new(params[:enquiry])
@courses = Course.active_courses
@accomodations = Accomodation.active_accomodation
if @enquiry.save
@enquiry.set_fixed_fees # set the fixed fees
@enquiry.calcula...