Parcourir la source

Show total capacity of goods/costs in doc view

Jocelyn Delande il y a 9 ans
Parent
commit
4353d95191
1 fichiers modifiés avec 20 ajouts et 2 suppressions
  1. 20 2
      costs/templates/costs/document_detail.html

+ 20 - 2
costs/templates/costs/document_detail.html

@@ -21,7 +21,8 @@
 <table>
   <thead>
     <tr>
-      <th>Désignation</th><th>Occupation</th><th>Coût mensuel</th>
+      <th>Désignation</th><th>Capacité totale</th>
+      <th>Occupation</th><th>Coût mensuel</th>
     </tr>
   </thead>
   <tbody>
@@ -33,6 +34,13 @@
           {{ cost.name }}
         </a>
       </td>
+      <td>
+        {% if cost.capacity_unit %}
+        {{ cost.total_capacity }} {{ cost.get_capacity_unit_display }}
+        {% else %}
+        n/a
+        {% endif %}
+      </td>
       <td>{{ cost.used_fraction|percent }}</td>
       <td>{{ cost.price|price }}</td>
     </tr>
@@ -46,7 +54,10 @@
 <table>
   <thead>
     <tr>
-      <th>Désignation</th><th>Occupation</th><th>Coût d'achat</th>
+      <th>Désignation</th>
+      <th>Capacité totale</th>
+      <th>Occupation</th>
+      <th>Coût d'achat</th>
     </tr>
   </thead>
   <tbody>
@@ -59,6 +70,13 @@
       </a>
     </td>
     <td>
+        {% if good.capacity_unit %}
+          {{ good.total_capacity }} {{ good.get_capacity_unit_display }}
+        {% else %}
+          n/a
+        {% endif %}
+    </td>
+    <td>
       {{ good.used_fraction|percent }}
     </td>
     <td>