-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Clean up code to determine line items for membership batch entry #20779
Conversation
(Standard links)
|
I suspect this is the underlying e-notice - closing until I've fixed Stacktrace /home/jenkins/bknix-dfl/build/core-20779-4u7oy/web/sites/all/modules/civicrm/api/api.php:134 |
@eileenmcnaughton I'm not sure why the commit from #20778 is still showing up in this PR. Can you try rebasing? |
@colemanw done |
This removes a chunk of weird code & further consolidates on the internal BAO_Order helper. Note the test cover is in CRM_Batch_Form_EntryTest, which has validateFinancials enabled
@@ -742,22 +760,45 @@ public function getLineItem($index): array { | |||
*/ | |||
protected function fillMembershipLine(array $lineItem): array { | |||
$fields = $this->getPriceFieldsMetadata(); | |||
$field = reset($fields); |
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.
this incorrectly assumed there would only be one possible field - but it's one per membership organization (the field in the membership_type table)
* | ||
* @return void | ||
*/ | ||
protected function addTotalsToLineBasedOnOverrideTotal(int $financialTypeID, array &$lineItem): void { |
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.
extraction
@colemanw are you comfortable merging this - it's less scary & more tested than it looks - but I agree it looks a bit scary :-) |
Ok I see this is mostly code cleanup and test coverage is good. |
@colemanw yeah - it was test cover that made me realise this code is doing something weird :-) |
Overview
Clean up code to determine line items for membership batch entry
Before
whoa
After
Whee
Technical Details
This is towards switching this code to use the order api as it currently uses the BAO to create it's contributions
Comments
Builds on #20778