Sort entries, fix docs

This commit is contained in:
3wc
2023-01-12 16:34:51 -08:00
parent d171cf4c5d
commit 40c0312e4c
2 changed files with 11 additions and 4 deletions

View File

@ -206,6 +206,8 @@ def list_activities(search, csv_output):
results = get_activities(search=search)
results.sort(key=lambda t: (t[2], t[1]))
if csv_output:
csv_writer = csv.writer(sys.stdout)
@ -412,7 +414,9 @@ def _get_kimai_mapping_file(path):
'FROM activity',
'TO Customer',
'TO Project',
'TO Activity'
'TO Activity',
'TO Tag',
'TO Note'
])
results = get_activities(category_search=category_search)
@ -644,6 +648,9 @@ def _import(username, mapping_path=None, output=None, category_search=None, afte
), fg='yellow')
continue
if len(mapping_) < 5:
mapping_.append(None)
date_start, date_end = (
datetime.strptime(fact[2].split('.')[0], '%Y-%m-%d %H:%M:%S'),
datetime.strptime(fact[1].split('.')[0], '%Y-%m-%d %H:%M:%S')
@ -662,7 +669,7 @@ def _import(username, mapping_path=None, output=None, category_search=None, afte
mapping_[0],
mapping_[1],
mapping_[2],
fact[3] or '',
fact[3] or mapping_[4] or '',
'0', # Exported
mapping_[3],
'', # Hourly rate