--CRM-13231, fixed upgrade issue, created default COGS and EXP account if arent prese...
[civicrm-core.git] / CRM / Contribute / Form / ContributionPage / Amount.php
index de4a9aaed3a9f885563c0779ee779ece85b37d5e..94b5ff2833684fe5e02eb87a7205e974152f0061 100644 (file)
@@ -363,7 +363,12 @@ SELECT id
         }
       }
     }
-
+    
+    if (CRM_Utils_Array::value('payment_processor', $fields) 
+      && $financialType = CRM_Contribute_BAO_Contribution::validateFinancialType($self->_defaultValues['financial_type_id'])) {
+      $errors['payment_processor'] = ts("Financial Account of account relationship of 'Expense Account is' is not configured for Financial Type : ") . $financialType;  
+    }
+        
     if (CRM_Utils_Array::value('is_recur_interval', $fields)) {
       foreach(array_keys($fields['payment_processor']) as $paymentProcessorID) {
         $paymentProcessorTypeId = CRM_Core_DAO::getFieldValue(