code = halves[0]
return cls(code, comment)
- @classmethod
- def from_subclass(cls, line: '_DatLine') -> Self:
- 'Devolve from subclassed line into cls.'
- return cls(line.code, line.comment)
-
@property
def comment_instructions(self) -> dict[str, str]:
'Parse .comment into _Account modification instructions.'
return ''
@property
- def lines(self) -> list[_DatLine]:
+ def lines(self) -> list[_BookingLine | _GapLine]:
'Return .lines of .booking and .gap as list[_DatLine].'
lines = (self.booking.lines if self.booking else []) + self.gap.lines
if self.booking and not self.gap.lines:
lines += [_GapLine()]
- return [_DatLine.from_subclass(line) for line in lines]
+ return lines
def _set_neighbor(
self,
lines = []
for block in self._blocks:
lines += block.lines
- return lines
+ return [_DatLine(line.code, line.comment) for line in lines]
def _calc_accounts(self) -> dict[str, _Account]:
'Build mapping of account names to _Accounts.'
/>
</td>
<td rowspan={{ block.lines | length + 1 }} {# -#}
- class="block_column{{ 'critical' if block.booking
- and block.booking.sink_error }}">
+ class="block_column{{ ' critical' if block.booking
+ and block.booking.sink_error }}">
[<a href="#block_{{ block.id_ }}">#</a>]<br />
[<a href="/balance?up_incl={{ block.id_ }}">b</a>]<br />
[<a href="/edit_{{ mode }}/{{ block.id_ }}">e</a>]
{{ macros.ledger_block_columns('raw', block) -}}
{##}{% for line in block.lines %}
<tr>{# -#}
- <td{{ ' class="critical"' if line.errors }}>
- {{-line.raw}} {# -#}
+ <td{{ ' class="critical"'|safe if line.errors }}>
+ {{- line.raw }} {# -#}
</td>{# -#}
</tr>
{##}{% endfor %}
<td class="currency{{ ' critical' if line.errors }}">
{{- macros.currency_short(line.currency) -}}
</td>
- <td{{ ' class="critical"' if line.errors }}>
+ <td{{ ' class="critical"'|safe if line.errors }}>
{{- line.account -}}
</td>
<td>{{ line.comment }}</td>
|
balance after <a href="/blocks/4">booking 4 (2001-01-01: test)</a>
</p>
-<table class="alternating ">
+<table class="alternating critical">
<tr>
<td class="money">
<details>
<summary>
<table>
<tr>
- <td class="balance amount">-10</td>
+ <td class="balance amount">-9</td>
<td class="balance currency">€</td>
</tr>
</table>
2001-01-02 test
bar -10 € ; bar
baz 10 €
+ baz x €
2001-01-02 test
bar 20 €
+ bar 1 €
baz -20 € ; baz
2001-01-01 test
<tr><td> </td></tr>
<tr></tr><!-- keep the background-color alternation in proper order -->
<tr id="block_2">
- <td rowspan=6 class="block_column">
+ <td rowspan=7 class="block_column">
<input type="submit"
name="ledger_moveup_2"
value="^"
<br />
<input type="submit" name="ledger_copy_2" value="C"/>
</td>
- <td rowspan=6 class="block_column">
+ <td rowspan=7 class="block_column">
[<a href="#block_2">#</a>]<br />
[<a href="/balance?up_incl=2">b</a>]<br />
[<a href="/edit_raw/2">e</a>]
<tr><td>2001-01-02 test </td></tr>
<tr><td> bar -10 € ; bar </td></tr>
<tr><td> baz 10 € </td></tr>
+ <tr><td class="critical"> baz x € </td></tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr></tr><!-- keep the background-color alternation in proper order -->
<tr id="block_3">
- <td rowspan=5 class="block_column">
+ <td rowspan=6 class="block_column">
<input type="submit"
name="ledger_moveup_3"
value="^"
<br />
<input type="submit" name="ledger_copy_3" value="C"/>
</td>
- <td rowspan=5 class="block_column">
+ <td rowspan=6 class="block_column critical">
[<a href="#block_3">#</a>]<br />
[<a href="/balance?up_incl=3">b</a>]<br />
[<a href="/edit_raw/3">e</a>]
</tr>
<tr><td>2001-01-02 test </td></tr>
<tr><td> bar 20 € </td></tr>
+ <tr><td> bar 1 € </td></tr>
<tr><td> baz -20 € ; baz </td></tr>
<tr><td> </td></tr>
<tr></tr><!-- keep the background-color alternation in proper order -->
</tr>
<tr></tr><!-- keep the background-color alternation in proper order -->
<tr id="block_2">
- <td rowspan=6 class="block_column">
+ <td rowspan=7 class="block_column">
<input type="submit"
name="ledger_moveup_2"
value="^"
<br />
<input type="submit" name="ledger_copy_2" value="C"/>
</td>
- <td rowspan=6 class="block_column">
+ <td rowspan=7 class="block_column">
[<a href="#block_2">#</a>]<br />
[<a href="/balance?up_incl=2">b</a>]<br />
[<a href="/edit_structured/2">e</a>]
<td>baz</td>
<td></td>
</tr>
+ <tr>
+ <td class="amount critical">x</td>
+ <td class="currency critical">€</td>
+ <td class="critical">baz</td>
+ <td></td>
+ </tr>
<tr>
<td colspan=4> </td>
</tr>
</tr>
<tr></tr><!-- keep the background-color alternation in proper order -->
<tr id="block_3">
- <td rowspan=5 class="block_column">
+ <td rowspan=6 class="block_column">
<input type="submit"
name="ledger_moveup_3"
value="^"
<br />
<input type="submit" name="ledger_copy_3" value="C"/>
</td>
- <td rowspan=5 class="block_column">
+ <td rowspan=6 class="block_column critical">
[<a href="#block_3">#</a>]<br />
[<a href="/balance?up_incl=3">b</a>]<br />
[<a href="/edit_structured/3">e</a>]
<td>bar</td>
<td></td>
</tr>
+ <tr>
+ <td class="amount">1.00</td>
+ <td class="currency">€</td>
+ <td>bar</td>
+ <td></td>
+ </tr>
<tr>
<td class="amount">-20.00</td>
<td class="currency">€</td>