Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3244

CiviPledge - Pledge Tab with Selectors and Create/Edit Pledge Form

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: CiviPledge
    • Labels:
      None

      Description

      Implement new "Pledges" tab for contact/view. This tab is visible when the CiviPledge component is enabled and the Pledges tab is checked under Site Preferences and the "access CiviPledge" permissions is true for the user.

      ===================
      Form Fields - Add Mode
      ===================

          • Fields are listed as "Label" : [field type] / comments {DB column}

            , "Onscreen description / help"

      Pledge By : $display_name (read only)

      {pledge.contact_id}

      Total Pledge Amount : [text, money value]

      {pledge.amount}

      "To be Paid in" [text integer - default =12]

      {pledge.installments}

      "installments of"

      {calculated payment amount}

      each

      {pledge.frequency_interval - default=1}

      [select]

      {pledge.frequency_unit - default = Monthly/month}

      "Payments are Due on the " [text integer - default=1]

      {pledge.frequency_day}

      "of the period.", "This applies to weekly, monthly and yearly payments."

      "Each payment amount will be" : [jscript calculated payment amount - read only - calculate onblur of frequency_unit - $value = $amount / $installments ]

      "Pledge Made" : [date select - default = today()]

      {pledge.create_date}

      , "Date when pledge was made by the contributor."

      "Payments Start" : [date select - default today()]

      {pledge.start_date}

      , "Date of first pledge payment."

      "Send Acknowledgment?" : [checkbox]

      "Acknowledgment Date" : [date select - default = null, hidden if Send Ack is checked]

      {pledge.acknowledge_date}

      , "Date when an acknowledgment of the pledge was sent."

      "Contribution Type" : [select - default = "Donation"],

      {pledge.contribution_type_id}

      , "Sets the default contribution type for payments against this pledge."

      "Pledge Status" : [select - default = Pending]

      {pledge.status_id}

      , "If payments are received on time, Pledges remain in In Progress status until all scheduled payment are completed. Overdue pledges are ones with payment(s) past due."

      If status is "Cancelled", then show "Cancel Date".

      "Honoree Information" -this is a dojo pane - clicking invokes the exact same fields as used for this pane in Form/Contribution.php

      "Payment Reminders" - this is a 2nd dojo pane. 3 fields are contained in this pane:
      "Send Initial Reminder" [text, integer, default = 5]

      {pledge.initial_reminder_day}

      "days prior to each scheduled payment due date."

      "Send up to " [text, integer, default = 1]

      {pledge.max_reminders}

      "reminders for each scheduled payment."

      "Send additional reminders [text, integer, default = 5]

      {pledge.additional_reminder_day}

      "days after the last one sent, up to the maximum number of reminders."

      =====================
      Form Fields - Update Mode
      =====================
      NOTE: For now we'll avoid the problem of needing to "rebuild" the payment schedule by making most fields read-only in update mode. The only editable fields are:

      • Contribution Type
      • Pledge Status
      • Send Ack and Ack Date (in case they want to or have re-sent an ack)
      • All fields in the Honoree Info and Payment Reminders panes

      ====================
      Pledge form PostProcess
      ====================
      If action = add:

      • Insert pledge record - status = Pending (Status should be changed to "In Progress", once payment is made)
      • Insert pledge payment records - 1 for each installment. All have status = Pending
      • Send Acknowledgment email if checked (see next section for email content)
        • Insert Activity Record linked to the Ack email. Activity Type = Pledge Acknowledgment (this is a new activity type)
      • Display status message:
        "Pledge has been recorded and payment schedule has been created."
        if (is_acknowledge)
        " An acknowledgment email has been sent to $email."
        " If a payment is due now, you can record <a href="contrib url with pledge payment id">a Cash or Check payment for this pledge</a> OR <a href="contrib url mode=live...">submit a credit card payment</a> ."

      (Note - the status message link to "submit a credit card payment" is conditional on a configured applicable payment processor.)

      If action = update:

      • Update pledge record
      • Send ack if requested
        • Insert Activity Record linked to the Ack email. Activity Type = Pledge Acknowledgment (this is a new activity type)
      • If the status is changed to "Cancelled" - ask for cancellation confirmation and then update all linked pledge_payment record statuses to Cancelled EXCEPT for those that have status = Completed. This is the same process which is triggered when the "Cancel" action link is clicked from the Pledge selector.
      • Display status message:
        "Pledge has been updated." OR "Pledge has been Cancelled and all scheduled (not completed) payments have been cancelled."
        if (is_acknowledge)
        " An acknowledgment email has been sent to $email."
        " If a payment is due now, you can record <a href="contrib url with pledge id">a Cash or Check payment for this pledge</a> OR <a href="contrib url mode=live...">submit a credit card payment</a> ."

      ========================
      Pledge Acknowledgment Email
      ========================
      Acknowledgment email Subject and Message template content have been drafted in the following committed files:

      • templates/CRM/Pledge/Form/AcknowledgeMessage.tpl
      • templates/CRM/Pledge/Form/AcknowledgeSubject.tpl

      All contact and domain tokens should be "available to the message template so admins can modify / add dynamic info to the message. Contact tokens evaluate to the pledge.contact_id. (Examples: {$contact.last_name}, {$contact.nick_name}...). The FROM email for these acknowledgments is "civicrm_domain.email_name" <civicrm_domain.email_address>

      ===============================
      Pledge and Pledge Payments Selectors
      ===============================
      Implement a 2 level selector:
      Pledge 1
      Pledge Payment 1
      Pledge Payment 2

      Pledge 2
      Pledge Payment 1
      Pledge Payment 2

      (This 2 level selector will need some discussion w/ kurund and lobo as to implementation. Lobo and I discussed using a dojo drill-down grid - or possibly the pane's widget we use in advanced search - where each pledge is a "pane" containing it's pledge payment records).

      Pledge selector columns (field name or data source in parenthesis)
      =====================================================

      • Total Pledged (pledge.amount)
      • Total Paid (SUM of completed contribution records via join to pledge_payment)
      • Balance Due (SUM of pledge_payment records with status = Pending)
      • Type (civicrm_pledge.contribution_type_id)
      • Next Payment Date ( select scheduled_date from 1st pledge_payment with status = Pending sorted by date ascending)
      • Next Payment Amount ( select scheduled_amount from 1st pledge_payment with status = Pending sorted by date ascending)
      • Status (civicrm_pledge.status_id)

      NOTE: Set row style to show text in red if pledge or payment status is Overdue.

      Actions for the Pledge rows
      =====================

      • View
      • Edit
      • Cancel
      • Delete (Delete is only allowed if no pledge payments have been completed for the pledge)

      Pledge Payment selector columns (field name or data source in parenthesis)
      ===========================================================

      • Scheduled Amount (pledge_payment.scheduled_amount)
      • Scheduled Date (pledge_payment.scheduled_date)
      • Paid Amount ( empty if not paid yet, or civicrm_contribution.total_amount for linked contribution record)
      • Paid Date ( empty if not paid yet, or civicrm_contribution.receive_date for linked contribution record)
      • Last Reminder (pledge_payment.reminder_date)
      • Reminders Sent (pledge_payment.reminder_count)
      • Status (pledge_payment.status_id)

      NOTE: Set row style to show text in red if pledge or payment status is Overdue.

      Actions for the Pledge Payment rows
      =============================

      • Record Payment (Check, Cash or EFT...)
        NOTE: only include this action if status is "Pending" or "Overdue"
      • Submit Credit Card Payment
        NOTE: only include this action if status is "Pending" or "Overdue" AND an applicable processor is enabled
      • Edit Schedule

      Pledge Payments Form
      ===================
      Pledge payments are inserted automatically so there is no "Add" form. The only allowable editing is to modify the Scheduled Date field IF payment status = Pending or Overdue (no point in editing scheduled date for completed or cancelled payments). The form should show the current status "frozen". PostProcess should update the payment status based on the updated Scheduled Date.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mover Michał Mach
                Reporter:
                dgg David Greenberg
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: