Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
67cf3cb9
Commit
67cf3cb9
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fixed: BIC/SWIFT and IBAN must be at same level
parent
b6818855
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/core/lib/pdf.lib.php
+28
-28
28 additions, 28 deletions
htdocs/core/lib/pdf.lib.php
with
28 additions
and
28 deletions
htdocs/core/lib/pdf.lib.php
+
28
−
28
View file @
67cf3cb9
...
@@ -492,7 +492,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
...
@@ -492,7 +492,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
* @param int $curx X
* @param int $curx X
* @param int $cury Y
* @param int $cury Y
* @param Account $account Bank account object
* @param Account $account Bank account object
* @param int $onlynumber Output only number
* @param int $onlynumber Output only number
(bank+desk+key+number according to country, but without name of bank and domiciliation)
* @param int $default_font_size Default font size
* @param int $default_font_size Default font size
* @return float The Y PDF position
* @return float The Y PDF position
*/
*/
...
@@ -513,10 +513,14 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
...
@@ -513,10 +513,14 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$outputlangs
->
load
(
"banks"
);
$outputlangs
->
load
(
"banks"
);
// Use correct name of bank id according to country
$bickey
=
"BICNumber"
;
if
(
$account
->
getCountryCode
()
==
'IN'
)
$bickey
=
"SWIFT"
;
// Get format of bank account according to its country
// Get format of bank account according to its country
$usedetailedbban
=
$account
->
useDetailedBBAN
();
$usedetailedbban
=
$account
->
useDetailedBBAN
();
//
$onlynumber=0; $usedetailedbban=
0
; // For tests
$onlynumber
=
0
;
$usedetailedbban
=
1
;
// For tests
if
(
$usedetailedbban
)
if
(
$usedetailedbban
)
{
{
$savcurx
=
$curx
;
$savcurx
=
$curx
;
...
@@ -529,27 +533,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
...
@@ -529,27 +533,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$cury
+=
3
;
$cury
+=
3
;
}
}
// Use correct name of bank id according to country
$ibankey
=
"IBANNumber"
;
if
(
$account
->
getCountryCode
()
==
'IN'
)
$ibankey
=
"IFSC"
;
if
(
!
empty
(
$account
->
iban
))
{
$ibanDisplay_temp
=
$outputlangs
->
convToOutputCharset
(
$account
->
iban
);
$ibanDisplay
=
""
;
for
(
$i
=
0
;
$i
<
dol_strlen
(
$ibanDisplay_temp
);
$i
++
){
$ibanDisplay
.
=
$ibanDisplay_temp
[
$i
];
if
(
$i
%
4
==
3
&&
$i
>
0
){
$ibanDisplay
.
=
" "
;
}
}
$pdf
->
SetFont
(
''
,
'B'
,
$default_font_size
-
3
);
$pdf
->
SetXY
(
$curx
,
$cury
);
$pdf
->
MultiCell
(
100
,
3
,
$outputlangs
->
transnoentities
(
$ibankey
)
.
': '
.
$ibanDisplay
,
0
,
'L'
,
0
);
$cury
+=
3
;
}
if
(
empty
(
$onlynumber
))
$pdf
->
line
(
$curx
+
1
,
$cury
+
1
,
$curx
+
1
,
$cury
+
8
);
if
(
empty
(
$onlynumber
))
$pdf
->
line
(
$curx
+
1
,
$cury
+
1
,
$curx
+
1
,
$cury
+
8
);
if
(
$usedetailedbban
==
1
)
if
(
$usedetailedbban
==
1
)
...
@@ -612,7 +595,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
...
@@ -612,7 +595,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
}
}
$curx
=
$savcurx
;
$curx
=
$savcurx
;
$cury
+=
10
;
$cury
+=
9
;
}
}
else
else
{
{
...
@@ -629,10 +612,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
...
@@ -629,10 +612,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
if
(
$diffsizecontent
<=
2
)
$cury
+=
1
;
if
(
$diffsizecontent
<=
2
)
$cury
+=
1
;
}
}
// Use correct name of bank id according to country
$bickey
=
"BICNumber"
;
if
(
$account
->
getCountryCode
()
==
'IN'
)
$bickey
=
"SWIFT"
;
$pdf
->
SetFont
(
''
,
''
,
$default_font_size
-
$diffsizecontent
);
$pdf
->
SetFont
(
''
,
''
,
$default_font_size
-
$diffsizecontent
);
if
(
empty
(
$onlynumber
)
&&
!
empty
(
$account
->
domiciliation
))
if
(
empty
(
$onlynumber
)
&&
!
empty
(
$account
->
domiciliation
))
...
@@ -647,8 +626,29 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
...
@@ -647,8 +626,29 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
}
}
else
if
(
!
$usedetailedbban
)
$cury
+=
1
;
else
if
(
!
$usedetailedbban
)
$cury
+=
1
;
// Use correct name of bank id according to country
$ibankey
=
"IBANNumber"
;
if
(
$account
->
getCountryCode
()
==
'IN'
)
$ibankey
=
"IFSC"
;
if
(
!
empty
(
$account
->
iban
))
{
$ibanDisplay_temp
=
$outputlangs
->
convToOutputCharset
(
$account
->
iban
);
$ibanDisplay
=
""
;
for
(
$i
=
0
;
$i
<
dol_strlen
(
$ibanDisplay_temp
);
$i
++
)
{
$ibanDisplay
.
=
$ibanDisplay_temp
[
$i
];
if
(
$i
%
4
==
3
&&
$i
>
0
)
$ibanDisplay
.
=
" "
;
}
$pdf
->
SetFont
(
''
,
'B'
,
$default_font_size
-
3
);
$pdf
->
SetXY
(
$curx
,
$cury
);
$pdf
->
MultiCell
(
100
,
3
,
$outputlangs
->
transnoentities
(
$ibankey
)
.
': '
.
$ibanDisplay
,
0
,
'L'
,
0
);
$cury
+=
3
;
}
if
(
!
empty
(
$account
->
bic
))
if
(
!
empty
(
$account
->
bic
))
{
{
$pdf
->
SetFont
(
''
,
'B'
,
$default_font_size
-
3
);
$pdf
->
SetXY
(
$curx
,
$cury
);
$pdf
->
SetXY
(
$curx
,
$cury
);
$pdf
->
MultiCell
(
100
,
3
,
$outputlangs
->
transnoentities
(
$bickey
)
.
': '
.
$outputlangs
->
convToOutputCharset
(
$account
->
bic
),
0
,
'L'
,
0
);
$pdf
->
MultiCell
(
100
,
3
,
$outputlangs
->
transnoentities
(
$bickey
)
.
': '
.
$outputlangs
->
convToOutputCharset
(
$account
->
bic
),
0
,
'L'
,
0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment