Skip to content

Commit

Permalink
Display time-saving in member time_logs
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Feb 26, 2023
1 parent 17e9439 commit 4caa923
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions app/Resources/views/member/_partial/time_logs.html.twig
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
<table>
<thead>
<tr>
<th>TOTAL</th>
<th>
TOTAL
{% if use_time_log_saving %}
<span>TEMPS</span>
{% endif %}
</th>
<th>TOTAL CYCLE EN COURS</th>
{% if use_time_log_saving %}
<th>TOTAL EPARGNE</th>
{% endif %}
</tr>
</thead>
<tbody>
<tr>
<td>{{ member.shiftTimeCount | duration_from_minutes }}</td>
<td>{{ member.shiftTimeCount(membership_service.endOfCycle(member)) | duration_from_minutes }}</td>
{% if use_time_log_saving %}
<td>{{ member.savingTimeCount | duration_from_minutes }}</td>
{% endif %}
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -48,7 +59,7 @@
</thead>
<tbody>
{% for timeLog in member.timeLogs %}
<tr class="{% if timeLog.time > 0 %}green{% elseif timeLog.time < 0 %}red{% else %}grey{% endif %} lighten-5">
<tr class="{% if timeLog.type == 20 %}blue{% elseif timeLog.time > 0 %}green{% elseif timeLog.time < 0 %}red{% else %}grey{% endif %} lighten-5">
<td title="{{ timeLog.createdAt | date_fr_with_time }}">{{ timeLog.createdAt | date("d/m/Y") }}</td>
<td>{{ timeLog.createdBy }}</td>
<td>{{ timeLog.time | duration_from_minutes }}</td>
Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Entity/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Membership

/**
* @ORM\OneToMany(targetEntity="TimeLog", mappedBy="membership", cascade={"persist", "remove"})
* @OrderBy({"createdAt" = "DESC"})
* @OrderBy({"createdAt" = "DESC", "type" = "DESC"})
*/
private $timeLogs;

Expand Down

0 comments on commit 4caa923

Please sign in to comment.