Skip to content

Commit

Permalink
War bug
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 7, 2012
1 parent 317abb4 commit 6d2a3ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
13 changes: 6 additions & 7 deletions htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> /* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -31,8 +31,7 @@




/** /**
* \class pdf_canelle * Class to generate the supplier invoices with the canelle model
* \brief Class to generate the supplier invoices with the canelle model
*/ */
class pdf_canelle extends ModelePDFSuppliersInvoices class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
Expand Down Expand Up @@ -882,7 +881,7 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)


// If BILLING contact defined on invoice, we use it // If BILLING contact defined on invoice, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING'); $arrayidcontact=$object->getIdContact('internal','BILLING');
if (count($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
Expand All @@ -894,15 +893,15 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $mysoc->nom;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($mysoc->nom);
} }


$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); $carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,$object->contact,$usecontact,'target');


// Show recipient // Show recipient
$posy=42; $posy=42;
Expand Down
Expand Up @@ -954,7 +954,7 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)


// If BILLING contact defined on invoice, we use it // If BILLING contact defined on invoice, we use it
$usecontact=false; $usecontact=false;
$arrayidcontact=$object->getIdContact('external','BILLING'); $arrayidcontact=$object->getIdContact('internal','BILLING');
if (count($arrayidcontact) > 0) if (count($arrayidcontact) > 0)
{ {
$usecontact=true; $usecontact=true;
Expand All @@ -966,15 +966,15 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{ {
// On peut utiliser le nom de la societe du contact // On peut utiliser le nom de la societe du contact
if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname;
else $socname = $object->client->nom; else $socname = $mysoc->nom;
$carac_client_name=$outputlangs->convToOutputCharset($socname); $carac_client_name=$outputlangs->convToOutputCharset($socname);
} }
else else
{ {
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); $carac_client_name=$outputlangs->convToOutputCharset($mysoc->nom);
} }


$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); $carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,$object->contact,$usecontact,'target');


// Show recipient // Show recipient
$posy=42; $posy=42;
Expand Down

0 comments on commit 6d2a3ed

Please sign in to comment.