12345678910111213141516171819202122232425262728 |
- from time_recoder.time_recoder_config import HOURLY_WAGE_IN_EURO, PATH
- from personal_income_calculator.income_calculator_main import calc_income_by_time
- from tool_lib import create_excel_tables
- from os import path
- def create_recorded_time_dict(worked_time, income, sales_taxes):
- return {'Arbeitszeit' : worked_time,
- 'Einkommen': income,
- 'Umsatzsteuern': sales_taxes}
- def table_exists(path):
- return path.isfile(path)
- def add_to_xlsx_table(table_object):
- pass
- def create_xlsx_table(table_object):
- pass
- def save_recorded_time_in_table(worked_time_in_minutes):
- income, sales_taxes = calc_income_by_time(worked_time_in_minutes, HOURLY_WAGE_IN_EURO)
- table_dict = create_recorded_time_dict(worked_time_in_minutes, income, sales_taxes)
- xlsx_table= create_excel_tables.CreateTable(table_dict, path=PATH)
- if table_exists(PATH):
- add_to_xlsx_table(xlsx_table)
- else:
- create_xlsx_table(xlsx_table)
|