Renamed records to item_list, and record to item in the report templates in the accounting application.
This commit is contained in:
		| @@ -86,7 +86,7 @@ First written: 2020/7/15 | ||||
|   </div> | ||||
| </div> | ||||
|  | ||||
| {% if records %} | ||||
| {% if item_list %} | ||||
|   {% include "mia_core/include/pagination.html" %} | ||||
|  | ||||
|   {# The table for large screens #} | ||||
| @@ -102,16 +102,16 @@ First written: 2020/7/15 | ||||
|       </tr> | ||||
|     </thead> | ||||
|     <tbody> | ||||
|       {% for record in records %} | ||||
|         <tr class="{% if record.balance < 0 %} table-danger {% endif %}"> | ||||
|           <td>{{ record.label }}</td> | ||||
|           <td class="amount">{{ record.credit|accounting_amount }}</td> | ||||
|           <td class="amount">{{ record.debit|accounting_amount }}</td> | ||||
|           <td class="amount {% if record.balance < 0 %} text-danger {% endif %}">{{ record.balance|accounting_amount }}</td> | ||||
|           <td class="amount {% if record.cumulative_balance < 0 %} text-danger {% endif %}">{{ record.cumulative_balance|accounting_amount }}</td> | ||||
|       {% for item in item_list %} | ||||
|         <tr class="{% if item.balance < 0 %} table-danger {% endif %}"> | ||||
|           <td>{{ item.label }}</td> | ||||
|           <td class="amount">{{ item.credit|accounting_amount }}</td> | ||||
|           <td class="amount">{{ item.debit|accounting_amount }}</td> | ||||
|           <td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td> | ||||
|           <td class="amount {% if item.cumulative_balance < 0 %} text-danger {% endif %}">{{ item.cumulative_balance|accounting_amount }}</td> | ||||
|           <td class="actions"> | ||||
|             {% if record.month is not None %} | ||||
|               <a class="btn btn-info" role="button" href="{% url "accounting:cash" current_subject.code record.month|date:"Y-m" %}"> | ||||
|             {% if item.month is not None %} | ||||
|               <a class="btn btn-info" role="button" href="{% url "accounting:cash" current_subject.code item.month|date:"Y-m" %}"> | ||||
|                 <i class="fas fa-eye"></i> | ||||
|                 <span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span> | ||||
|               </a> | ||||
| @@ -124,41 +124,41 @@ First written: 2020/7/15 | ||||
|  | ||||
|   {# The list for small screens #} | ||||
|   <ul class="list-group d-sm-none"> | ||||
|     {% for record in records %} | ||||
|       <li class="list-group-item {% if record.balance < 0 %} list-group-item-danger {% endif %}"> | ||||
|         {% if record.month is not None %} | ||||
|           <a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:cash" current_subject.code record.month|date:"Y-m" %}"> | ||||
|             {{ record.label }} | ||||
|     {% for item in item_list %} | ||||
|       <li class="list-group-item {% if item.balance < 0 %} list-group-item-danger {% endif %}"> | ||||
|         {% if item.month is not None %} | ||||
|           <a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:cash" current_subject.code item.month|date:"Y-m" %}"> | ||||
|             {{ item.label }} | ||||
|             <div> | ||||
|               <span class="badge badge-success badge-pill"> | ||||
|                 {{ record.credit|accounting_amount }} | ||||
|                 {{ item.credit|accounting_amount }} | ||||
|               </span> | ||||
|               <span class="badge badge-warning badge-pill"> | ||||
|                 {{ record.debit|accounting_amount }} | ||||
|                 {{ item.debit|accounting_amount }} | ||||
|               </span> | ||||
|               <span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> | ||||
|                 {{ record.balance|intcomma:False }} | ||||
|               <span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> | ||||
|                 {{ item.balance|intcomma:False }} | ||||
|               </span> | ||||
|               <span class="badge {% if record.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill"> | ||||
|                 {{ record.cumulative_balance|intcomma:False }} | ||||
|               <span class="badge {% if item.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill"> | ||||
|                 {{ item.cumulative_balance|intcomma:False }} | ||||
|               </span> | ||||
|             </div> | ||||
|           </a> | ||||
|         {% else %} | ||||
|           <div class="d-flex justify-content-between align-items-center"> | ||||
|             {{ record.label }} | ||||
|             {{ item.label }} | ||||
|             <div> | ||||
|               <span class="badge badge-success badge-pill"> | ||||
|                 {{ record.credit|accounting_amount }} | ||||
|                 {{ item.credit|accounting_amount }} | ||||
|               </span> | ||||
|               <span class="badge badge-warning badge-pill"> | ||||
|                 {{ record.debit|accounting_amount }} | ||||
|                 {{ item.debit|accounting_amount }} | ||||
|               </span> | ||||
|               <span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> | ||||
|                 {{ record.balance|intcomma:False }} | ||||
|               <span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill"> | ||||
|                 {{ item.balance|intcomma:False }} | ||||
|               </span> | ||||
|               <span class="badge {% if record.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill"> | ||||
|                 {{ record.cumulative_balance|intcomma:False }} | ||||
|               <span class="badge {% if item.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill"> | ||||
|                 {{ item.cumulative_balance|intcomma:False }} | ||||
|               </span> | ||||
|             </div> | ||||
|           </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user