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

CRM-20008 fix pending flow. #10030

Merged
merged 1 commit into from
Apr 20, 2017
Merged

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Mar 22, 2017

This adds a test written by Peter Hartmann for repeattransaction with pending status.

I altered is a little, working on the assumption the flow should be

  • create pending, leave status unchanged
  • complete pending, updte status & advance end date

@eileenmcnaughton
Copy link
Contributor Author

@h-c-c do you want to check this? I looked at your fix #9827 - but it seemed to me cleaner to deal with it a bit deeper.

@@ -4548,43 +4548,52 @@ public static function completeOrder(&$input, &$ids, $objects, $transaction, $re
}
$dao->free();

$membershipParams['num_terms'] = $contribution->getNumTermsByContributionAndMembershipType(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change is just indentation - the if -else block

);

$dates['join_date'] = $currentMembership['join_date'];
if (CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'contribution_status_id', CRM_Utils_Array::value('contribution_status_id', $input)) === 'Pending') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!! Yeah, makes sense to add coverage for the whole process.

}
else {
$membershipParams['num_terms'] = $contribution->getNumTermsByContributionAndMembershipType(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the else block is just formatting

This adds a test written by Peter Hartmann for repeattransaction with pending status.

I altered is a little, working on the assumption the flow should be
- create pending, leave status unchanged
- complete pending, updte status & advance end date
@seamuslee001
Copy link
Contributor

Jenkins re test this please

@seamuslee001
Copy link
Contributor

@eileenmcnaughton just re-testing to check git scan works and everything is hunky dory after your merge of the previous pull

@eileenmcnaughton
Copy link
Contributor Author

@h-c-c Can you confirm if you have tested this / read the code & feel it is good to merge. I need to get some review before I can merge. I feel quite good about the test case adding coverage for the scenario

Note that most of the change is moving code

@seamuslee001
Copy link
Contributor

This looks correct to me no num_terms if we are pending otherwise check as per previous

@eileenmcnaughton
Copy link
Contributor Author

Thanks @seamuslee001 - merging

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.

4 participants