'9' => 3 //discount account is
);
- $financialAccountType = $financialAccountType[$this->_submitValues['account_relationship']];
+ $financialAccountType = CRM_Utils_Array::value($this->_submitValues['account_relationship'], $financialAccountType);
$result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
$financialAccountSelect = array('' => ts('- select -')) + $result;
'8' => 1, //premium inventory
'9' => 3, //discount account is
);
-
- $financialAccountType = "{$financialAccountType[$_GET['_value']]}";
+ $financialAccountType = CRM_Utils_Array::value($_GET['_value'], $financialAccountType);
$result = CRM_Contribute_PseudoConstant::financialAccount(NULL, $financialAccountType);
- $defaultId = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_financial_account WHERE is_default = 1 AND financial_account_type_id = $financialAccountType");
+ if ($financialAccountType) {
+ $defaultId = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_financial_account WHERE is_default = 1 AND financial_account_type_id = $financialAccountType");
+ }
}
$elements = array(
array(