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

[REF] simplify recordAdjustedAmt function #16135

Merged
merged 1 commit into from
Dec 26, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Makes IF statement more readable & casts to float to explicitly handle it

Before

Type of paidAmount is not explicit so when we change it to a float in getTotalPayments we could do something unexpected

After

Cast to float to be explicit. Also the IF is really confusing & it turns out it could be more readable by getting rid of the sill $skip & re-ordering the clauses.

Technical Details

Per #16129

Comments

Makes IF statement more readable & casts to float to explicity handle it
@civibot
Copy link

civibot bot commented Dec 22, 2019

(Standard links)

@civibot civibot bot added the master label Dec 22, 2019
@yashodha
Copy link
Contributor

@eileenmcnaughton Do we need accompanying tests for this?

@eileenmcnaughton
Copy link
Contributor Author

I'd hope we have some test cover on those functions as they are called all the time

@colemanw colemanw merged commit bdec4df into civicrm:master Dec 26, 2019
@eileenmcnaughton eileenmcnaughton deleted the pay_total branch December 30, 2019 02:46
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.

3 participants