Add customer code in proposals
This commit is contained in:
parent
d9aeb8eac6
commit
ffa4a884d9
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
*
|
*
|
||||||
@ -132,8 +132,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$propale = new Propal($this->db,"",$id);
|
$propale = new Propal($this->db,"",$id);
|
||||||
$ret=$propale->fetch($id);
|
$ret=$propale->fetch($id);
|
||||||
}
|
}
|
||||||
|
$propale->fetch_client();
|
||||||
$deja_regle = "";
|
$deja_regle = "";
|
||||||
|
|
||||||
// Définition de $dir et $file
|
// Définition de $dir et $file
|
||||||
if ($propale->specimen)
|
if ($propale->specimen)
|
||||||
{
|
{
|
||||||
@ -811,6 +812,14 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : " . dol_print_date($object->fin_validite,"day",false,$outputlangs,true), '', 'R');
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : " . dol_print_date($object->fin_validite,"day",false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
|
if ($object->client->code_client)
|
||||||
|
{
|
||||||
|
$posy+=5;
|
||||||
|
$pdf->SetXY(100,$posy);
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $object->client->code_client, '', 'R');
|
||||||
|
}
|
||||||
|
|
||||||
if ($showadress)
|
if ($showadress)
|
||||||
{
|
{
|
||||||
// Emetteur
|
// Emetteur
|
||||||
@ -865,7 +874,6 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->SetXY(102,$posy-5);
|
$pdf->SetXY(102,$posy-5);
|
||||||
$pdf->MultiCell(80,4, $outputlangs->transnoentities("BillTo").":");
|
$pdf->MultiCell(80,4, $outputlangs->transnoentities("BillTo").":");
|
||||||
$object->fetch_client();
|
|
||||||
|
|
||||||
// Cadre client destinataire
|
// Cadre client destinataire
|
||||||
$pdf->rect(100, $posy, 100, $hautcadre);
|
$pdf->rect(100, $posy, 100, $hautcadre);
|
||||||
|
|||||||
@ -116,7 +116,9 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
$propale = new Propal($this->db,"",$id);
|
$propale = new Propal($this->db,"",$id);
|
||||||
$ret=$propale->fetch($id);
|
$ret=$propale->fetch($id);
|
||||||
}
|
}
|
||||||
|
$propale->fetch_client();
|
||||||
|
$deja_regle = "";
|
||||||
|
|
||||||
// Definition de $dir et $file
|
// Definition de $dir et $file
|
||||||
if ($propale->specimen)
|
if ($propale->specimen)
|
||||||
{
|
{
|
||||||
@ -199,7 +201,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
|
|
||||||
$pdf->writeHTMLCell(102, 4, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
$pdf->writeHTMLCell(102, 4, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // On repositionne la police par défaut
|
$pdf->SetFont('Arial','', 9); // On repositionne la police par d<EFBFBD>faut
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
|
|
||||||
$ref=dol_htmlentitiesbr($propale->lignes[$i]->ref);
|
$ref=dol_htmlentitiesbr($propale->lignes[$i]->ref);
|
||||||
@ -421,11 +423,22 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
$pdf->SetXY(110,90);
|
$pdf->SetXY(110,90);
|
||||||
$pdf->MultiCell(100, 10, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs,true));
|
$pdf->MultiCell(100, 10, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs,true));
|
||||||
|
|
||||||
|
$posy=20;
|
||||||
|
$posy+=5;
|
||||||
|
$pdf->SetXY(100,$posy);
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : " . dol_print_date($object->fin_validite,"day",false,$outputlangs,true), '', 'R');
|
||||||
|
|
||||||
|
if ($object->client->code_client)
|
||||||
|
{
|
||||||
|
$posy+=5;
|
||||||
|
$pdf->SetXY(100,$posy);
|
||||||
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $object->client->code_client, '', 'R');
|
||||||
|
}
|
||||||
|
|
||||||
$posy=39;
|
$posy=39;
|
||||||
|
|
||||||
$object->fetch_client();
|
|
||||||
|
|
||||||
|
|
||||||
// If BILLING contact defined, we use it
|
// If BILLING contact defined, we use it
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
@ -449,7 +462,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
// Nom client
|
// Nom client
|
||||||
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
|
||||||
// Caractéristiques client
|
// Caract<EFBFBD>ristiques client
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address);
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address);
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
||||||
if ($object->contact->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->trans("Country".$object->contact->pays_code)."\n";
|
if ($object->contact->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->trans("Country".$object->contact->pays_code)."\n";
|
||||||
@ -461,24 +474,24 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
$pdf->SetFont('Arial','B',11);
|
$pdf->SetFont('Arial','B',11);
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
||||||
|
|
||||||
// Nom du contact suivi propal si c'est une société
|
// Nom du contact suivi propal si c'est une soci<EFBFBD>t<EFBFBD>
|
||||||
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
|
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
|
||||||
if (sizeof($arrayidcontact) > 0)
|
if (sizeof($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$object->fetch_contact($arrayidcontact[0]);
|
$object->fetch_contact($arrayidcontact[0]);
|
||||||
// On vérifie si c'est une société ou un particulier
|
// On v<EFBFBD>rifie si c'est une soci<63>t<EFBFBD> ou un particulier
|
||||||
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
||||||
{
|
{
|
||||||
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Caractéristiques client
|
// Caract<EFBFBD>ristiques client
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->adresse);
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->adresse);
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n";
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n";
|
||||||
if ($object->client->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->trans("Country".$object->client->pays_code)."\n";
|
if ($object->client->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->trans("Country".$object->client->pays_code)."\n";
|
||||||
}
|
}
|
||||||
// Numéro TVA intracom
|
// Num<EFBFBD>ro TVA intracom
|
||||||
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
|
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
|
||||||
$pdf->SetFont('Arial','',9);
|
$pdf->SetFont('Arial','',9);
|
||||||
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user