Skip to content

add internal descriptions to worktimes (63818) #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/controllers/concerns/worktimes_csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def send_worktimes_csv(worktimes, filename)
def worktimes_csv(worktimes)
CSV.generate do |csv|
csv << ['Datum', 'Stunden', 'Von Zeit', 'Bis Zeit', 'Stundenansatz CHF', 'Reporttyp',
'Verrechenbar', 'Member', 'Position', 'Ticket', 'Bemerkungen']
'Verrechenbar', 'Member', 'Position', 'Ticket', 'Bemerkungen', 'Interne Bemerkungen']
worktimes.each do |time|
csv << [I18n.l(time.work_date),
time.hours,
Expand All @@ -32,7 +32,8 @@ def worktimes_csv(worktimes)
time.employee.label,
time.account.label_verbose,
time.ticket,
time.description]
time.description,
time.internal_description]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ordertimes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class OrdertimesController < WorktimesController
self.permitted_attrs = %i[account_id report_type work_date hours meal_compensation
from_start_time to_end_time description billable ticket]
from_start_time to_end_time description internal_description billable ticket]

after_destroy :send_email_notification

Expand Down
1 change: 1 addition & 0 deletions app/controllers/worktimes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def new
@worktime.account_id = template.account_id
@worktime.ticket = template.ticket
@worktime.description = template.description
@worktime.internal_description = template.internal_description
@worktime.billable = template.billable
@worktime.meal_compensation = template.meal_compensation
end
Expand Down
3 changes: 3 additions & 0 deletions app/helpers/order_services_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def checkable_worktimes_table(entries, options)
t.attr(:description, nil, class: 'truncated', style: 'max-width: 250px;') do |w|
content_tag(:span, w.description.to_s, title: w.description)
end
t.attr(:internal_description, nil, class: 'truncated', style: 'max-width: 150px;') do |w|
content_tag(:span, w.internal_description.to_s, title: w.internal_description)
end
t.attrs(:billable, :meal_compensation, :invoice_id)
t.foot { options[:footer] } if options[:footer]
end
Expand Down
1 change: 1 addition & 0 deletions app/views/ordertimes/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
url: search_work_items_path })
= f.labeled_input_field(:ticket, span: 2)
= f.labeled_text_area(:description)
= f.labeled_text_area(:internal_description, html_options = {title: "Wird innerhalb von PuzzleTime und im CSV-Export angezeigt, ist im Zeitrapport jedoch nicht enthalten", data: {toggle: :tooltip}})
= f.labeled_date_field(:work_date,
data: { remote: true,
url: url_for(action: 'existing'),
Expand Down
1 change: 1 addition & 0 deletions config/locales/models.de-CH.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ de-CH:
from_start_time: Von
to_end_time: Bis
description: Bemerkungen
internal_description: Interne Bemerkungen
billable: Verrechenbar
meal_compensation: Verpflegungsentschädigung
ticket: Ticket
Expand Down
1 change: 1 addition & 0 deletions config/locales/models.de-DE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ de-DE:
from_start_time: Von
to_end_time: Bis
description: Bemerkungen
internal_description: Interne Bemerkungen
billable: Verrechenbar
meal_compensation: Verpflegungsentschädigung
ticket: Ticket
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddInternalDescriptionToWorktimes < ActiveRecord::Migration[7.1]
def change
add_column :worktimes, :internal_description, :text
end
end
Loading
Loading