|
@@ -1,15 +1,16 @@
|
|
|
from time_recoder.time_recoder_config import HOURLY_WAGE_IN_EURO, PATH, NAME
|
|
|
-from personal_income_calculator.income_calculator_main import calc_income_by_time_in_euro
|
|
|
+from personal_income_calculator.income_calculator_main import calc_income_by_time_in_euro_without_sales_tax
|
|
|
+from tool_lib import datetime_functions
|
|
|
from tool_lib import create_excel_tables
|
|
|
from os import path
|
|
|
from time import time
|
|
|
-from datetime import date
|
|
|
-def create_recorded_time_dict(worked_time, income, sales_taxes):
|
|
|
+
|
|
|
+def create_recorded_time_dict(worked_time, income):
|
|
|
return {'Name': NAME,
|
|
|
- 'Datum': str(date.today()),
|
|
|
+ 'Datum': str(datetime_functions.get_current_date()) ,
|
|
|
'Arbeitszeit' : worked_time,
|
|
|
'Einkommen': income,
|
|
|
- 'Umsatzsteuern': sales_taxes}
|
|
|
+ 'Kalenderwoche': datetime_functions.get_calendarweek_from_datetime(datetime_functions.get_current_date())}
|
|
|
|
|
|
def table_exists(path_):
|
|
|
return path.isfile(path_)
|
|
@@ -24,8 +25,8 @@ def create_xlsx_table(table_object):
|
|
|
table_object.export_to_excel(table_object.create_writer())
|
|
|
|
|
|
def save_recorded_time_in_table(worked_time_in_minutes):
|
|
|
- income, sales_taxes = calc_income_by_time_in_euro(worked_time_in_minutes, HOURLY_WAGE_IN_EURO)
|
|
|
- table_dict = create_recorded_time_dict(worked_time_in_minutes, income, sales_taxes)
|
|
|
+ income = calc_income_by_time_in_euro_without_sales_tax(worked_time_in_minutes, HOURLY_WAGE_IN_EURO)
|
|
|
+ table_dict = create_recorded_time_dict(worked_time_in_minutes, income)
|
|
|
xlsx_table = create_excel_tables.CreateTable(table_dict, path=PATH)
|
|
|
if table_exists(PATH):
|
|
|
add_to_xlsx_table(xlsx_table)
|