Jump to content

Invoice PDF shows <br/> tags in Notes after upgrade to 5.2.2 from 5.1.2


Recommended Posts

Thank you,

 

I've used notes in old (5.1.2) version many time, with no problems ever.

Now, I've tried using \n and it doesn't help, please see attached screenshots:

 

/https://www.evernote.com/shard/s131/sh/e4b2167a-b502-4538-a4d7-6c81c35425b3/bed0c4cce9d3a2fb57085976ec6bba00

Link to comment
Share on other sites

Same issue after upgrade to 5.2.2 from 5.1.2

 

This doesn't happen on quotes, only on invoices. I converted a quote - quote looks good, invoice full of <br /> tags in the notes.

 

Also tried the Portal and Default templates - same issue

Link to comment
Share on other sites

It is highly likely that you no longer need to use a html line break. IF this is in a text area (right click and view source of the input form) then pressing enter automatically uses a \n. You will notice this if you are adding api ip addresses it tells you to enter them 1 per line, that is because they are using the standard function of a text area to allow for ip address separation in the table.

 

This means anything pulled from a text area will have the lined already used. i have no reason to think that if its done there it will also be done else where, it takes less code to handle a \n than it does a <br>, also note. the use of <br /> is for XHTML where the requirement is to close all opened tags and instead you should be using <br> in your HTML templates.

 

While browsers cope with it, if you intend on validating your code you will find you need to replace each of them.

Link to comment
Share on other sites

Thank you, but there is no markup in the notes area. This is just the notes tab on an invoice, new lines are just made by clicking enter.

 

I first noticed it when I went to send a pdf copy of an invoice that was converted from a quote. The line items are fine (item & cost), its only under the total in the notes area where the <br /> tag is coming up at the end of each line.

 

Attached a screenshot

whmcs invoice.jpg

Link to comment
Share on other sites

Just use HTML in your PDF.

 

Use something like this:

if ($notes) 
{
$notes = '<table width="100%" height:"30"><tr>
		<td style="font-weight:bold;text-align:left;" width="15%">'.$_LANG["invoicesnotes"].':</td>
		<td style="font-weight:normal;text-align:left;" width="85%">'.$notes.'</td>
	</tr></table>';
$pdf->writeHTML($notes, true, false, false, false, '');
}

 

insted of something like this:

if ($notes) {
$pdf->SetFont('helvetica','',;
$pdf->MultiCell(170,5,$_LANG["invoicesnotes"].": $notes");
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated