Extended Giving Statement
Imports: 6

For churches that want to record and report certain types of giving, which cannot be recorded directly in PCO Giving (e.g. gifts in kind, third-party distributions, etc.). It generates statements per household, including all notes with a specified prefix, within the specified dates. To use, create note categories with specified prefix (default is "Extended Giving - "). Each note created in these categories will appear on the statement, including the date, the name of the category (after the prefix) and the description.

Preview

Report Preview


<!--

What note category prefixes should be included? (each with a semi-colon with no space after)
{% capture notePrefix %}Extended Giving - {% endcapture %}

What is the start date for the statment?
{% capture startDate %}
{{- 'now' | date: '%Y' -}}-01-01
{% endcapture %}

What is the end date for the statment?
{% capture endDate %}
{{- 'now' | date: '%Y' -}}-12-31
{% endcapture %}

Header text for table
{% capture tableHeader %}
Donations for {{ startDate | date: '%Y' }} (as of {{ 'now' | date: '%B %Y' -}})
{% endcapture%}

Paragraph content
{% capture messageContent %}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Phasellus tristique ultricies urna, ac scelerisque nunc accumsan ut.
Nulla ullamcorper mi erat, quis viverra ex facilisis fermentum.
Vestibulum lacinia fermentum felis quis fringilla.
{% endcapture%}

-->

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <style>
    html, * {font-family: lato, sans-serif; line-height:1.4em;}
    @page {margin: .5in 0;}   /*-- PDF margin reset --*/
    body {margin: 0; font-size: 10.5pt;}
    
    /*-- Baseline Fonts --*/
    h1 {font-size: 14.5pt; font-weight: bold;}
    h2 {font-size: 13.5pt;}
    h3 {font-size: 10.5pt; font-weight:normal;}
    li {font-size: 9pt;}
    
    /*-- Layout --*/
    .header h1 {margin: 0 0 1em;} /*-- Report Title --*/
    .main h2 {margin: 0 1em 0 0;} /*-- Household Name --*/
    .main h3 {margin: 0;} /*-- Household Address --*/
    
    .household-item {display: block; margin-bottom: 1em;}
    .household-item {page-break-before: always;}
    .main div:first-child {page-break-before: auto;}
    .addressee {padding: 5em 0 4em 4em;}
 
    table {border-collapse: collapse; font-size: 10.5pt; width: 100%;}
    thead {text-align: left; border-bottom: 2pt solid #888;}
    th {text-align: left;}
    td, th {padding-right: .25em; padding-left: .25em;}
    tr:nth-child(even) {background: #E9E9E9;}
    tr:nth-child(odd) {background: #FFF;}

    

    
    /*----- Font size equivalents for screen. This provides a more accurate preview of print sizes on a monitor ----*/
    @media screen {
      h1 {font-size: 20px; font-weight: bold; margin-top:0;}
      h2 {font-size: 18px;}
      h3 {font-size: 14px; font-weight:normal;}
      h4 {font-size: 14px font-weight: bold;}
      li {font-size: 12px;}
      li.name	{font-size: 14px; font-weight: bold; margin-bottom: 4px;}
      .btn {font-size: 12px;}
      
      /*----- The wrapper class controls the preview frame in the HTML generated report. ----*/
      /*----- Please note that PDFs are generated in portrait orientation. To print in landscape, generate the report in HTML and print from your browser -----*/ 
      /*----- Portrait view = max-width: 720px; Landscape view = max-width: 1000px ----*/
      .wrapper 	{padding: 1.5em; border: 1px solid rgb(204,204,204); margin:1.5em auto; max-width:720px;}
      
    }
    
    @media print {
      .no-print {display: none;} /*----- Apply this class to any element you do not want on the print view ----*/
      body {margin: .5in .5in 1in .5in;} /*----- Adjust this to change the page margins for printing ----*/
    }
  </style>
</head>

<body>

  <div class="wrapper">
    <div class="main">
      
      {% for household in households %}
      
        {% assign householdNotes = '' | split: '##' %}
        {% assign householdNotesFiltered = '' | split: '##' %}
      
      
        {% for person in household.people %}
          {% assign householdNotes = householdNotes | concat: person.notes %}
        {% endfor %}
      
        {% assign householdNotes = householdNotes | sort: 'date' %}
      
        {% for note in householdNotes %}
          {% if note.date >= startDate and note.date <= endDate and note.category contains notePrefix %}
            {% capture householdNotesAdd %}{{ note.date | date: "%-m/%-d/%Y" }}@@{{ note.category }}@@{{ note.message | replace: "&quot;","”" | replace: "&amp;#39;","’" | replace: " ’"," ‘" | replace: " ”"," “" }}{% endcapture %}
            {% assign householdNotesAdd = householdNotesAdd | split: '##' %}
            {% assign householdNotesFiltered = householdNotesFiltered | concat: householdNotesAdd %}
          {% endif %}
        {% endfor %}
        
        {% unless householdNotesFiltered.size == 0 %}
          
          <div class="household-item">
            <div class="logo">
              <div>
                Header Content Here
              </div>
            </div>
            
            <div class="addressee">
            {% if household.people.size > 1 %}
              {{ household.name }}
              {% else %}
              {{ household.primary_contact.name }}
                {% endif %}<br />
            {{ household.primary_address.postal_address }}
            </div>
            
            <p>{{notePrefixLength}}Dear {% if household.people.size > 1 %}{{ household.name }}{% else %}{{ household.primary_contact.name }}{% endif %},</p>
            <p>{{ messageContent }}</p>
            
            <h1>{{ tableHeader }}</h1>
            <table>
              <thead>
                <tr>
                  <th>Date</th>
                  <th>Type</th>
                  <th>Description</th>
                </tr>
              </thead>
              <tbody>
                {% for note in householdNotesFiltered %}
                  {% assign noteArray = note | split: '@@' %}
                  {% assign shortCategory = noteArray[1] | slice: notePrefix.size,100 %}
                    <tr>
                      <td style="width: 6em; padding-right: 1em;">{{ noteArray[0] }}</td>
                      <td style="width: 10em; padding-right: 1em;">{{ shortCategory }}</td>
                      <td>{{ noteArray[2] | replace: '::',' — ' }}</td>
                    </tr>
                {% endfor %}
              </tbody>
            </table>

          </div>
        
        {% endunless %}
        
      {% endfor %}
    </div>      
  </div>  
</body>
</html>