<input name="replace_from" />
<input type="submit" name="replace" value="-> replace ->" />
<input name="replace_to" />
+<input type="submit" name="add_mirror" value="add mirror" />
<br />
<input name="date" value="{{date|e}}" size=9 />
<input name="description" value="{{desc|e}}" list="descriptions" />
ret += [f' {acc_buffer} {-final_minus} € ; assume as to earn in year: {acc_buffer} + {12 - months_passed - 1} * this = {year_needed}']
return ret
+ def add_mirror(self, lines):
+ ret = []
+ bookings, _ = parse_lines(lines)
+ booking = bookings[0]
+ for line in booking.lines[1:]:
+ ret += [f'? {-line[1]} {line[2]}']
+ return ret
+
def ledger_as_html(self):
booking_tmpl = jinja2.Template(booking_html)
single_c_tmpl = jinja2.Template('<span class="comment">{{c|e}}</span><br />') ##
elif 'replace' in postvars.keys():
for i, line in enumerate(lines):
lines[i] = line.replace(postvars['replace_from'][0], postvars['replace_to'][0])
+ elif 'add_mirror' in postvars.keys():
+ lines += self.add_mirror(lines)
return lines, add_empty_line