Works on hook integration in pdf

This commit is contained in:
Regis Houssin 2010-09-09 15:24:06 +00:00
parent 683fcb75c4
commit 015f32dd0d
2 changed files with 66 additions and 58 deletions

View File

@ -959,7 +959,7 @@ class Propal extends CommonObject
$line->subprice = $objp->subprice; $line->subprice = $objp->subprice;
$line->fk_remise_except = $objp->fk_remise_except; $line->fk_remise_except = $objp->fk_remise_except;
$line->remise_percent = $objp->remise_percent; $line->remise_percent = $objp->remise_percent;
$line->price = $objp->price; // deprecated $line->price = $objp->price; // TODO deprecated
$line->info_bits = $objp->info_bits; $line->info_bits = $objp->info_bits;
$line->total_ht = $objp->total_ht; $line->total_ht = $objp->total_ht;

View File

@ -405,6 +405,12 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$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 $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; $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);
}
else
{
if ($issupplierline) $prodser = new ProductFournisseur($db); if ($issupplierline) $prodser = new ProductFournisseur($db);
else $prodser = new Product($db); else $prodser = new Product($db);
@ -420,7 +426,6 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
} }
} }
// Description short of product line // Description short of product line
$libelleproduitservice=$label; $libelleproduitservice=$label;
@ -479,6 +484,8 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice; $libelleproduitservice=$prefix_prodserv.$ref_prodserv.$libelleproduitservice;
} }
} }
}
$libelleproduitservice=dol_htmlentitiesbr($libelleproduitservice,1); $libelleproduitservice=dol_htmlentitiesbr($libelleproduitservice,1);
if ($object->lines[$i]->date_start || $object->lines[$i]->date_end) if ($object->lines[$i]->date_start || $object->lines[$i]->date_end)
@ -500,6 +507,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
$libelleproduitservice.="<br>".dol_htmlentitiesbr($period,1); $libelleproduitservice.="<br>".dol_htmlentitiesbr($period,1);
//print $libelleproduitservice; //print $libelleproduitservice;
} }
return $libelleproduitservice; return $libelleproduitservice;
} }