NEW Option DOC_SHOW_FIRST_SALES_REP shows name of buyer or saler on PDF.

This commit is contained in:
Laurent Destailleur 2016-08-01 14:20:41 +02:00
parent edbd92ee3e
commit 49258db58d
5 changed files with 55 additions and 3 deletions

View File

@ -1253,6 +1253,19 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R');
// Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
$posy+=2;
// Show list of linked objects

View File

@ -1557,6 +1557,19 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
}
// Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
$posy+=1;
// Show list of linked objects

View File

@ -1453,6 +1453,19 @@ class pdf_azur extends ModelePDFPropales
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
}
// Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("SalesRepresentative")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
$posy+=2;
// Show list of linked objects

View File

@ -1105,7 +1105,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
}
// Get contact
if (!empty($conf->global->SUPPLIER_ORDER_SHOW_FIRST_SALES_REP))
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
if (count($arrayidcontact) > 0)

View File

@ -1271,14 +1271,27 @@ class pdf_aurore extends ModelePDFSupplierProposal
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierProposalDate")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R');
*/
if ($object->thirdparty->code_client)
if ($object->thirdparty->code_fournisseur)
{
$posy+=4;
$pdf->SetXY($posx,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_client), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_fournisseur), '', 'R');
}
// Get contact
if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
{
$arrayidcontact=$object->getIdContact('internal','SALESREPFOLL');
if (count($arrayidcontact) > 0)
{
$usertmp=new User($this->db);
$usertmp->fetch($arrayidcontact[0]);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(190, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R');
}
}
$posy+=2;
// Show list of linked objects