Skip to content
Snippets Groups Projects
Commit ec2a8b55 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #1800 from Devensys/Develop-HighlitingIBAN

Highliting IBAN (sepa)
parents e35135d5 92a5030f
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr> * Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -498,7 +499,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default ...@@ -498,7 +499,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
$diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT); $diffsizecontent=(empty($conf->global->PDF_DIFFSIZE_CONTENT)?4:$conf->global->PDF_DIFFSIZE_CONTENT);
$pdf->SetXY($curx, $cury); $pdf->SetXY($curx, $cury);
if (empty($onlynumber)) if (empty($onlynumber))
...@@ -526,6 +526,27 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default ...@@ -526,6 +526,27 @@ 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)
...@@ -606,9 +627,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default ...@@ -606,9 +627,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
} }
// Use correct name of bank id according to country // Use correct name of bank id according to country
$ibankey="IBANNumber";
$bickey="BICNumber"; $bickey="BICNumber";
if ($account->getCountryCode() == 'IN') $ibankey="IFSC";
if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT";
$pdf->SetFont('','',$default_font_size - $diffsizecontent); $pdf->SetFont('','',$default_font_size - $diffsizecontent);
...@@ -625,13 +644,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default ...@@ -625,13 +644,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
} }
else if (! $usedetailedbban) $cury+=1; else if (! $usedetailedbban) $cury+=1;
if (! empty($account->iban))
{
$pdf->SetXY($curx, $cury);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': ' . $outputlangs->convToOutputCharset($account->iban), 0, 'L', 0);
$cury+=3;
}
if (! empty($account->bic)) if (! empty($account->bic))
{ {
$pdf->SetXY($curx, $cury); $pdf->SetXY($curx, $cury);
...@@ -641,7 +653,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default ...@@ -641,7 +653,6 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
return $pdf->getY(); return $pdf->getY();
} }
/** /**
* Show footer of page for PDF generation * Show footer of page for PDF generation
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment