{% extends "index.html" %}
{% block body %}

    <div class="content-section">
        <form method="POST" action="" enctype="multipart/form-data">
            {{ form.hidden_tag() }}
            <fieldset class="form-group">
                <legend class="border-bottom mb-4">Create New Expense</legend>
                <div class="form-content">
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                {{ form.client_name.label(class="form-control-label") }}

                                {% if form.client_name.errors %}
                                    {{ form.client_name(class="form-control is-invalid") }}
                                    <div class="invalid-feedback">
                                        {% for error in form.client_name.errors %}
                                            <span>{{ error }}</span>
                                        {% endfor %}
                                    </div>
                                {% else %}
                                    {{ form.client_name(class="form-control") }}
                                {% endif %}
                            </div>
                            <div class="form-group">
                                {{ form.client_project.label(class="form-control-label") }}
                                
                                {% if form.client_project.errors %}
                                    {{ form.client_project(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.client_project.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.client_project(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                {{ form.GBP.label(class="form-control-label") }}

                                {% if form.GBP.errors %}
                                    {{ form.GBP(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.GBP.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.GBP(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                {{ form.EUR.label(class="form-control-label") }}

                                {% if form.EUR.errors %}
                                    {{ form.EUR(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.EUR.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.EUR(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                {{ form.USD.label(class="form-control-label") }}

                                {% if form.USD.errors %}
                                    {{ form.USD(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.USD.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.USD(class="form-control") }}
                                {% endif %}
                            </div>
                            <div class="form-group">
                                {{ form.picture_expense.label() }}
                                {{ form.picture_expense(class="form-control-file") }}
                                    
                                    {% if form.picture_expense.errors %}
                                        {% for error in form.picture_expense.errors %}
                                            <span class="text-danger">{{ error }}</span></br>
                                        {% endfor %}
                                    {% endif %}
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                {{ form.client_or_saggezza.label(class="form-control-label") }}

                                {% if form.client_or_saggezza.errors %}
                                    {{ form.client_or_saggezza(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.client_or_saggezza.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.client_or_saggezza(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                {{ form.expenses_date.label(class="form-control-label") }}
                
                                {{ form.expenses_date(class="datepicker form-control") }}

                            </div>
                            <div class="form-group">
                                {{ form.billable_to.label(class="form-control-label") }}
                                
                                {% if form.billable_to.errors %}
                                    {{ form.billable_to(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.billable_to.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    
                                    {{ form.billable_to(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                {{ form.payment.label(class="form-control-label") }}
                                
                                {% if form.payment.errors %}
                                    {{ form.payment(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.payment.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.payment(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                {{ form.receipt.label(class="form-control-label") }}
                                
                                {% if form.receipt.errors %}
                                    {{ form.receipt(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.receipt.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.receipt(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                {{ form.expense_category.label(class="form-control-label") }}
                                
                                {% if form.expense_category.errors %}
                                    {{ form.expense_category(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.expense_category.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.expense_category(class="form-control") }}
                                {% endif %}
                                
                            </div>
                            <div class="form-group">
                                
                                
                                {% if form.description.errors %}
                                    {{ form.description(class="form-control is-invalid") }}
                                        <div class="invalid-feedback">
                                            {% for error in form.description.errors %}
                                                <span>{{ error }}</span>
                                            {% endfor %}
                                        </div>
                                {% else %}
                                    {{ form.description(class="form-control",placeholder="Description") }}
                                {% endif %}
                                
                            </div>
                        </div>
                    
                    </div>
                    <div class="form-group">
                            {{ form.submit(class="btn btn-outline-info") }}
                    </div>
                </div>
            </fieldset>
        
        </form>
    </div>

{% endblock %}