invoice_form.html 5.04 KB
Newer Older
Patrick's avatar
Patrick committed
1
{% extends 'subpage_base_wo_cms_toolbar.html' %}
pi's avatar
pi committed
2 3 4 5
{% load cms_tags sekizai_tags i18n l10n repanier_tags %}
{% block sub_content %}
<div class="container">
{# {% debug %} #}
Patrick's avatar
Patrick committed
6 7 8 9 10
    <div class="panel {% if object.balance < 0 %}panel-danger{% else %}panel-success{% endif %}">
        <div class="panel-heading">
        <h4>{% trans "New balance" %} {{ object.customer.long_basket_name }} : {{ object.balance }}&nbsp;&euro; <small>({{ object.date_balance | date:"DATE_FORMAT" }})</small></h4>
        </div>
    </div>
pi's avatar
pi committed
11 12
{% if bank_account_set %}
    <h4>{% trans "Bank movement(s) :" %}</h4>
Patrick's avatar
Patrick committed
13
    <table class="table table-hover table-bordered" >
pi's avatar
pi committed
14
    <tr>
Patrick's avatar
Patrick committed
15
    <thead>
pi's avatar
pi committed
16 17 18 19 20 21 22 23 24 25 26 27 28
        <th>
            {% trans "Date" %}
        </th>
        <th align="right">
            {% trans "Payment" %}
        </th>
        <th align="right">
            {% trans "Refund" %}
        </th>
        <th>
            {% trans "Comment" %}
        </th>
    <tr>
Patrick's avatar
Patrick committed
29 30
    </thead>
    <tbody>
pi's avatar
pi committed
31 32 33 34 35 36
    {% for bank_account in bank_account_set %}
    <tr>
        <td>
            {{ bank_account.operation_date }}
        </td>
        <td align="right">
Patrick's avatar
Patrick committed
37
            {{ bank_account.bank_amount_in }}&nbsp;&euro;
pi's avatar
pi committed
38 39
        </td>
        <td align="right">
Patrick's avatar
Patrick committed
40
            {{ bank_account.bank_amount_out }}&nbsp;&euro;
pi's avatar
pi committed
41 42 43 44 45 46 47 48
        </td>
        <td>
        {% if bank_account.operation_comment %}
            {{ bank_account.operation_comment }}
        {% endif %}
        </td>
    <tr>
    {% endfor %}
Patrick's avatar
Patrick committed
49
    </tbody>
pi's avatar
pi committed
50 51 52 53 54
    </table>
{% else %}
    <h4>{% trans "No bank movement found" %}</h4>
{% endif %}
{% if purchase_set %}
Patrick's avatar
Patrick committed
55 56 57 58 59 60 61 62
    <h4>{{ object.permanence }} - {% trans "Purchase(s) :" %} {{ object.total_price_with_tax }}&nbsp;&euro;</h4>
    {% if object.total_vat != 0 or object.total_compensation != 0 or object.total_deposit != 0 %}
        <h4><small>{% trans "This price include" %} <span class="glyphicon glyphicon-arrow-right"></span> {% if object.total_vat != 0 %}{% trans "Vat" %} : {{ object.total_vat }}&nbsp;&euro;{% endif %}</small></h4>
        <h4><small>{% if object.total_compensation != 0 %}{% if object.total_vat != 0 %}, {% endif %}{% trans "Compensation" %} : {{ object.total_compensation }}&nbsp;&euro;{% endif %}</small></h4>
        <h4><small>{% if object.total_deposit != 0 %}{% if object.total_vat != 0 or object.total_compensation != 0 %}, {% endif %}{% trans "Deposit" %} : {{ object.total_deposit }}&nbsp;&euro;{% endif %}</small></h4>
    {% endif %}
    <table class="table table-hover table-bordered" >
    <thead>
pi's avatar
pi committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
    <tr>
        <th>
            {% trans "Date" %}
        </th>
        <th>
            {% trans "Producer" %}
        </th>
        <th>
            {% trans "Product" %}
        </th>
        <th>
            {% trans "Qty" %}
        </th>
        <th>
            {% trans "Unit price" %}
        </th>
        <th>
            {% trans "Total price" %}
        </th>
        <th>
            {% trans "Comment" %}
        </th>
    <tr>
Patrick's avatar
Patrick committed
86 87
    </thead>
    <tbody>
pi's avatar
pi committed
88 89 90 91 92 93 94 95 96 97 98 99
    {% for purchase in purchase_set %}
    <tr>
        <td>
            {{ purchase.distribution_date }}
        </td>
        <td>
            {{ purchase.producer.short_profile_name | truncatechars:15 }}
        </td>
        <td>
            {{ purchase.long_name }}
        </td>
        <td align="right">
Patrick's avatar
Patrick committed
100
            {{ purchase.quantity | floatformat:3 }}
pi's avatar
pi committed
101 102
        </td>
        <td align="right">
Patrick's avatar
Patrick committed
103
            {{ purchase.real_unit_price }}&nbsp;&euro;{% if purchase.unit_deposit %} <span class="glyphicon glyphicon-plus"></span> {{ purchase.unit_deposit }}&nbsp;&euro; <span class="glyphicon glyphicon-leaf"></span>{% endif %}
pi's avatar
pi committed
104 105
        </td>
        <td align="right">
Patrick's avatar
Patrick committed
106
            {% if purchase.invoiced_price_with_compensation %}{{ purchase.price_with_compensation }}{% else %}{{ purchase.price_with_vat }}{% endif %}&nbsp;&euro;
pi's avatar
pi committed
107 108 109 110 111 112 113 114
        </td>
        <td>
        {% if purchase.comment %}
            {{ purchase.comment }}
        {% endif %}
        </td>
    <tr>
    {% endfor %}
Patrick's avatar
Patrick committed
115
    </tbody>
pi's avatar
pi committed
116 117 118 119
    </table>
{% else %}
    <h4>{% trans "No purchase found" %}</h4>
{% endif %}
Patrick's avatar
Patrick committed
120
    <h4>{% trans "Previous balance" %} : {{ object.previous_balance }}&nbsp;&euro; <small>({{ object.date_previous_balance | date:"DATE_FORMAT" }})</small></h4>
pi's avatar
pi committed
121 122 123 124 125
</div>
{% endblock %}
{% block footer %}
        <div class="btn-group">
            {% if previous_customer_invoice_id %}
Patrick's avatar
Patrick committed
126
                <a href="{% url 'invoice_view' previous_customer_invoice_id %}" class="btn btn-success btn-disabled"><span class="glyphicon glyphicon-arrow-left"></span></a>
pi's avatar
pi committed
127
            {% else %}
Patrick's avatar
Patrick committed
128 129 130
                <a href="#" class="btn btn-disabled"></a>
            {% endif %}
            {% if previous_customer_invoice_id or next_customer_invoice_id %}
Patrick's avatar
Patrick committed
131
                <a href="#" class="btn btn-disabled"> {% trans "Invoice" %} </a>
pi's avatar
pi committed
132 133
            {% endif %}
            {% if next_customer_invoice_id %}
Patrick's avatar
Patrick committed
134
            <a href="{% url 'invoice_view' next_customer_invoice_id %}" class="btn btn-success btn-disabled"><span class="glyphicon glyphicon-arrow-right"></span></a>
pi's avatar
pi committed
135
            {% else %}
Patrick's avatar
Patrick committed
136
                <a href="#" class="btn btn-disabled"></a>
pi's avatar
pi committed
137 138 139
            {% endif %}
        </div>
{% endblock %}