{% from '_macros.html' import td_eur, td_source, td_source_short, copy_btn, copy_btn_str, verify_btn, verify_btn_str, casilla_badge, pluralize, cell_amount, casilla_warnings_block, note_block, section_h2, empty_state %} {{ section_h2(casilla, 'Venta de acciones') }} {{ note_block(casilla) }} {{ casilla_warnings_block(casilla) }}
Crea una "entidad emisora" por cada activo y, pulsando sobre la casilla {{ casilla_badge(328) }}, introduce los datos de la entidad. Después, añade cada operación con el botón "alta ganancia/pérdida".
Las casillas a rellenar por cada operación son la {{ casilla_badge(328) }} (valor de transmisión) y la {{ casilla_badge(331) }} (valor de adquisición). Las casillas {{ casilla_badge(336) }} (ganancias por activo), {{ casilla_badge(337) }}{{ casilla_badge(338) }} (pérdidas por activo), {{ casilla_badge(339) }} (total ganancias) y {{ casilla_badge(340) }} (total pérdidas) se calculan automáticamente en la Renta y se muestran aquí para verificar los datos una vez introducidos.
{% if casilla.extras.grupos_activo %}

Resumen por activo

{% for grupo in casilla.extras.grupos_activo %} {% endfor %}
Activo Ganancias Pérdidas
{{ grupo.ticker }} {{ cell_amount(grupo.ganancias_activo, casilla=336, button='verify', abs_value=True) }} {{ cell_amount(grupo.perdidas_activo, casillas=[337,338], button='verify', abs_value=True) }}
Total {{ cell_amount(casilla.extras.total_ganancias, casilla=339, button='verify', abs_value=True) }} {{ cell_amount(casilla.extras.total_perdidas, casilla=340, button='verify', abs_value=True) }}

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') }}  ·  Transmisiones {% if grupo.total_ingresos_eur is not none %}{{ casilla_badge(328) }} {{ grupo.total_ingresos_eur|format_num }} €{{ verify_btn(grupo.total_ingresos_eur) }}{% else %}—{% endif %}  ·  Adquisiciones {% if grupo.total_coste_eur is not none %}{{ casilla_badge(331) }} {{ grupo.total_coste_eur|format_num }} €{{ verify_btn(grupo.total_coste_eur) }}{% else %}—{% endif %} {% for item in grupo.operaciones %} {% set e = item.extras %} {% if item.error %} {{ td_source_short(item.fuente, 'group-start', multi=not single_src) }} {% elif item.aviso %} {{ td_source_short(item.fuente, 'group-start', multi=not single_src) }} {% else %} {{ td_eur(item.importe_eur, color=True, sign=True, button=none) }} {{ td_source_short(item.fuente, 'group-start', multi=not single_src) }} {% endif %} {% endfor %}
# Fechas Cantidad Valores (USD) Tipo de Cambio Valores (EUR) Origen
AdquisiciónTransmisión AdquisiciónTransmisión AdquisiciónTransmisión TransmisiónAdquisición Ganancia
{{ loop.index }} {{ e.get('fecha_vesting', '') }} {{ e.get('fecha_venta', '') }} {{ e.get('cantidad', '') }} {{ e.get('coste_usd', '') }} {{ e.get('ingresos_usd', '') }} {{ item.error }}
{{ loop.index }} {{ e.get('fecha_vesting', '') }} {{ e.get('fecha_venta', '') }} {{ e.get('cantidad', '') }} {{ e.get('coste_usd', '') }} {{ e.get('ingresos_usd', '') }} {{ item.aviso }}
{{ loop.index }} {{ e.get('fecha_vesting', '') }} {{ e.get('fecha_venta', '') }} {{ e.get('cantidad', '') }} {{ e.get('coste_usd', '') }} {{ e.get('ingresos_usd', '') }} {{ e.get('tipo_vesting', '') }} {{ e.get('tipo_venta', '') }} {{ e.get('ingresos_eur', '') }}{{ copy_btn_str(e.get('ingresos_eur', '')) }} {{ e.get('coste_eur', '') }}{{ copy_btn_str(e.get('coste_eur', '')) }}
{% endfor %} {% else %} {{ empty_state('No hay ventas de acciones en este ejercicio.') }} {% endif %}