Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
sepaocrformat
Commits
2bd485f0
Commit
2bd485f0
authored
Dec 10, 2019
by
jaapjansma
Browse files
Merge branch 'master' of
https://lab.civicrm.org/extensions/sepaocrformat
parents
1c22718b
b49cc073
Changes
2
Hide whitespace changes
Inline
Side-by-side
sepaocrformat.php
View file @
2bd485f0
...
...
@@ -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
...
...
templates/Sepa/Formats/OCR/Format.php
View file @
2bd485f0
...
...
@@ -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'
]
=
s
ubstr
(
str_pad
(
$contribution
[
'message'
],
25
),
0
,
25
);
$contributions
[
$idx
][
'message'
]
=
s
tr_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
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment