arkhitech / redmine_leaves

A simple plugin for user leaves management. It allows user to check-in and check-out for attendance marking. Leave is marked for any user that does not check-in by the specified time. Administrator can define leave types via the administrative interface for the plugin
MIT License
15 stars 6 forks source link

open user_time_activity_report_monthly error 500 #75

Open radist opened 7 years ago

radist commented 7 years ago
I, [2017-07-31T10:46:08.987088 #24210]  INFO -- : Processing by UserTimeChecksController#user_time_activity_report_monthly as HTML
I, [2017-07-31T10:46:09.006119 #24210]  INFO -- :   Current user: radist (id=4)
I, [2017-07-31T10:46:09.009676 #24210]  INFO -- : Completed 500 Internal Server Error in 22ms (ActiveRecord: 15.2ms)
F, [2017-07-31T10:46:09.011021 #24210] FATAL -- : 
ActiveRecord::StatementInvalid (PG::UndefinedFunction: ERROR:  function month(date) does not exist
LINE 1: SELECT Distinct users.id as user_id,month(time_entries.spent...
                                            ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
: SELECT Distinct users.id as user_id,month(time_entries.spent_on) as month,year(time_entries.spent_on) as year FROM "users" INNER JOIN time_entries on users.id= time_entries.user_id WHERE "users"."type" IN ('User', 'AnonymousUser', 'Person') AND ( time_entries.spent_on>='2017-06-30' and  time_entries.spent_on<='2017-07-31')  ORDER BY user_id):
  plugins/redmine_leaves/app/controllers/user_time_checks_controller.rb:129:in `user_time_activity_report_monthly'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

Environment: Redmine version 3.3.1.stable Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux] Rails version 4.2.7.1 Environment production Database adapter PostgreSQL SCM: Git 2.7.4 Filesystem
Redmine plugins: a_common_libs 2.3.2 additionals 2.0.0 autowatch 0.2.0 clipboard_image_paste 1.10 collapsed_journals 0.0.3 custom_menu 1.7.4 issue_hot_buttons 0.4.4 periodictask 3.1.1 progressive_projects_list 3.0.1 projects_show 0.0.3 redmine__select2 1.1.0 redmine_agile 1.4.1 redmine_attach_by_url 1.0.2 redmine_bitbucket 1.0.0 redmine_chat_telegram 1.6.1 redmine_checklists 3.1.5 redmine_ckeditor 1.1.4 redmine_codebutton 0.1.0 redmine_contacts 4.0.4 redmine_contacts_helpdesk 3.0.1 redmine_contacts_invoices 4.1.1 redmine_custom_css 0.1.6 redmine_custom_workflows 0.1.6 redmine_dashboard 2.7.1 redmine_default_assign 0.6 redmine_digest 1.1.0 redmine_editauthor 0.11.0 redmine_email_images 0.2.0 redmine_email_logs 0.0.1 redmine_finance 2.1.0 redmine_gist 0.1.0 redmine_gitlab_hook 0.1.3 redmine_impersonate 0.10.0 redmine_intouch 0.6.1 redmine_issue_completion 0.0.2 redmine_issue_favicon 0.0.1 redmine_issue_history_filter 0.0.1 redmine_issue_templates 0.1.3 redmine_jstoolbar_ext 0.2.1 redmine_jstoolbar_ext_images 0.3.1 redmine_keyboard_shortcuts 0.0.1 redmine_knowledgebase 3.2.1 redmine_leaves 0.1.0 redmine_lightbox2 0.3.1 redmine_login_audit 0.3.1 redmine_macros 0.0.1 redmine_mail_reminder 3.0.0.0001 redmine_mentions 0.0.1 redmine_move_comments 0.0.2 redmine_my_page 0.1.10 redmine_one_issue_in_process_only 0.0.4 redmine_people 1.2.0 redmine_percent_done 1.1.0 redmine_project_alias_2 1.0.2 redmine_recurring_tasks 0.0.2 redmine_scheduling_poll 2.0.0 redmine_shared_api 0.0.2 redmine_sidekiq 2.1.0 redmine_silencer 0.4.1 redmine_slack 0.2 redmine_spent_time 3.1.2 redmine_spent_time_curve 0.0.1 redmine_tags 3.1.1 redmine_telegram_common 0.0.15 redmine_theme_changer 0.2.0 redmine_webhook 0.0.2 redmine_workflow_hidden_fields 0.3.0 sidebar_hide 0.0.7 subtask_list_columns 0.0.3 ttm 0.2.0 unread_issues 2.1.0 vault 0.3.0