X-Git-Url: https://plomlompom.com/repos/unset_cookie?a=blobdiff_plain;f=ledger.py;h=0dbc9fe4debe3c133a766d039394d1828a88a600;hb=1b9c909cedf7e135f9b3ab977e9554a45d1f09d9;hp=640c63afca0a601488ca55fce96a311cec60aa89;hpb=ed21ddf65324afb6cdce3aec0b97449e6c5c2829;p=misc
diff --git a/ledger.py b/ledger.py
index 640c63a..0dbc9fe 100755
--- a/ledger.py
+++ b/ledger.py
@@ -426,6 +426,7 @@ edit:
return f'{self.header_add_form("add_free")}{self.footer_add_form(start, end)}'
def add_structured(self, db, start=0, end=0, bonus_lines=10):
+ import datetime
lines = db.get_lines(start, end)
bookings, comments = parse_lines(lines)
if len(bookings) > 1:
@@ -436,7 +437,8 @@ edit:
safe_val = html.escape(str(val))
return f''
if len(bookings) == 0:
- input_lines += f'{inpu("date")} {inpu("description")} ; {inpu("comment")}
'
+ today = str(datetime.datetime.now())[:10]
+ input_lines += f'{inpu("date", today)} {inpu("description")} ; {inpu("comment")}
'
last_line = 1
else:
booking = bookings[0]