'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(
}
if ($_GET['_value'] == 'select') {
- $result = CRM_Core_PseudoConstant::accountOptionValues('account_relationship');
+ $result = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
}
else {
$financialAccountType = array(
'4' => array(7), //cost of sales
);
$financialAccountTypeId = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialAccount', $_GET['_value'], 'financial_account_type_id');
- $result = CRM_Core_PseudoConstant::accountOptionValues('account_relationship');
+ $result = CRM_Core_PseudoConstant::get('CRM_Financial_DAO_EntityFinancialAccount', 'account_relationship');
}
$elements = array(
case 'reopen':
$status = $op == 'close' ? 'Closed' : 'Open';
$ids['batchID'] = $recordID;
- $batchStatus = CRM_Core_PseudoConstant::accountOptionValues('batch_status');
+ $batchStatus = CRM_Core_PseudoConstant::get('CRM_Batch_DAO_Batch', 'status_id');
$params['status_id'] = CRM_Utils_Array::key($status, $batchStatus);
$session = CRM_Core_Session::singleton();
$params['modified_date'] = date('YmdHis');