$dataType = CRM_Utils_Type::typeToString($whereTable['type']);
}
- $wc = ($op != 'LIKE' && $dataType != 'Date') ? "LOWER($whereTable[where])" : "$whereTable[where]";
- $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($wc, $op, $value, $dataType);
+ $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($whereTable['where'], $op, $value, $dataType);
$query->_qill[$grouping][] = "$whereTable[title] $op $quoteValue";
- list($tableName, $fieldName) = explode('.', $whereTable['where'], 2);
+ list($tableName) = explode('.', $whereTable['where'], 2);
$query->_tables[$tableName] = $query->_whereTables[$tableName] = 1;
if ($tableName == 'civicrm_contribution_product') {
$query->_tables['civicrm_product'] = $query->_whereTables['civicrm_product'] = 1;
// 2);
}
+ /**
+ * Check the credit note retrieval is case insensitive.
+ */
+ public function testGetCreditNoteCaseInsensitive() {
+ $this->contributionCreate(array('contact_id' => $this->_individualId));
+ $this->contributionCreate(array('creditnote_id' => 'cN1234', 'contact_id' => $this->_individualId, 'invoice_id' => rand(), 'trxn_id' => rand()));
+ $contribution = $this->callAPISuccess('Contribution', 'getsingle', array('creditnote_id' => 'CN1234'));
+ $this->assertEquals($contribution['creditnote_id'], 'cN1234');
+ }
+
/**
* Test retrieval by total_amount works.
*