{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <div class="row max-width-initial">
        <form action="{{ path('report_inventory_transfer_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 class="required">Transferred Date (From)</label>
                                    <input type="text" class="date" name="date_from"  value="{{ 'now'|date('m/d/Y') }}"  required>
                                </div>
                                <div class="large-6 medium-6 small-12 columns">
                                    <label class="required">Transferred Date (To)</label>
                                    <input type="text" class="date" name="date_to"  value="{{ 'now'|date('m/d/Y') }}"  required>
                                </div>
                                <div class="large-6 medium-6 small-12 columns">
                                    <label>Branch (From)</label>
                                    <select name="branch_from" class="select2">
                                        <option value="">All</option>
                                        {% for branch in branches %}
                                            <option value="{{ branch.idencoded }}">{{ branch.description }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                                <div class="large-6 medium-6 small-12 columns">
                                    <label>Branch (To)</label>
                                    <select name="branch_to" class="select2">
                                        <option value="">All</option>
                                        {% for branch in branches %}
                                            <option value="{{ branch.idencoded }}">{{ branch.description }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                                <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>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">
                                </div>
                            </div>
                            <hr class="max-width-initial">
                            <div>
                                {% if userData.type == 'Super Admin' or 'Admin Report Inventory Transfer 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 Transfer Preview' 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 %}