CRM_Core_Session::setStatus(ts('Unbalanced transactions may be created if you delete the account of type: %1.', array(1 => $relationValues[$financialType->account_relationship])));
}
- /**
- * Get Financial Account Name.
- *
- * @param int $entityId
- *
- * @param string $entityTable
- *
- * @param string $columnName
- * Column to fetch.
- *
- * @return null|string
- */
- public static function getFinancialAccount($entityId, $entityTable, $columnName = 'name') {
- $join = $columnName == 'name' ? 'LEFT JOIN civicrm_financial_account ON civicrm_entity_financial_account.financial_account_id = civicrm_financial_account.id' : NULL;
- $query = "
-SELECT {$columnName}
-FROM civicrm_entity_financial_account
-{$join}
-WHERE entity_table = %1
-AND entity_id = %2";
-
- $params = array(
- 1 => array($entityTable, 'String'),
- 2 => array($entityId, 'Integer'),
- );
- return CRM_Core_DAO::singleValueQuery($query, $params);
- }
-
/**
* Financial Account for payment instrument.
*