def __init__(self, booking: 'Booking', code: str) -> None:
super().__init__(booking)
+ self.date = '#'
+ self.target = ''
if code[0].isspace():
self.errors += ['intro line indented']
toks = code.lstrip().split(maxsplit=1)
if len(toks) != 2:
self.errors += ['illegal number of tokens']
- if len(toks) < 1:
+ elif len(toks) < 1:
return
- self.date = '#'
+ else:
+ self.target = toks[1]
try:
dt_date.fromisoformat(toks[0])
except ValueError:
comment = self.postvars.first(f'line_{lineno}_comment')
for name in input_names:
input_ = self.postvars.first(f'line_{lineno}_{name}')
- if name == 'intro':
+ if name == 'date':
data = input_
+ elif name == 'target':
+ data += f' {input_}'
elif name == 'error':
data = f'{indent}{input_}'
elif name == 'account':
</td>
{% else %}
{% if dat_line.is_intro %}
- <td{% if dat_line.error %} class="invalid"{% endif %} colspan=3><a href="/booking/{{dat_line.booking_id}}">{{dat_line.code}}</a></td>
+ <td{% if dat_line.error %} class="invalid"{% endif %}><a href="/booking/{{dat_line.booking_id}}">{{dat_line.booking_line.date}}</a></td>
+ <td{% if dat_line.error %} class="invalid"{% endif %} colspan=2>{{dat_line.booking_line.target}}</td>
{% elif not dat_line.error %}
<td class="amt">{{dat_line.booking_line.amount_short}}</td>
<td class="curr">{{dat_line.booking_line.currency|truncate(4,true,"…")}}</td>
{% for dat_line in dat_lines %}
<tr>
{% if dat_line.is_intro %}
- <td{% if dat_line.error %} class="invalid"{% endif %} colspan=3><input name="line_{{loop.index0}}_intro" value="{{dat_line.code}}"/></td>
+ <td{% if dat_line.error %} class="invalid"{% endif %}><input name="line_{{loop.index0}}_date" value="{{dat_line.booking_line.date}}" /></td>
+ <td{% if dat_line.error %} class="invalid"{% endif %} colspan=2><input name="line_{{loop.index0}}_target" value="{{dat_line.booking_line.target}}" /></td>
{% elif not dat_line.error %}
<td><input name="line_{{loop.index0}}_account" value="{{dat_line.booking_line.account}}" /></td>
<td><input name="line_{{loop.index0}}_amount" value="{{dat_line.booking_line.amount or ''}}" /></td>