<?xml version="1.0"?>
<AddToOrder
    version="{{ xml_gateway_version|default('1.50', true) }}"
    device="102"
>
    <OrdCheck
        badge="{{ employee }}"
        department="{{ department }}"
        check="{{ check }}"
    >
        <Department num="{{ department }}">
            <Seat num="1">
                {%- for item in items %}
                <Item
                    id="{{ item.menu_item_id }}"
                    {%- if item.menu_item.open %}
                    price="{{ cents_to_dollars(item.price_per_unit) }}"
                    {%- endif %}
                    {%- if item.discounts %}
                    promo="{{ item.discounts[0].discount_id }}"
                    {%- endif %}
                    {%- if item.comment %}
                    name="{{ item.comment }}"
                    {%- endif %}
                />
                {%- if item.quantity > 1 %}
                <Qty amount="{{ convert_to_squirrel_decimal(item.quantity) }}" />
                {%- endif %}
                {%- for modifier in item.modifiers %}
                <Item id="{{ modifier.menu_modifier_id }}"
                    {%- if modifier.menu_modifier.open %}
                    price="{{ cents_to_dollars(modifier.price_per_unit) }}"
                    {%- endif %}
                    {%- if modifier.comment %}
                    name="{{ modifier.comment }}"
                    {%- endif %}
                />
                {%- endfor %}
                {%- endfor %}
            </Seat>
        </Department>
    </OrdCheck>
</AddToOrder>
