class CashboxReport
Allows for adding cash to a specific course
Public Instance Methods
layout()
click to toggle source
# File Views/Cashbox/Report.rb, line 6 def layout @order = 30 @update = true @functions_need = [:cashbox] gui_hbox do gui_vbox :nogroup do show_list_single :report_type, :callback => true, :maxheight => 160 show_date :report_start, :callback => :date show_entity_course :course, :single, :name, lambda{|c| c.entries}, :callback => true, :flexheight => 1 show_print :print end gui_vbox :nogroup do show_table :report, :headings => [ :Date, :Desc, :Amount, :Sum ], :widths => [ 100, 200, 75, 75 ], :height => 400, :width => 470, :columns => [0, 0, :align_right, :align_right] show_button :delete end gui_window :print_status do gui_vbox :nogroup do show_html :status show_button :close end end end end
rpc_callback_date( session, data )
click to toggle source
# File Views/Cashbox/Report.rb, line 102 def rpc_callback_date( session, data ) rpc_list_choice_report_type( session, data ) end
rpc_list_choice_course( session, data )
click to toggle source
# File Views/Cashbox/Report.rb, line 98 def rpc_list_choice_course( session, data ) rpc_list_choice_report_type( session, data ) end
rpc_list_choice_report_type( session, data )
click to toggle source
# File Views/Cashbox/Report.rb, line 76 def rpc_list_choice_report_type( session, data ) dputs(3){"report is #{data._report_start.inspect}"} date = Date.parse( data._report_start.to_s ) ret = reply( :empty, :report ) case report = data._report_type.first when 1 if data._course != [] ret += reply( :update, :report => data._course.report_list ) end show = :course when 2..4 ret += reply( :update, :report => session.owner.report_list( [ :daily, :all, :all_paid ][report - 2], date ) ) show = :report_start end ret + reply( :unhide, show ) + reply( :hide, show == :report_start ? :course : :report_start ) end
rpc_show( session )
click to toggle source
Calls superclass method
# File Views/Cashbox/Report.rb, line 35 def rpc_show( session ) super( session ) end
rpc_update( session )
click to toggle source
Calls superclass method
# File Views/Cashbox/Report.rb, line 39 def rpc_update( session ) super( session ) + reply( :empty_nonlists, [ :course, :report_type ] ) + reply( :update, :report_type => %w( Course Due_Daily Due_All Paid_All ). map.with_index{|d,i| [ i + 1, d ]} ) + reply( :update, :course => Courses.list_courses_entries(session) ) + reply( :hide, [:report_start, :course ] ) + reply( :update, :report_start => Date.today.strftime( "%d.%m.%Y") ) + reply_visible( session.owner.has_permission?( :accounting ), :delete ) + reply_print( session ) end