// to get billing address if present
$billingAddress = array();
- foreach ($addressDetails as $key => $address) {
+ foreach ($addressDetails as $address) {
if ((isset($address['is_billing']) && $address['is_billing'] == 1) && (isset($address['is_primary']) && $address['is_primary'] == 1) && $address['contact_id'] == $contribution->contact_id) {
$billingAddress[$address['contact_id']] = $address;
break;
// retrieving the subtotal and sum of same tax_rate
$dataArray = array();
$subTotal = 0;
- foreach ($lineItem as $entity_id => $taxRate) {
+ foreach ($lineItem as $taxRate) {
if (isset($dataArray[(string) $taxRate['tax_rate']])) {
$dataArray[(string) $taxRate['tax_rate']] = $dataArray[(string) $taxRate['tax_rate']] + CRM_Utils_Array::value('tax_amount', $taxRate);
}
$contributionParams['is_pay_later'] = 1;
$contribution = $this->callAPISuccess('Contribution', 'create', $contributionParams);
+ $contribution3 = $this->callAPISuccess('Contribution', 'create', $contributionParams);
+ $this->callAPISuccess('Payment', 'create', array('total_amount' => 8, 'contribution_id' => $contribution3['id']));
+
+ $this->callAPISuccess('Contribution', 'create', array('id' => $contribution3['id'], 'is_pay_later' => 0));
+
$contributionIDs = array(
array($result['id']),
array($contribution['id']),
+ array($contribution3['id']),
);
$contactIds[] = $this->_individualId;
$this->assertContains('Due Date', $invoiceHTML[$contribution['id']]);
$this->assertContains('PAYMENT ADVICE', $invoiceHTML[$contribution['id']]);
+ $this->assertContains('AMOUNT DUE: </font></b></td>
+ <td style = "padding-left:34px;text-align:right;"><b><font size = "1">$ 92.00</font></b></td>', $invoiceHTML[$contribution3['id']]);
+
}
}