Timecard
Imports: 1

A short explanation. . .

Preview

Report Preview


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!-- This report calculates each person's total time served based on the Times assigned to them.
  If the values seem incorrect, please check that the Teams/Positions your volunteers are scheduled
  with are correctly linked to the Times in the Plan.
-->
<html>
    <head>
        <title>Timecard</title>
        <style>
            * { font-family: Verdana, Arial; font-size: 10pt; }
            body { padding:0; margin:0; }
    	.matrix { border: solid 1px black; border-collapse: collapse; margin-top: 15px; }
		.matrix td { border: solid 1px black; padding: 2px;}
        .number { text-align: center; }
        
        #title { font-weight: bold; font-size: 18pt; text-align: center; }
        #dates { font-size: 12pt; text-align: center; }

        .explanation { background-color: #C9D3DD; width: 475px; margin: 50px auto; padding: 15px; border: 1px solid #70A1D3; -webkit-box-reflect: below  10px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(50%, transparent), to(rgba(255,255,255,0.2))); }

        .section_header { background-color: #666; color: white; font-weight: bold; font-size: 10pt; }
        
        @media print {
            .explanation { display: none; }
        
        }
        </style>
    </head>
    <body>
    <div id="title">Timecard</div>
    <div id="dates">
        {% for plan in plans %}
            {% if forloop.first %}{{ plan.dates }}{% endif %}
            {% if forloop.last %}- {{ plan.dates }}{% endif %}
        {% endfor %}
    </div>
	<table width="100%" class="matrix">	
    <thead>
        <tr>
            <th>Name</th>
            <th>Time Breakdown</th>
            <th>Total Plans</th>
            <th>Total Time in Minutes</th>
        </tr>
    </thead>
    <tbody>
    {% for person in people %}
		<tr>
			<td class="person">{{ person.name }}</td>
            <td>
            {% assign count = 0 %}{% assign time_served = 0 %}{% array assigned_time_ids = "" %}{% array plan_ids_seen = ""%}
            {% for plan in plans %}
                {% for plan_person in plan.plan_people_not_declined_grouped_by_person[person.id] %}
              		{% unless plan_ids_seen contains plan.id %}
              			{% assign count = count | plus:1 %}
              			{% append plan_ids_seen < plan.id %}
                    {% endunless %}
                    {% for time in plan_person.times %}
              			{% unless assigned_time_ids contains time.id %}
              				{% append assigned_time_ids < time.id %}              					
                            {% assign end_time_hour_in_minutes = time.ends_at | date: "%H" | to_number | times: 60 %}
                            {% assign end_time = time.ends_at | date: "%M" | to_number | plus: end_time_hour_in_minutes %}
                            {% assign start_time_hour_in_minutes = time.starts_at | date: "%H" | to_number | times: 60 %}
                            {% assign start_time = time.starts_at | date: "%M" | to_number | plus: start_time_hour_in_minutes %}
                            {% assign time_served = end_time | minus: start_time | plus: time_served %}
                            {{ time.name }} {{ time.starts_at | date: "%b %d %I:%M" }}-{{ time.ends_at | date: "%I:%M" }} = {{ end_time | minus: start_time }}<br />
              			{% endunless %}
                    {% endfor %}
                {% endfor %}
            {% endfor %}
            </td>
            <td class="number">
                {{ count }}
            </td>
            <td class="number">
                {{ time_served }}
            </td>
		</tr>
        {% endfor %}
    </tbody>
	</table>
    
     <div class="explanation">This report calculates each person's total time served based on the Times assigned to them. If the values seem incorrect, please check that the Teams/Positions your volunteers are scheduled with are correctly linked to the Times in the Plan.
        <br /><br /><em>This message will not print</em>
     </div>
    </body>
</html>