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

Fix failure to calculate net_amount correctly on update when fee_amount is not in the parameters. #13177

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Fixes a scenario net_amount is not recalculated correctly on updating total_amount

Before

civicrm_api3('Contribution', 'create', ['id' => 1, 'total_amount' => 8]);

would NOT correctly update net_amount taking into consideration the saved fee amount

After

civicrm_api3('Contribution', 'create', ['id' => 1, 'total_amount' => 8]);

would correctly load the saved fee_amount for calculations.

Technical Details

This addresses what is clearly a coding oversight / error

Comments

@aydun I was looking at https://lab.civicrm.org/dev/core/issues/552 but I think this is tangental

@civibot
Copy link

civibot bot commented Nov 29, 2018

(Standard links)

@civibot civibot bot added the 5.8 label Nov 29, 2018
@seamuslee001
Copy link
Contributor

(CiviCRM Review Template WORD-1.1)

  • (r-explain) Pass
  • (r-test) Pass
  • (r-code) Pass
  • (r-doc) Pass
  • (r-maint) Pass
  • (r-run) Pass i used the cli api and confirmed that changing an amount with a fee amount set didn't re-calculate the net_amount correctly, applied the PR and confirmed that it has now correctly applied the calculation
  • (r-user) Pass
  • (r-tech) Pass

@seamuslee001 seamuslee001 merged commit 579e44f into civicrm:5.8 Nov 30, 2018
@seamuslee001 seamuslee001 deleted the net_amount branch November 30, 2018 04:50
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