Bugfix total hours in csv in project reports#440
Conversation
dybi
left a comment
There was a problem hiding this comment.
Please see comment before merging.
employees/common/exports.py
Outdated
|
|
||
|
|
||
| def save_work_book_as_csv(writer: _writer, work_book: Workbook) -> None: | ||
| def save_work_book_as_csv(writer: _writer, work_book: Workbook, zip_version: bool = False) -> None: |
There was a problem hiding this comment.
save_work_book_as_csv has no knowledge about zip files. zip_version boolean is used to choose between SINGLE_USER constants and USER_IN_PROJECT constants. Is should be changed to sth like is_report_for_single_user.
Or even better - extract logic for choosing column to function call and pass hours_column_name instead.
There was a problem hiding this comment.
I was thinking about second option but I wasn't sure so I left it like that to listen your opinion, so I will change it as you said and pass hours_column_name but I have a question @dybi, should I pass this long version for instance: constants.HEADERS_TO_COLUMNS_SETTINGS_FOR_USER_IN_PROJECT.value[constants.HOURS_HEADER_STR.value].position or assign it to variable before passing?
kbeker
left a comment
There was a problem hiding this comment.
I agree same as @rwrzesien and @dybi but please apply what @dybi asked for ;)
f269fd0 to
c7485e8
Compare
c7485e8 to
7342b35
Compare
Resolves: #436
The problem was only in csv in project reports.