On fait marché l'apercu du specimen des modeles expedition

This commit is contained in:
Laurent Destailleur 2006-08-26 14:13:37 +00:00
parent ffcfab529c
commit 74f6dcde9e
4 changed files with 52 additions and 49 deletions

View File

@ -578,7 +578,7 @@ class Expedition extends CommonObject
*/ */
function fetch_commande() function fetch_commande()
{ {
$this->commande =& new Commande($this->db); $this->commande = & new Commande($this->db);
$this->commande->fetch($this->commande_id); $this->commande->fetch($this->commande_id);
} }

View File

@ -142,7 +142,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
// Sauvegarde le dernier modèle choisi pour générer un document // Sauvegarde le dernier modèle choisi pour générer un document
$expedition = new Expedition($db, 0, $_REQUEST['id']); $expedition = new Expedition($db, 0, $_REQUEST['id']);
$expedition->fetch($_REQUEST['id']); $expedition->fetch($_REQUEST['id']);
$expedition->fetch_commande();
if ($_REQUEST['model']) if ($_REQUEST['model'])
{ {
$expedition->set_pdf_model($user, $_REQUEST['model']); $expedition->set_pdf_model($user, $_REQUEST['model']);

View File

@ -122,6 +122,7 @@ function expedition_pdf_create($db, $id, $modele='', $outputlangs='')
$expedition = new Expedition($db); $expedition = new Expedition($db);
$result=$expedition->fetch($id); $result=$expedition->fetch($id);
$result=$expedition->fetch_commande();
if ($obj->write_file($expedition, $langs) > 0) if ($obj->write_file($expedition, $langs) > 0)
{ {

View File

@ -199,10 +199,10 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
$pdf->SetFont('Arial','', 10); $pdf->SetFont('Arial','', 10);
$curY = $this->tableau_top + 5; $curY = $this->tableau_top + 5;
$pdf->Text(12, $curY+2, $outputlangs->trans("Description")); $pdf->Text(12, $curY+2, $outputlangs->trans("Description"));
$pdf->Text(166, $curY, $outputlangs->trans("Qty")); $pdf->Text(160, $curY, $outputlangs->trans("Qty"));
$pdf->Text(166, $curY+4, "Commandée"); $pdf->Text(160, $curY+4, "Commandée");
$pdf->Text(190, $curY, $outputlangs->trans("Qty")); $pdf->Text(186, $curY, $outputlangs->trans("Qty"));
$pdf->Text(190, $curY+4, "Livrée"); $pdf->Text(186, $curY+4, "Livrée");
$this->expe->fetch_lignes(); $this->expe->fetch_lignes();
for ($i = 0 ; $i < sizeof($this->expe->lignes) ; $i++) for ($i = 0 ; $i < sizeof($this->expe->lignes) ; $i++)
@ -243,20 +243,22 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page $pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
if ($conf->fckeditor->enabled) if ($conf->fckeditor->enabled)
{ {
$pdf->writeHTMLCell(108, 4, $this->posxdesc, $curY, $libelleproduitservice, 0, 1); $pdf->writeHTMLCell(150, 3, $this->posxdesc, $curY, $libelleproduitservice, 0, 1);
// $pdf->SetXY ($this->posxdesc, $curY);
// $pdf->MultiCell(150, 3, "zzzz g dg fdgdfgfgfgfdg dfg dfgdfgfdggggggggggggggggggg f g fd g fdgfdgggggggggggggggggggggggggggg fg df g ff hf hz", 0, 'J');
} }
else else
{ {
$pdf->SetXY ($this->posxdesc, $curY); $pdf->SetXY ($this->posxdesc, $curY);
$pdf->MultiCell(108, 4, $libelleproduitservice, 0, 'J'); $pdf->MultiCell(150, 3, $libelleproduitservice, 0, 'J');
} }
$pdf->SetXY (160, $curY);
$pdf->MultiCell(30, 3, $this->expe->lignes[$i]->qty_commande);
$pdf->Text(170, $curY, $this->expe->lignes[$i]->qty_commande); $pdf->SetXY (186, $curY);
$pdf->MultiCell(30, 3, $this->expe->lignes[$i]->qty_expedition);
$pdf->Text(194, $curY, $this->expe->lignes[$i]->qty_expedition);
} }
$pdf->AliasNbPages(); $pdf->AliasNbPages();