mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fixed [ bug #1642 ]: add a free line in contract
This commit is contained in:
@@ -536,10 +536,10 @@ else if ($action == 'addline' && $user->rights->contrat->creer)
|
||||
$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']);
|
||||
|
||||
@@ -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
|
||||
*
|
||||
@@ -581,17 +593,17 @@ class pdf_strato extends ModelePDFContract
|
||||
$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');
|
||||
|
||||
Reference in New Issue
Block a user