Company name overwrites address text

I hope it will be better if the developers fix these two problems in version 3.2 as an update, because too much people without programming knowledge are using Dolibarr. I tried too much to apply the solutions mentioned here but was not successful.

I have used the same code I posted here to fix this problem. It is a work arround. Better would be to work out why the dol_nboflines_bis() not work.

Thanks for your effort to help solving this problem, but i have no knowledge about php programming. Therefore i dont know what to do with the codes you have written. Should i add this code into some place in azur.modules.php?

Yes, the code should be added where you see the line I showed in the previous posts. it is in doc directory in 3.2.0 and in file pdf_azur.module.php or something like that.

It is on the end of the _pagehead() function or near the end of it.

Here is the code:

			// Show recipient information
			$pdf->SetFont('','', $default_font_size - 1);
			//$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
			// Check if the company name is longer than 35 char. If yes, set the address pos to start lower.
			if ( strlen ($carac_client_name) > 35 ) {
				$pdf->SetXY($posx+2,$posy+12);
			} 
			else
			{
				$pdf->SetXY($posx+2,$posy+8);
			}

			$pdf->MultiCell(100,4, $carac_client, 0, 'L');
		}
	}

It starts on line 1074 in htdocs/core/modules/propale/doc/pdf_azur.modules.php

Hope it helps.

Many thanks saxa,
I applied the codes as you mentioned and it worked for the recepient adress. The same fault exist also for the sender and I think we can use some codes like you sent for the sender.

I think so. You are welcome.

Hi saxa,

Please see below the snapshot of the output of pdf_azur.modules. The sender (customer area is ok) name overwrites the sender address. I tried too much to solve it but no success. Please give some more help for this bug. I am sorry for annoying you too much.

Thanks in advance.

I do not see your snapshot. But you can safely use the same code slightly modified for the sender too. It is a bit before the customer part.

His saxa,
I changed the line 1027 of the file pdf_azur.modules (in C:\dolibarr\www\dolibarr\htdocs\core\modules\propale\doc) as below:

$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_emetteur,50)*4));

and the overwriting stopped.

Good to hear that.

Hi it seems that this bug still persists in my 3.2.1 install. Anybody can confirm that ?

Can you reproduce pb in demo.dolibarr.org ?

It seems that demo is creating ok the company name. Although I get some other error, not relevant now.

But my version is 3.2.1 and does overwrite the address.

Ok I figured out why it does not work.

The function dol_nboflines_bis is located in core/lib/functions.lib.php but in the file modules/propale/doc/pdf_azur.modules.php it is not included.
The pdf_azur.modules.php includes the file functions2.lib.php which has not the required function in it.

This is the reason why it can not work.

Sollution is to add the following line to pdf_azur.modules.php file at the beginning:

require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';

Ok this solution is not the one which works at least for me not. It seems that
on the old contacts I have I get the name of the contact overwritten, but on new companies the company name does not overwrite the address.

It seems now the company name overwrites the contacts name. This is in 3.2.2

I still haveing this problem. Anybody can confirm this in 3.2.2 ?

I’m still getting the overwrite of the persons contact name with the company name. This is in 3.3.1. See attached screenshot.

overwrite.png

overwrite.png

This issue is not solved also in 3.3.2
I don’t understand why it is not being solved by the developers. If the developers decide to solve this issue please also add the codes for the state to be displayed on the address.