The supplier code was not visible on supplier pdf.

This commit is contained in:
Laurent Destailleur 2015-04-13 14:25:27 +02:00
parent 5dc1102601
commit d7ef1e7da0
4 changed files with 59 additions and 31 deletions

View File

@ -68,7 +68,7 @@ class pdf_crabe extends ModelePDFFactures
*/
public $posxprogress;
/**
* Constructor
*
@ -293,7 +293,7 @@ class pdf_crabe extends ModelePDFFactures
}
// Situation invoice handling
if ($object->situation_cycle_ref)
if ($object->situation_cycle_ref)
{
$this->situationinvoice = True;
$progress_width = 14;
@ -332,16 +332,16 @@ class pdf_crabe extends ModelePDFFactures
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
$nexY = $pdf->GetY();
$height_incoterms=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$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);
$tab_top = $nexY+6;
$height_incoterms += 4;
}
}
// Affiche notes
$notetoshow=empty($object->note_public)?'':$object->note_public;
if (! empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
@ -508,7 +508,7 @@ class pdf_crabe extends ModelePDFFactures
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY($this->postotalht, $curY);
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
$prev_progress = $object->lines[$i]->get_prev_progress();
if ($prev_progress > 0) // Compute progress from previous situation
@ -1481,12 +1481,12 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEcheance")." : " . dol_print_date($object->date_lim_reglement,"day",false,$outputlangs,true), '', 'R');
}
if ($object->client->code_client)
if ($object->thirdparty->code_client)
{
$posy+=3;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
}
$posy+=1;

View File

@ -274,16 +274,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
$nexY = $pdf->GetY();
$height_incoterms=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$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);
$tab_top = $nexY+6;
$height_incoterms += 4;
}
}
// Affiche notes
if (! empty($object->note_public))
{
@ -957,46 +957,57 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierInvoice")." ".$outputlangs->convToOutputCharset($object->ref), '', 'R');
$pdf->SetFont('','B', $default_font_size);
$posy+=1;
if ($object->ref_supplier)
{
$posy+=4;
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSupplier")." : " . $object->ref_supplier, '', 'R');
$posy+=1;
}
$pdf->SetFont('','', $default_font_size - 1);
$posy+=6;
if (! empty($conf->global->PDF_SHOW_PROJECT))
{
$object->fetch_projet();
$pdf->SetXY($posx,$posy);
if (! empty($object->project->ref))
{
$langs->load("projects");
$posy+=4;
$pdf->SetXY($posx,$posy);
$langs->load("projects");
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R');
$posy+=4;
}
}
$pdf->SetXY($posx,$posy);
if ($object->date)
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,"day",false,$outputlangs,true), '', 'R');
}
else
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(255,0,0);
$pdf->MultiCell(100, 4, strtolower($outputlangs->transnoentities("OrderToProcess")), '', 'R');
}
$posy+=2;
if ($object->thirdparty->code_fournisseur)
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_fournisseur), '', 'R');
}
$posy+=1;
$pdf->SetTextColor(0,0,60);
// Show list of linked objects

View File

@ -282,16 +282,16 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
$nexY = $pdf->GetY();
$height_incoterms=$nexY-$tab_top;
// Rect prend une longueur en 3eme param
$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);
$tab_top = $nexY+6;
$height_incoterms += 4;
}
}
// Affiche notes
if (! empty($object->note_public))
{
@ -1001,51 +1001,67 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities("SupplierOrder")." ".$outputlangs->convToOutputCharset($object->ref);
$pdf->MultiCell(100, 3, $title, '', 'R');
$pdf->SetFont('','B', $default_font_size);
$posy+=1;
if ($object->ref_supplier)
{
$posy+=4;
$pdf->SetFont('','B', $default_font_size);
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefSupplier")." : " . $outputlangs->convToOutputCharset($object->ref_supplier), '', 'R');
$posy+=1;
}
$pdf->SetFont('','', $default_font_size -1);
$posy+=6;
if (! empty($conf->global->PDF_SHOW_PROJECT))
{
$object->fetch_projet();
$pdf->SetXY($posx,$posy);
if (! empty($object->project->ref))
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$langs->load("projects");
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R');
$posy+=4;
}
}
$pdf->SetXY($posx,$posy);
if (! empty($object->date_commande))
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R');
}
else
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(255,0,0);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
}
$pdf->SetTextColor(0,0,60);
$usehourmin='day';
if ( empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour';
if (! empty($object->date_livraison)) $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,$usehourmin,false,$outputlangs,true), '', 'R');
if (empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour';
if (! empty($object->date_livraison))
{
$posy+=4;
$pdf->SetXY($posx-90,$posy);
$pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,$usehourmin,false,$outputlangs,true), '', 'R');
}
$posy+=5;
if ($object->thirdparty->code_fournisseur)
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_fournisseur), '', 'R');
}
$posy+=1;
$pdf->SetTextColor(0,0,60);
// Show list of linked objects

View File

@ -140,6 +140,7 @@ if (empty($reshook))
{
$result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
else $object->ref_supplier = GETPOST('ref_supplier','alpha'); // The setValueFrom does not set new property of object
}
// Set incoterm