Change Public Note Position in Proposal

Hi team,

I need to change the Public Note position from top to bottom in pdf file. (Please see the atachment)

Any suggest?

Thanks in advance

Hi Richardmax,
You can try adding free text which can be configured from:
Home–>Setup–>Modules–>Proposals–> Setup
Look for free text.
Assuming this text is the same in all proposals then it will work.

Hi

Text is not the same. Goal is diferent message by customer. Then must be public note but i get it now with new pdf_my.modules.php

1- Move Note code to new position at line 674.
2- Move Customer signature area to line 718 behind Notes. just before FOOTER

I have another challenge now: With long text public note must insert a page break for show note a customer siganture at top of next page:

1- I used the this function to get height of note content

$heightfornote=pdfGetHeightForHtmlContent($pdf, dol_htmlentitiesbr($notetoshow));
2- Maybe use folowing vars to know the rest space to bottom:

$this->page_largeur-$this->marge_gauche-$this->marge_droite
3- Do the page break and show public note

How?

Any suggestions on how to do it?

I get it now! :woohoo:

Page break if height of Public Note is higher than space for content. Include footer output before page break.

Customer signature area are moved also if you have enabled it

Thanks you very much!!

2 Likes

Hi Richardmax,

I am having issue of overlapping public note with product table.

I am not able to print product table on second page, I am giving page break in note(public) as only the content to show on first page.

Please find attached my code.

Please help if you can.

Regards
Ripal Shah

pdf_pmlogic.modules.txt (61.5 KB)

Hi,

to insert a page break only, you need somethink like:

$pdf->AddPage('','',true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $pdf->setPage($pageposbefore+1); $curY = $tab_top_newpage;
But in that position the remaining content will jump to the next page also.

You must copy the “Affiche Note” section to new position behind “Affiche zone infos” and add some condition for non duplicate the note on print. I did it like that:

1- Set a new parameter at Home -> Setup -> Other :

Value: 0 or 1
Comment: Public Note position 0 for above or 1 for below product list box position

2- Use MAIN_PDF_PUBLICNOTE_POSITION as condition for both Public Note code block:

LINE 246

if (! isset($conf->global->MAIN_PDF_PUBLICNOTE_POSITION) || empty($conf->global->MAIN_PDF_PUBLICNOTE_POSITION))
{
   $note_position = 0;
}
else 
{
   $note_position = $conf->global->MAIN_PDF_PUBLICNOTE_POSITION;
}

if ($note_position = 0)
{
   if (! empty($object->note_public))
   {
             ...... // Rest of Public Note code
   }
}

LINE xxx (second block)

if ($note_position =1)
{
   if (! empty($object->note_public))
   {
             ......
             
             // Add page break
             
             $tab_top = 90;
	     $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
	     $tab_height = 130;
	     $tab_height_newpage = 150;
						
	     $this->_pagefoot($pdf,$object,$outputlangs,1);
						
	     $pdf->AddPage('','',true);
	     $pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
												
	      if (! empty($tplidx)) $pdf->useTemplate($tplidx);
	      if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
						
	      $pdf->setPage($pageposbefore+1);
         
            ..........

            // Rest of Public Note code

   }
}

The code above only force a page break when note is set below product box list. Howerver I added more code to condition page break to height of the content note result, regarding the space remaining to bottom margin but function pdfGetHeightForHtmlContent($pdf, dol_htmlentitiesbr($notetoshow)) did not give me a reliable value to use in for a while.

I hope this help you a lot

4 Likes

Hi Richard,

How did you move Public note on Invoice? I try your suggest but it doesn’t work on Invoice, some error show.

Please, Check this answer: #31090

Topic moved to the Tips and Tricks category

Hi,
Can you please advise where is your answer #31090? If you can share the link? As I dont know how to go to that or search that.
Thanks.

follow this link:https://www.dolibarr.org/forum/t/change-public-note-position-in-proposal/15938/6

Good evening, can you tell me how to correct the position of the public note below the table. Thank you