1
0
Fork 0
mirror of https://github.com/Findus23/invoices.git synced 2024-09-19 15:13:47 +02:00

set useful defaults for all interactive questions

This commit is contained in:
fkarg 2020-09-22 14:00:59 +02:00
parent 00e2a77d58
commit e7149ad443

12
main.py
View file

@ -22,19 +22,19 @@ def create_invoice():
config["last_id"] = current_id
invoice.locale = ask("locale", "set", set=["de", "en"], default="de")
invoice.id = ask("id", "int", default=current_id)
invoice.title = ask("title")
invoice.title = ask("title", default=config["title"])
invoice.recipient = ask("recipient", "set", set=get_possible_recipents(), default=config["default_recipient"])
invoice.date = ask("date", "date", default="today")
invoice.description = ask("description")
invoice.range = ask("range")
invoice.description = ask("description", default=config["description"])
invoice.range = ask("range", default=config["range"])
if invoice.mode == "single":
invoice.price = ask("price", "money")
elif invoice.mode == "hourly":
invoice.hours = ask("hours", "int")
invoice.minutes = ask("minutes", "int")
invoice.per_hour = ask("per hour", "money", default=config["default_hourly_rate"])
invoice.hours = ask("hours", "int", default=config["hours"])
invoice.minutes = ask("minutes", "int", default="0")
invoice.per_hour = ask("rate per hour", "money", default=config["default_hourly_rate"])
directory = invoice_dir + "/" + str(invoice.id)
if os.path.exists(directory):
if not ask("overwrite", "boolean"):