Commit 2bd485f0 authored by jaapjansma's avatar jaapjansma
Browse files
parents 1c22718b b49cc073
......@@ -136,6 +136,9 @@ function _sepaocrformat_get_notification_to_bank($mandate_id) {
}
function _sepaocrformat_get_notification_to_bank_by_contribution_recur_id($contribution_recur_id) {
if (!$contribution_recur_id) {
return 0;
}
$sqlParams[1] = [$contribution_recur_id, 'Integer'];
$sql = "
SELECT notification_to_bank
......
......@@ -64,10 +64,10 @@ class CRM_Sepa_Logic_Format_OCR extends CRM_Sepa_Logic_Format {
$contact = CRM_Core_DAO::executeQuery($contactSql, array(1 => array($contribution['contact_id'], 'Integer')));
if ($contact->fetch()) {
$firstName = @iconv("UTF-8", "ASCII//IGNORE", mb_substr($contact->first_name, 0, 5));
$lastName = @iconv("UTF-8", "ASCII//IGNORE", mb_substr($contact->last_name, 0, 5));
$firstName = @iconv("UTF-8", "ISO-8859-1", mb_substr($contact->first_name, 0, 5));
$lastName = @iconv("UTF-8", "ISO-8859-1", mb_substr($contact->last_name, 0, 5));
if (empty($firstName) && empty($lastName)) {
$abbreviatedName = str_pad(@iconv("UTF-8", "ASCII//IGNORE", mb_substr($contact->display_name, 0,10)), 10);
$abbreviatedName = str_pad(@iconv("UTF-8", "ISO-8859-1", mb_substr($contact->display_name, 0,10)), 10);
} else {
$abbreviatedName = str_pad($firstName . $lastName, 10);
}
......@@ -84,7 +84,7 @@ class CRM_Sepa_Logic_Format_OCR extends CRM_Sepa_Logic_Format {
$abbreviatedName = '';
}
$contributions[$idx]['name'] = $abbreviatedName;
$contributions[$idx]['message'] = substr(str_pad($contribution['message'], 25), 0, 25);
$contributions[$idx]['message'] = str_pad(@iconv("UTF-8", "ISO-8859-1", mb_substr($contribution['message'], 0, 25)), 25);
$transactionNr ++;
}
$template->assign('contributions', $contributions);
......@@ -126,4 +126,15 @@ class CRM_Sepa_Logic_Format_OCR extends CRM_Sepa_Logic_Format {
public function getFileReference($txgroup) {
return $txgroup['reference'];
}
/**
* Apply string encoding
*
* @param string $content
*
* @return mixed
*/
public function characterEncode($content) {
return $content;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment