New: Removed limit on cheque receipts
This commit is contained in:
parent
051d6f5ce8
commit
b2b5505304
@ -19,10 +19,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
|
||||
* \ingroup banque
|
||||
* \brief File to build cheque deposit receipts
|
||||
* \version $Id$
|
||||
* \file htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php
|
||||
* \ingroup banque
|
||||
* \brief File to build cheque deposit receipts
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
||||
@ -32,39 +32,39 @@ require_once(DOL_DOCUMENT_ROOT."/includes/modules/cheque/pdf/modules_chequerecei
|
||||
|
||||
|
||||
/**
|
||||
* \class BordereauChequeBlochet
|
||||
* \brief Class of file to build cheque deposit receipts
|
||||
* \class BordereauChequeBlochet
|
||||
* \brief Class of file to build cheque deposit receipts
|
||||
*/
|
||||
class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
{
|
||||
var $error='';
|
||||
|
||||
var $emetteur; // Objet societe qui emet
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
*/
|
||||
function BordereauChequeBlochet($db)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
/**
|
||||
* \brief Constructeur
|
||||
*/
|
||||
function BordereauChequeBlochet($db)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = "blochet";
|
||||
$this->db = $db;
|
||||
$this->name = "blochet";
|
||||
|
||||
$this->tab_top = 60;
|
||||
$this->tab_top = 60;
|
||||
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=20;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
// Dimension page pour format A4
|
||||
$this->type = 'pdf';
|
||||
$this->page_largeur = 210;
|
||||
$this->page_hauteur = 297;
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
$this->marge_gauche=10;
|
||||
$this->marge_droite=20;
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
@ -72,62 +72,50 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->line_height = 5;
|
||||
$this->line_per_page = 25;
|
||||
$this->tab_height = 200; //$this->line_height * $this->line_per_page;
|
||||
}
|
||||
$this->line_per_page = 40;
|
||||
$this->tab_height = 200; //$this->line_height * $this->line_per_page;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fonction generant le rapport sur le disque
|
||||
* @param _dir Directory
|
||||
* @param number Number
|
||||
* @param outputlangs Lang output object
|
||||
* @return int 1=ok, 0=ko
|
||||
*/
|
||||
function write_file($_dir, $number, $outputlangs)
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
/**
|
||||
* Fonction generant le rapport sur le disque
|
||||
* @param _dir Directory
|
||||
* @param number Number
|
||||
* @param outputlangs Lang output object
|
||||
* @return int 1=ok, 0=ko
|
||||
*/
|
||||
function write_file($_dir, $number, $outputlangs)
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
if (!class_exists('TCPDF')) $outputlangs->charset_output='ISO-8859-1';
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
$sav_charset_output=$outputlangs->charset_output;
|
||||
if (!class_exists('TCPDF')) $outputlangs->charset_output='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("compta");
|
||||
|
||||
$dir = $_dir . "/".get_exdir($number,2,1).$number;
|
||||
$dir = $_dir . "/".get_exdir($number,2,1).$number;
|
||||
|
||||
if (! is_dir($dir))
|
||||
{
|
||||
$result=create_exdir($dir);
|
||||
if (! is_dir($dir))
|
||||
{
|
||||
$result=create_exdir($dir);
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$month = sprintf("%02d",$month);
|
||||
$year = sprintf("%04d",$year);
|
||||
$_file = $dir . "/bordereau-".$number.".pdf";
|
||||
$month = sprintf("%02d",$month);
|
||||
$year = sprintf("%04d",$year);
|
||||
$_file = $dir . "/bordereau-".$number.".pdf";
|
||||
|
||||
// Protection et encryption du pdf
|
||||
/* if ($conf->global->PDF_SECURITY_ENCRYPTION)
|
||||
{
|
||||
$pdf = new FPDI_Protection('P','mm',$this->format);
|
||||
$pdfrights = array('print'); // Ne permet que l'impression du document
|
||||
$pdfuserpass = ''; // Mot de passe pour l'utilisateur final
|
||||
$pdfownerpass = NULL; // Mot de passe du proprietaire, cree aleatoirement si pas defini
|
||||
$pdf->SetProtection($pdfrights,$pdfuserpass,$pdfownerpass);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdf=new FPDI('P','mm',$this->format);
|
||||
}
|
||||
*/
|
||||
// Create PDF instance
|
||||
$pdf=pdf_getInstance($this->format);
|
||||
|
||||
if (class_exists('TCPDF'))
|
||||
@ -137,104 +125,102 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
|
||||
$pdf->Open();
|
||||
$pagenb=0;
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
$pdf->Open();
|
||||
$pagenb=0;
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
|
||||
$pdf->SetDrawColor(128,128,128);
|
||||
$pdf->SetTitle($outputlangs->transnoentities("CheckReceipt")." ".$number);
|
||||
$pdf->SetSubject($outputlangs->transnoentities("CheckReceipt"));
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->transnoentities("CheckReceipt")." ".$number);
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
$pdf->SetTitle($outputlangs->transnoentities("CheckReceipt")." ".$number);
|
||||
$pdf->SetSubject($outputlangs->transnoentities("CheckReceipt"));
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
|
||||
$pdf->SetKeyWords($outputlangs->transnoentities("CheckReceipt")." ".$number);
|
||||
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);
|
||||
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
$pdf->SetAutoPageBreak(1,0);
|
||||
|
||||
$lines=$this->line_per_page; // There is no line in such PDF.
|
||||
$nboflines=sizeof($this->lines);
|
||||
// Define nb of page
|
||||
$pages = intval($nboflines / $this->line_per_page);
|
||||
if (($nboflines % $this->line_per_page)>0)
|
||||
{
|
||||
$pages++;
|
||||
}
|
||||
if ($pages == 0)
|
||||
{
|
||||
// force to build at least one page if report has no lines
|
||||
$pages = 1;
|
||||
}
|
||||
|
||||
$pages = intval($lines / $this->line_per_page);
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$this->Header($pdf, $pagenb, $pages, $outputlangs);
|
||||
|
||||
if (($lines % $this->line_per_page)>0)
|
||||
{
|
||||
$pages++;
|
||||
}
|
||||
$this->Body($pdf, $pagenb, $pages, $outputlangs);
|
||||
|
||||
if ($pages == 0)
|
||||
{
|
||||
// force to build at least one page if report has no lines
|
||||
$pages = 1;
|
||||
}
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,'',$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$pdf->AddPage();
|
||||
$pdf->Close();
|
||||
|
||||
$this->Header($pdf, 1, $pages, $outputlangs);
|
||||
$pdf->Output($_file,'F');
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
$this->Body($pdf, 1, $outputlangs);
|
||||
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,'',$outputlangs);
|
||||
$pdf->AliasNbPages();
|
||||
|
||||
$pdf->Close();
|
||||
|
||||
$pdf->Output($_file,'F');
|
||||
if (! empty($conf->global->MAIN_UMASK))
|
||||
@chmod($file, octdec($conf->global->MAIN_UMASK));
|
||||
|
||||
return 1; // Pas d'erreur
|
||||
}
|
||||
$outputlangs->charset_output=$sav_charset_output;
|
||||
return 1; // Pas d'erreur
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Generate Header
|
||||
* \param pdf pdf object
|
||||
* \param page current page number
|
||||
* \param pages number of pages
|
||||
*/
|
||||
function Header(&$pdf, $page, $pages, $outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
/**
|
||||
* Generate Header
|
||||
* @param pdf Pdf object
|
||||
* @param page Current page number
|
||||
* @param pages Total number of pages
|
||||
*/
|
||||
function Header(&$pdf, $page, $pages, $outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
$outputlangs->load("compta");
|
||||
$outputlangs->load("banks");
|
||||
$outputlangs->load("compta");
|
||||
$outputlangs->load("banks");
|
||||
|
||||
$title = $outputlangs->transnoentities("CheckReceipt");
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$title = $outputlangs->transnoentities("CheckReceipt");
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->SetXY(10,8);
|
||||
$pdf->MultiCell(0,2,$title,0,'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(10,15);
|
||||
$pdf->MultiCell(22,2,$outputlangs->transnoentities("Ref"),0,'L');
|
||||
$pdf->MultiCell(22,2,$outputlangs->transnoentities("Ref"),0,'L');
|
||||
$pdf->SetXY(32,15);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->MultiCell(60, 2, $outputlangs->convToOutputCharset($this->number), 0, 'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(10,20);
|
||||
$pdf->MultiCell(22,2,$outputlangs->transnoentities("Date"),0,'L');
|
||||
$pdf->SetXY(32,20);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->MultiCell(60, 2, dol_print_date($this->date,"day",false,$outputlangs));
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(10,26);
|
||||
$pdf->MultiCell(22,2,$outputlangs->transnoentities("Owner"),0,'L');
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(32,26);
|
||||
$pdf->MultiCell(60,2,$outputlangs->convToOutputCharset($this->account->proprio),0,'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(10,32);
|
||||
$pdf->MultiCell(0,2,$outputlangs->transnoentities("Account"),0,'L');
|
||||
pdf_bank($pdf,$outputlangs,32,30,$this->account,1);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(114,15);
|
||||
$pdf->MultiCell(40, 2, $outputlangs->transnoentities("Signature"), 0, 'L');
|
||||
$pdf->MultiCell(40, 2, $outputlangs->transnoentities("Signature"), 0, 'L');
|
||||
|
||||
$pdf->Rect(9, 14, 192, 33);
|
||||
$pdf->line(9, 19, 112, 19);
|
||||
@ -245,142 +231,158 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
|
||||
$pdf->line(30, 14, 30, 47);
|
||||
$pdf->line(112, 14, 112, 47);
|
||||
|
||||
// Number of cheques
|
||||
$posy=49;
|
||||
$pdf->Rect(9, $posy, 192, 7);
|
||||
$pdf->line(55, $posy, 55, $posy+7);
|
||||
$pdf->line(140, $posy, 140, $posy+7);
|
||||
$pdf->line(170, $posy, 170, $posy+7);
|
||||
// Number of cheques
|
||||
$posy=49;
|
||||
$pdf->Rect(9, $posy, 192, 7);
|
||||
$pdf->line(55, $posy, 55, $posy+7);
|
||||
$pdf->line(140, $posy, 140, $posy+7);
|
||||
$pdf->line(170, $posy, 170, $posy+7);
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(10,$posy+2);
|
||||
$pdf->MultiCell(40, 2, $outputlangs->transnoentities("NumberOfCheques"), 0, 'L');
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(10,$posy+2);
|
||||
$pdf->MultiCell(40, 2, $outputlangs->transnoentities("NumberOfCheques"), 0, 'L');
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->SetXY(57,$posy+2);
|
||||
$pdf->MultiCell(40, 2, $this->nbcheque, 0, 'L');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetFont('','', $default_font_size);
|
||||
$pdf->SetXY(148,$posy+2);
|
||||
$pdf->MultiCell(40, 2, $langs->trans("Total"));
|
||||
$pdf->MultiCell(40, 2, $langs->trans("Total"));
|
||||
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->SetXY (170, $posy+2);
|
||||
$pdf->MultiCell(31, 2, price($this->amount), 0, 'C', 0);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->SetXY (170, $posy+2);
|
||||
$pdf->MultiCell(31, 2, price($this->amount), 0, 'C', 0);
|
||||
|
||||
// Tableau
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY (11, $this->tab_top+2);
|
||||
$pdf->MultiCell(40,2,$outputlangs->transnoentities("Num"), 0, 'L');
|
||||
$pdf->line(40, $this->tab_top, 40, $this->tab_top + $this->tab_height + 10);
|
||||
// Tableau
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY (11, $this->tab_top+2);
|
||||
$pdf->MultiCell(40,2,$outputlangs->transnoentities("Num"), 0, 'L');
|
||||
$pdf->line(40, $this->tab_top, 40, $this->tab_top + $this->tab_height + 10);
|
||||
|
||||
$pdf->SetXY (41, $this->tab_top+2);
|
||||
$pdf->SetXY (41, $this->tab_top+2);
|
||||
$pdf->MultiCell(40,2,$outputlangs->transnoentities("Bank"), 0, 'L');
|
||||
$pdf->line(100, $this->tab_top, 100, $this->tab_top + $this->tab_height + 10);
|
||||
$pdf->line(100, $this->tab_top, 100, $this->tab_top + $this->tab_height + 10);
|
||||
|
||||
$pdf->SetXY (101, $this->tab_top+2);
|
||||
$pdf->MultiCell(40,2,$outputlangs->transnoentities("CheckTransmitter"), 0, 'L');
|
||||
$pdf->line(180, $this->tab_top, 180, $this->tab_top + $this->tab_height + 10);
|
||||
$pdf->line(180, $this->tab_top, 180, $this->tab_top + $this->tab_height + 10);
|
||||
|
||||
$pdf->SetXY (180, $this->tab_top+2);
|
||||
$pdf->MultiCell(20,2,$outputlangs->transnoentities("Amount"), 0, 'R');
|
||||
$pdf->line(9, $this->tab_top + 8, 201, $this->tab_top + 8);
|
||||
$pdf->SetXY (180, $this->tab_top+2);
|
||||
$pdf->MultiCell(20,2,$outputlangs->transnoentities("Amount"), 0, 'R');
|
||||
$pdf->line(9, $this->tab_top + 8, 201, $this->tab_top + 8);
|
||||
|
||||
$pdf->Rect(9, $this->tab_top, 192, $this->tab_height + 10);
|
||||
}
|
||||
$pdf->Rect(9, $this->tab_top, 192, $this->tab_height + 10);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Output array
|
||||
*/
|
||||
function Body(&$pdf, $page, $outputlangs)
|
||||
{
|
||||
// x=10 - Num
|
||||
// x=30 - Banque
|
||||
// x=100 - Emetteur
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$oldprowid = 0;
|
||||
$pdf->SetFillColor(220,220,220);
|
||||
$yp = 0;
|
||||
for ($j = 0 ; $j < sizeof($this->lines) ; $j++)
|
||||
{
|
||||
$pdf->SetXY (1, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(8, $this->line_height, $j+1, 0, 'R', 0);
|
||||
/**
|
||||
* Output array
|
||||
*/
|
||||
function Body(&$pdf, $pagenb, $pages, $outputlangs)
|
||||
{
|
||||
// x=10 - Num
|
||||
// x=30 - Banque
|
||||
// x=100 - Emetteur
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$oldprowid = 0;
|
||||
$pdf->SetFillColor(220,220,220);
|
||||
$yp = 0;
|
||||
$lineinpage=0;
|
||||
for ($j = 0 ; $j < sizeof($this->lines) ; $j++)
|
||||
{
|
||||
$lineinpage++;
|
||||
|
||||
$pdf->SetXY (10, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(30, $this->line_height, $this->lines[$j]->num_chq?$this->lines[$j]->num_chq:'', 0, 'L', 0);
|
||||
$pdf->SetXY (1, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(8, $this->line_height, $j+1, 0, 'R', 0);
|
||||
|
||||
$pdf->SetXY (40, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(70, $this->line_height, dol_trunc($outputlangs->convToOutputCharset($this->lines[$j]->bank_chq),44), 0, 'L', 0);
|
||||
$pdf->SetXY (10, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(30, $this->line_height, $this->lines[$j]->num_chq?$this->lines[$j]->num_chq:'', 0, 'L', 0);
|
||||
|
||||
$pdf->SetXY (100, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(80, $this->line_height, dol_trunc($outputlangs->convToOutputCharset($this->lines[$j]->emetteur_chq),50), 0, 'L', 0);
|
||||
$pdf->SetXY (40, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(70, $this->line_height, dol_trunc($outputlangs->convToOutputCharset($this->lines[$j]->bank_chq),44), 0, 'L', 0);
|
||||
|
||||
$pdf->SetXY (180, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(20, $this->line_height, price($this->lines[$j]->amount_chq), 0, 'R', 0);
|
||||
$pdf->SetXY (100, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(80, $this->line_height, dol_trunc($outputlangs->convToOutputCharset($this->lines[$j]->emetteur_chq),50), 0, 'L', 0);
|
||||
|
||||
$yp = $yp + $this->line_height;
|
||||
}
|
||||
}
|
||||
$pdf->SetXY (180, $this->tab_top + 10 + $yp);
|
||||
$pdf->MultiCell(20, $this->line_height, price($this->lines[$j]->amount_chq), 0, 'R', 0);
|
||||
|
||||
$yp = $yp + $this->line_height;
|
||||
|
||||
if ($lineinpage >= $this->line_per_page && $j < (sizeof($this->lines)-1))
|
||||
{
|
||||
$lineinpage=0; $yp=0;
|
||||
|
||||
// New page
|
||||
$pdf->AddPage();
|
||||
$pagenb++;
|
||||
$this->Header($pdf, $pagenb, $pages, $outputlangs);
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf Object PDF
|
||||
* \param object Object cheque receipt
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
/**
|
||||
* \brief Show footer of page
|
||||
* \param pdf Object PDF
|
||||
* \param object Object cheque receipt
|
||||
* \param outputlangs Object lang for output
|
||||
* \remarks Need this->emetteur object
|
||||
*/
|
||||
function _pagefoot(&$pdf,$object,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
|
||||
//return pdf_pagefoot($pdf,$outputlangs,'BANK_CHEQUERECEIPT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
$paramfreetext='BANK_CHEQUERECEIPT_FREE_TEXT';
|
||||
$marge_basse=$this->marge_basse;
|
||||
$marge_gauche=$this->marge_gauche;
|
||||
$page_hauteur=$this->page_hauteur;
|
||||
//return pdf_pagefoot($pdf,$outputlangs,'BANK_CHEQUERECEIPT_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
|
||||
$paramfreetext='BANK_CHEQUERECEIPT_FREE_TEXT';
|
||||
$marge_basse=$this->marge_basse;
|
||||
$marge_gauche=$this->marge_gauche;
|
||||
$page_hauteur=$this->page_hauteur;
|
||||
|
||||
// Line of free text
|
||||
$line=(! empty($conf->global->$paramfreetext))?$outputlangs->convToOutputCharset($conf->global->$paramfreetext):"";
|
||||
// Line of free text
|
||||
$line=(! empty($conf->global->$paramfreetext))?$outputlangs->convToOutputCharset($conf->global->$paramfreetext):"";
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetDrawColor(224,224,224);
|
||||
$pdf->SetFont('','', $default_font_size - 3);
|
||||
$pdf->SetDrawColor(224,224,224);
|
||||
|
||||
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
|
||||
$nbofline=dol_nboflines_bis($line,0,$outputlangs->charset_output);
|
||||
//print 'e'.$line.'t'.dol_nboflines($line);exit;
|
||||
$posy=$marge_basse + ($nbofline*3) + ($line1?3:0) + ($line2?3:0);
|
||||
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
|
||||
$nbofline=dol_nboflines_bis($line,0,$outputlangs->charset_output);
|
||||
//print 'e'.$line.'t'.dol_nboflines($line);exit;
|
||||
$posy=$marge_basse + ($nbofline*3) + ($line1?3:0) + ($line2?3:0);
|
||||
|
||||
if ($line) // Free text
|
||||
{
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(20000, 3, $line, 0, 'L', 0); // Use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.
|
||||
$posy-=($nbofline*3); // 6 of ligne + 3 of MultiCell
|
||||
}
|
||||
if ($line) // Free text
|
||||
{
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(20000, 3, $line, 0, 'L', 0); // Use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text.
|
||||
$posy-=($nbofline*3); // 6 of ligne + 3 of MultiCell
|
||||
}
|
||||
|
||||
$pdf->SetY(-$posy);
|
||||
$pdf->line($marge_gauche, $page_hauteur-$posy, 200, $page_hauteur-$posy);
|
||||
$posy--;
|
||||
$pdf->SetY(-$posy);
|
||||
$pdf->line($marge_gauche, $page_hauteur-$posy, 200, $page_hauteur-$posy);
|
||||
$posy--;
|
||||
|
||||
if ($line1)
|
||||
{
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
|
||||
}
|
||||
if ($line1)
|
||||
{
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
|
||||
}
|
||||
|
||||
if ($line2)
|
||||
{
|
||||
$posy-=3;
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
|
||||
}
|
||||
if ($line2)
|
||||
{
|
||||
$posy-=3;
|
||||
$pdf->SetXY($marge_gauche,-$posy);
|
||||
$pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
|
||||
}
|
||||
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
$pdf->MultiCell(11, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
}
|
||||
$pdf->SetXY(-20,-$posy);
|
||||
$pdf->MultiCell(11, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user