{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <div class="row max-width-initial">
        <form action="{{ path('report_inventory_export') }}" target="_blank">
        <div class="small-12 columns">
            <div class="content-container">
                <div class="content-container-content">
                    <div class="row max-width-initial">
                        <div class="large-8 columns">
                            <div class="row max-width-initial">
                                <div class="large-6 medium-6 small-12 columns">
                                    <label>Category</label>
                                    <select name="categories[]" multiple class="select2">
                                        {% for category in categories %}
                                            <option value="{{ category.idencoded }}">{{ category.description }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                                <div class="large-6 medium-6 small-12 columns">
                                    <label>Branch</label>
                                    <select name="branches[]" multiple class="select2">
                                        {% for branch in branches %}
                                            <option value="{{ branch.idencoded }}">{{ branch.description }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                                <div class="large-6 medium-6 small-12 columns">
                                    <label>Item</label>
                                    <input type="text" id="item_desc">
                                    <input type="hidden" id="item" name="item" />
                                </div>
                                <div class="large-6 medium-6 small-12 columns">
                                    <label>Status</label>
                                    <select name="statuses[]" multiple class="select2">
                                        <option value="">All</option>
                                        <option value="{{ constant('RxConnexionBundle\\Entity\\InventoryEntity::STATUS_SOLD') }}">{{ constant('RxConnexionBundle\\Entity\\InventoryEntity::STATUS_SOLD') }}</option>
                                        <option value="{{ constant('RxConnexionBundle\\Entity\\InventoryEntity::STATUS_STOCK_ON_HAND') }}" selected>{{ constant('RxConnexionBundle\\Entity\\InventoryEntity::STATUS_STOCK_ON_HAND') }}</option>
                                    </select>
                                </div>
                            </div>
                            <hr class="max-width-initial">
                            <div>
                                {% if userData.type == 'Super Admin' or 'Admin Report Inventory Item List Preview' in userData.accesses %}
                                <button type="submit" class="button secondary" value="preview" name="type">Preview</button>
                                {% endif %}
                                {#<button type="submit" class="button alert" value="pdf" name="type">Export to PDF</button>#}
                                {% if userData.type == 'Super Admin' or 'Admin Report Inventory Item List Excel' in userData.accesses %}
                                    <button type="submit" class="button success" value="excel" name="type">Export to Excel</button>
                                {% endif %}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </form>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script language="javascript">
        //<![CDATA[
        jQ(document).ready(function(){
            report.init('{{ app.environment }}');

            jQ('.select2').select2();
            global.autocomplete.bind('{{ path('item_autocomplete') }}', '#item_desc', '#item');
        });
        //]]>
    </script>
{% endblock %}