Answers.Body: <p>I found the solution by changing two lines of PHP for the Contribution Detail report (<code>CRM\Report\Form\Contribute\Detail.php</code>) and putting it in our Custom PHP directory.</p>
  
  <p>The filters section for the batch name field reads by default (Civi 4.6.20) as follows:</p>
  
  <pre><code>  $this-&gt;_columns['civicrm_batch']['filters']['bid'] = array(
      'name' =&gt; 'id',
      'title' =&gt; ts('Batch Name'),
      'type' =&gt; CRM_Utils_Type::T_INT,
      'operatorType' =&gt; CRM_Report_Form::OP_MULTISELECT,
      'options' =&gt; $this-&gt;_allBatches,
    );
  </code></pre>
  
  <p>By changing the operator type and commenting out the options, I was able to get a widget with an "Is empty (Null)" option (<a href="https://wiki.civicrm.org/confluence/display/CRMDOC/CiviReport+Reference#CiviReportReference-filters" rel="nofollow noreferrer">thanks to the wiki</a>, I knew to look in CRM_Report_Form for the possible values.)  My code now reads:</p>
  
  <pre><code>  $this-&gt;_columns['civicrm_batch']['filters']['bid'] = array(
      'name' =&gt; 'id',
      'title' =&gt; ts('Batch Name'),
      'type' =&gt; CRM_Utils_Type::T_INT,
      'operatorType' =&gt; CRM_Report_Form::OP_INT,
      //'options' =&gt; $this-&gt;_allBatches,
    );
  </code></pre>
  
  <p><a href="https://i.sstatic.net/Om2pM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Om2pM.png" alt="new Batch Name widget"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-04T01:03:17.500Z
Answers.Text: Thanks Pete! There seems to be a two day waiting period on accepting your own answer, so I will when that's over.
Answers.UserDisplayName: Allen Hutchison
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-03T22:42:28.870Z
Answers.LastActivityDate: 2016-11-23T06:35:30.167Z
Answers.LastEditDate: 2016-11-23T06:35:30.167Z
Answers.UserDisplayName: Allen Hutchison
Body: <p>We use Civi accounting batches to export our contributions to an external accounting program.  The office manager has asked me to create a report (in Drupal or Civi) that will <strong>show all contributions that have not yet been put into an accounting batch</strong>.  I've made some attempts, but have been unsuccessful.  Any help would be greatly appreciated. (Drupal 7; Civi 4.6)</p>
  
  <p><em>Drupal attempt:</em></p>
  
  <p>We use <a href="https://www.drupal.org/project/civicrm_entity" rel="nofollow noreferrer">CiviCRM Entity</a> in a few different ways, especially in Views. We love the module!  However, accounting batch data is not available in the current release, 7.x-2.0-beta3. A number of contribution and financial entities are now available in Views, but as far as I can tell, none of them make data from the Batch table available (either directly through their Fields or indirectly through Relationships).</p>
  
  <p><em>CiviReport UI attempts:</em></p>
  
  <p>Of the standard reports, it seems the Contribution Detail and Bookkeeping reports have access to Batch info already included.  Of those two, only the Contribution Detail report has 'Batch Name' included in the filters.  (The <a href="https://civicrm.org/extensions/extended-reports" rel="nofollow noreferrer">Extended Reports</a> extension didn't seem to have any reports with extra/different options related to Batch data).  The filter type is <code>CRM_Report_Form::OP_MULTISELECT</code> so the only two options are "Is one of" and "Is not one of".  If I use "Is not one of" and select all of the Batch options, I can get the unbatched contributions, but that doesn't seem realistic, especially as the number of batches continues to grow.  Is there a way to automatically select all of the options?  Or do I need to dive into the report's code?</p>
  
Tags: <civicontribute><civireport><developer><accounting><batches>
Title: Report for Unbatched Contributions
ThreadText: # Report for Unbatched Contributions
  
  (Asked by: username_0 on 2016-11-03)
  
  We use Civi accounting batches to export our contributions to an external accounting program. The office manager has asked me to create a report (in Drupal or Civi) that will **show all contributions that have not yet been put into an accounting batch**. I've made some attempts, but have been unsuccessful. Any help would be greatly appreciated. (Drupal 7; Civi 4.6)
  
  *Drupal attempt:*
  
  We use [CiviCRM Entity](https://www.drupal.org/project/civicrm_entity) in a few different ways, especially in Views. We love the module! However, accounting batch data is not available in the current release, 7.x-2.0-beta3. A number of contribution and financial entities are now available in Views, but as far as I can tell, none of them make data from the Batch table available (either directly through their Fields or indirectly through Relationships).
  
  *CiviReport UI attempts:*
  
  Of the standard reports, it seems the Contribution Detail and Bookkeeping reports have access to Batch info already included. Of those two, only the Contribution Detail report has 'Batch Name' included in the filters. (The [Extended Reports](https://civicrm.org/extensions/extended-reports) extension didn't seem to have any reports with extra/different options related to Batch data). The filter type is `CRM_Report_Form::OP_MULTISELECT` so the only two options are "Is one of" and "Is not one of". If I use "Is not one of" and select all of the Batch options, I can get the unbatched contributions, but that doesn't seem realistic, especially as the number of batches continues to grow. Is there a way to automatically select all of the options? Or do I need to dive into the report's code?
  
  **Tags:** civicontribute, civireport, developer, accounting, batches
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-11-03. Score: 3 | Accepted answer
  
  I found the solution by changing two lines of PHP for the Contribution Detail report (CRM\Report\Form\Contribute\Detail.php) and putting it in our Custom PHP directory.
  The filters section for the batch name field reads by default (Civi 4.6.20) as follows:
    $this->_columns['civicrm_batch']['filters']['bid'] = array(
      'name' => 'id',
      'title' => ts('Batch Name'),
      'type' => CRM_Utils_Type::T_INT,
      'operatorType' => CRM_Report_Form::OP_MULTISELECT,
      'options' => $this->_allBatches,
    );
  
  By changing the operator type and commenting out the options, I was able to get a widget with an "Is empty (Null)" option (thanks to the wiki, I knew to look in CRM_Report_Form for the possible values.)  My code now reads:
    $this->_columns['civicrm_batch']['filters']['bid'] = array(
      'name' => 'id',
      'title' => ts('Batch Name'),
      'type' => CRM_Utils_Type::T_INT,
      'operatorType' => CRM_Report_Form::OP_INT,
      //'options' => $this->_allBatches,
    );
  
  > **Comments:**
  > **username_0**: Thanks Pete! There seems to be a two day waiting period on accepting your own answer, so I will when that's over.  
  
  ---
  
  