Skip to content

dev/core#3871 Write-off feature for pledges - #24777

Closed
yashodha wants to merge 2 commits into
civicrm:masterfrom
yashodha:dev-3871
Closed

dev/core#3871 Write-off feature for pledges#24777
yashodha wants to merge 2 commits into
civicrm:masterfrom
yashodha:dev-3871

Conversation

@yashodha

@yashodha yashodha commented Oct 20, 2022

Copy link
Copy Markdown
Contributor

Overview

Write-off feature for pledges

https://lab.civicrm.org/dev/core/-/issues/3871

Functional specifications:

On a pledge, in Edit Scheduled Payment, we can delete a pledge payment. The total pledge amount is reduced by the amount of the scheduled payment and the balance due is recalculated.
But in this scenario, the pledge status is left as is.

We can also cancel a pledge. All scheduled payments are canceled but the pledge status is set to canceled and the pledge balance and the total pledge amount are not recalculated. So I propose a new feature for the write-off.

  • Add the menu option “Write Off” before Cancel.
  • All scheduled payments are canceled like for a pledge cancellation.
  • Pledge status is changed to Completed.
  • Total pledge amount is reduced by the existing pledge balance amount.
  • Pledge balance is set to $0.
  • An activity of type “Pledge write-off” is created and recorded on the contact.
    • Activity Subject=total pledge amount
    • Activity Date and time = date and time of the action
    • Activity Status=Completed
    • Actions available on the activity should be View and File on case only like for the activity type Contribution.
  • The option Write-Off is available only for a pledge that has at least one pledge payment. If no pledge payment has been recorded with a pledge, write-off doesn’t make any sense, so we should have only the options to delete or cancel a pledge.
    • if pledge status =Pending or Overdue > Show only Cancel and Delete
    • if pledge status = In progress > show only Write-Off and Delete
    • if pledge status = Completed or Canceled > show only Delete

@civibot

civibot Bot commented Oct 20, 2022

Copy link
Copy Markdown

(Standard links)

➡️ Online demo of this PR 🔗

@civibot civibot Bot added the master label Oct 20, 2022
@seamuslee001

Copy link
Copy Markdown
Contributor

Jenkins re test this please (just verifying checkstyle still works)

@stesi561

stesi561 commented Apr 2, 2024

Copy link
Copy Markdown
Contributor

@yashodha do you still have energy to progress this? Perhaps this can be closed if not?

Just currently looks like it's got merge conflicts + failing tests and hasn't been touched in a long time!

@JoeMurray

Copy link
Copy Markdown
Contributor

I like the idea of having a write off for pledges.

@mlutfy

mlutfy commented Oct 30, 2024

Copy link
Copy Markdown
Member

I tried to resolve the conflict, so that it builds a sandbox site.

Looking at the code, it might be missing a "Pledge write-off" Activity? i.e. needs to be added to the default install and in the upgrader?

I was wondering if we really need a new Activity Type for this. Activities are sometimes used as a form of logging. In this case it seems relevant.

@mlutfy mlutfy changed the title (dev/core#3871) Write-off feature for pledges dev/core#3871 Write-off feature for pledges Oct 30, 2024
@mlutfy

mlutfy commented Oct 30, 2024

Copy link
Copy Markdown
Member

The patch is failing to apply because of changes in CRM/Pledge/Selector/Search.php with the is_active property of links:

+    $status = CRM_Utils_Array::value(2, $args);
     if (in_array('Cancel', $hideOption)) {
       unset(self::$_links[CRM_Core_Action::DETACH]);
+      unset(self::$_links[CRM_Core_Action::CLOSE]);
+    }
+
+    if (in_array($status, [2,6])) {
+      unset(self::$_links[CRM_Core_Action::CLOSE]);
+    }
+
+    if (in_array($status, [5])) {
+      unset(self::$_links[CRM_Core_Action::DETACH]);
     }

should be rewritten by updating the is_active property on the Cancel / Close / Detach links.

Alas I don't often use Pledges, this was a bit of a side-quest for me. @yashodha if by any chance you have a bit of time to fix the two issues: action links, and check if we need to add an Activity Type, I would be happy to help review/merge.

@stesi561

Copy link
Copy Markdown
Contributor

@yashodha any further energy on this one? I see the associated issue has been auto closed.

@colemanw

colemanw commented Jul 4, 2026

Copy link
Copy Markdown
Member

@nganivet @yashodha this is officially our oldest open PR. It's had lots of community engagement but no response from the OP. What should we do with it?

@nganivet

Copy link
Copy Markdown
Contributor

@colemanw Thanks for the ping, we will get this over the finish line and are making this a priority.

@yashodha

Copy link
Copy Markdown
Contributor Author

@colemanw I am working on this and will keep you posted. Thanks!

@colemanw

Copy link
Copy Markdown
Member

Thanks @yashodha & @nganivet that would be great.

@colemanw

colemanw commented Aug 3, 2026

Copy link
Copy Markdown
Member

Closing in favor of #36395

@colemanw colemanw closed this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants