{% macro metadata_block(metadata) -%} {% if metadata %}

Metadatos

{% if metadata.script_type %}
Tipo: {{ metadata.script_type }}
{% endif %} {% if metadata.suitescript_version %}
SuiteScript: {{ metadata.suitescript_version }}
{% endif %} {% if metadata.language %}
Lenguaje: {{ metadata.language }}
{% endif %} {% if metadata.module_type %}
Módulo: {{ metadata.module_type }}
{% endif %}
{% if metadata.description %}

{{ metadata.description }}

{% endif %} {% if metadata.dependencies %}

Dependencias: {% for dep in metadata.dependencies %} {{ dep }} {% endfor %}

{% endif %}
{% endif %} {%- endmacro %} {% macro summary_block(text) -%} {% if text %}

Resumen Ejecutivo

{{ text }}
{% endif %} {%- endmacro %} {% macro list_block(title, items) -%} {% if items %}

{{ title }}

{% endif %} {%- endmacro %} {# --------- AQUÍ ESTÁ EL CAMBIO IMPORTANTE --------- #} {% macro table_block(title, rows, columns) -%} {% if rows %}

{{ title }}

{% for column in columns %} {% endfor %} {% for row in rows %} {# Si row es un dict: comportamiento normal #} {% if row is mapping %} {% for column in columns %} {% set value = row.get(column.field) %} {% if value is sequence and value is not string %} {% else %} {% endif %} {% endfor %} {% else %} {# Fallback: fila no estructurada (string, número, etc.) #} {% endif %} {% endfor %}
{{ column.title }}
{{ value|join(", ") }}{{ value or "" }}
{{ row }}
{% endif %} {%- endmacro %} {% macro logic_block(title, text) -%} {% if text %}

{{ title }}

{{ text }}

{% endif %} {%- endmacro %}