Skip to content

Commit

Permalink
Merge pull request #2074 from marcosgdf/bug-1642
Browse files Browse the repository at this point in the history
Fixed [ bug #1642 ]: add a free line in contract
  • Loading branch information
eldy committed Nov 28, 2014
2 parents bca0ccb + 9f73277 commit 44b81ad
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
6 changes: 3 additions & 3 deletions htdocs/contrat/card.php
Expand Up @@ -536,10 +536,10 @@
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$model=$object->modelpdf;
if (empty($model)) { $tmp=getListOfModels($db, 'contract'); $keys=array_keys($tmp); $model=$keys[0]; }

$ret = $object->fetch($id); // Reload to get new records
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);

$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}

unset($_POST ['prod_entry_mode']);
Expand Down
24 changes: 18 additions & 6 deletions htdocs/core/modules/contract/doc/pdf_strato.modules.php
Expand Up @@ -53,6 +53,18 @@ class pdf_strato extends ModelePDFContract
var $marge_haute;
var $marge_basse;

/**
* Issuer
* @var Societe
*/
public $emetteur;

/**
* Recipient
* @var Societe
*/
public $recipient;

/**
* Constructor
*
Expand Down Expand Up @@ -581,17 +593,17 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
$result=$object->fetch_contact($arrayidcontact[0]);
}

$this->recipient = $object->client;

// Recipient name
if (! empty($usecontact))
{
if (! empty($usecontact)) {
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$this->recipient->name=$outputlangs->convToOutputCharset($socname);
$this->recipient->name = $outputlangs->convToOutputCharset($socname);
}
else
{
$this->recipient->name=$outputlangs->convToOutputCharset($object->client->name);
else {
$this->recipient->name = $outputlangs->convToOutputCharset($object->client->name);
}

$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
Expand Down

0 comments on commit 44b81ad

Please sign in to comment.