2
0
forked from Wavyzz/dolibarr

Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2021-10-05 13:39:46 +02:00
42 changed files with 210 additions and 170 deletions

View File

@@ -295,11 +295,14 @@ class doc_generic_contract_odt extends ModelePDFContract
// Recipient name
$contactobject = null;
if (!empty($usecontact)) {
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$socobject = $object->contact;
// We can use the company of contact instead of thirdparty company
if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
} else {
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use as recipient we store the contact object for later use
// if we have a CUSTOMER contact and we dont use it as thirdparty recipient we store the contact object for later use
$contactobject = $object->contact;
}
} else {

View File

@@ -720,7 +720,7 @@ class pdf_strato extends ModelePDFContract
$this->recipient = $object->thirdparty;
// Recipient name
if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->thirdparty;