Add: possibilit d'utiliser l'adresse du contact suivi commande dans le document

Add: patch de Team Raider qui permet d'afficher les nom de contact si dfini dans les documents
Fix: uniformisation du code
This commit is contained in:
Regis Houssin 2007-11-18 14:59:34 +00:00
parent 9c4ae61554
commit 52d6005929
7 changed files with 301 additions and 213 deletions

View File

@ -1,9 +1,10 @@
<?php
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -122,16 +123,29 @@ if ($_GET["action"] == 'setmod')
// par appel methode canBeActivated
dolibarr_set_const($db, "COMMANDE_ADDON",$_GET["value"]);
Header("Location: commande.php");
exit;
}
if ($_POST["action"] == 'setvalidorder')
{
dolibarr_set_const($db, "COMMANDE_VALID_AFTER_CLOSE_PROPAL",$_POST["validorder"]);
Header("Location: commande.php");
exit;
}
if ($_POST["action"] == 'deliverycostline')
{
dolibarr_set_const($db, "COMMANDE_ADD_DELIVERY_COST_LINE",$_POST["addline"]);
Header("Location: commande.php");
exit;
}
if ($_POST["action"] == 'set_use_customer_contact_as_recipient')
{
dolibarr_set_const($db, "COMMANDE_USE_CUSTOMER_CONTACT_AS_RECIPIENT",$_POST["use_customer_contact_as_recipient"]);
Header("Location: commande.php");
exit;
}
// défini les constantes du modèle saphir
@ -348,36 +362,44 @@ print_titre($langs->trans("OtherOptions"));
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td align="center" width="160">'.$langs->trans("Value").'</td>';
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
print "<td>&nbsp;</td>\n";
print "</tr>\n";
$var=true;
// Valider la commande après cloture de la propale
// permet de na pas passer par l'option commande provisoire
$var=! $var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("ValidOrderAfterPropalClosed");
print '</td><td width="160" align="center">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="setvalidorder">';
print $html->selectyesno("validorder",$conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</form>\n";
print "</td></tr>\n";
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("ValidOrderAfterPropalClosed").'</td>';
print '<td width="60" align="center">'.$html->selectyesno("validorder",$conf->global->COMMANDE_VALID_AFTER_CLOSE_PROPAL,1).'</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr>';
print '</form>';
// Ajouter une ligne de frais port indiquant le poids de la commande
$var=! $var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("AddDeliveryCostLine");
print '</td><td width="160" align="center">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="deliverycostline">';
print $html->selectyesno("addline",$conf->global->COMMANDE_ADD_DELIVERY_COST_LINE,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("AddDeliveryCostLine").'</td>';
print '<td width="60" align="center">'.$html->selectyesno("addline",$conf->global->COMMANDE_ADD_DELIVERY_COST_LINE,1).'</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr>';
print '</form>';
// Utiliser le contact de la commande dans le document
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="action" value="set_use_customer_contact_as_recipient">';
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("UseCustomerContactAsOrderRecipientIfExist").'</td>';
print '<td width="60" align="center">'.$html->selectyesno("use_customer_contact_as_recipient",$conf->global->COMMANDE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1).'</td>';
print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr>';
print '</form>';
print "</td></tr>\n";

View File

@ -18,7 +18,6 @@
* or see http://www.gnu.org/
*
* $Id$
* $Source$
*/
/**
@ -742,143 +741,190 @@ class pdf_einstein extends ModelePDFCommandes
*/
function _pagehead(&$pdf, $object, $showadress=1, $outputlangs)
{
global $conf,$langs;
global $conf,$langs;
$outputlangs->load("main");
$outputlangs->load("bills");
$outputlangs->load("propal");
$outputlangs->load("companies");
$outputlangs->load("main");
$outputlangs->load("bills");
$outputlangs->load("propal");
$outputlangs->load("companies");
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);
$posy=$this->marge_haute;
$posy=$this->marge_haute;
$pdf->SetXY($this->marge_gauche,$posy);
// Logo
$logo=$conf->societe->dir_logos.'/'.$this->emetteur->logo;
if ($this->emetteur->logo)
{
if (is_readable($logo))
{
$pdf->Image($logo, $this->marge_gauche, $posy, 0, 24);
}
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
}
}
else if (defined("FAC_PDF_INTITULE"))
{
$pdf->MultiCell(100, 4, FAC_PDF_INTITULE, 0, 'L');
$pdf->SetXY($this->marge_gauche,$posy);
// Logo
$logo=$conf->societe->dir_logos.'/'.$this->emetteur->logo;
if ($this->emetteur->logo)
{
if (is_readable($logo))
{
$pdf->Image($logo, $this->marge_gauche, $posy, 0, 24);
}
else
{
$pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
}
}
else if (defined("FAC_PDF_INTITULE"))
{
$pdf->MultiCell(100, 4, FAC_PDF_INTITULE, 0, 'L');
}
$pdf->SetFont('Arial','B',13);
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities("Order");
$pdf->MultiCell(100, 4, $title, '' , 'R');
$pdf->SetFont('Arial','B',12);
$posy+=6;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'R');
$posy+=1;
$pdf->SetFont('Arial','',10);
$pdf->SetFont('Arial','B',13);
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$title=$outputlangs->transnoentities("Order");
$pdf->MultiCell(100, 4, $title, '' , 'R');
$pdf->SetFont('Arial','B',12);
$posy+=6;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'R');
$posy+=1;
$pdf->SetFont('Arial','',10);
$posy+=5;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dolibarr_print_date($object->date,"%d %b %Y"), '', 'R');
$posy+=5;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dolibarr_print_date($object->date,"%d %b %Y"), '', 'R');
if ($showadress)
{
// Emetteur
$posy=42;
$hautcadre=40;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marge_gauche,$posy-5);
$pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":");
if ($showadress)
{
// Emetteur
$posy=42;
$hautcadre=40;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marge_gauche,$posy-5);
$pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":");
$pdf->SetXY($this->marge_gauche,$posy);
$pdf->SetFillColor(230,230,230);
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
$pdf->SetXY($this->marge_gauche,$posy);
$pdf->SetFillColor(230,230,230);
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
$pdf->SetXY($this->marge_gauche+2,$posy+3);
// Nom emetteur
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',11);
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) $pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
else $pdf->MultiCell(80, 4, $this->emetteur->nom, 0, 'L');
$pdf->SetXY($this->marge_gauche+2,$posy+3);
// Caractéristiques emetteur
$carac_emetteur = '';
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE;
else {
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->adresse;
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->cp.' '.$this->emetteur->ville;
}
$carac_emetteur .= "\n";
// Tel
if (defined("FAC_PDF_TEL") && FAC_PDF_TEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".FAC_PDF_TEL;
elseif ($this->emetteur->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$this->emetteur->tel;
// Fax
if (defined("FAC_PDF_FAX") && FAC_PDF_FAX) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".FAC_PDF_FAX;
elseif ($this->emetteur->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$this->emetteur->fax;
// EMail
if (defined("FAC_PDF_MEL") && FAC_PDF_MEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".FAC_PDF_MEL;
elseif ($this->emetteur->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$this->emetteur->email;
// Web
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".FAC_PDF_WWW;
elseif ($this->emetteur->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$this->emetteur->url;
// Nom emetteur
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',11);
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) $pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
else $pdf->MultiCell(80, 4, $this->emetteur->nom, 0, 'L');
$pdf->SetFont('Arial','',9);
$pdf->SetXY($this->marge_gauche+2,$posy+8);
$pdf->MultiCell(80,4, $carac_emetteur);
// Caractéristiques emetteur
$carac_emetteur = '';
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE;
else {
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->adresse;
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->cp.' '.$this->emetteur->ville;
}
$carac_emetteur .= "\n";
// Tel
if (defined("FAC_PDF_TEL") && FAC_PDF_TEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".FAC_PDF_TEL;
elseif ($this->emetteur->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$this->emetteur->tel;
// Fax
if (defined("FAC_PDF_FAX") && FAC_PDF_FAX) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".FAC_PDF_FAX;
elseif ($this->emetteur->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$this->emetteur->fax;
// EMail
if (defined("FAC_PDF_MEL") && FAC_PDF_MEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".FAC_PDF_MEL;
elseif ($this->emetteur->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$this->emetteur->email;
// Web
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".FAC_PDF_WWW;
elseif ($this->emetteur->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$this->emetteur->url;
$pdf->SetFont('Arial','',9);
$pdf->SetXY($this->marge_gauche+2,$posy+8);
$pdf->MultiCell(80,4, $carac_emetteur);
// Client destinataire
$posy=42;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
$pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":");
$object->fetch_client();
// Cadre client destinataire
$pdf->rect(100, $posy, 100, $hautcadre);
// Nom client
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $object->client->nom, 0, 'L');
// Caractéristiques client
$carac_client=$object->client->adresse;
$carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n";
if ($this->emetteur->pays_code != $object->client->pays_code)
{
$carac_client.=$object->client->pays."\n";
}
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client);
}
}
// Client destinataire
$posy=42;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
$pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":");
$object->fetch_client();
// Cadre client destinataire
$pdf->rect(100, $posy, 100, $hautcadre);
// If CUSTOMER contact defined on invoice, we use it
$usecontact=false;
if ($conf->global->COMMANDE_USE_CUSTOMER_CONTACT_AS_RECIPIENT)
{
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
if (sizeof($arrayidcontact) > 0)
{
$usecontact=true;
$result=$object->fetch_contact($arrayidcontact[0]);
}
}
if ($usecontact)
{
// Nom societe
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $object->client->nom, 0, 'L');
$posy+=4;
// Nom client
$pdf->SetXY(102,$posy+4);
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(106,4, $object->contact->getFullName($outputlangs,1), 0, 'L');
// Caractéristiques client
$carac_client=$object->contact->adresse;
$carac_client.="\n".$object->contact->cp . " " . $object->contact->ville."\n";
if ($this->emetteur->pays_code != $object->contact->pays_code)
{
$carac_client.=$object->contact->pays."\n";
}
}
else
{
// Nom client
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $object->client->nom, 0, 'L');
// Nom du contact suivi commande si c'est une société
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
if (sizeof($arrayidcontact) > 0)
{
$object->fetch_contact($arrayidcontact[0]);
// On vérifie si c'est une société ou un particulier
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
{
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1);
}
}
// Caractéristiques client
$carac_client.="\n".$object->client->adresse;
$carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n";
if ($this->emetteur->pays_code != $object->client->pays_code) $carac_client.=$object->client->pays."\n";
}
// Numéro TVA intracom
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+6);
$pdf->MultiCell(86,4, $carac_client);
}
}
/*
* \brief Affiche le pied de page

View File

@ -1,23 +1,24 @@
<?php
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
* $Id$
*/
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
* $Id$
*/
/**
\file htdocs/includes/modules/facture/pdf_crabe.modules.php
@ -1032,10 +1033,6 @@ class pdf_crabe extends ModelePDFFactures
{
$carac_client.=$object->contact->pays."\n";
}
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client);
}
else
{
@ -1043,22 +1040,33 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $object->client->nom, 0, 'L');
// Nom du contact facturation si c'est une société
$arrayidcontact = $object->getIdContact('external','BILLING');
if (sizeof($arrayidcontact) > 0)
{
$object->fetch_contact($arrayidcontact[0]);
// On vérifie si c'est une société ou un particulier
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
{
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1);
}
}
// Caractéristiques client
$carac_client=$object->client->adresse;
$carac_client.="\n".$object->client->adresse;
$carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n";
if ($this->emetteur->pays_code != $object->client->pays_code)
{
$carac_client.=$object->client->pays."\n";
}
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client);
}
}
}
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+6);
$pdf->MultiCell(86,4, $carac_client);
}
}
/*
* \brief Affiche le pied de page

View File

@ -1,23 +1,24 @@
<?php
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
* $Id$
*/
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* or see http://www.gnu.org/
*
* $Id$
*/
/**
\file htdocs/includes/modules/propale/pdf_propale_azur.modules.php
@ -907,33 +908,40 @@ class pdf_propale_azur extends ModelePDFPropales
{
$carac_client.=$object->contact->pays."\n";
}
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client);
}
else
{
// Nom client
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $object->client->nom, 0, 'L');
$pdf->SetXY(102,$posy+3);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(106,4, $object->client->nom, 0, 'L');
// Nom du contact suivi propal si c'est une société
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
if (sizeof($arrayidcontact) > 0)
{
$object->fetch_contact($arrayidcontact[0]);
// On vérifie si c'est une société ou un particulier
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
{
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1);
}
}
// Caractéristiques client
$carac_client=$object->client->adresse;
$carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n";
if ($this->emetteur->pays_code != $object->client->pays_code)
{
$carac_client.=$object->client->pays."\n";
}
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client);
$carac_client.="\n".$object->client->adresse;
$carac_client.="\n".$object->client->cp . " " . $object->client->ville."\n";
if ($this->emetteur->pays_code != $object->client->pays_code)
{
$carac_client.=$object->client->pays."\n";
}
}
}
}
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
$pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+6);
$pdf->MultiCell(86,4, $carac_client);
}
}
/*
* \brief Affiche le pied de page

View File

@ -94,6 +94,8 @@ Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constant COMMANDE_SUPPLIER_ADDON not de
Error_COMMANDE_ADDON_NotDefined=Constant COMMANDE_ADDON not defined
Error_FailedToLoad_COMMANDE_SUPPLIER_ADDON_File=Failed to load module file '%s'
Error_FailedToLoad_COMMANDE_ADDON_File=Failed to load module file '%s'
UseCustomerContactAsOrderRecipientIfExist=Use customer contact address if defined instead of third party address as order recipient address
# Sources
OrderSource0=Commercial proposal
OrderSource1=Internet

View File

@ -74,7 +74,7 @@ SetDateLivraison=Set shipping date
CopyPropalFrom=Create commercial proposal by copying existing proposal
CreateEmptyPropal=Create empty commercial proposals vierge or from list of products/services
DefaultProposalDurationValidity=Default commercial proposal validity duration (in days)
UseCustomerContactAsPropalRecipientIfExist=Use customer contact adress if defined instead of third party address as proposal recipient address
UseCustomerContactAsPropalRecipientIfExist=Use customer contact address if defined instead of third party address as proposal recipient address
# azur PDF Model
PDFAzurDescription=A complete proposal model (logo...)

View File

@ -94,6 +94,8 @@ Error_COMMANDE_SUPPLIER_ADDON_NotDefined=Constante COMMANDE_SUPPLIER_ADDON non d
Error_COMMANDE_ADDON_NotDefined=Constante COMMANDE_ADDON non définie
Error_FailedToLoad_COMMANDE_SUPPLIER_ADDON_File=Echec chargement du fichier module '%s'
Error_FailedToLoad_COMMANDE_ADDON_File=Echec chargement du fichier module '%s'
UseCustomerContactAsOrderRecipientIfExist=Utiliser adresse contact suivi client si défini plutot que adresse tiers comme destinataire des commandes
# Sources
OrderSource0=Proposition commerciale
OrderSource1=Internet