fix hour*wage calc
This commit is contained in:
parent
c017c80a22
commit
d4bc9dd22a
1 changed files with 3 additions and 3 deletions
|
@ -70,14 +70,14 @@ today = datetime.datetime.now().date() - datetime.timedelta(days=1)
|
||||||
|
|
||||||
|
|
||||||
def append_hours(worksheet: Worksheet, data: List[List[str]]):
|
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)
|
column = worksheet.get_col(1)
|
||||||
|
|
||||||
# get last non-empty row
|
# get last non-empty row
|
||||||
last_row = next(filter(lambda x: not x[1], enumerate(column)))[0]
|
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)
|
worksheet.insert_rows(last_row, len(d), d)
|
||||||
|
|
||||||
# inserting rows changes the top sums
|
# inserting rows changes the top sums
|
||||||
|
|
Loading…
Reference in a new issue