$contributionParams['id'] = $contribution->id;
- // KG - if you update the contribution here with financial_type_id it can/will mess with $lineItem
+ // CRM-19309 - if you update the contribution here with financial_type_id it can/will mess with $lineItem
// unsetting it here does NOT cause any other contribution test to fail!
unset($contributionParams['financial_type_id']);
$contributionResult = civicrm_api3('Contribution', 'create', $contributionParams);
public static function calculateRecurLineItems($recurId, $total_amount, $financial_type_id) {
$originalContributionID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $recurId, 'id', 'contribution_recur_id');
$lineItems = CRM_Price_BAO_LineItem::getLineItemsByContributionID($originalContributionID);
- $lineSets=[];
+ $lineSets = array();
if (count($lineItems) == 1) {
foreach ($lineItems as $index => $lineItem) {
if ($financial_type_id) {
$lineSets[$priceField->price_set_id][] = $lineItem;
}
}
- // KG if more than one then just pass them through:
+ // CRM-19309 if more than one then just pass them through:
elseif (count($lineItems) > 1) {
foreach ($lineItems as $index => $lineItem) {
$lineSets[$index][] = $lineItem;
* Test repeat contribution successfully creates line items (plural).
*/
public function testRepeatTransactionLineItems() {
- // KG
+ // CRM-19309
$originalContribution = $this->setUpRepeatTransaction($recurParams = array(), 'multiple');
$this->callAPISuccess('contribution', 'repeattransaction', array(
'original_contribution_id' => $originalContribution['id'],
unset($lineItem2['values'][1]['id'], $lineItem2['values'][1]['entity_id']);
$this->assertEquals($lineItem1['values'][1], $lineItem2['values'][1]);
- // KG ok so we want to:
- // check that financial_line_items have been created for entity_id 3 and 4; - visually they look good
- // the first set of line items id 1 and 2 will not create financial_items b/c of how I created them
+ // CRM-19309 so in future we also want to:
+ // check that financial_line_items have been created for entity_id 3 and 4;
$this->callAPISuccessGetCount('FinancialItem', array('description' => 'Sales Tax', 'amount' => 0), 0);
$this->quickCleanUpFinancialEntities();
'payment_processor_id' => $paymentProcessorID,
), $recurParams));
- $originalContribution=[];
+ $originalContribution = '';
if ($flag == 'multiple') {
- // KG create a contribution + also add in line_items (plural):
+ // CRM-19309 create a contribution + also add in line_items (plural):
$originalContribution = $this->callAPISuccess('contribution', 'create', array_merge(
$this->_params,
array(