Anniversary Report (With Remarried)
Imports: 1

A short explanation. . .

Preview

Report Preview


{% assign sorted_people = people | sort: "anniversary_day" %}

{% assign houses = "" %}

<html>
  <head>
    <title>Anniversaries</title>
    {{ helpers.bootstrap_3 }}
    <style>
      @page { margin: 0.5in; size: US-Letter; }
      body { font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif; }
    </style>
  </head>
  <body>
    <h1>
      {{ filter.name }}
    </h1>
    <table class="table table-condensed phone_numbers">
      <thead>
        <tr>
          <th>Names</th>
          <th>Anniversary</th>
          <th>Address</th>
        </tr>
      </thead>
      <tbody>
        {% for person in sorted_people %}
        	{% assign show_hh = "No" %}
          {% assign first = "" %}
          {% for household in person.households %}
        	 {% assign households_shown = houses | split: "," %}
        	 {% assign this_house = household.id | downcase %}
        		{% if households_shown contains this_house %}
        		{% else %}
    			    {% for adult in household.active_adults %}
        				{% if adult.marital_status == "Married" or adult.marital_status == "Remarried" %}
        					{% assign first = first | append: adult.first_name | append: "," %}
        					{% assign last = adult.last_name %}
        				{% assign show_hh = "Yes" %}
        				{% endif %}
   			      {% endfor %}
        		{% if show_hh == "Yes" %}
         <tr>  
            <td>{% assign fnames = first | split: "," %}{% for name in fnames %}{{ name }}{% unless forloop.last %} & {% endunless %}{% endfor %} {{ last }}</td>
            <td>{{ person.anniversary | date: "%b %d" }}</td>
            <td>{{ person.primary_address.postal_address }} </td>
        </tr>
        			{% endif %}
        		{% assign houses = houses | append: this_house | append: "," %}
           {% endif %}
    			{% endfor %}
        {% endfor %}
      </tbody>
    </table>
  </body>
</html>