-
-
Notifications
You must be signed in to change notification settings - Fork 824
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-20555: Incorrect balance amount is shown on participant view page if 'Deferred Revenue' is enabled #10204
Conversation
monishdeb
commented
Apr 21, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-20037: Change Contribution tab to show balance due
- CRM-20555: Incorrect balance amount is shown on participant view page if 'Deferred Revenue' is enabled
We'd better get some stats on this on large searches on large sites before merging - we did discuss this on another ticket - ie. the concerns about imposing possibly-unconformant change - I'll try to find the ticket |
@eileenmcnaughton I think that might have been the soft credits one? |
CRM/Contribute/Selector/Search.php
Outdated
@@ -402,6 +402,13 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) { | |||
} | |||
} | |||
|
|||
$row['balance_due'] = CRM_Core_BAO_FinancialTrxn::getPartialPaymentWithType( | |||
$result->contribution_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.
@eileenmcnaughton @colemanw and I just looked through this function and it does two calls to the db which don't look bad. This .tpl is used on contributions tab and also on search results for Search: Find Contribution. But in the latter it's only going to be perhaps 100 or so records. So we're not too concerned after code review.
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.
So it's a max 300 extra queries per search (if all are participant), or 100 viewing a contribution tab on a donor with 30 or donations?
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.
On further research, if we MUST add this improvement i.e. add Balance Due
column on Contribution list, then there is no other easy alternative other than using CRM_Core_BAO_FinancialTrxn::getPartialPaymentWithType(..)
to calculate the balance due 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.
OK - it would actually be easy to do in an extension - ie. add an api in the extension & just add a region in the tpl & call crmAPI from there
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.
So @eileenmcnaughton do you have site to test this on, or are you proposing that JMA create a test site and populate it. Personally I don't think this is an issue. Let's see what the total number of queries per search results page is for 25 results with and without the change, and the differential page load time on a server with reasonable resources, and then discuss with @colemanw ? Recall as well that we are on a deadline on this and we had agreement to move ahead.
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.
Hi - if you have agreed to go ahead with @colemanw then I guess he'll have to honour that - please do it as a setting that is opt-out by default and then no-one else will be affected.
If you DO impose this on all sites then you effectively transfer the work onto me of making it not run extra queries before I can upgrade.
For #10204 (comment) @pradpnayak on closer look @JoeMurray should I create a separate ticket for that? |
@pradpnayak I have fixed the issue where it shows the incorrect balance amount if 'Deferred Revenue' is enabled (also added unit test) and this is the patch 52d2e89 This has also fixed the issue on Fee Section on Participant's view page. Here's the difference: |
@JoeMurray @eileenmcnaughton I have made necessary changes in this PR to add And as per the core changes here's my hook definition
(this new index |
#10295 proposes an alternative approach to the tpl |
95ddf0a
to
a30579a
Compare
@eileenmcnaughton I have reverted my changes in tpl and php files after merging #10295 Also please check my comment |
@monishdeb this seems OK except - it's not fixing the thing the ticket is about anymore, it's fixing something else related to deferred revenue. Can you log a separate ticket that describes what this is fixing & update the PR /commits to refer to it. |
also - you've updated the docs for how to do the hook? |
@eileenmcnaughton I have created a new ticket and updated the title of the PR. Also submitted a minor fix #10334 |
Getting the JIRA admin sorted was the final issue on this PR - adding merge on pass |
Jenkin, test this please |