class CashboxCourse
Allows for adding cash to a specific course
Public Instance Methods
layout()
click to toggle source
# File Views/Cashbox/Course.rb, line 4 def layout @order = 10 @update = true @functions_need = [:cashbox, :accounting_courses] gui_hboxg do gui_vbox :nogroup do show_entity_course :courses, :single, :name, :flexheight => 1, :callback => true, :width => 100 end gui_vbox :nogroup do show_entity_person :students, :single, :full_name, :flexheight => 1, :callback => true, :width => 300 show_str :full_name show_button :add_student end gui_vbox :nogroup do show_table :payments, :headings => [:Date, :Money, :Rest], :widths => [100, 75, 75], :height => 200, :columns => [0, :align_right, :align_right] show_date :payment_date show_int :cash show_str :remark show_str :receit_id show_list_drop :old_cash, '%w( No Yes )' show_button :pay, :delete, :move end gui_window :error do show_html :msg show_button :close end gui_window :win_move do show_entity_person :move_students, :drop, :full_name, :width => 300 show_button :close, :do_move end end @date_pay = Date.today end
rpc_list_choice_courses(session, data)
click to toggle source
# File Views/Cashbox/Course.rb, line 46 def rpc_list_choice_courses(session, data) reply(:empty_nonlists, :students) + reply(:update, :students => data._courses.list_students(true)) end
rpc_list_choice_students(session, data)
click to toggle source
# File Views/Cashbox/Course.rb, line 51 def rpc_list_choice_students(session, data) reply(:empty, %w(cash remark receit_id)) + reply(:update, :payment_date => @date_pay.strftime('%d.%m.%Y')) + reply(:update, :payments => data._courses.student_payments(data._students.login_name)) end
rpc_update(session)
click to toggle source
# File Views/Cashbox/Course.rb, line 110 def rpc_update(session) if owner = session.owner reply_visible(owner.has_permission?(:admin), :old_cash) else [] end + reply(:empty_nonlists, :students) + reply(:empty_nonlists, :courses) + reply(:update, :courses => Courses.list_courses_entries) end