Browse Source

Merge branch 'mmidocuments-pdf-billing-contact-only' into 16.0-mmi

Mathieu Moulin 1 year ago
parent
commit
de993b4e08
1 changed files with 3 additions and 3 deletions
  1. 3 3
      htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php

+ 3 - 3
htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php

@@ -1742,13 +1742,13 @@ class pdf_eratosthene extends ModelePDFCommandes
 				}
 
 				// Recipient name
-				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)))) {
+				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;
 				}
 
-				$carac_client_name = $recipient_type != 'MGMT' ?pdfBuildThirdpartyName($thirdparty, $outputlangs) :'';
+				$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
 
 				$mode =  'target';
 				$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, $mode, $object);
@@ -1797,7 +1797,7 @@ class pdf_eratosthene extends ModelePDFCommandes
 				}
 
 				// Recipient name
-				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)))) {
+				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;