Issue of print pdf file (Could not change contact title behind contact name)

Hi

I thinks this is a issue for some country (like in taiwan or china ) that we put the contact name first and
then the tilte usually .
For example : Chou David Mr. or Chen annie Miss .
But when i export the proposal or order i could not export pdf (azur in proposal or einstein in order) as my example of contact name .
Are there anyone know how to fix it ?

Hey :grinning:

There is no option that permits this !!!

so you must modify the GetFullName function which is used for civility, firstname and lastname…
in the file core/class/commonobject.class.php, here is the original code for version 12.0.4

you must move lines 567 to 571 to obtain this :

Good continuation

Hi

That works , thanks a lot .
I have the other question is if i want a space ( blank ) between first name and title how do i do ?
Like Chen Andy Mr. not Chen AndyMr. .

Although this way works , but i think the developer still have a option of this issue .

Hello :grinning:

if you just do this update, I think this will work as you want

Good continuation

Hi

i have saw that , but i still not know how to do with that .
It seems same as before .
Would you please make it more clear ?

Hello :grinning:

you must reproduce exactly this,
original line 570 (red arrow) must be changed as line 573 (blue arrow) :

Good continuation

Hi

I have tried this , but i have done this step from your first reply .
It doesn’t work . Are there other suggestion ?

Hey

can you show the code you used, or give us more precision on what is the problem you have

Hi

My code is as below :
$ret = ‘’;

	$ret .= dolGetFirstLastname($firstname, $lastname , $nameorder);
	
	if ($option && $this->civility_code)
	{
		if ($langs->transnoentitiesnoconv("Civility".$this->civility_code) != "Civility".$this->civility_code) $ret .= $langs->transnoentitiesnoconv("Civility".$this->civility_code).' ';
		else $ret .=' ' . $this->civility_code;
	}

	return dol_trunc($ret, $maxlen);
}

But i still get =>> Lastname firstnamecivility =>>Chou morrisMr.
I need =>>Chou morris Mr. or Choumorris Mr. in chinese.

Your problem is about this code :

You must change with :
image

Good continuation

Hi

Yes , that’s work.

Thanks