CRM-21026 fix issue with ContributionCount not including disabled financialtypes
[civicrm-core.git] / CRM / Contribute / PseudoConstant.php
index 1cc6cd9859b1a1825844695164305d717aac32bb..26110dc06abcc9d266b947b4c615611048c7aa77 100644 (file)
@@ -101,13 +101,17 @@ class CRM_Contribute_PseudoConstant extends CRM_Core_PseudoConstant {
    *
    *
    * @param int $id
+   * @param bool $includeDisabled
    *
    * @return array
    *   array reference of all financial types if any
    */
-  public static function &financialType($id = NULL) {
+  public static function &financialType($id = NULL, $includeDisabled = FALSE) {
     if (!self::$financialType) {
-      $condition = " is_active = 1 ";
+      $condition = "";
+      if (!$includeDisabled) {
+        $condition = " is_active = 1 ";
+      }
       CRM_Core_PseudoConstant::populate(
         self::$financialType,
         'CRM_Financial_DAO_FinancialType',