{% 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

{% for grupo in casilla.extras.grupos_activo %} {% endfor %}
Activo Ganancias Pérdidas Balance
{{ 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 %}
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 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 %} {% for item in grupo.operaciones %} {% set e = item.extras %} {{ td_eur(item.importe_eur, color=True, sign=True, button=none) }} {{ td_source_short(item.fuente, 'group-start', multi=not single_src) }} {% endfor %}
# Fechas Cantidad Valores (EUR) Notas Origen
AdquisiciónTransmisión TransmisiónAdquisición Ganancia
{{ loop.index }} {{ e.get('fecha_adquisicion', '') }} {{ e.get('fecha_venta', '') }} {{ e.get('cantidad', '') }} {{ e.get('ingresos_eur', '') }} {{ e.get('coste_eur', '') }}{{ e.get('notas', '') }}
{% endfor %} {% else %} {{ empty_state('No hay ventas de cryptos en este ejercicio.') }} {% endif %}