forked from Wavyzz/dolibarr
New: add method for show linked objects in pdf
This commit is contained in:
@@ -631,14 +631,37 @@ class pdf_edison extends ModelePDFCommandes
|
||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
||||
$pdf->MultiCell(86,4, $carac_client, 0, 'L');
|
||||
}
|
||||
|
||||
$curY = 80;
|
||||
$posy=$curY;
|
||||
|
||||
// Date - order
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('','B', $default_font_size + 2);
|
||||
$pdf->SetXY(11, 88);
|
||||
$pdf->SetFont('','B', $default_font_size + 1);
|
||||
$pdf->SetXY(11, $posy);
|
||||
$posy+=6;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs), 0, 'L');
|
||||
$pdf->SetXY(11, 94);
|
||||
$pdf->SetXY(11, $posy);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->ref), 0, 'L');
|
||||
|
||||
|
||||
$posy+=1;
|
||||
|
||||
// Add list of linked objects
|
||||
$linkedobjects = pdf_getLinkedObjects($object,$outputlangs);
|
||||
if (! empty($linkedobjects))
|
||||
{
|
||||
foreach($linkedobjects as $linkedobject)
|
||||
{
|
||||
$posy+=3;
|
||||
$pdf->SetXY(11,$posy);
|
||||
$pdf->SetFont('','', $default_font_size + 1);
|
||||
$pdf->MultiCell(100, 4, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', 'L');
|
||||
$posy+=4;
|
||||
$pdf->SetXY(11,$posy);
|
||||
$pdf->MultiCell(100, 4, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', 'L');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -922,7 +922,25 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R');
|
||||
|
||||
|
||||
$posy+=2;
|
||||
|
||||
// Add list of linked objects
|
||||
$linkedobjects = pdf_getLinkedObjects($object,$outputlangs);
|
||||
if (! empty($linkedobjects))
|
||||
{
|
||||
foreach($linkedobjects as $linkedobject)
|
||||
{
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $linkedobject["ref_title"].' : '.$linkedobject["ref_value"], '', 'R');
|
||||
$posy+=3;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->MultiCell(100, 3, $linkedobject["date_title"].' : '.$linkedobject["date_value"], '', 'R');
|
||||
}
|
||||
}
|
||||
|
||||
if ($showaddress)
|
||||
{
|
||||
// Sender properties
|
||||
|
||||
Reference in New Issue
Block a user