{% from '_macros.html' import td_eur, td_source, td_source_short, verify_btn, copy_btn, casilla_badge, pluralize, cell_amount, casilla_warnings_block, note_block, section_h2, empty_state %}
{{ section_h2(casilla, 'Venta de cryptos') }}
{{ note_block(casilla) }}
{{ casilla_warnings_block(casilla) }}
Por cada activo, pulsa "alta elemento patrimonial" y, dentro de la casilla {{ casilla_badge(1804) }},
introduce el nombre del activo y los agregados de total transmisiones {{ casilla_badge(1804) }} y
total adquisiciones {{ casilla_badge(1806) }} (mostrados en el resumen de cada activo más abajo).
Verifica el balance de cada activo en la tabla resumen con la casilla {{ casilla_badge(1809) }} (ganancias) o
{{ casilla_badge(1807) }}{{ casilla_badge(1808) }} (pérdidas) según corresponda. Una vez introducidos todos los activos, verifica los totales globales con
{{ casilla_badge(1814) }} (total ganancias) y {{ casilla_badge(1813) }} (total pérdidas).
{% if casilla.extras.grupos_activo %}
Resumen por activo
| Activo |
Ganancias |
Pérdidas |
Balance |
{% for grupo in casilla.extras.grupos_activo %}
| {{ grupo.ticker }} |
{{ cell_amount(grupo.ganancias_activo, button=none, abs_value=True) }} |
{{ cell_amount(grupo.perdidas_activo, button=none, abs_value=True) }} |
{% if grupo.total_ganancia_eur is none %}NO CALCULADO
{% elif grupo.total_ganancia_eur > 0 %}{{ cell_amount(grupo.total_ganancia_eur, casilla=1809, button='verify') }}
{% elif grupo.total_ganancia_eur < 0 %}{{ cell_amount(grupo.total_ganancia_eur, casillas=[1807,1808], button='verify') }}
{% else %}{{ cell_amount(grupo.total_ganancia_eur) }}
{% endif %}
|
{% endfor %}
| Total |
{{ cell_amount(casilla.extras.total_ganancias, casilla=1814, button='verify', abs_value=True) }} |
{{ cell_amount(casilla.extras.total_perdidas, casilla=1813, button='verify', abs_value=True) }} |
{% if casilla.extras.total_ganancias is none or casilla.extras.total_perdidas is none %}
NO CALCULADO
{% else %}
{{ (casilla.extras.total_ganancias + casilla.extras.total_perdidas)|format_num }} €
{% endif %}
|
Detalle de operaciones
{% for grupo in casilla.extras.grupos_activo %}
{% set ns = namespace(files=[], labels=[]) %}
{% for item in grupo.operaciones %}{% if item.fuente and item.fuente.file not in ns.files %}{% set ns.files = ns.files + [item.fuente.file] %}{% set ns.labels = ns.labels + [item.fuente.file_label] %}{% endif %}{% endfor %}
{% set single_src = ns.labels|length <= 1 %}
{{ grupo.ticker }}
{% if grupo.tiene_errores %}ERROR{% endif %}
{% if grupo.tiene_avisos and not grupo.tiene_errores %}AVISO{% endif %}
{% if ns.labels %}{{ ns.labels|join(' · ') }}{% endif %}
{{ grupo.num_ops }} {{ pluralize(grupo.num_ops, 'operación', 'operaciones') }}
{% if grupo.wallets %} · {{ grupo.wallets|join(', ') }}{% endif %}
· Transmisiones {% if grupo.total_ingresos_eur is not none %}{{ casilla_badge(1804) }} {{ grupo.total_ingresos_eur|format_num }} €{{ copy_btn(grupo.total_ingresos_eur) }}{% else %}—{% endif %}
· Adquisiciones {% if grupo.total_coste_eur is not none %}{{ casilla_badge(1806) }} {{ grupo.total_coste_eur|format_num }} €{{ copy_btn(grupo.total_coste_eur) }}{% else %}—{% endif %}
|
Adquisición | Transmisión |
|
Transmisión | Adquisición |
Ganancia |
|
|
{% for item in grupo.operaciones %}
{% set e = item.extras %}
{% if item.aviso %}
| {{ loop.index }} |
{{ e.get('fecha_adquisicion', '') }} |
{{ e.get('fecha_venta', '') }} |
{{ e.get('cantidad', '') }} |
— |
— |
{{ item.aviso }} |
|
{{ td_source_short(item.fuente, 'group-start', multi=not single_src) }}
{% else %}
| {{ loop.index }} |
{{ e.get('fecha_adquisicion', '') }} |
{{ e.get('fecha_venta', '') }} |
{{ e.get('cantidad', '') }} |
{{ e.get('ingresos_eur', '') }} |
{{ e.get('coste_eur', '') }} |
{{ td_eur(item.importe_eur, color=True, sign=True, button=none) }}
{{ e.get('notas', '') }} |
{{ td_source_short(item.fuente, 'group-start', multi=not single_src) }}
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
{{ empty_state('No hay ventas de cryptos en este ejercicio.') }}
{% endif %}