class ReportComptaExecutive
Public Instance Methods
layout()
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 4 def layout @order = 20 @update = true @functions_need = [:accounting] gui_hboxg do gui_vbox :nogroup do gui_vboxg :nogroup do show_entity_report_all :reports, :single, :name, :callback => true, :flexheight => 1 show_button :report_add, :report_delete end gui_vbox :nogroup do show_date :start show_int :months show_print :print end end gui_vboxg :nogroup do show_str :name show_entity_reportAccount :accounts, :single, :flexheight => 1, :width => 300 show_button :account_add, :account_del, :account_edit show_button :account_up, :account_down end gui_window :win_account do gui_vbox :nogroup do show_entity_account :root, :drop, :width => 400, :callback => true show_entity_account :account, :drop show_int :level show_button :account_add_win, :account_save_win, :close end end gui_window :win_report do show_str :report_name show_button :report_add_win, :close end gui_window :progress do show_html :progress_txt show_button :report_cancel end window_print_status end end
rpc_list_choice_reports(session, data)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 211 def rpc_list_choice_reports(session, data) return if data._reports == [] reply(:empty, :accounts) + update_report(data._reports) end
rpc_list_choice_root(session, data)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 217 def rpc_list_choice_root(session, data) return if data._root == [] update_account(data._root) end
rpc_update(session)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 85 def rpc_update(session) td = Date.today # Start in beginning of semester start = Date.new(td.year, (td.month / 7.0).floor * 6 + 1) update_reports + reply(:update, :start => start.to_web) + reply(:update, :months => 6) + reply_print(session) end
rpc_update_with_values(session, data)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 198 def rpc_update_with_values(session, data) report = data._reports if report_ce = session.s_data._report_ce return reply(:window_hide) + reply(:auto_update, 0) + send_printer_reply(session, :print, data, report_ce) else return reply(:update, :progress_txt => "Accounts done: #{(report.print_accounts * 100).floor}%<br>" + "Calculating: #{report.print_account}") end end
start_thread(session, data)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 187 def start_thread(session, data) session.s_data._report_ce = nil session.s_data._report_ce_thread = Thread.start { System.rescue_all do session.s_data._report_ce = data._reports.print_pdf_monthly( Date.from_web(data._start), data._months.to_i) end dputs(2){ 'Thread finished'} } end
update_account(root = AccountRoot.actual, account = nil)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 58 def update_account(root = AccountRoot.actual, account = nil) reply(:empty, :account) + reply(:update, :account => root.listp_path) + reply(:update, :account => [(account.class == Account) ? account.id : 0]) end
update_report(report, account = nil)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 77 def update_report(report, account = nil) reply(:empty, :accounts) + reply(:update, :name => report.name) + reply(:update, :accounts => report.listp_accounts) + reply(:update, :accounts => (account.class == ReportAccount) ? [account.id] : nil) end
update_reports()
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 72 def update_reports reply(:empty, :reports) + reply(:update, :reports => Reports.listp_name) end
update_root(root = AccountRoot.actual)
click to toggle source
# File Views/Report/ComptaExecutive.rb, line 64 def update_root(root = AccountRoot.actual) roots = [[AccountRoot.actual.id, 'Actual']] archive = AccountRoot.archive and roots.concat(archive.listp_path(1)[1..-1]) reply(:empty, :root) + reply(:update_silent, :root => roots.concat([(root.class == Account) ? root.id : 0])) end