-
{{ c.consumable }}
-
+ {% if missed_reservations %}
+
Missed reservations
+ {% for m in missed_reservations %}
+
+ {{ m.reservation_item }}
+
+ {% if project_autocomplete or selected_project %}
+ Missed by {{ m.user }}
+
+ {% endif %}
+ {{ m.start }}
+
+ Charged to project {{ m.project }}
+ {% if m|can_be_adjusted:user %}
+ {% include "usage/adjustment_request_button.html" with charge=m %}
+ {% endif %}
+
+ {% endfor %}
+ {% endif %}
+ {% if consumables %}
+
Supplies and consumables
+ {% for c in consumables %}
+
+ {{ c.consumable }}
+
+ {% if project_autocomplete or selected_project %}
+ For {{ c.customer }}
+
+ {% endif %}
+ Quantity {{ c.quantity }}
+
+ Purchased from {{ c.merchant }} on {{ c.date }}
+
+ Charged to project {{ c.project }}
+ {% if c|can_be_adjusted:user %}
+ {% include "usage/adjustment_request_button.html" with charge=c %}
+ {% endif %}
+
+ {% endfor %}
+ {% endif %}
+ {% if staff_charges %}
+
Staff charges
+ {% for s in staff_charges %}
+
+ Work performed by {{ s.staff_member }}
{% if project_autocomplete or selected_project %}
- For {{ c.customer }}
-
+ on behalf of {{ s.customer }}
+ {% else %}
+ on your behalf
{% endif %}
- Quantity {{ c.quantity }}
-
- Purchased from {{ c.merchant }} on {{ c.date }}
-
- Charged to project {{ c.project }}
-
- {% endfor %}
- {% endif %}
- {% if staff_charges %}
-
Staff charges
- {% for s in staff_charges %}
-
- Work performed by {{ s.staff_member }}
+
+
+ {% if s.note %}
+ Charge note: {{ s.note|linebreaksbr }}
+
+ {% endif %}
+ {{ s.start }}
+
+ {{ s.end }}
+
+ Charged to project {{ s.project }}
+ {% if s|can_be_adjusted:user %}
+ {% include "usage/adjustment_request_button.html" with charge=s %}
+ {% endif %}
+
+ {% endfor %}
+ {% endif %}
+ {% if training_sessions %}
+
Training sessions
+ {% for t in training_sessions %}
+
+ {{ t.tool }} {{ t.get_type_display }} training
+ {% if project_autocomplete or selected_project %}for {{ t.trainee }}{% endif %}
+
+ Trained by {{ t.trainer }}
+
+ {{ t.date }} ({{ t.duration }} minutes)
+
+ Charged to project {{ t.project }}
+
+ {% endfor %}
+ {% endif %}
+ {% if area_access %}
+
Area access
+ {% for a in area_access %}
+
+ {{ a.area }}
+
+ {% if a.staff_charge %}
+ Area accessed by {{ a.staff_charge.staff_member }}
{% if project_autocomplete or selected_project %}
- on behalf of {{ s.customer }}
+ on behalf of {{ a.customer }}
{% else %}
on your behalf
{% endif %}
- {% if s.note %}
- Charge note: {{ s.note|linebreaksbr }}
+ {% else %}
+ {% if project_autocomplete or selected_project %}
+ Area accessed by {{ a.customer }}
{% endif %}
- {{ s.start }}
-
- {{ s.end }}
-
- Charged to project {{ s.project }}
- {% if adj_staff_charge == "enabled" and s.staff_member == user and user.is_staff %}
- {% if not adjustment_time_limit or adjustment_time_limit <= s.end %}
- {% include "usage/adjustment_request_button.html" with charge=s %}
- {% endif %}
- {% endif %}
-
- {% endfor %}
- {% endif %}
- {% if training_sessions %}
-
Training sessions
- {% for t in training_sessions %}
-
- {{ t.tool }} {{ t.get_type_display }} training
- {% if project_autocomplete or selected_project %}for {{ t.trainee }}{% endif %}
-
- Trained by {{ t.trainer }}
-
- {{ t.date }} ({{ t.duration }} minutes)
-
- Charged to project {{ t.project }}
-
- {% endfor %}
- {% endif %}
- {% if area_access %}
-
Area access
- {% for a in area_access %}
-
- {{ a.area }}
-
- {% if a.staff_charge %}
- Area accessed by {{ a.staff_charge.staff_member }}
- {% if project_autocomplete or selected_project %}
- on behalf of {{ a.customer }}
- {% else %}
- on your behalf
- {% endif %}
-
-
- {% else %}
+ {% endif %}
+ {{ a.start }}
+
+ {{ a.end|default_if_none:"In progress" }}
+
+ Charged to project {{ a.project }}
+ {% if a|can_be_adjusted:user %}
+ {% include "usage/adjustment_request_button.html" with charge=a %}
+ {% endif %}
+
+ {% endfor %}
+ {% endif %}
+ {% if usage_events %}
+
Tool usage
+ {% for u in usage_events %}
+
+ {{ u.tool }}
+
+ {% if u.user != u.operator %}
+ Operated by {{ u.operator }}
{% if project_autocomplete or selected_project %}
- Area accessed by {{ a.customer }}
-
- {% endif %}
- {% endif %}
- {{ a.start }}
-
- {{ a.end|default_if_none:"In progress" }}
-
- Charged to project {{ a.project }}
- {% if not a.staff_charge and adj_area_access == "enabled" %}
- {% if not adjustment_time_limit or adjustment_time_limit <= a.end %}
- {% if a.customer == user or a.project in pi_projects %}
- {% include "usage/adjustment_request_button.html" with charge=a %}
- {% endif %}
- {% endif %}
- {% elif a.staff_charge and adj_staff_charge == "enabled" %}
- {% if not adjustment_time_limit or adjustment_time_limit <= a.end %}
- {% if a.staff_charge.staff_member == user and user.is_staff %}
- {% include "usage/adjustment_request_button.html" with charge=a %}
- {% endif %}
+ on behalf of {{ u.user }}
+ {% else %}
+ on your behalf
{% endif %}
- {% endif %}
-
- {% endfor %}
- {% endif %}
- {% if usage_events %}
-
Tool usage
- {% for u in usage_events %}
-
- {{ u.tool }}
+
- {% if u.user != u.operator %}
- Operated by {{ u.operator }}
- {% if project_autocomplete or selected_project %}
- on behalf of {{ u.user }}
- {% else %}
- on your behalf
- {% endif %}
-
+ {% else %}
+ {% if project_autocomplete or selected_project %}
+ Operated by {{ u.user }}
- {% else %}
- {% if project_autocomplete or selected_project %}
- Operated by {{ u.user }}
-
- {% endif %}
{% endif %}
- {{ u.start }}
-
- {{ u.end }}
-
- Charged to project {{ u.project }}
- {% if adj_tool_usage == "enabled" %}
- {% if not adjustment_time_limit or adjustment_time_limit <= u.end %}
- {% if u.user == u.operator and u.user == user or u.project in pi_projects %}
- {% include "usage/adjustment_request_button.html" with charge=u %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% if adj_staff_charge == "enabled" %}
- {% if not adjustment_time_limit or adjustment_time_limit <= u.end %}
- {% if u.operator == user and user.is_staff and u.remote_work %}
- {% include "usage/adjustment_request_button.html" with charge=u %}
- {% endif %}
- {% endif %}
- {% endif %}
-
- {% endfor %}
- {% endif %}
- {% endwith %}
+ {% endif %}
+ {{ u.start }}
+
+ {{ u.end }}
+
+ Charged to project {{ u.project }}
+ {% if u|can_be_adjusted:user %}
+ {% include "usage/adjustment_request_button.html" with charge=u %}
+ {% endif %}
+
+ {% endfor %}
+ {% endif %}
{% endblock %}
diff --git a/NEMO/templates/usage/usage_base.html b/NEMO/templates/usage/usage_base.html
index 5927700f..443905d8 100644
--- a/NEMO/templates/usage/usage_base.html
+++ b/NEMO/templates/usage/usage_base.html
@@ -150,12 +150,15 @@