-
-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Enhancements for Partial payment Payments #15696
[WIP] Enhancements for Partial payment Payments #15696
Conversation
(Standard links)
|
1a4eb13
to
70790cb
Compare
70790cb
to
40143ea
Compare
bbf75a3
to
4aba5ec
Compare
429db01
to
8cbe87f
Compare
8cbe87f
to
00af3cc
Compare
f5cace9
to
10d265f
Compare
CRM_Core_Error::statusBounce(ts("This contribution is already fully paid.")); | ||
} | ||
$contribution = civicrm_api3('Contribution', 'getsingle', array('id' => $this->_ccid)); | ||
if ($contribution['contribution_status'] == 'Pending' || $contribution['contribution_status'] == 'Partially paid') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can't use 'contribution_status' since its a label field(correct me if i am wrong) which can be changed from UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If (in_array($contribution['contribution_status'], ['Pending', 'Partially Paid'])) {
} | ||
$contribution = civicrm_api3('Contribution', 'getsingle', array('id' => $this->_ccid)); | ||
if ($contribution['contribution_status'] == 'Pending' || $contribution['contribution_status'] == 'Partially paid') { | ||
$totalAmount = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $this->_ccid, 'total_amount'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->assign('contribution_total', $contribution['total_amount']);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This is required for tpl logic. We should move away from hard-code this to adding an array of actions to the row | ||
// which the tpl can iterate through - this should allow us to cope with competing attempts to add new buttons | ||
// and allow extensions to assign new ones through the pageRun hook | ||
if ('Pending' === CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $row['contribution_status_id'])) { | ||
if ('Pending' === CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $row['contribution_status_id']) || 'Partially paid' === CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $row['contribution_status_id'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be simplified as
$statusName = CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $row['contribution_status_id']);
if (in_array($statusName , ['Pending', 'Partially Paid'])) {
1896183
to
1e65fc2
Compare
dcc4f31
to
bdcdbcf
Compare
…Partial_payment_Payments
bdcdbcf
to
bfc0576
Compare
…ithub.com/magnolia61/civicrm-core into Enhancements_for_Partial_payment_Payments
Closing as in WIP long-term. Please Re-open when reviewable |
Overview
Enable the "Pay now" button on the userdashboard for 'partially paid' payments .
Use case:
Before
Only for contributions with status "Pending" the "Pay Now" button was shown
After
For contributions with status "Pending" and "Partially paid" the 'Pay now' button is shown.
Using the Pay Now button the following contribution page shows the proper balance due (30 euro).
After payment of this the contribution is completed.
user dashboard:
payment screen:
Technical Details
All changes of the past period Eileen made to the payment.create api made it very easy to enable this because it is already supported.
Comments
This is a follow up of #12319
Remaining bugs:
bug 1: the paid remaining amount (30 euro) overrides the Contribution Total (this changed from 50 to 30)
bug 2: the contribution date gets overwritten by the date of the current payment
WIP:
a. Send the Additional Payment receipt instead of the 'Event Confirmation' mail
b. Show Partially paid details on the contribution invoice (the pdf ignores these atm)