-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
CRM-20610: 'Edit Contribution' backoffice improvements #10386
Conversation
monishdeb
commented
May 20, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-20610: 'Edit Contribution' backoffice improvements
54d62e4
to
c504898
Compare
@@ -4145,6 +4146,27 @@ public static function getPaymentInfo($id, $component, $getTrxnInfo = FALSE, $us | |||
} | |||
$paidByLabel .= " ({$creditCardType}{$pantruncation})"; | |||
} | |||
|
|||
// show payment edit link only for payments done via backoffice form |
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.
Question: do any online payment processor plugin currently support changes to the value of a transaction, @eileenmcnaughton ? If so, we should allow those payments to be editted. JMA is aiming to support this for Authorize.net this summer assuming client funding comes through.
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.
Smart debit for direct debits in the UK certainly supports changing the value of the transaction via the API, it's not really being used yet on the civi side, but you can do it via the "Update billing details" link.
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.
@mattwire So at present there is no support for this within CiviCRM, correct?
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.
@JoeMurray Not as far as I know :-)
CRM/Contribute/Form/Contribution.php
Outdated
@@ -1507,6 +1513,18 @@ protected function submit($submittedValues, $action, $pledgePaymentID) { | |||
if (!empty($this->_payNow)) { | |||
$this->_params['contribution_id'] = $this->_id; | |||
} | |||
// since we are hiding the payment details block in edit mode it |
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.
please remove 'it' from end of line. Thx.
CRM/Core/Payment/Manual.php
Outdated
@@ -96,7 +96,7 @@ public function getPaymentFormFields() { | |||
// Really we should render check_number here, but we need to review how we edit |
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 assume that we are going to be rendering check number properly on payment area of pages, not in overal contribution area. Since we are addressing the implied To Do of this comment, let's remove the comment.
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.
Actually that change is doing the reverse of what you say Joe & I think it may be a mistake / in conflict with changes & approach in other PRs
{/if} | ||
{ts 1=$entity}No payments found for this %1 record{/ts} | ||
{/if} | ||
{include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"} |
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.
Nice. Thanks for this cleanup.
<tr id="checkNumber" class="crm-contribution-form-block-check_number"> | ||
<td class="label">{$form.check_number.label}</td> | ||
<td>{$form.check_number.html}</td> | ||
<div class="crm-accordion-wrapper crm-accordion_title-accordion crm-accordion-processed payment-details_group"> |
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.
nice cleanup. thx.
a3b9e13
to
ae9fb83
Compare
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 tested this out. In the issue it says "On Edit Contribution, freeze/disable CC fields for contribution paid by using payment processor via online contribution page or CC"
However after trying this PR the form looked like this:
Both CC type (icon) and last-4-digits are editable fields. However CC type does not appear to show the card type as selected. Changing it has no effect. But the last-4 field is editable. Not sure what effect editing it has, or why you'd want to do so.
@colemanw
|
@monishdeb I applied this patch to the very latest tip of master branch.
Try a pull --rebase on this branch and see if you get the same results.
…On 06/29/2017 10:52 AM, Monish Deb wrote:
@colemanw <https://github.com/colemanw>
I am getting expected result and the CC fields were freezed/readonly
for online contribution. These are the steps I used to replicate:
1. Created a online contribution (using contribution page - 'Help
Support CiviCRM')
2. Edit the created contribution
On backoffice form:
screen shot 2017-06-29 at 8 19 35 pm
<https://user-images.githubusercontent.com/3735621/27693983-70ee2686-5d08-11e7-9f17-1ed49daf767b.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10386 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACveIKo6C2Lup2V0r0QZ-EKKU7KPxs34ks5sI7pIgaJpZM4NhXl1>.
|
@colemanw yes I did that before testing
Also in your screenshot there is no transaction ID set, seems like the contribution is created via backoffice form not via contribution page or via 'submit credit card card contribution'. So the CC fields are expected to be editable. |
NOTE: The CC field value will be readonly if contribution created via any contribution page or via 'submit credit card card contribution'. The CC fields will be editable ONLY if contribution are created via backoffice form. And the browser cache need to be cleared to resolve any js glitch related to CC-type. |
Isn't this back to going down the path I refused to merge :-) I think I was committed to not overloading the edit transaction form with editing (potentially one of many) transactions & instead we were going to have a display of the transactions & links to edit them. I guess I haven't been prepared to put the hours into reviewing this so I'd better leave it in @colemanw 's capable hands. |
@eileenmcnaughton the changes were made in accordance with IIDA needs. I don't think we are overloading or showing any extra fields rather than rendering the same set of payment method fields (checkNumber / CC-type and pan_truncation) that we are already featuring on backoffice form for creating a new contribution. So on edit mode, I have ensured that the these payment fields are readonly screenshot ) for contribution done using payment processor or else editable if payment made via backoffice form i.e. using manual payment processor. In addition to that this PR contain other improvements like:
|
@Eileen could you remind me of your preferred approach to the UI for this? It sounds like a list of payments that could be individually edited is the direction of your thinking. |
Tested. The patch works fine On Edit screen Credit card type and Last 4 digit credit card number are allowed to update and also updated in financial trxn when saved in case of payment not done via payment processor. But incase of payment done via payment processor this fields are freezed on edit screen of contribution. However i found a bug, Payment Instrument is stored wrong when Submit Credit Card Event Registration is done. |
@JoeMurray - yes - I think when we last discussed this the idea was that on the tab view of payments there would be a link to pop up an edit and that same code snippet (the list of payments with the action link to edit) would also show up on the view & edit views of a contribution. The key thing for me here is the lack of a one-to-one relationship causes complexity on an already complex form |
@monishdeb @pradpnayak I agree with the direction of @eileenmcnaughton's thinking: we should not be editing those fields on contribution edit, but on payment edit. On contribution with multiple payments by backend credit card, we wouldn't know which should be used. Please revert from contribution edit and add to payment edit. |
Marking with [wip] as the changed spec need approval first, as discussed with @JoeMurray |
@monishdeb would it be better - I'm not sure - to close this and open a new PR given the significant UI changes? The downside is that we lose the connection to the comments here |
@JoeMurray @monishdeb I think opening a new PR & linking here for reference is better than changing this PR to be something substantially different to what the comments are discussing |
@eileenmcnaughton agree, created separate PR #10729 Closing it now |