toggl2sheets

toggl entries to google sheets
git clone git://git.bain.cz/toggl2sheets.git
Log | Files | Refs | README

commit d4bc9dd22a191a8da9152189e124e03d42a30c5a
parent c017c80a223616ea1e8513f4677ae67b0687b469
Author: bain <bain@bain.cz>
Date:   Thu, 11 Aug 2022 23:38:41 +0200

fix hour*wage calc

Diffstat:
Mtoggl2sheets.py | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/toggl2sheets.py b/toggl2sheets.py @@ -70,14 +70,14 @@ today = datetime.datetime.now().date() - datetime.timedelta(days=1) def append_hours(worksheet: Worksheet, data: List[List[str]]): - # add a calculated hours * wage cell to all rows - # start at number 2 to skip header - d = [[*x, f"=C{i}*D{i}"] for i, x in enumerate(data, start=2)] column = worksheet.get_col(1) # get last non-empty row last_row = next(filter(lambda x: not x[1], enumerate(column)))[0] + # add a calculated hours * wage cell to all rows + d = [[*x, f"=C{i}*D{i}"] for i, x in enumerate(data, start=last_row + 1)] + worksheet.insert_rows(last_row, len(d), d) # inserting rows changes the top sums