Details
-
Type:
New Feature
-
Status: Done/Fixed
-
Priority:
Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 2.2.0
-
Fix Version/s: 3.0
-
Component/s: CiviContribute, CiviPledge
-
Labels:None
Description
1. Add Soft Credit assignment option to contribution import
Users can assign a soft credit to any contribution row in the import by mapping the field(s) needed to match to an existing contact record. Contact matching options for soft credit assignment are the same as the options for matching to the "contributor" contact record.
- Add the following options to the mapper select fields
+ Add "Soft Credit" to mapper[0]
+ When "Soft Credit" selected, then display mapper[1] with contact matching options:
+- Contact ID (match to contact)
+- External Identifier (match to contact)
.... and any fields defined in Individual Strict Default matching rule, by default this is:
+- Email (match to contact)
- If "match to soft credit" column(s) are defined and have a value for the row, use existing logic to find the matching contact record.
+ If no match found, throw a no-match error for the row - "No match found for specified Soft Credit contact data. Row was skipped."
+ If match found, insert civicrm_contribution_soft record with contribution ID, matched contact_id and contribution amount (all other columns = defaults)
- Create a count variable for number of soft credits assigned and include this in the import summary output.
2. Add Pledge Payment option to contribution import
Users can flag an imported contribution as a payment for a scheduled pledge payment.
- Add the following options to the mapper select fields IF CiviPledge is enabled:
+ Pledge Payment?
+ Pledge ID
- If 'Pledge Payment' column is mapped and a row has a value (1/0, TRUE/FALSE, YES/NO - case insensitive - are valid values for this boolean) - then:
+ check if Pledge ID also has a row value. If so, use this as the pledge ID . If not, check for Pledge(s) belonging to this contact with status = Pending or In Progress.
+ if we find 0 or >1 pending or in progress pledges for this contact, then we have a 'mismatch' error and should skip the contribution row.
If 0 pending/in progress pledges, error message for the row is "No open pledges found for this contact. Contribution row was skipped."
If > 1 pending/in progress pledge: "This contact has more than one open pledge. Unable to determine which pledge to apply the contribution to. Contribution row was skipped."
If they pass a pledge ID but it's not valid (i.e. pledge status is NOT Pending or In Progress, OR pledge doesn't exist OR pledge doesn't belong to the specified contact): "Invalid Pledge ID provided. Contribution row was skipped."
+ If we get a "valid" pledge (either by Pledge ID or by finding 1 and only 1 "usable" pledge), then select for the oldest "Pending" pledge_payment record and apply the contribution as payment for it.
+ Add a counter var for pledge payments applied and increment for each "hit". Include "Pledge Payments Applied: $cnt" in import summary.