Fix phpcs
This commit is contained in:
parent
917b9d69fa
commit
1274d71a10
@ -984,10 +984,11 @@ class Categorie extends CommonObject
|
|||||||
* fullpath = chemin complet compose des id
|
* fullpath = chemin complet compose des id
|
||||||
*
|
*
|
||||||
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...).
|
* @param string $type Type of categories ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...).
|
||||||
* @param int|string|array $markafterid Keep only or removed all categories including the leaf $markafterid in category tree (exclude) or Keep only of category is inside the leaf starting with this id.
|
* @param int|string|array $markafterid Keep only or removed all categories including the leaf $markafterid in category tree (exclude) or Keep only of category is inside the leaf starting with this id.
|
||||||
* $markafterid can be an : int (id of category)
|
* $markafterid can be an :
|
||||||
* string (categories ids seprated by comma)
|
* - int (id of category)
|
||||||
* array (list of categories ids)
|
* - string (categories ids seprated by comma)
|
||||||
|
* - array (list of categories ids)
|
||||||
* @param int $include [=0] Removed or 1=Keep only
|
* @param int $include [=0] Removed or 1=Keep only
|
||||||
* @return array|int Array of categories. this->cats and this->motherof are set, -1 on error
|
* @return array|int Array of categories. this->cats and this->motherof are set, -1 on error
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -988,10 +988,10 @@ class Invoices extends DolibarrApi
|
|||||||
|
|
||||||
// Insert one discount by VAT rate category
|
// Insert one discount by VAT rate category
|
||||||
$discount = new DiscountAbsolute($this->db);
|
$discount = new DiscountAbsolute($this->db);
|
||||||
if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE){
|
if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) {
|
||||||
$discount->description = '(CREDIT_NOTE)';
|
$discount->description = '(CREDIT_NOTE)';
|
||||||
}
|
}
|
||||||
elseif ($this->invoice->type == Facture::TYPE_DEPOSIT){
|
elseif ($this->invoice->type == Facture::TYPE_DEPOSIT) {
|
||||||
$discount->description = '(DEPOSIT)';
|
$discount->description = '(DEPOSIT)';
|
||||||
}
|
}
|
||||||
elseif ($this->invoice->type == Facture::TYPE_STANDARD || $this->invoice->type == Facture::TYPE_REPLACEMENT || $this->invoice->type == Facture::TYPE_SITUATION) {
|
elseif ($this->invoice->type == Facture::TYPE_STANDARD || $this->invoice->type == Facture::TYPE_REPLACEMENT || $this->invoice->type == Facture::TYPE_SITUATION) {
|
||||||
|
|||||||
@ -1071,14 +1071,14 @@ abstract class CommonDocGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* print standard column content
|
* Print standard column content
|
||||||
*
|
*
|
||||||
* @param PDF $pdf pdf object
|
* @param PDF $pdf Pdf object
|
||||||
* @param float $tab_top tab top position
|
* @param float $tab_top Tab top position
|
||||||
* @param float $tab_height default tab height
|
* @param float $tab_height Default tab height
|
||||||
* @param $outputlangs
|
* @param Translate $outputlangs Output language
|
||||||
* @param int $hidetop
|
* @param int $hidetop Hide top
|
||||||
* @return float height of col tab titles
|
* @return float Height of col tab titles
|
||||||
*/
|
*/
|
||||||
function pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop = 0)
|
function pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop = 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3806,9 +3806,10 @@ class Form
|
|||||||
* @param string $htmlname HTML field name
|
* @param string $htmlname HTML field name
|
||||||
* @param int $maxlength Maximum length for labels
|
* @param int $maxlength Maximum length for labels
|
||||||
* @param int|string|array $markafterid Keep only or removed all categories including the leaf $markafterid in category tree (exclude) or Keep only of category is inside the leaf starting with this id.
|
* @param int|string|array $markafterid Keep only or removed all categories including the leaf $markafterid in category tree (exclude) or Keep only of category is inside the leaf starting with this id.
|
||||||
* $markafterid can be an : int (id of category)
|
* $markafterid can be an :
|
||||||
* string (categories ids seprated by comma)
|
* - int (id of category)
|
||||||
* array (list of categories ids)
|
* - string (categories ids seprated by comma)
|
||||||
|
* - array (list of categories ids)
|
||||||
* @param int $outputmode 0=HTML select string, 1=Array
|
* @param int $outputmode 0=HTML select string, 1=Array
|
||||||
* @param int $include [=0] Removed or 1=Keep only
|
* @param int $include [=0] Removed or 1=Keep only
|
||||||
* @return string
|
* @return string
|
||||||
|
|||||||
@ -116,7 +116,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Company object that emits
|
* @var Societe object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
|
|||||||
@ -225,13 +225,13 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
//var_dump($objphoto->ref);exit;
|
//var_dump($objphoto->ref);exit;
|
||||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
||||||
{
|
{
|
||||||
$pdir[0] = get_exdir($objphoto->id,2,0,0,$objphoto,'product') . $objphoto->id ."/photos/";
|
$pdir[0] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product') . $objphoto->id ."/photos/";
|
||||||
$pdir[1] = get_exdir(0,0,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/';
|
$pdir[1] = get_exdir(0, 0, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pdir[0] = get_exdir(0,0,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/'; // default
|
$pdir[0] = get_exdir(0, 0, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/'; // default
|
||||||
$pdir[1] = get_exdir($objphoto->id,2,0,0,$objphoto,'product') . $objphoto->id ."/photos/"; // alternative
|
$pdir[1] = get_exdir($objphoto->id, 2, 0, 0, $objphoto, 'product') . $objphoto->id ."/photos/"; // alternative
|
||||||
}
|
}
|
||||||
|
|
||||||
$arephoto = false;
|
$arephoto = false;
|
||||||
@ -575,7 +575,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
// We start with Photo of product line
|
// We start with Photo of product line
|
||||||
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
|
if (isset($imglinesize['width']) && isset($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
|
||||||
{
|
{
|
||||||
$pdf->AddPage('','',true);
|
$pdf->AddPage('', '', true);
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pdf->setPage($pageposbefore+1);
|
$pdf->setPage($pageposbefore+1);
|
||||||
|
|
||||||
@ -630,7 +630,7 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$nexY = max($pdf->GetY(),$posYAfterImage);
|
$nexY = max($pdf->GetY(), $posYAfterImage);
|
||||||
|
|
||||||
|
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
@ -1358,8 +1358,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
|||||||
if (empty($hidetop)){
|
if (empty($hidetop)){
|
||||||
$pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param
|
$pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Company object that emits
|
* @var Societe object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$formatarray=pdf_getFormat();
|
$formatarray=pdf_getFormat();
|
||||||
$this->page_largeur = $formatarray['width'];
|
$this->page_largeur = $formatarray['width'];
|
||||||
$this->page_hauteur = $formatarray['height'];
|
$this->page_hauteur = $formatarray['height'];
|
||||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
$this->format = array($this->page_largeur, $this->page_hauteur);
|
||||||
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
$this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
|
||||||
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
$this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
|
||||||
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
$this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
|
||||||
@ -184,18 +184,18 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$objphoto = new Product($this->db);
|
$objphoto = new Product($this->db);
|
||||||
$objphoto->fetch($object->lines[$i]->fk_product);
|
$objphoto->fetch($object->lines[$i]->fk_product);
|
||||||
|
|
||||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
|
|
||||||
$realpath='';
|
$realpath='';
|
||||||
|
|
||||||
foreach ($objphoto->liste_photos($dir,1) as $key => $obj)
|
foreach ($objphoto->liste_photos($dir, 1) as $key => $obj)
|
||||||
{
|
{
|
||||||
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
|
if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) // If CAT_HIGH_QUALITY_IMAGES not defined, we use thumb if defined and then original photo
|
||||||
{
|
{
|
||||||
if ($obj['photo_vignette'])
|
if ($obj['photo_vignette'])
|
||||||
{
|
{
|
||||||
$filename= $obj['photo_vignette'];
|
$filename=$obj['photo_vignette'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -236,7 +236,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
if (dol_mkdir($dir) < 0)
|
if (dol_mkdir($dir) < 0)
|
||||||
{
|
{
|
||||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -250,9 +250,9 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$hookmanager=new HookManager($this->db);
|
$hookmanager=new HookManager($this->db);
|
||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('pdfgeneration'));
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
// Set nblignes with the new facture lines content after hook
|
// Set nblignes with the new facture lines content after hook
|
||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
@ -280,7 +280,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
$pdf->Open();
|
$pdf->Open();
|
||||||
$pagenb=0;
|
$pagenb=0;
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
|
|
||||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
@ -298,9 +298,9 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
@ -316,13 +316,13 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top = 88;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_incoterms=$nexY-$tab_top;
|
$height_incoterms=$nexY-$tab_top;
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192, 192, 192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
@ -335,7 +335,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top = 88 + $height_incoterms;
|
||||||
$tab_top_alt = $tab_top;
|
$tab_top_alt = $tab_top;
|
||||||
|
|
||||||
$pdf->SetFont('','B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, 0, 1, false, true, 'L');
|
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top-1, $outputlangs->transnoentities("TrackingNumber")." : " . $object->tracking_number, 0, 1, false, true, 'L');
|
||||||
|
|
||||||
$tab_top_alt = $pdf->GetY();
|
$tab_top_alt = $pdf->GetY();
|
||||||
@ -350,7 +350,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
if ($object->shipping_method_id > 0)
|
if ($object->shipping_method_id > 0)
|
||||||
{
|
{
|
||||||
// Get code using getLabelFromKey
|
// Get code using getLabelFromKey
|
||||||
$code=$outputlangs->getLabelFromKey($this->db,$object->shipping_method_id,'c_shipment_mode','rowid','code');
|
$code=$outputlangs->getLabelFromKey($this->db, $object->shipping_method_id, 'c_shipment_mode', 'rowid', 'code');
|
||||||
$label='';
|
$label='';
|
||||||
if ($object->tracking_url != $object->tracking_number) $label.=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
if ($object->tracking_url != $object->tracking_number) $label.=$outputlangs->trans("LinkToTrackYourPackage")."<br>";
|
||||||
$label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code));
|
$label.=$outputlangs->trans("SendingMethod").": ".$outputlangs->trans("SendingMethod".strtoupper($code));
|
||||||
@ -360,7 +360,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$label.=" : ";
|
$label.=" : ";
|
||||||
$label.=$object->tracking_url;
|
$label.=$object->tracking_url;
|
||||||
}
|
}
|
||||||
$pdf->SetFont('','B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top_alt, $label, 0, 1, false, true, 'L');
|
$pdf->writeHTMLCell(60, 4, $this->posxdesc-1, $tab_top_alt, $label, 0, 1, false, true, 'L');
|
||||||
|
|
||||||
$tab_top_alt = $pdf->GetY();
|
$tab_top_alt = $pdf->GetY();
|
||||||
@ -371,7 +371,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
// Notes
|
// Notes
|
||||||
if (! empty($object->note_public))
|
if (! empty($object->note_public))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
$pdf->SetFont('', '', $default_font_size - 1); // Dans boucle pour gerer multi-page
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top_alt, dol_htmlentitiesbr($object->note_public), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top_alt, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192, 192, 192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_height = $tab_height - $height_note;
|
||||||
@ -392,7 +392,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
|
|
||||||
// Use new auto collum system
|
// Use new auto collum system
|
||||||
$this->prepareArrayColumnField($object,$outputlangs,$hidedetails,$hidedesc,$hideref);
|
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
|
||||||
// Simulation de tableau pour connaitre la hauteur de la ligne de titre
|
// Simulation de tableau pour connaitre la hauteur de la ligne de titre
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
@ -408,8 +408,8 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
for ($i = 0; $i < $nblignes; $i++)
|
for ($i = 0; $i < $nblignes; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('', '', $default_font_size - 1); // Into loop to work with multipage
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
// Define size of image if we need it
|
// Define size of image if we need it
|
||||||
$imglinesize=array();
|
$imglinesize=array();
|
||||||
@ -450,7 +450,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
if($this->getColumnStatus('desc'))
|
if($this->getColumnStatus('desc'))
|
||||||
{
|
{
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->getColumnContentWidth('desc'),3,$this->getColumnContentXStart('desc'),$curY,$hideref,$hidedesc);
|
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
{
|
{
|
||||||
@ -458,7 +458,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$pageposafter=$pageposbefore;
|
$pageposafter=$pageposbefore;
|
||||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->getColumnContentWidth('desc'),3,$this->getColumnContentXStart('desc'),$curY,$hideref,$hidedesc);
|
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
|
||||||
|
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$posyafter=$pdf->GetY();
|
$posyafter=$pdf->GetY();
|
||||||
@ -503,8 +503,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|
||||||
|
|
||||||
// weight
|
// weight
|
||||||
|
|
||||||
@ -553,7 +552,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||||
{
|
{
|
||||||
$pdf->setPage($pageposafter);
|
$pdf->setPage($pageposafter);
|
||||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
|
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80,80,80)));
|
||||||
//$pdf->SetDrawColor(190,190,200);
|
//$pdf->SetDrawColor(190,190,200);
|
||||||
$pdf->line($this->marge_gauche, $nexY-1, $this->page_largeur - $this->marge_droite, $nexY-1);
|
$pdf->line($this->marge_gauche, $nexY-1, $this->page_largeur - $this->marge_droite, $nexY-1);
|
||||||
$pdf->SetLineStyle(array('dash'=>0));
|
$pdf->SetLineStyle(array('dash'=>0));
|
||||||
@ -571,7 +570,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||||
}
|
}
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
$this->_pagefoot($pdf, $object,$outputlangs, 1);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$pdf->setPage($pagenb);
|
$pdf->setPage($pagenb);
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -587,7 +586,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
|
||||||
}
|
}
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
$this->_pagefoot($pdf, $object, $outputlangs, 1);
|
||||||
// New page
|
// New page
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
@ -612,8 +611,8 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs);
|
$posy=$this->_tableau_tot($pdf, $object, 0, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
@ -621,9 +620,9 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
// Add pdfgeneration hook
|
// Add pdfgeneration hook
|
||||||
$hookmanager->initHooks(array('pdfgeneration'));
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0)
|
if ($reshook < 0)
|
||||||
{
|
{
|
||||||
$this->error = $hookmanager->error;
|
$this->error = $hookmanager->error;
|
||||||
@ -672,7 +671,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
$tab2_top = $posy;
|
$tab2_top = $posy;
|
||||||
$tab2_hl = 4;
|
$tab2_hl = 4;
|
||||||
$pdf->SetFont('','B', $default_font_size - 1);
|
$pdf->SetFont('', 'B', $default_font_size - 1);
|
||||||
|
|
||||||
// Tableau total
|
// Tableau total
|
||||||
$col1x = $this->posxweightvol-50; $col2x = $this->posxweightvol;
|
$col1x = $this->posxweightvol-50; $col2x = $this->posxweightvol;
|
||||||
@ -732,9 +731,6 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->getColumnStatus('qty_asked') && $totalOrdered)
|
if ($this->getColumnStatus('qty_asked') && $totalOrdered)
|
||||||
{
|
{
|
||||||
$this->printStdColumnContent($pdf, $tab2_top, 'qty_asked', $totalOrdered);
|
$this->printStdColumnContent($pdf, $tab2_top, 'qty_asked', $totalOrdered);
|
||||||
@ -745,15 +741,12 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$this->printStdColumnContent($pdf, $tab2_top, 'qty_shipped', $totalToShip);
|
$this->printStdColumnContent($pdf, $tab2_top, 'qty_shipped', $totalToShip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($this->getColumnStatus('subprice'))
|
if ($this->getColumnStatus('subprice'))
|
||||||
{
|
{
|
||||||
$this->printStdColumnContent($pdf, $tab2_top, 'subprice', price($object->total_ht, 0, $outputlangs));
|
$this->printStdColumnContent($pdf, $tab2_top, 'subprice', price($object->total_ht, 0, $outputlangs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
$pdf->SetTextColor(0,0,0);
|
|
||||||
|
|
||||||
return ($tab2_top + ($tab2_hl * $index));
|
return ($tab2_top + ($tab2_hl * $index));
|
||||||
}
|
}
|
||||||
@ -783,7 +776,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
// Amount in (at tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('','',$default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
|
|
||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
@ -792,10 +785,10 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128,128,128);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// Output Rect
|
// Output Rect
|
||||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||||
|
|
||||||
|
|
||||||
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
$this->pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
|
||||||
@ -824,17 +817,17 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
|
pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
|
||||||
|
|
||||||
// Show Draft Watermark
|
// Show Draft Watermark
|
||||||
if($object->statut==0 && (! empty($conf->global->SHIPPING_DRAFT_WATERMARK)) )
|
if($object->statut==0 && (! empty($conf->global->SHIPPING_DRAFT_WATERMARK)) )
|
||||||
{
|
{
|
||||||
pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->SHIPPING_DRAFT_WATERMARK);
|
pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->SHIPPING_DRAFT_WATERMARK);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Prepare la suite
|
//Prepare la suite
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFont('','B', $default_font_size + 3);
|
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||||
|
|
||||||
$w = 110;
|
$w = 110;
|
||||||
|
|
||||||
@ -854,7 +847,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pdf->SetTextColor(200,0,0);
|
$pdf->SetTextColor(200, 0, 0);
|
||||||
$pdf->SetFont('','B', $default_font_size - 2);
|
$pdf->SetFont('','B', $default_font_size - 2);
|
||||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
||||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||||
@ -883,7 +876,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
//$pdf->Image($logo,10, 5, 0, 24);
|
//$pdf->Image($logo,10, 5, 0, 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
if (! empty($conf->barcode->enabled))
|
if (! empty($conf->barcode->enabled))
|
||||||
{
|
{
|
||||||
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
|
// TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref
|
||||||
@ -895,39 +888,39 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$posx=$this->page_largeur - $w - $this->marge_droite;
|
$posx=$this->page_largeur - $w - $this->marge_droite;
|
||||||
$posy=$this->marge_haute;
|
$posy=$this->marge_haute;
|
||||||
|
|
||||||
$pdf->SetFont('','B', $default_font_size + 2);
|
$pdf->SetFont('', 'B', $default_font_size + 2);
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$title=$outputlangs->transnoentities("SendingSheet");
|
$title=$outputlangs->transnoentities("SendingSheet");
|
||||||
$pdf->MultiCell($w, 4, $title, '', 'R');
|
$pdf->MultiCell($w, 4, $title, '', 'R');
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size + 1);
|
$pdf->SetFont('', '', $default_font_size + 1);
|
||||||
|
|
||||||
$posy+=5;
|
$posy+=5;
|
||||||
|
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R');
|
||||||
|
|
||||||
// Date planned delivery
|
// Date planned delivery
|
||||||
if (! empty($object->date_delivery))
|
if (! empty($object->date_delivery))
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell($w, 4, $outputlangs->transnoentities("DateDeliveryPlanned")." : ".dol_print_date($object->date_delivery,"day",false,$outputlangs,true), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($object->thirdparty->code_client))
|
if (! empty($object->thirdparty->code_client))
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
|
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size + 3);
|
$pdf->SetFont('', '', $default_font_size + 3);
|
||||||
$Yoff=25;
|
$Yoff=25;
|
||||||
|
|
||||||
// Add list of linked orders
|
// Add list of linked orders
|
||||||
@ -946,7 +939,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
//$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects
|
//$linkedobject->fetchObjectLinked() Get all linked object to the $linkedobject (commonly order) into $linkedobject->linkedObjects
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
$text=$linkedobject->ref;
|
$text=$linkedobject->ref;
|
||||||
if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')';
|
if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')';
|
||||||
$Yoff = $Yoff+8;
|
$Yoff = $Yoff+8;
|
||||||
@ -954,7 +947,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$pdf->MultiCell($w, 2, $outputlangs->transnoentities("RefOrder") ." : ".$outputlangs->transnoentities($text), 0, 'R');
|
$pdf->MultiCell($w, 2, $outputlangs->transnoentities("RefOrder") ." : ".$outputlangs->transnoentities($text), 0, 'R');
|
||||||
$Yoff = $Yoff+3;
|
$Yoff = $Yoff+3;
|
||||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - $w,$Yoff);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - $w,$Yoff);
|
||||||
$pdf->MultiCell($w, 2, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($linkedobject->date,"day",false,$outputlangs,true), 0, 'R');
|
$pdf->MultiCell($w, 2, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($linkedobject->date, "day", false, $outputlangs, true), 0, 'R');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -982,25 +975,25 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
|
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
|
||||||
|
|
||||||
// Show sender frame
|
// Show sender frame
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
$pdf->SetXY($posx,$posy-5);
|
$pdf->SetXY($posx, $posy-5);
|
||||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("Sender").":", 0, 'L');
|
$pdf->MultiCell(66, 5, $outputlangs->transnoentities("Sender").":", 0, 'L');
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetFillColor(230,230,230);
|
$pdf->SetFillColor(230, 230, 230);
|
||||||
$pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1);
|
$pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
|
|
||||||
// Show sender name
|
// Show sender name
|
||||||
$pdf->SetXY($posx+2,$posy+3);
|
$pdf->SetXY($posx+2, $posy+3);
|
||||||
$pdf->SetFont('','B',$default_font_size);
|
$pdf->SetFont('', 'B',$default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox-2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
$pdf->MultiCell($widthrecbox-2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
||||||
$posy=$pdf->getY();
|
$posy=$pdf->getY();
|
||||||
|
|
||||||
// Show sender information
|
// Show sender information
|
||||||
$pdf->SetXY($posx+2,$posy);
|
$pdf->SetXY($posx+2, $posy);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->MultiCell($widthrecbox-2, 4, $carac_emetteur, 0, 'L');
|
$pdf->MultiCell($widthrecbox-2, 4, $carac_emetteur, 0, 'L');
|
||||||
|
|
||||||
|
|
||||||
@ -1023,7 +1016,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
|
|
||||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||||
|
|
||||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails',$object);
|
$carac_client=pdf_build_address($outputlangs,$this->emetteur, $object->thirdparty, (!empty($object->contact)?$object->contact:null), $usecontact, 'targetwithdetails', $object);
|
||||||
|
|
||||||
// Show recipient
|
// Show recipient
|
||||||
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;
|
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;
|
||||||
@ -1033,22 +1026,22 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||||
|
|
||||||
// Show recipient frame
|
// Show recipient frame
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
$pdf->SetXY($posx+2,$posy-5);
|
$pdf->SetXY($posx+2, $posy-5);
|
||||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L');
|
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("Recipient").":", 0, 'L');
|
||||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||||
|
|
||||||
// Show recipient name
|
// Show recipient name
|
||||||
$pdf->SetXY($posx+2,$posy+3);
|
$pdf->SetXY($posx+2, $posy+3);
|
||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('', 'B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
$posy = $pdf->getY();
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy);
|
$pdf->SetXY($posx+2, $posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1075,7 +1068,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
* Define Array Column Field
|
* Define Array Column Field
|
||||||
*
|
*
|
||||||
* @param object $object common object
|
* @param object $object common object
|
||||||
* @param outputlangs $outputlangs langs
|
* @param Translate $outputlangs langs
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
@ -1223,7 +1216,7 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
'hideref' => $hideref
|
'hideref' => $hideref
|
||||||
);
|
);
|
||||||
|
|
||||||
$reshook=$hookmanager->executeHooks('defineColumnField',$parameters,$this); // Note that $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('defineColumnField', $parameters, $this); // Note that $object may have been modified by hook
|
||||||
if ($reshook < 0)
|
if ($reshook < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
@ -1236,8 +1229,5 @@ class pdf_espadon extends ModelePdfExpedition
|
|||||||
{
|
{
|
||||||
$this->cols = $hookmanager->resArray;
|
$this->cols = $hookmanager->resArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class pdf_rouget extends ModelePdfExpedition
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Company object that emits
|
* @var Societe object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
|
|||||||
@ -1559,8 +1559,6 @@ class pdf_sponge extends ModelePDFFactures
|
|||||||
if (empty($hidetop)){
|
if (empty($hidetop)){
|
||||||
$pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param
|
$pdf->line($this->marge_gauche, $tab_top+$this->tabTitleHeight, $this->page_largeur-$this->marge_droite, $tab_top+$this->tabTitleHeight); // line prend une position y en 2eme param et 4eme param
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -110,7 +110,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Issuer
|
* Issuer
|
||||||
* @var Company object that emits
|
* @var Societe object that emits
|
||||||
*/
|
*/
|
||||||
public $emetteur;
|
public $emetteur;
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
// Get source company
|
// Get source company
|
||||||
$this->emetteur=$mysoc;
|
$this->emetteur=$mysoc;
|
||||||
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined
|
||||||
|
|
||||||
// Define position of columns
|
// Define position of columns
|
||||||
$this->posxdesc=$this->marge_gauche+1; // For module retrocompatibility support durring PDF transition: TODO remove this at the end
|
$this->posxdesc=$this->marge_gauche+1; // For module retrocompatibility support durring PDF transition: TODO remove this at the end
|
||||||
@ -214,12 +214,12 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
|
||||||
{
|
{
|
||||||
$pdir = get_exdir($object->lines[$i]->fk_product,2,0,0,$objphoto,'product') . $object->lines[$i]->fk_product ."/photos/";
|
$pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product') . $object->lines[$i]->fk_product ."/photos/";
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/';
|
$pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product') . dol_sanitizeFileName($objphoto->ref).'/';
|
||||||
$dir = $conf->product->dir_output.'/'.$pdir;
|
$dir = $conf->product->dir_output.'/'.$pdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
if (dol_mkdir($dir) < 0)
|
if (dol_mkdir($dir) < 0)
|
||||||
{
|
{
|
||||||
$this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
|
$this->error=$langs->transnoentities("ErrorCanNotCreateDir", $dir);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,9 +281,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$hookmanager=new HookManager($this->db);
|
$hookmanager=new HookManager($this->db);
|
||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('pdfgeneration'));
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
|
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1, 0);
|
||||||
|
|
||||||
if (class_exists('TCPDF'))
|
if (class_exists('TCPDF'))
|
||||||
{
|
{
|
||||||
@ -310,7 +310,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
$pdf->Open();
|
$pdf->Open();
|
||||||
$pagenb=0;
|
$pagenb=0;
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
|
|
||||||
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
|
||||||
$pdf->SetSubject($outputlangs->transnoentities("Order"));
|
$pdf->SetSubject($outputlangs->transnoentities("Order"));
|
||||||
@ -336,9 +336,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
|
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
$tab_top = 90+$top_shift;
|
$tab_top = 90+$top_shift;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
||||||
@ -351,13 +351,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$tab_top -= 2;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_incoterms=$nexY-$tab_top;
|
$height_incoterms=$nexY-$tab_top;
|
||||||
|
|
||||||
// Rect prend une longueur en 3eme param
|
// Rect prend une longueur en 3eme param
|
||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192, 192, 192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
@ -406,7 +406,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
// back to start
|
// back to start
|
||||||
$pdf->setPage($pageposbeforenote);
|
$pdf->setPage($pageposbeforenote);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
$pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$pageposafternote=$pdf->getPage();
|
$pageposafternote=$pdf->getPage();
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+20))) // There is no space left for total+free text
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+20))) // There is no space left for total+free text
|
||||||
{
|
{
|
||||||
$pdf->AddPage('','',true);
|
$pdf->AddPage('', '', true);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$pageposafternote++;
|
$pageposafternote++;
|
||||||
$pdf->setPage($pageposafternote);
|
$pdf->setPage($pageposafternote);
|
||||||
@ -431,7 +431,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pdf->setPage($i);
|
$pdf->setPage($i);
|
||||||
|
|
||||||
|
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
// Draw note frame
|
// Draw note frame
|
||||||
if($i>$pageposbeforenote){
|
if($i>$pageposbeforenote){
|
||||||
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
|
$height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
|
||||||
@ -444,7 +444,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
// Add footer
|
// Add footer
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
$this->_pagefoot($pdf, $object, $outputlangs, 1);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -455,7 +455,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
$height_note=$posyafter-$tab_top_newpage;
|
$height_note=$posyafter-$tab_top_newpage;
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1);
|
||||||
|
|
||||||
}
|
}
|
||||||
else // No pagebreak
|
else // No pagebreak
|
||||||
{
|
{
|
||||||
@ -468,7 +467,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+20)) )
|
if($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+20)) )
|
||||||
{
|
{
|
||||||
// not enough space, need to add page
|
// not enough space, need to add page
|
||||||
$pdf->AddPage('','',true);
|
$pdf->AddPage('', '', true);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$pageposafternote++;
|
$pageposafternote++;
|
||||||
$pdf->setPage($pageposafternote);
|
$pdf->setPage($pageposafternote);
|
||||||
@ -493,7 +492,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$nexY = $tab_top + 7;
|
$nexY = $tab_top + 7;
|
||||||
|
|
||||||
// Use new auto collum system
|
// Use new auto collum system
|
||||||
$this->prepareArrayColumnField($object,$outputlangs,$hidedetails,$hidedesc,$hideref);
|
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
|
||||||
// Loop on each lines
|
// Loop on each lines
|
||||||
$pageposbeforeprintlines=$pdf->getPage();
|
$pageposbeforeprintlines=$pdf->getPage();
|
||||||
@ -502,7 +501,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
// Define size of image if we need it
|
// Define size of image if we need it
|
||||||
$imglinesize=array();
|
$imglinesize=array();
|
||||||
@ -519,7 +518,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
// We start with Photo of product line
|
// We start with Photo of product line
|
||||||
if (!empty($imglinesize['width']) && !empty($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
|
if (!empty($imglinesize['width']) && !empty($imglinesize['height']) && ($curY + $imglinesize['height']) > ($this->page_hauteur-($heightforfooter+$heightforfreetext+$heightforinfotot))) // If photo too high, we moved completely on new page
|
||||||
{
|
{
|
||||||
$pdf->AddPage('','',true);
|
$pdf->AddPage('', '', true);
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
$pdf->setPage($pageposbefore+1);
|
$pdf->setPage($pageposbefore+1);
|
||||||
@ -542,7 +541,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if($this->getColumnStatus('desc'))
|
if($this->getColumnStatus('desc'))
|
||||||
{
|
{
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->getColumnContentWidth('desc'),3,$this->getColumnContentXStart('desc'),$curY,$hideref,$hidedesc);
|
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
if ($pageposafter > $pageposbefore) // There is a pagebreak
|
||||||
{
|
{
|
||||||
@ -550,14 +549,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pageposafter=$pageposbefore;
|
$pageposafter=$pageposbefore;
|
||||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
//print $pageposafter.'-'.$pageposbefore;exit;
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->getColumnContentWidth('desc'),3,$this->getColumnContentXStart('desc'),$curY,$hideref,$hidedesc);
|
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 3, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
$posyafter=$pdf->GetY();
|
$posyafter=$pdf->GetY();
|
||||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) // There is no space left for total+free text
|
||||||
{
|
{
|
||||||
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
if ($i == ($nblignes-1)) // No more lines, and no space left to show total, so we create a new page
|
||||||
{
|
{
|
||||||
$pdf->AddPage('','',true);
|
$pdf->AddPage('', '', true);
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
//if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
//if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
$pdf->setPage($pageposafter+1);
|
$pdf->setPage($pageposafter+1);
|
||||||
@ -587,7 +586,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
|
$pdf->SetFont('', '', $default_font_size - 1); // On repositionne la police par defaut
|
||||||
|
|
||||||
// VAT Rate
|
// VAT Rate
|
||||||
if ($this->getColumnStatus('vat'))
|
if ($this->getColumnStatus('vat'))
|
||||||
@ -602,7 +601,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
|
||||||
$this->printStdColumnContent($pdf, $curY, 'subprice', $up_excl_tax);
|
$this->printStdColumnContent($pdf, $curY, 'subprice', $up_excl_tax);
|
||||||
$nexY = max($pdf->GetY(),$nexY);
|
$nexY = max($pdf->GetY(), $nexY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quantity
|
// Quantity
|
||||||
@ -611,7 +610,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
|
||||||
$this->printStdColumnContent($pdf, $curY, 'qty', $qty);
|
$this->printStdColumnContent($pdf, $curY, 'qty', $qty);
|
||||||
$nexY = max($pdf->GetY(),$nexY);
|
$nexY = max($pdf->GetY(), $nexY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -620,7 +619,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
$unit = pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
|
||||||
$this->printStdColumnContent($pdf, $curY, 'unit', $unit);
|
$this->printStdColumnContent($pdf, $curY, 'unit', $unit);
|
||||||
$nexY = max($pdf->GetY(),$nexY);
|
$nexY = max($pdf->GetY(), $nexY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Discount on line
|
// Discount on line
|
||||||
@ -628,7 +627,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
|
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
|
||||||
$this->printStdColumnContent($pdf, $curY, 'discount', $remise_percent);
|
$this->printStdColumnContent($pdf, $curY, 'discount', $remise_percent);
|
||||||
$nexY = max($pdf->GetY(),$nexY);
|
$nexY = max($pdf->GetY(), $nexY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Total HT line
|
// Total HT line
|
||||||
@ -636,7 +635,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
|
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
|
||||||
$this->printStdColumnContent($pdf, $curY, 'totalexcltax', $total_excl_tax);
|
$this->printStdColumnContent($pdf, $curY, 'totalexcltax', $total_excl_tax);
|
||||||
$nexY = max($pdf->GetY(),$nexY);
|
$nexY = max($pdf->GetY(), $nexY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -649,7 +648,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
'outputlangs' => $outputlangs,
|
'outputlangs' => $outputlangs,
|
||||||
'hidedetails' => $hidedetails
|
'hidedetails' => $hidedetails
|
||||||
);
|
);
|
||||||
$reshook=$hookmanager->executeHooks('printPDFline',$parameters,$this); // Note that $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printPDFline', $parameters, $this); // Note that $object may have been modified by hook
|
||||||
|
|
||||||
|
|
||||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||||
@ -673,7 +672,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
if ((! isset($localtax1_type) || $localtax1_type=='' || ! isset($localtax2_type) || $localtax2_type=='') // if tax type not defined
|
||||||
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
&& (! empty($localtax1_rate) || ! empty($localtax2_rate))) // and there is local tax
|
||||||
{
|
{
|
||||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc,$object->thirdparty);
|
$localtaxtmp_array=getLocalTaxesFromRate($vatrate, 0, $mysoc, $object->thirdparty);
|
||||||
$localtax1_type = $localtaxtmp_array[0];
|
$localtax1_type = $localtaxtmp_array[0];
|
||||||
$localtax2_type = $localtaxtmp_array[2];
|
$localtax2_type = $localtaxtmp_array[2];
|
||||||
}
|
}
|
||||||
@ -694,7 +693,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
|
||||||
{
|
{
|
||||||
$pdf->setPage($pageposafter);
|
$pdf->setPage($pageposafter);
|
||||||
$pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(80,80,80)));
|
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80,80,80)));
|
||||||
//$pdf->SetDrawColor(190,190,200);
|
//$pdf->SetDrawColor(190,190,200);
|
||||||
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
$pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1);
|
||||||
$pdf->SetLineStyle(array('dash'=>0));
|
$pdf->SetLineStyle(array('dash'=>0));
|
||||||
@ -714,7 +713,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
|
||||||
}
|
}
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
$this->_pagefoot($pdf, $object, $outputlangs, 1);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$pdf->setPage($pagenb);
|
$pdf->setPage($pagenb);
|
||||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||||
@ -730,7 +729,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
{
|
{
|
||||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
|
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
|
||||||
}
|
}
|
||||||
$this->_pagefoot($pdf,$object,$outputlangs,1);
|
$this->_pagefoot($pdf, $object, $outputlangs, 1);
|
||||||
// New page
|
// New page
|
||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
@ -765,7 +764,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||||
if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
|
if (method_exists($pdf, 'AliasNbPages')) $pdf->AliasNbPages();
|
||||||
|
|
||||||
$pdf->Close();
|
$pdf->Close();
|
||||||
|
|
||||||
@ -773,9 +772,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
// Add pdfgeneration hook
|
// Add pdfgeneration hook
|
||||||
$hookmanager->initHooks(array('pdfgeneration'));
|
$hookmanager->initHooks(array('pdfgeneration'));
|
||||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
$parameters=array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs);
|
||||||
global $action;
|
global $action;
|
||||||
$reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0)
|
if ($reshook < 0)
|
||||||
{
|
{
|
||||||
$this->error = $hookmanager->error;
|
$this->error = $hookmanager->error;
|
||||||
@ -791,13 +790,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
|
$this->error=$langs->trans("ErrorCanNotCreateDir", $dir);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$langs->trans("ErrorConstantNotDefined","SUPPLIER_OUTPUTDIR");
|
$this->error=$langs->trans("ErrorConstantNotDefined", "SUPPLIER_OUTPUTDIR");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -855,7 +854,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$titre = $outputlangs->transnoentities("PaymentConditions").':';
|
$titre = $outputlangs->transnoentities("PaymentConditions").':';
|
||||||
$pdf->MultiCell(80, 4, $titre, 0, 'L');
|
$pdf->MultiCell(80, 4, $titre, 0, 'L');
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
$pdf->SetXY($posxval, $posy);
|
$pdf->SetXY($posxval, $posy);
|
||||||
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement);
|
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement);
|
||||||
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
|
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
|
||||||
@ -867,12 +866,12 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
// Show payment mode
|
// Show payment mode
|
||||||
if (!empty($object->mode_reglement_code))
|
if (!empty($object->mode_reglement_code))
|
||||||
{
|
{
|
||||||
$pdf->SetFont('','B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$titre = $outputlangs->transnoentities("PaymentMode").':';
|
$titre = $outputlangs->transnoentities("PaymentMode").':';
|
||||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
$pdf->SetXY($posxval, $posy);
|
$pdf->SetXY($posxval, $posy);
|
||||||
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
$lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
||||||
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
|
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
|
||||||
@ -904,7 +903,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
$tab2_top = $posy;
|
$tab2_top = $posy;
|
||||||
$tab2_hl = 4;
|
$tab2_hl = 4;
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// Tableau total
|
// Tableau total
|
||||||
$col1x = 120; $col2x = 170;
|
$col1x = 120; $col2x = 170;
|
||||||
@ -918,7 +917,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
// Total HT
|
// Total HT
|
||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255, 255, 255);
|
||||||
$pdf->SetXY($col1x, $tab2_top + 0);
|
$pdf->SetXY($col1x, $tab2_top + 0);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
|
||||||
|
|
||||||
@ -927,7 +926,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1);
|
||||||
|
|
||||||
// Show VAT by rates and total
|
// Show VAT by rates and total
|
||||||
$pdf->SetFillColor(248,248,248);
|
$pdf->SetFillColor(248, 248, 248);
|
||||||
|
|
||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
foreach( $this->tva as $tvakey => $tvaval )
|
foreach( $this->tva as $tvakey => $tvaval )
|
||||||
@ -943,11 +942,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
if (preg_match('/\*/',$tvakey))
|
if (preg_match('/\*/',$tvakey))
|
||||||
{
|
{
|
||||||
$tvakey=str_replace('*','',$tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
|
|
||||||
$totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' ';
|
$totalvat =$outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' ';
|
||||||
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
$totalvat.=vatrate($tvakey,1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
@ -1008,8 +1007,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$tvakey=str_replace('*','',$tvakey);
|
$tvakey=str_replace('*','',$tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat =$outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
|
$totalvat =$outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' ';
|
||||||
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
@ -1021,7 +1020,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
//if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
|
||||||
//{
|
//{
|
||||||
//Local tax 2
|
//Local tax 2
|
||||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
|
foreach($this->localtax2 as $localtax_type => $localtax_rate)
|
||||||
{
|
{
|
||||||
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
||||||
|
|
||||||
@ -1037,11 +1036,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$tvacompl='';
|
$tvacompl='';
|
||||||
if (preg_match('/\*/',$tvakey))
|
if (preg_match('/\*/',$tvakey))
|
||||||
{
|
{
|
||||||
$tvakey=str_replace('*','',$tvakey);
|
$tvakey=str_replace('*', '', $tvakey);
|
||||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||||
}
|
}
|
||||||
$totalvat =$outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
|
$totalvat =$outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
|
||||||
$totalvat.=vatrate(abs($tvakey),1).$tvacompl;
|
$totalvat.=vatrate(abs($tvakey), 1).$tvacompl;
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
@ -1062,7 +1061,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
|
|
||||||
$creditnoteamount=0;
|
$creditnoteamount=0;
|
||||||
$depositsamount=0;
|
$depositsamount=0;
|
||||||
@ -1083,16 +1082,16 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFillColor(224,224,224);
|
$pdf->SetFillColor(224, 224, 224);
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
|
||||||
|
|
||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
@ -1124,12 +1123,12 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
|
||||||
// Amount in (at tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
|
|
||||||
if (empty($hidetop))
|
if (empty($hidetop))
|
||||||
{
|
{
|
||||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$currency));
|
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
|
||||||
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
|
||||||
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
|
||||||
|
|
||||||
@ -1137,8 +1136,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_droite-$this->marge_gauche, 5, 'F', null, explode(',',$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetDrawColor(128,128,128);
|
$pdf->SetDrawColor(128, 128, 128);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
|
||||||
// Output Rect
|
// Output Rect
|
||||||
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
$this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
|
||||||
@ -1160,7 +1159,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0] );
|
$pdf->SetXY($colDef['xStartPos'] + $colDef['title']['padding'][3], $tab_top + $colDef['title']['padding'][0] );
|
||||||
|
|
||||||
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1];
|
$textWidth = $colDef['width'] - $colDef['title']['padding'][3] -$colDef['title']['padding'][1];
|
||||||
$pdf->MultiCell($textWidth,2,$colDef['title']['label'],'',$colDef['title']['align']);
|
$pdf->MultiCell($textWidth, 2, $colDef['title']['label'], '', $colDef['title']['align']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1197,8 +1196,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
}*/
|
}*/
|
||||||
//Print content
|
//Print content
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->SetFont('','B',$default_font_size + 3);
|
$pdf->SetFont('', 'B',$default_font_size + 3);
|
||||||
|
|
||||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||||
$posy=$this->marge_haute;
|
$posy=$this->marge_haute;
|
||||||
@ -1216,8 +1215,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pdf->SetTextColor(200,0,0);
|
$pdf->SetTextColor(200, 0, 0);
|
||||||
$pdf->SetFont('','B', $default_font_size - 2);
|
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||||
}
|
}
|
||||||
@ -1229,8 +1228,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$title=$outputlangs->transnoentities("SupplierOrder")." ".$outputlangs->convToOutputCharset($object->ref);
|
$title=$outputlangs->transnoentities("SupplierOrder")." ".$outputlangs->convToOutputCharset($object->ref);
|
||||||
$pdf->MultiCell(100, 3, $title, '', 'R');
|
$pdf->MultiCell(100, 3, $title, '', 'R');
|
||||||
$posy+=1;
|
$posy+=1;
|
||||||
@ -1238,14 +1237,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if ($object->ref_supplier)
|
if ($object->ref_supplier)
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('', 'B', $default_font_size);
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefSupplier")." : " . $outputlangs->convToOutputCharset($object->ref_supplier), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefSupplier")." : " . $outputlangs->convToOutputCharset($object->ref_supplier), '', 'R');
|
||||||
$posy+=1;
|
$posy+=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size -1);
|
$pdf->SetFont('', '', $default_font_size -1);
|
||||||
|
|
||||||
if (! empty($conf->global->PDF_SHOW_PROJECT))
|
if (! empty($conf->global->PDF_SHOW_PROJECT))
|
||||||
{
|
{
|
||||||
@ -1253,9 +1252,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if (! empty($object->project->ref))
|
if (! empty($object->project->ref))
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1263,33 +1262,33 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if (! empty($object->date_commande))
|
if (! empty($object->date_commande))
|
||||||
{
|
{
|
||||||
$posy+=5;
|
$posy+=5;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$posy+=5;
|
$posy+=5;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(255,0,0);
|
$pdf->SetTextColor(255, 0, 0);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$usehourmin='day';
|
$usehourmin='day';
|
||||||
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour';
|
if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour';
|
||||||
if (! empty($object->date_livraison))
|
if (! empty($object->date_livraison))
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx-90,$posy);
|
$pdf->SetXY($posx-90, $posy);
|
||||||
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,$usehourmin,false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,$usehourmin,false,$outputlangs,true), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($object->thirdparty->code_fournisseur)
|
if ($object->thirdparty->code_fournisseur)
|
||||||
{
|
{
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_fournisseur), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_fournisseur), '', 'R');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1303,13 +1302,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$usertmp->fetch($arrayidcontact[0]);
|
$usertmp->fetch($arrayidcontact[0]);
|
||||||
$posy+=4;
|
$posy+=4;
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx,$posy);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R');
|
$pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$posy+=1;
|
$posy+=1;
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
|
|
||||||
$top_shift = 0;
|
$top_shift = 0;
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
@ -1341,23 +1340,23 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
$hautcadre=40;
|
$hautcadre=40;
|
||||||
|
|
||||||
// Show sender frame
|
// Show sender frame
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('','', $default_font_size - 2);
|
||||||
$pdf->SetXY($posx,$posy-5);
|
$pdf->SetXY($posx,$posy-5);
|
||||||
$pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
|
$pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
|
||||||
$pdf->SetXY($posx,$posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->SetFillColor(230,230,230);
|
$pdf->SetFillColor(230, 230, 230);
|
||||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
|
|
||||||
// Show sender name
|
// Show sender name
|
||||||
$pdf->SetXY($posx+2,$posy+3);
|
$pdf->SetXY($posx+2, $posy+3);
|
||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('', 'B', $default_font_size);
|
||||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
||||||
$posy=$pdf->getY();
|
$posy=$pdf->getY();
|
||||||
|
|
||||||
// Show sender information
|
// Show sender information
|
||||||
$pdf->SetXY($posx+2,$posy);
|
$pdf->SetXY($posx+2, $posy);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||||
|
|
||||||
@ -1365,7 +1364,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
// If BILLING contact defined on order, we use it
|
// If BILLING contact defined on order, we use it
|
||||||
$usecontact=false;
|
$usecontact=false;
|
||||||
$arrayidcontact=$object->getIdContact('external','BILLING');
|
$arrayidcontact=$object->getIdContact('external', 'BILLING');
|
||||||
if (count($arrayidcontact) > 0)
|
if (count($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$usecontact=true;
|
$usecontact=true;
|
||||||
@ -1382,7 +1381,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||||
|
|
||||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,($usecontact?$object->contact:''),$usecontact,'target',$object);
|
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact?$object->contact:''), $usecontact, 'target', $object);
|
||||||
|
|
||||||
// Show recipient
|
// Show recipient
|
||||||
$widthrecbox=100;
|
$widthrecbox=100;
|
||||||
@ -1392,22 +1391,22 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||||
|
|
||||||
// Show recipient frame
|
// Show recipient frame
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
$pdf->SetFont('','', $default_font_size - 2);
|
$pdf->SetFont('', '', $default_font_size - 2);
|
||||||
$pdf->SetXY($posx+2,$posy-5);
|
$pdf->SetXY($posx+2, $posy-5);
|
||||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":", 0, 'L');
|
||||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||||
|
|
||||||
// Show recipient name
|
// Show recipient name
|
||||||
$pdf->SetXY($posx+2,$posy+3);
|
$pdf->SetXY($posx+2, $posy+3);
|
||||||
$pdf->SetFont('','B', $default_font_size);
|
$pdf->SetFont('', 'B', $default_font_size);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
$posy = $pdf->getY();
|
$posy = $pdf->getY();
|
||||||
|
|
||||||
// Show recipient information
|
// Show recipient information
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
$pdf->SetXY($posx+2,$posy);
|
$pdf->SetXY($posx+2, $posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1436,26 +1435,26 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
* Define Array Column Field
|
* Define Array Column Field
|
||||||
*
|
*
|
||||||
* @param object $object common object
|
* @param object $object common object
|
||||||
* @param outputlangs $outputlangs langs
|
* @param Translate $outputlangs langs
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function defineColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0){
|
function defineColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
|
||||||
|
{
|
||||||
global $conf, $hookmanager;
|
global $conf, $hookmanager;
|
||||||
|
|
||||||
// Default field style for content
|
// Default field style for content
|
||||||
$this->defaultContentsFieldsStyle = array(
|
$this->defaultContentsFieldsStyle = array(
|
||||||
'align' => 'R', // R,C,L
|
'align' => 'R', // R,C,L
|
||||||
'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
||||||
);
|
);
|
||||||
|
|
||||||
// Default field style for content
|
// Default field style for content
|
||||||
$this->defaultTitlesFieldsStyle = array(
|
$this->defaultTitlesFieldsStyle = array(
|
||||||
'align' => 'C', // R,C,L
|
'align' => 'C', // R,C,L
|
||||||
'padding' => array(0.5,0,0.5,0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
'padding' => array(0.5, 0, 0.5, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1486,7 +1485,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
'align' => 'L',
|
'align' => 'L',
|
||||||
// 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
|
// 'textkey' => 'yourLangKey', // if there is no label, yourLangKey will be translated to replace label
|
||||||
// 'label' => ' ', // the final label
|
// 'label' => ' ', // the final label
|
||||||
'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
||||||
),
|
),
|
||||||
'content' => array(
|
'content' => array(
|
||||||
'align' => 'L',
|
'align' => 'L',
|
||||||
@ -1503,7 +1502,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
'label' => ' '
|
'label' => ' '
|
||||||
),
|
),
|
||||||
'content' => array(
|
'content' => array(
|
||||||
'padding' => array(0,0,0,0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
'padding' => array(0, 0, 0, 0), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left
|
||||||
),
|
),
|
||||||
'border-left' => false, // remove left line separator
|
'border-left' => false, // remove left line separator
|
||||||
);
|
);
|
||||||
@ -1616,7 +1615,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
'hideref' => $hideref
|
'hideref' => $hideref
|
||||||
);
|
);
|
||||||
|
|
||||||
$reshook=$hookmanager->executeHooks('defineColumnField',$parameters,$this); // Note that $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('defineColumnField', $parameters, $this); // Note that $object may have been modified by hook
|
||||||
if ($reshook < 0)
|
if ($reshook < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
@ -1632,40 +1631,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* DEBUT PARTIE NORMALEMENT DANS LA CLASSE CommonDocGenerator
|
* DEBUT PARTIE NORMALEMENT DANS LA CLASSE CommonDocGenerator
|
||||||
@ -1694,22 +1659,22 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
/**
|
/**
|
||||||
* Prepare Array Column Field
|
* Prepare Array Column Field
|
||||||
*
|
*
|
||||||
* @param object $object common object
|
* @param object $object common object
|
||||||
* @param outputlangs $outputlangs langs
|
* @param Translate $outputlangs langs
|
||||||
* @param int $hidedetails Do not show line details
|
* @param int $hidedetails Do not show line details
|
||||||
* @param int $hidedesc Do not show desc
|
* @param int $hidedesc Do not show desc
|
||||||
* @param int $hideref Do not show ref
|
* @param int $hideref Do not show ref
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function prepareArrayColumnField($object,$outputlangs,$hidedetails=0,$hidedesc=0,$hideref=0){
|
function prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0){
|
||||||
|
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->defineColumnField($object,$outputlangs,$hidedetails,$hidedesc,$hideref);
|
$this->defineColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
|
|
||||||
|
|
||||||
// Sorting
|
// Sorting
|
||||||
uasort ( $this->cols, array( $this, 'columnSort' ) );
|
uasort($this->cols, array($this, 'columnSort'));
|
||||||
|
|
||||||
// Positionning
|
// Positionning
|
||||||
$curX = $this->page_largeur-$this->marge_droite; // start from right
|
$curX = $this->page_largeur-$this->marge_droite; // start from right
|
||||||
@ -1870,14 +1835,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
'columnText' => $columnText,
|
'columnText' => $columnText,
|
||||||
'colKey' => $colKey
|
'colKey' => $colKey
|
||||||
);
|
);
|
||||||
$reshook=$hookmanager->executeHooks('printStdColumnContent',$parameters,$this); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printStdColumnContent', $parameters, $this); // Note that $action and $object may have been modified by hook
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error,$hookmanager->errors,'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
if (!$reshook)
|
if (!$reshook)
|
||||||
{
|
{
|
||||||
if(empty($columnText)) return;
|
if(empty($columnText)) return;
|
||||||
$pdf->SetXY($this->getColumnContentXStart($colKey),$curY); // Set curent position
|
$pdf->SetXY($this->getColumnContentXStart($colKey), $curY); // Set curent position
|
||||||
$colDef = $this->cols[$colKey];
|
$colDef = $this->cols[$colKey];
|
||||||
$pdf->MultiCell( $this->getColumnContentWidth($colKey),2, $columnText,'',$colDef['content']['align']);
|
$pdf->MultiCell($this->getColumnContentWidth($colKey), 2, $columnText, '', $colDef['content']['align']);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1896,5 +1861,4 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user