Modified Basic Report By Date
Imports: 8

I borrowed some code from Ron Hudson here on PCO Chef, used some PCO report code, and then altered it only to include: Event name/approval, Start/end time, Room(plus setup if applicable), Resource list by room, Owner of the event, and notes attached to the event/rooms. Thanks Ron!

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
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
{% assign day_page_break = false %}

<!DOCTYPE html>
<html lang="en">
    
    
  <head>
    <title>{{ report.kind | capitalize }} Report by Date</title>
    <link rel="stylesheet" type="text/css" media="all" href="{{ report.stylesheet_href.divider }}">
    <meta charset="utf-8">
    <style>
      li {
        list-style-type: none;
      }
    </style>
  </head>
  
  
  
  
  <body>
    {% if report.org_twenty_four_hour_time? %}
      {% assign time_format = "%H:%M" %}
    {% else %}
      {% assign time_format = "%-I:%M%P" %}
    {% endif %}

    {% if report.org_day_month_dates? %}
      {% assign date_format = "%d/%m/%Y" %}
    {% else %}
      {% assign date_format = "%m/%d/%Y" %}
    {% endif %}

    {% for day in days_with_instances %}
        {% if forloop.first or day_page_break %}
          <div>
            <h1 class="header-large txt-center gutter-bottom-small">Basic {{ report.kind | capitalize }} Report by Date</h1>
            <h2 class="header-medium txt-center soft gutter-bottom-large">{{ report.scope }}: {{ report.start_date }} through {{ report.end_date }}</h2>
          </div>
        {% endif %}
        <div class="table-container{% if day_page_break and forloop.index < forloop.length  %} page-break{% endif %}">
          <div class="gutter-bottom-large">
            <h3 class="header-medium">{{ day.date | date: '%A, %B %-d, %Y'}} </h3>
            <table>
              <thead>
                <tr>
                  <th width="20%">Event Name</th>
                  <th> Time </th>
                  <th width="20%">Room(s)</th>
                  <th width="20%">Resources</th>
                  <th width="20%">Owner</th>
                  <th width="20%">Notes</th>
                </tr>
              </thead>
              
              
              <tbody>
                  
                {% for instance in day.instances | sort: "starts_at" %}
                  <tr>
                      
                      
                    <td>
                      <div>
                        <div>
                          <span class="status {{ instance.approval_status_class }}">
                            {{ instance.approval_status | replace: "Approved", "A" | replace: "Pending Conflicts", "PC"| replace: "Pending", "P" | replace: "Rejected", "R" }}
                          </span>
                        </div>
                        <div class="status-text {{ instance.approval_status_class }}">{{ instance.event.name }}</div>
                      </div>
                    </td>
                    
                    
                    {% capture start_date %} {{ instance.starts_at | date: "%m/%d/%Y" }} {% endcapture %} {% capture end_date %} {{ instance.ends_at | date: "%m/%d/%Y" }} {% endcapture %} {% capture today %} {{ day.date | date: "%m/%d/%Y" }} {% endcapture %}
                 
                    <td>
                      {% if instance.reservation.all_day_event? %}
                        All-day
                      {% elsif start_date == today and start_date != end_date %}
                        Today, {{ instance.starts_at | date: time_format }}
                      {% elsif start_date == end_date %}
                        {{ instance.starts_at | date: time_format | downcase }}
                      {% else %}
                        {{instance.starts_at | date: date_format }} ({{ instance.starts_at | date: time_format | downcase }})
                      {% endif %}
<!-- combines start and end time into one column -->
                      {% if instance.reservation.all_day_event? %}
                        All-day
                      {% elsif end_date == today and start_date != end_date %}
                        Today, {{ instance.ends_at | date: time_format }}
                      {% elsif start_date == end_date %}
                        {{ instance.ends_at | date: time_format | downcase }}
                      {% else %}
                        {{instance.ends_at | date: date_format }} ({{ instance.ends_at | date: time_format | downcase }})
                      {% endif %}
                    </td>
                   
                   
                   
                    <td>
                      {% for room_request in instance.reservation.room_requests %}
                        <li {% if forloop.last == false %}style="padding-bottom: 5px;"{% endif %}>
                          - {{ room_request.room.name }}
                          {% if room_request.room_setup %}
                            <span style="color: grey;">( {{ room_request.room_setup.name }} )</span>
                          {% endif %}
                        </li>
                      {% endfor %}
                      
                      
                            <div class="gutter-bottom-small level-3">

                                                                {% for answer in request.answers %}
                                                                    {% if answer.section_header? %}
                                                                        <strong>{{ answer.label }}</strong>
                                                                        <br/>
                                                                        <p class="question-description">{{ answer.description }}</p>
                                                                    {% else %}
                                                                        <div class="divider-soft">
                                                                            <strong>{{ answer.question }}
                                                                                :</strong>
                                                                            &mdash; {{ answer.answer }}
                                                                            <p class="question-description">{{ answer.description }}</p>
                                                                        </div>
                                                                    {% endif %}
                                                                {% endfor %}
                            </div>
                    </td>
                    
                    
                    
                    
                    
                    
                    
                    
                    
{% if instance.reservation.room_requests.size > 0 %}
  <td>
    {% for room_request in instance.reservation.room_requests %}
      {% assign room_resources = room_request.resource_requests | where: "approval_status", "approved" %}
      {% if room_resources.size > 0 %}
        <h5>{{ room_request.room.name }}</h5>
        <ul>
          {% for resource_request in room_resources %}
            <li>
              {% if resource_request.quantity > 1 %}{{resource_request.quantity}} {% endif %}{{resource_request.resource.name}}
            </li>
          {% endfor %}
        </ul>
      {% endif %}
    {% endfor %}
  </td>
{% else %}
  <td>
     
  </td>
{% endif %}






                    
<!-- This code pulls the event owner -->

                    <td>{{ instance.event.owner.name }}
                
                      {% for owner in instance.event.owner %}
                        <li {% if forloop.last == false %}style="padding-bottom: 5px;"{% endif %}>
                          {{ owner.name }}
                        </li>
                      {% endfor %}
                    </td>
                    
<!-- Pulls event notes, and room notes. Not resource notes.-->


<td>
    

<ul>
  {% if instance.event.notes != blank %}
  <li>
    <h3>Event Notes</h3>
    <p>{{ instance.event.notes }}</p>
  </li>
  {% endif %}

  {% for resource_request in instance.reservation.resource_requests %}
    {% if instance.resource_request.notes != blank %}
    <li>
      <h3>{{ resource_request.resource.name }} Notes</h3>
      <p>{{ resource_request.notes }}</p>
    </li>
    {% endif %}
  {% endfor %}

  {% for room_request in instance.reservation.room_requests %}
    {% if room_request.notes != blank %}
    <li>
      <h3>{{ room_request.room.name }} Notes</h3>
      <p>{{ room_request.notes }}</p>
    </li>
    {% endif %}
  {% endfor %}
</ul>




    
</td>

                    
                    
                  </tr>
                {% endfor %}
                
                
              </tbody>
            </table>
          </div>
      </div>
    {% else %}
      <div>
        <h1 class="header-large txt-center gutter-bottom-small">Basic {{ report.kind | capitalize }} Report by Date</h1>
        <h2 class="header-medium txt-center soft gutter-bottom-large">{{ report.scope }}: {{ report.start_date }} through {{ report.end_date }}</h2>
        <h1 class="header-large txt-center gutter-bottom-small">There are no events which fit the filters in the selected date range.</h1>
      </div>
    {% endfor %}
  </body>
</html>