'civicrm_batch' => array(
'dao' => 'CRM_Batch_DAO_EntityBatch',
'grouping' => 'contri-fields',
+ 'fields' => array(
+ 'batch_id' => array(
+ 'name' => 'batch_id',
+ 'title' => ts('Batch Title'),
+ ),
+ ),
'filters' => array(
'batch_id' => array(
'title' => ts('Batch Title'),
'type' => CRM_Utils_Type::T_INT,
),
),
+ 'group_bys' => array(
+ 'batch_id' => array('title' => ts('Batch ID')),
+ ),
),
'civicrm_contribution_soft' => array(
'dao' => 'CRM_Contribute_DAO_ContributionSoft',
{$this->_aliases['civicrm_phone']}.is_primary = 1)";
$this->addAddressFromClause();
- if (!empty($this->_params['batch_id_value'])) {
+ //for contribution batches
+ if ($this->isTableSelected('civicrm_batch')) {
$this->_from .= "
- LEFT JOIN civicrm_entity_financial_trxn eft
- ON eft.entity_id = {$this->_aliases['civicrm_contribution']}.id AND
- eft.entity_table = 'civicrm_contribution'
- LEFT JOIN civicrm_entity_batch {$this->_aliases['civicrm_batch']}
- ON {$this->_aliases['civicrm_batch']}.entity_id = eft.financial_trxn_id AND
- {$this->_aliases['civicrm_batch']}.entity_table = 'civicrm_financial_trxn'\n";
+ LEFT JOIN civicrm_entity_financial_trxn eft
+ ON eft.entity_id = {$this->_aliases['civicrm_contribution']}.id AND
+ eft.entity_table = 'civicrm_contribution'
+ LEFT JOIN civicrm_entity_batch {$this->_aliases['civicrm_batch']}
+ ON ({$this->_aliases['civicrm_batch']}.entity_id = eft.financial_trxn_id
+ AND {$this->_aliases['civicrm_batch']}.entity_table = 'civicrm_financial_trxn')";
}
}
$entryFound = TRUE;
}
+ // convert batch id to batch title
+ if (!empty($row['civicrm_batch_batch_id'])) {
+ $rows[$rowNum]['civicrm_batch_batch_id'] = CRM_Core_DAO::getFieldValue('CRM_Batch_BAO_Batch', $row['civicrm_batch_batch_id'], 'title');
+ $entryFound = TRUE;
+ }
+
$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'contribute/detail', 'List all contribution(s) for this ') ? TRUE : $entryFound;
$entryFound = $this->alterDisplayContactFields($row, $rows, $rowNum, 'contribute/detail', 'List all contribution(s) for this ') ? TRUE : $entryFound;