self.comment = halves[1] if len(halves) > 1 else ''
self.code = halves[0]
self.booking_line: Optional[BookingLine] = None
+ self.questionable = False
@property
def is_intro(self) -> bool:
dat_line.booking_line = TransferLine(self.id_, dat_line.code)
self.account_changes: dict[str, Wealth] = {}
self.sink_account = None
- for dat_line in [dl for dl in self.dat_lines if dl.error]:
- return
changes = Wealth()
for transfer_line in [dl.booking_line for dl in self.dat_lines[1:]]:
assert isinstance(transfer_line, TransferLine)
if self.sink_account:
self.account_changes[self.sink_account] += changes.as_sink
elif not changes.sink_empty:
- last_line = self.dat_lines[-1]
- assert isinstance(last_line.booking_line, BookingLine)
- last_line.booking_line.error = 'needed sink missing'
+ assert self.dat_lines[-1].booking_line is not None
+ self.dat_lines[-1].booking_line.error = 'needed sink missing'
+ for dat_line in [dl for dl in self.dat_lines if dl.error]:
+ for dl in self.dat_lines:
+ dl.questionable = True
class Handler(PlomHttpHandler):
<style>
body { background-color: white; font-family: sans-serif; }
tr:nth-child(odd) { background-color: #dcdcdc; }
-td.invalid { background-color: red; }
{% block css %}{% endblock %}
</style>
</head>
{% macro css_value_line() %}
+tr.warning td { background-color: #ff8888; }
+td.invalid, tr.warning td.invalid { background-color: #ff0000; }
td.amt { text-align: right }
td.amt, td.curr { font-family: monospace; font-size: 1.3em; }
td.curr { text-align: center; }
{% if (not (raw or single)) and dat_line.is_intro and loop.index > 1 %}
<tr><td colspan=5> </td></tr>
{% endif %}
- <tr>
+ <tr{% if dat_line.questionable %} class="warning"{% endif %}>
{% if not single %}
{% if dat_line.is_intro %}
<td id="{{dat_line.booking_id}}"><a href="#{{dat_line.booking_id}}">#</a></td>
{% endif %}
</tr>
{% if dat_line.error and not raw %}
- <tr><td class="invalid" colspan={% if single %}4{% else %}5{% endif %}>{{dat_line.error}}</td></tr>
+ <tr class="warning">{% if not single %}<td></td>{% endif %}<td class="invalid" colspan=3>{{dat_line.error}}</td><td></td></tr>
{% endif %}
{% endfor %}
</table>