Skip to content
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 - add paid_amount & balance_amount to apiv4 #23802

Closed

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Jun 15, 2022

Overview

add paid_amount & balance_amount to apiv4

This makes these two fields available as tokens and as fields for apiv4

Before

now you don't see it

After

now you do

Technical Details

I've added into this PR conversion for the invoice template to use the new fields as simplifying to use consistent tokens has always been the goal - however, unless we want to force an message template update on people we can always continue to assign the variables. That is an enthusiasm question as we do have a reasonable find & replace routine for straight template swaps

Comments

@mattwire

@civibot
Copy link

civibot bot commented Jun 15, 2022

(Standard links)

@civibot civibot bot added the master label Jun 15, 2022
@eileenmcnaughton eileenmcnaughton force-pushed the cont_balance branch 2 times, most recently from 5433c14 to 7fbb333 Compare June 15, 2022 07:25
@eileenmcnaughton eileenmcnaughton changed the title wip - add paid_amount to apiv wip - add paid_amount & balance_amount to apiv4 Jun 15, 2022
@mattwire
Copy link
Contributor

@eileenmcnaughton I think for ease of review/clarity we'd be better having two PRs. One for the API4 functionality and one for the invoice template changes.

Also, I'm not sure how API4 calculated fields work - I'm assuming that paid_amount and balance_amount won't be returned by default and won't be calculated by default? Ping @colemanw - just thinking about performance on large Contribution::get calls.

Have not tested yet but this will be a really useful feature going forward.

@eileenmcnaughton
Copy link
Contributor Author

My understanding is that it 'might' if people use addSelect('*) which is not that common in api v4 (and pretty clearly discouraged) so it might not be a show stopper but we can see what @colemanw says.

I'll focus on the other template changes first & come back to this after I've got those merged

@eileenmcnaughton
Copy link
Contributor Author

I'll close this out for now and come back to it later - I think the select side does have a mitigation but I don't think I need an open PR to look into that when I'm ready to

@mattwire
Copy link
Contributor

@eileenmcnaughton What's the blocker here? I don't understand your comment "the select side does have a mitigation"

@eileenmcnaughton
Copy link
Contributor Author

Yeah - I think the performance thing is non-blocking - I just don't want to prioritise getting this mergeable at the moment

@eileenmcnaughton
Copy link
Contributor Author

Ah this clarifies the performance thing #23819 (comment) - so it's definitely not a blocker - once I've worked through the rest of the template changes I will re-visit this as the last change in the template series

@eileenmcnaughton
Copy link
Contributor Author

#24118 now open

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.

2 participants