'dao' => 'CRM_Contribute_DAO_Contribution',
//'bao' => 'CRM_Contribute_BAO_Contribution',
'fields' => array(
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ ),
'contribution_source' => array('title' => ts('Source')),
'currency' => array(
'required' => TRUE,
'title' => ts('Contribution Amount Stats'),
'default' => TRUE,
'statistics' => array(
- 'sum' => ts('Contribution Aggregate'),
'count' => ts('Contributions'),
+ 'sum' => ts('Contribution Aggregate'),
'avg' => ts('Contribution Avg'),
),
),
'chart' => TRUE,
),
'contribution_source' => NULL,
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+ 'default' => array(1),
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
),
),
'civicrm_contribution_soft' => array(
'title' => ts('Soft Credit Amount Stats'),
'name' => 'amount',
'statistics' => array(
- 'sum' => ts('Soft Credit Aggregate'),
'count' => ts('Soft Credits'),
+ 'sum' => ts('Soft Credit Aggregate'),
'avg' => ts('Soft Credit Avg'),
),
),
$ignoreFields = array('total_amount', 'sort_name');
$errors = $self->customDataFormRule($fields, $ignoreFields);
- if (empty($fields['group_bys']['receive_date'])) {
- if (!empty($fields['receive_date_relative']) ||
- CRM_Utils_Date::isDate($fields['receive_date_from']) ||
- CRM_Utils_Date::isDate($fields['receive_date_to'])
- ) {
- $errors['receive_date_relative'] = ts("Do not use filter on Date if group by Receive Date is not used ");
- }
- }
if (empty($fields['fields']['total_amount'])) {
foreach (array(
'total_count_value',
*/
public function alterDisplay(&$rows) {
$entryFound = FALSE;
+ $contributionStatus = CRM_Contribute_PseudoConstant::contributionStatus();
foreach ($rows as $rowNum => $row) {
// make count columns point to detail report
$entryFound = TRUE;
}
+ // convert contribution status id to status name
+ if ($value = CRM_Utils_Array::value('civicrm_contribution_contribution_status_id', $row)) {
+ $rows[$rowNum]['civicrm_contribution_contribution_status_id'] = $contributionStatus[$value];
+ $entryFound = TRUE;
+ }
+
// If using campaigns, convert campaign_id to campaign title
if (array_key_exists('civicrm_contribution_campaign_id', $row)) {
if ($value = $row['civicrm_contribution_campaign_id']) {