Works on hook integration
This commit is contained in:
parent
99b7ab959e
commit
93df5fcb01
@ -285,7 +285,7 @@ class Expedition extends CommonObject
|
||||
$this->modelpdf = $obj->model_pdf;
|
||||
$this->expedition_method_id = $obj->fk_expedition_methode;
|
||||
$this->tracking_number = $obj->tracking_number;
|
||||
$this->origin = $obj->origin;
|
||||
$this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility
|
||||
$this->origin_id = $obj->origin_id;
|
||||
|
||||
$this->trueWeight = $obj->weight;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@ -194,11 +194,15 @@ class pdf_edison extends ModelePDFCommandes
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs,1);
|
||||
$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1);
|
||||
//$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$ref = pdf_getlineref($object, $i, $outputlangs);
|
||||
|
||||
@ -242,12 +242,12 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
// Description of product line
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
$pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@ -205,7 +205,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object->$origin,$i,$outputlangs);
|
||||
//$libelleproduitservice=pdf_getlinedesc($pdf,$object->$origin,$i,$outputlangs);
|
||||
//if ($i==1) { print $object->commande->lignes[$i]->libelle.' - '.$libelleproduitservice; exit; }
|
||||
|
||||
//Creation des cases a cocher
|
||||
@ -218,7 +218,8 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
//Insertion du libelle
|
||||
$pdf->SetFont('','', 7);
|
||||
$pdf->SetXY (50, $curY+1 );
|
||||
$pdf->writeHTMLCell(90, 3, 50, $curY+1, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 'L', 0);
|
||||
$libelleproduitservice = pdf_getlinedesc($pdf,$object->$origin,$i,$outputlangs,90,3,50,$curY+1,1);
|
||||
//$pdf->writeHTMLCell(90, 3, 50, $curY+1, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 'L', 0);
|
||||
//Insertion de la quantite commandee
|
||||
$pdf->SetFont('','', 7);
|
||||
$pdf->SetXY (140, $curY+1 );
|
||||
|
||||
@ -335,12 +335,14 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
{
|
||||
$pdf->i25($this->marge_gauche+3, ($curY - 2), "000000".$object->lines[$i]->fk_product, 1, 8);
|
||||
}
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,150,3,$this->posxdesc,$curY);
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
$pdf->writeHTMLCell(150, 3, $this->posxdesc, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
//$pdf->writeHTMLCell(150, 3, $this->posxdesc, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -250,10 +250,14 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$curY = $nexY;
|
||||
|
||||
// Description of product line
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
$pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY);
|
||||
|
||||
//$pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -214,9 +214,11 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$curY = $nexY;
|
||||
|
||||
// Description of product line
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY+1);
|
||||
|
||||
$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
//$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
|
||||
@ -186,11 +186,13 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
$curY = $nexY;
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1);
|
||||
|
||||
$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
//$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -243,11 +243,13 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
$curY = $nexY;
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY);
|
||||
|
||||
$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
//$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -243,14 +243,12 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
|
||||
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
// Description
|
||||
$pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 4, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
// Description de la ligne produit
|
||||
$curX = $this->posxdesc-1;
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -186,10 +186,12 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
$curY = $nexY;
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs,1);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs,1);
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,102,4,30,$curY,1);
|
||||
|
||||
$pdf->writeHTMLCell(102, 4, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
//$pdf->writeHTMLCell(102, 4, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -233,11 +233,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$curY = $nexY;
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs,0,0,1);
|
||||
//$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs,0,0,1);
|
||||
|
||||
$pdf->SetFont('','', 9); // Dans boucle pour gerer multi-page
|
||||
|
||||
pdf_getlinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY,0,0,1);
|
||||
|
||||
$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
//$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
$pdf->SetFont('','', 9); // On repositionne la police par defaut
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -452,22 +453,22 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
|
||||
* @param hidedesc Hide description
|
||||
* @param issupplierline Is it a line for a supplier object ?
|
||||
*/
|
||||
function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issupplierline=0)
|
||||
function pdf_getlinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0)
|
||||
{
|
||||
global $db, $conf, $langs;
|
||||
|
||||
$idprod=$object->lines[$i]->fk_product;
|
||||
$label=$object->lines[$i]->label; if (empty($label)) $label=$object->lines[$i]->libelle;
|
||||
$desc=$object->lines[$i]->desc; if (empty($desc)) $desc=$object->lines[$i]->description;
|
||||
$ref_supplier=$object->lines[$i]->ref_supplier; if (empty($ref_supplier)) $ref_supplier=$object->lines[$i]->ref_fourn; // TODO Not yeld saved for supplier invoices, only supplier orders
|
||||
$note=$object->lines[$i]->note;
|
||||
|
||||
if (!empty($object->hooks) && $object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code))
|
||||
{
|
||||
$libelleproduitservice = $object->hooks[$object->lines[$i]->special_code]->pdf_getlinedesc($object,$i,$outputlangs);
|
||||
$object->hooks[$object->lines[$i]->special_code]->pdf_getlinedesc($pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy);
|
||||
}
|
||||
else
|
||||
{
|
||||
$idprod=$object->lines[$i]->fk_product;
|
||||
$label=$object->lines[$i]->label; if (empty($label)) $label=$object->lines[$i]->libelle;
|
||||
$desc=$object->lines[$i]->desc; if (empty($desc)) $desc=$object->lines[$i]->description;
|
||||
$ref_supplier=$object->lines[$i]->ref_supplier; if (empty($ref_supplier)) $ref_supplier=$object->lines[$i]->ref_fourn; // TODO Not yeld saved for supplier invoices, only supplier orders
|
||||
$note=$object->lines[$i]->note;
|
||||
|
||||
if ($issupplierline) $prodser = new ProductFournisseur($db);
|
||||
else $prodser = new Product($db);
|
||||
|
||||
@ -541,31 +542,35 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
$libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice;
|
||||
}
|
||||
}
|
||||
|
||||
$libelleproduitservice=dol_htmlentitiesbr($libelleproduitservice,1);
|
||||
|
||||
if ($object->lines[$i]->date_start || $object->lines[$i]->date_end)
|
||||
{
|
||||
// Show duration if exists
|
||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateFromTo',dol_print_date($object->lines[$i]->date_start, $format, false, $outputlangs),dol_print_date($object->lines[$i]->date_end, $format, false, $outputlangs)).')';
|
||||
}
|
||||
if ($object->lines[$i]->date_start && ! $object->lines[$i]->date_end)
|
||||
{
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateFrom',dol_print_date($object->lines[$i]->date_start, $format, false, $outputlangs)).')';
|
||||
}
|
||||
if (! $object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($object->lines[$i]->date_end, $format, false, $outputlangs)).')';
|
||||
}
|
||||
//print '>'.$outputlangs->charset_output.','.$period;
|
||||
$libelleproduitservice.="<br>".dol_htmlentitiesbr($period,1);
|
||||
//print $libelleproduitservice;
|
||||
}
|
||||
|
||||
// Description
|
||||
$pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||
|
||||
// For compatibility
|
||||
return $libelleproduitservice;
|
||||
}
|
||||
|
||||
$libelleproduitservice=dol_htmlentitiesbr($libelleproduitservice,1);
|
||||
|
||||
if ($object->lines[$i]->date_start || $object->lines[$i]->date_end)
|
||||
{
|
||||
// Show duration if exists
|
||||
if ($object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateFromTo',dol_print_date($object->lines[$i]->date_start, $format, false, $outputlangs),dol_print_date($object->lines[$i]->date_end, $format, false, $outputlangs)).')';
|
||||
}
|
||||
if ($object->lines[$i]->date_start && ! $object->lines[$i]->date_end)
|
||||
{
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateFrom',dol_print_date($object->lines[$i]->date_start, $format, false, $outputlangs)).')';
|
||||
}
|
||||
if (! $object->lines[$i]->date_start && $object->lines[$i]->date_end)
|
||||
{
|
||||
$period='('.$outputlangs->transnoentitiesnoconv('DateUntil',dol_print_date($object->lines[$i]->date_end, $format, false, $outputlangs)).')';
|
||||
}
|
||||
//print '>'.$outputlangs->charset_output.','.$period;
|
||||
$libelleproduitservice.="<br>".dol_htmlentitiesbr($period,1);
|
||||
//print $libelleproduitservice;
|
||||
}
|
||||
|
||||
return $libelleproduitservice;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user