$this->registerParticipantAndPay();
$priceSetParams['price_' . $this->priceSetFieldID] = $this->cheapFeeValueID;
- $lineItem = $this->getParticipantLineItems();
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $lineItem);
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->balanceCheck($this->_cheapFee);
$priceSetParams['price_' . $this->priceSetFieldID] = $this->expensiveFeeValueID;
- $lineItem = CRM_Price_BAO_LineItem::getLineItems($this->ids['Participant']['order']);
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $lineItem);
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->balanceCheck($this->_expensiveFee);
$priceSetParams['price_' . $this->priceSetFieldID] = $this->veryExpensiveFeeValueID;
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->balanceCheck($this->_veryExpensive);
}
$this->assertEquals($this->callAPISuccessGetValue('Contribution', ['id' => $this->ids['Contribution']['order'], 'return' => 'contribution_status_id']), $partiallyPaidContributionStatus);
$priceSetParams['price_' . $this->priceSetFieldID] = $this->veryExpensiveFeeValueID;
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->assertEquals($this->callAPISuccessGetValue('Contribution', ['id' => $this->ids['Contribution']['order'], 'return' => 'contribution_status_id']), $partiallyPaidContributionStatus);
}
$this->registerParticipantAndPay();
$actualPaidAmount = 100;
$priceSetParams['price_' . $this->priceSetFieldID] = $this->expensiveFeeValueID;
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->balanceCheck($this->_expensiveFee);
$contributionBalance = ($this->_expensiveFee - $actualPaidAmount);
$this->assertEquals($contributionBalance, CRM_Contribute_BAO_Contribution::getContributionBalance($this->ids['Contribution']['order']));
$priceSetParams['price_' . $this->priceSetFieldID] = $this->cheapFeeValueID;
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->balanceCheck($this->_cheapFee);
$contributionBalance = ($this->_cheapFee - $actualPaidAmount);
$this->assertEquals($contributionBalance, CRM_Contribute_BAO_Contribution::getContributionBalance($this->ids['Contribution']['order']));
// CASE 2: Choose text price qty 3 (x$10 = $30 amount)
$priceSetParams['price_' . $this->priceSetFieldID] = 3;
$lineItem = $this->getParticipantLineItems();
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $participant['id'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $participant['id'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
// CASE 3: Choose text price qty 2 (x$10 = $20 amount)
- CRM_Price_BAO_LineItem::changeFeeSelections(['price_' . $this->priceSetFieldID => 2], $participant['id'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections(['price_' . $this->priceSetFieldID => 2], $participant['id'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$financialItems = $this->callAPISuccess('FinancialItem', 'Get', [
'entity_table' => 'civicrm_line_item',
$priceSetParams['price_' . $this->priceSetFieldID] = $this->cheapFeeValueID;
$lineItem = CRM_Price_BAO_LineItem::getLineItems($this->ids['Participant']['order']);
$this->assertEquals($this->_expensiveFee, $lineItem[1]['line_total']);
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $lineItem);
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->validateContribution($this->_cheapFee, 'Pending refund');
$lineItem = $this->getParticipantLineItems();
$this->assertEquals('0.00', $lineItem[1]['line_total']);
$this->assertEquals($this->_cheapFee, $lineItem[2]['line_total']);
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $lineItem);
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->validateContribution($this->_cheapFee, 'Completed');
$priceSetParams['price_' . $this->priceSetFieldID] = $this->veryExpensiveFeeValueID;
$this->assertEquals('0.00', $lineItem[2]['line_total']);
// @todo this doesn't seem to work right even tho it should
//$this->assertDBCompareValue('CRM_Contribute_BAO_Contribution', $this->ids['Contribution']['order'], 'total_amount', 'id', $this->_expensiveFee, "Total Amount equals " . $this->_expensiveFee);
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$lineItem = CRM_Price_BAO_LineItem::getLineItems($this->ids['Participant']['order']);
$this->assertEquals('0.00', $lineItem[1]['line_total']);
$this->assertEquals('0.00', $lineItem[2]['line_total']);
$this->registerParticipantAndPay();
$actualPaidAmount = 100;
$priceSetParams['price_' . $this->priceSetFieldID] = $this->expensiveFeeValueID;
- $lineItem = CRM_Price_BAO_LineItem::getLineItems($this->participantID);
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $lineItem);
+
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->balanceCheck($this->_expensiveFee);
$contributionBalance = ($this->_expensiveFee - $actualPaidAmount);
$this->assertEquals($contributionBalance, CRM_Contribute_BAO_Contribution::getContributionBalance($this->ids['Contribution']['order']));
$priceSetParams['price_' . $this->priceSetFieldID] = $this->noFeeID;
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $this->getParticipantLineItems());
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$this->balanceCheck($this->_noFee);
$contributionBalance = ($this->_noFee - $actualPaidAmount);
$this->assertEquals($contributionBalance, CRM_Contribute_BAO_Contribution::getContributionBalance($this->ids['Contribution']['order']));
public function testPartialPaymentEntries(): void {
$this->registerParticipantAndPay($this->_expensiveFee);
$priceSetParams['price_' . $this->priceSetFieldID] = $this->veryExpensiveFeeValueID;
- $lineItem = CRM_Price_BAO_LineItem::getLineItems($this->participantID);
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $lineItem);
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$actualResults = $this->callAPISuccess('EntityFinancialTrxn', 'get', ['sequential' => 1, 'entity_table' => 'civicrm_financial_item'])['values'];
$this->assertCount(3, $actualResults);
$expectedResults = [
public function testRefundPaymentEntries(): void {
$this->registerParticipantAndPay($this->_expensiveFee);
$priceSetParams['price_' . $this->priceSetFieldID] = $this->cheapFeeValueID;
- $lineItem = CRM_Price_BAO_LineItem::getLineItems($this->participantID);
- CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock, $lineItem);
+ CRM_Price_BAO_LineItem::changeFeeSelections($priceSetParams, $this->ids['Participant']['order'], 'participant', $this->ids['Contribution']['order'], $this->_feeBlock);
$actualResults = $this->callAPISuccess('EntityFinancialTrxn', 'get', ['sequential' => 1, 'entity_table' => 'civicrm_financial_item', 'return' => ['amount', 'entity_id']])['values'];
$expectedResults = [
[