|
|
@ -50,6 +50,11 @@ class PrePayments: |
|
|
|
|
|
|
|
|
|
|
|
def __iter__(self) -> Iterable[PrePaymentEntry]: |
|
|
|
def __iter__(self) -> Iterable[PrePaymentEntry]: |
|
|
|
return iter(self.payments) |
|
|
|
return iter(self.payments) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
|
|
|
|
def nice_number(self) -> str: |
|
|
|
|
|
|
|
if len(self.travel_nr) > 6: |
|
|
|
|
|
|
|
return " ".join(self.travel_nr[:5], self.travel_nr[5:]) |
|
|
|
|
|
|
|
|
|
|
|
def to_form_data(self) -> dict[str, str]: |
|
|
|
def to_form_data(self) -> dict[str, str]: |
|
|
|
form_data = { |
|
|
|
form_data = { |
|
|
@ -239,7 +244,7 @@ def _create_text_stub(path: Pathlike, *, content: str = None) -> None: |
|
|
|
path.write_text(content) |
|
|
|
path.write_text(content) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def fill_pre_payments_form(destination_path: Pathlike) -> PrePayments: |
|
|
|
def _fill_pre_payments_form(destination_path: Pathlike) -> PrePayments: |
|
|
|
pre_payments = _read_pre_payments() |
|
|
|
pre_payments = _read_pre_payments() |
|
|
|
|
|
|
|
|
|
|
|
print(f"Projekt: {pre_payments.project}") |
|
|
|
print(f"Projekt: {pre_payments.project}") |
|
|
@ -263,18 +268,26 @@ def fill_pre_payments_form(destination_path: Pathlike) -> PrePayments: |
|
|
|
return pre_payments |
|
|
|
return pre_payments |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@click.command() |
|
|
|
|
|
|
|
def fill_prepayment_form(): |
|
|
|
|
|
|
|
destination_path = DESKTOP / f"{TODAY} UK-Abschlag.pdf" |
|
|
|
|
|
|
|
_fill_pre_payments_form(destination_path) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@click.command() |
|
|
|
@click.command() |
|
|
|
@click.option("-l", "--search_last_name", prompt=True, required=True) |
|
|
|
@click.option("-l", "--search_last_name", prompt=True, required=True) |
|
|
|
@click.option("-d", "--iso_date", prompt=True, required=True) |
|
|
|
@click.option("-d", "--iso_date", prompt=True, required=True) |
|
|
|
@click.option("-p", "--place", prompt=True, required=True) |
|
|
|
@click.option("-p", "--place", prompt=True, required=True) |
|
|
|
def final_payment(search_last_name: str, iso_date: str, place: str): |
|
|
|
def final_payment(search_last_name: str, iso_date: str, place: str): |
|
|
|
|
|
|
|
print("---") |
|
|
|
info = _complete_travel_info(search_last_name, iso_date, place) |
|
|
|
info = _complete_travel_info(search_last_name, iso_date, place) |
|
|
|
|
|
|
|
print(f"Name: {info.first_last}") |
|
|
|
|
|
|
|
|
|
|
|
folder = DESKTOP / f"{info.travel_name} (abgerechnet)" |
|
|
|
folder = DESKTOP / f"{info.travel_name} (abgerechnet)" |
|
|
|
folder.mkdir() |
|
|
|
folder.mkdir() |
|
|
|
|
|
|
|
|
|
|
|
destination_path = folder / f"{TODAY} {info.travel_short}, UK-Abschlag.pdf" |
|
|
|
destination_path = folder / f"{TODAY} {info.travel_short}, UK-Abschlag.pdf" |
|
|
|
payments = fill_pre_payments_form(destination_path) |
|
|
|
payments = _fill_pre_payments_form(destination_path) |
|
|
|
|
|
|
|
|
|
|
|
rk_path = folder / f"DATE {info.travel_short}, Reisekostenabrechnung.txt" |
|
|
|
rk_path = folder / f"DATE {info.travel_short}, Reisekostenabrechnung.txt" |
|
|
|
_create_text_stub(rk_path) |
|
|
|
_create_text_stub(rk_path) |
|
|
@ -288,6 +301,7 @@ def final_payment(search_last_name: str, iso_date: str, place: str): |
|
|
|
info.ger_date.replace(".", "/"), |
|
|
|
info.ger_date.replace(".", "/"), |
|
|
|
info.first_last, |
|
|
|
info.first_last, |
|
|
|
f"Schlusszahlung Dienstreise {info.place}, {info.ger_date}", |
|
|
|
f"Schlusszahlung Dienstreise {info.place}, {info.ger_date}", |
|
|
|
|
|
|
|
payments.nice_number |
|
|
|
] |
|
|
|
] |
|
|
|
) |
|
|
|
) |
|
|
|
_create_text_stub(uka_hint_path, content=content) |
|
|
|
_create_text_stub(uka_hint_path, content=content) |
|
|
|