Struggling with PDF templates

Hi everybody

i am struggling with the PDF templates creation. I have just prepared a template with the following code:

NetToHotel S.r.l. - GDS Made Easy
Sede legale Milano 20121 Piazza Repubblica, 9 – P.IVA e C.F 05355610964 REA Milano 1815839 CapSoc I.V. €10500,000 www.nettohotel.com info@nettohotel.com
T+39 2 36531715 F+39 2 99982222 nettohotel@pec.it

PROPOSTA CONTRATTUALE

Torino, {DATE d/m/Y}
Proposta n.$aos_quotes_number $aos_quotes_billing_account

Questa proposta commerciale è allegata all'Accordo Principale (Contratto) sottoscritto tra NETTOHOTEL Srl (Fornitore Servizi) e l'Hotel/Struttura Ricettiva indicato qui sotto (Cliente)

Hotel / Struttura:
$billing_account_name
Indirizzo:
$billing_account_shipping_address_street
Città:
$billing_account_shipping_address_city
Cap / Provincia:
$billing_account_shipping_address_postalcode $billing_account_shipping_address_state
Paese / St. / Cam:
$billing_account_shipping_address_country / / $billing_account_cam_c
Sito WEB:
$billing_account_website

$aos_line_item_groups_name
$aos_products_quotes_name
$aos_products_quotes_product_list_price
$aos_products_description

NOTE

Il firmatario dichiara di avere titolo per sottoscrivere il presente modulo d'ordine che fa riferimento al Contratto Base di cui è parte integrante. Le autorizzazioni al trattamento dati sono esplicitate ed autorizzate nel Contratto Base
NETTOHOTEL s.r.l.
Gianfranco Chiaretta
Direttore Commerciale
Data:

Timbro e firma

unfortunately it doesn’t work properly: when trying to print it the PDF skip the first section up to line

$billing_account_website

and then repeating the last section starting from

NOTE

Does anybody know what I am missing (messing!) here?

Regards

Hello
Which verion of SuiteCRM you are using?
From where you have generated the pdf?

Hi sagarjaydeep

I am using version 7.11.10 and I am trying to generate the PDF from a Quote

Thank you for your help!

It seems designing issue to parse it.
I copied and tried your design and it got failed,
Then I just removed the part

$aos_line_item_groups_name

$aos_products_quotes_name

$aos_products_quotes_product_list_price

$aos_products_description

and copied the template part that is in sample quote group sample of table format only and removed other variables from the table then it parses correctly.
Can you try to make a table instead of div for the product list?

I have just tried two different solutions with tables:

FIRST SOLUTION: 1 table containing all the data

<table>
<tbody>

<tr>
<td></td>
<td><small><strong>NetToHotel S.r.l. - GDS Made Easy</strong><br />Sede legale  Milano 20121 Piazza Repubblica, 9 – P.IVA e C.F 05355610964 REA Milano 1815839 CapSoc I.V. €10500,000 www.nettohotel.com info@nettohotel.com<br />T+39 2 36531715 F+39 2 99982222 nettohotel@pec.it</small></td>
</tr>

<tr>
<td colspan="2">PROPOSTA CONTRATTUALE</td>
</tr>

<tr>
<td>Torino, {DATE d/m/Y}</td>
<td>Proposta n.$aos_quotes_number $aos_quotes_billing_account</td>
</tr>

<tr>
<td colspan="2">Questa proposta commerciale è allegata all'Accordo Principale (Contratto) sottoscritto tra NETTOHOTEL Srl (Fornitore Servizi) e l'Hotel/Struttura Ricettiva indicato qui sotto (Cliente)</td>
</tr>

<tr>
<td>Hotel / Struttura: $billing_account_name</td>
<td>Ragione Sociale: [VARIABLE]</td>
</tr>
<tr>
<td>Indirizzo: $billing_account_shipping_address_street</td>
<td>Partita IVA: [VARIABLE]</td>
</tr>
<tr>
<td>Città: $billing_account_shipping_address_city</td>
<td>Contatto: [VARIABLE]</td>
</tr>
<tr>
<td>Cap / Provincia: $billing_account_shipping_address_postalcode $billing_account_shipping_address_state</td>
<td>Incarico: [VARIABLE]</td>
</tr>
<tr>
<td>Paese / St. / Cam: $billing_account_shipping_address_country / / $billing_account_cam_c</td>
<td>Numero: [VARIABLE]</td>
</tr>
<tr>
<td>Sito WEB: $billing_account_website</td>
<td>Email: [VARIABLE]</td>
</tr>
<tr>
<td>DESCRIZIONE PRODOTTO / SERVIZIO</td>
<td>LISTINO PREZZI iva esclusa</td>
</tr>

<tr>
<td>$aos_line_item_groups_name</td>
<td></td>
</tr>
<tr>
<td>$aos_products_quotes_name</td>
<td>$aos_products_quotes_product_list_price</td>
</tr>
<tr>
<td>$aos_products_description</td>
<td></td>
</tr>

<tr>
<td colspan="2">NOTE</td>
</tr>

<tr>
<td>Il firmatario dichiara di avere titolo per sottoscrivere il presente modulo d'ordine che fa riferimento al Contratto Base di cui è parte integrante.  Le autorizzazioni al trattamento dati sono esplicitate ed autorizzate nel Contratto Base</td>
<td>NETTOHOTEL s.r.l.<br />Gianfranco Chiaretta<br />Direttore Commerciale</td>
</tr>

<tr>
<td>Data:</td>
<td></td>
</tr>

<tr>
<td>Timbro e firma</td>
<td></td>
</tr>

</tbody>
</table>

SECOND SOLUTION: 3 tables (one for each section)

<table>
<tbody>

<tr>
<td></td>
<td><small><strong>NetToHotel S.r.l. - GDS Made Easy</strong><br />Sede legale  Milano 20121 Piazza Repubblica, 9 – P.IVA e C.F 05355610964 REA Milano 1815839 CapSoc I.V. €10500,000 www.nettohotel.com info@nettohotel.com<br />T+39 2 36531715 F+39 2 99982222 nettohotel@pec.it</small></td>
</tr>

<tr>
<td colspan="2">PROPOSTA CONTRATTUALE</td>
</tr>

<tr>
<td>Torino, {DATE d/m/Y}</td>
<td>Proposta n.$aos_quotes_number $aos_quotes_billing_account</td>
</tr>

<tr>
<td colspan="2">Questa proposta commerciale è allegata all'Accordo Principale (Contratto) sottoscritto tra NETTOHOTEL Srl (Fornitore Servizi) e l'Hotel/Struttura Ricettiva indicato qui sotto (Cliente)</td>
</tr>

<tr>
<td>Hotel / Struttura: $billing_account_name</td>
<td>Ragione Sociale: [VARIABLE]</td>
</tr>
<tr>
<td>Indirizzo: $billing_account_shipping_address_street</td>
<td>Partita IVA: [VARIABLE]</td>
</tr>
<tr>
<td>Città: $billing_account_shipping_address_city</td>
<td>Contatto: [VARIABLE]</td>
</tr>
<tr>
<td>Cap / Provincia: $billing_account_shipping_address_postalcode $billing_account_shipping_address_state</td>
<td>Incarico: [VARIABLE]</td>
</tr>
<tr>
<td>Paese / St. / Cam: $billing_account_shipping_address_country / / $billing_account_cam_c</td>
<td>Numero: [VARIABLE]</td>
</tr>
<tr>
<td>Sito WEB: $billing_account_website</td>
<td>Email: [VARIABLE]</td>
</tr>
<tr>
<td>DESCRIZIONE PRODOTTO / SERVIZIO</td>
<td>LISTINO PREZZI iva esclusa</td>
</tr>
</tbody>
</table>

<table>
<tbody>
<tr>
<td>$aos_line_item_groups_name</td>
<td></td>
</tr>
<tr>
<td>$aos_products_quotes_name</td>
<td>$aos_products_quotes_product_list_price</td>
</tr>
<tr>
<td>$aos_products_description</td>
<td></td>
</tr>
</tbody>
</table>

<table>
<tbody>
<tr>
<td colspan="2">NOTE</td>
</tr>

<tr>
<td>Il firmatario dichiara di avere titolo per sottoscrivere il presente modulo d'ordine che fa riferimento al Contratto Base di cui è parte integrante.  Le autorizzazioni al trattamento dati sono esplicitate ed autorizzate nel Contratto Base</td>
<td>NETTOHOTEL s.r.l.<br />Gianfranco Chiaretta<br />Direttore Commerciale</td>
</tr>

<tr>
<td>Data:</td>
<td></td>
</tr>

<tr>
<td>Timbro e firma</td>
<td></td>
</tr>

</tbody>
</table>

but is still not working :frowning:
FIRST SOLUTION: is repeating everything 2 times
SECOND SOLUTION: is removing the first section and repeating 2 times second and third section

No, what I mean was that only the repeated columns like Product group and other product related fields need to be in table fomat so it will parse multiple table accordingly.

Here is the HTML I used to generate the same issue based on your template

<div style="margin-top: 0px; color: #5c566a; font-family: Lato, sans-serif; font-size: 15px; font-style: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div>
<div><small style="font-size: .75rem;"><strong style="font-weight: bold;">NetToHotel S.r.l. - GDS Made Easy</strong><br />Sede legale Milano 20121 Piazza Repubblica, 9 – P.IVA e C.F 05355610964 REA Milano 1815839 CapSoc I.V. €10500,000 www.nettohotel.com info@nettohotel.com<br />T+39 2 36531715 F+39 2 99982222 nettohotel@pec.it</small></div>
</div>
<div>
<h2 style="margin: 30px 0px 10px; line-height: 1.2; font-size: 1.3195em;"><strong style="font-weight: bold;">PROPOSTA CONTRATTUALE</strong></h2>
</div>
<div>
<div>Torino, {DATE d/m/Y}</div>
<div>Proposta n.$aos_quotes_number $aos_quotes_billing_account</div>
</div>
<div>
<p>Questa proposta commerciale è allegata all'Accordo Principale (Contratto) sottoscritto tra NETTOHOTEL Srl (Fornitore Servizi) e l'Hotel/Struttura Ricettiva indicato qui sotto (Cliente)</p>
</div>
<div>
<div>
<div>Hotel / Struttura:</div>
<div><strong style="font-weight: bold;">$billing_account_name</strong></div>
</div>
</div>
<div>
<div>
<div>Indirizzo:</div>
<div>$billing_account_shipping_address_street</div>
</div>
</div>
<div>
<div>
<div>Città:</div>
<div>$billing_account_shipping_address_city</div>
</div>
</div>
<div>
<div>
<div>Cap / Provincia:</div>
<div>$billing_account_shipping_address_postalcode $billing_account_shipping_address_state</div>
</div>
</div>
<div>
<div>
<div>Paese / St. / Cam:</div>
<div>$billing_account_shipping_address_country / / $billing_account_cam_c</div>
</div>
</div>
<div>
<div>
<div>Sito WEB:</div>
<div>$billing_account_website</div>
<table style="width: 100%; border: 0pt none; border-spacing: 0pt;">
<tbody>
<tr>
<td style="border-style: solid; border-width: .5px; padding: 2px 6px; font-weight: bold; text-align: center;" colspan="8">$aos_line_item_groups_name</td>
</tr>
<tr>
<td style="border-style: solid; background-color: #b0c4de; border-width: .5px; padding: 2px 6px; font-weight: bold; text-align: center;">Product</td>
</tr>
<tr>
<td style="border-style: solid; border-width: .5px; padding: 2px 6px; text-align: center;">$aos_products_quotes_product_qty</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div style="color: #5c566a; font-family: Lato, sans-serif; font-size: 15px; font-style: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><hr style="height: 1px; margin: 1em 0px; border-width: 1px 0px 0px; border-top-style: dashed; border-top-color: #de6150; padding: 0px;" /></div>
<div style="color: #5c566a; font-family: Lato, sans-serif; font-size: 15px; font-style: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><hr style="height: 1px; margin: 1em 0px; border-width: 1px 0px 0px; border-top-style: dashed; border-top-color: #de6150; padding: 0px;" /></div>
<div style="margin-bottom: 0px; color: #5c566a; font-family: Lato, sans-serif; font-size: 15px; font-style: normal; font-weight: 400; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div>
<p>NOTE</p>
</div>
<div>
<div>Il firmatario dichiara di avere titolo per sottoscrivere il presente modulo d'ordine che fa riferimento al Contratto Base di cui è parte integrante. Le autorizzazioni al trattamento dati sono esplicitate ed autorizzate nel Contratto Base</div>
<div>NETTOHOTEL s.r.l.<br />Gianfranco Chiaretta<br />Direttore Commerciale</div>
</div>
<div>
<div>Data:</div>
</div>
<div>
<p>Timbro e firma</p>
</div>
</div>

oops sorry i got it wrong!

I have now tried with only the table for main section but I am still having trouble: the last section (from <p>NOTE</p>) is repeating 2 times

:sob:

Can you try the given example.? I believe that will solve your issue then after you just need to change your field name only
Or Can you share your current html from tinyMCE.?
I can try later

sure!

<div style="float: left; width: 100%;">
<div style="float: left; width: 100%;">
<div style="width: 50%; float: left; text-align: left;"></div>
<div style="width: 50%; float: left; text-align: right; font-size: 9px;"><small><strong>NetToHotel S.r.l. - GDS Made Easy</strong><br />Sede legale Milano 20121 Piazza Repubblica, 9 – P.IVA e C.F 05355610964 REA Milano 1815839 CapSoc I.V. €10500,000 www.nettohotel.com info@nettohotel.com<br />T+39 2 36531715 F+39 2 99982222 nettohotel@pec.it</small></div>
</div>
<div style="float: left; width: 100%;">
<h2 style="text-align: center;"><strong>PROPOSTA CONTRATTUALE</strong></h2>
</div>
<div style="float: left; width: 100%;">
<div style="width: 50%; float: left; text-align: left;">Torino, {DATE d/m/Y}</div>
<div style="width: 50%; float: left; text-align: right;">Proposta n.$aos_quotes_number $aos_quotes_billing_account</div>
</div>
<div style="float: left; width: 100%;">
<p>Questa proposta commerciale è allegata all'Accordo Principale (Contratto) sottoscritto tra NETTOHOTEL Srl (Fornitore Servizi) e l'Hotel/Struttura Ricettiva indicato qui sotto (Cliente)</p>
</div>
<div style="float: left; width: 100%;">
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Hotel / Struttura:</div>
<div style="float: left; width: 60%;"><strong style="text-transform: uppercase;">$billing_account_name</strong></div>
</div>
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Ragione Sociale:</div>
<div style="float: left; width: 60%;">[RAGIONE SOCIALE]</div>
</div>
</div>
<div style="float: left; width: 100%;">
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Indirizzo:</div>
<div style="float: left; width: 60%;">$billing_account_shipping_address_street</div>
</div>
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Partita IVA:</div>
<div style="float: left; width: 60%;">[P. IVA]</div>
</div>
</div>
<div style="float: left; width: 100%;">
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Città:</div>
<div style="float: left; width: 60%;">$billing_account_shipping_address_city</div>
</div>
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Contatto:</div>
<div style="float: left; width: 60%;">[CONTATTO]</div>
</div>
</div>
<div style="float: left; width: 100%;">
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Cap / Provincia:</div>
<div style="float: left; width: 60%;">$billing_account_shipping_address_postalcode $billing_account_shipping_address_state</div>
</div>
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Incarico:</div>
<div style="float: left; width: 60%;">[INCARICO]</div>
</div>
</div>
<div style="float: left; width: 100%;">
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Paese / St. / Cam:</div>
<div style="float: left; width: 60%;">$billing_account_shipping_address_country / / $billing_account_cam_c</div>
</div>
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Numero:</div>
<div style="float: left; width: 60%;">[NUMERO]</div>
</div>
</div>
<div style="float: left; width: 100%;">
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Sito WEB:</div>
<div style="float: left; width: 60%;">$billing_account_website</div>
</div>
<div style="float: left; width: 50%;">
<div style="float: left; width: 40%;">Email:</div>
<div style="float: left; width: 60%;">[EMAIL]</div>
</div>
</div>
<div style="float: left; width: 100%; margin-top: 30px;">
<div style="float: left; width: 100%;">
<div style="float: left; width: 50%;">DESCRIZIONE PRODOTTO / SERVIZIO</div>
<div style="float: left; width: 50%; text-align: right;">LISTINO PREZZI iva esclusa</div>
</div>
</div>
</div>
<div><hr /></div>
<table>
<tbody>
<tr>
<td>$aos_line_item_groups_name</td>
<td> </td>
</tr>
<tr>
<td>$aos_products_quotes_name</td>
<td>$aos_products_quotes_product_list_price</td>
</tr>
<tr>
<td>$aos_products_description</td>
<td> </td>
</tr>
</tbody>
</table>
<div><hr /></div>
<div style="float: left; width: 100%;">
<div style="float: left; width: 100%;">
<p>NOTE</p>
</div>
<div style="float: left; width: 100%;">
<div style="width: 80%; float: left; text-align: left;">Il firmatario dichiara di avere titolo per sottoscrivere il presente modulo d'ordine che fa riferimento al Contratto Base di cui è parte integrante. Le autorizzazioni al trattamento dati sono esplicitate ed autorizzate nel Contratto Base</div>
<div style="width: 20%; float: left; text-align: right;">NETTOHOTEL s.r.l.<br />Gianfranco Chiaretta<br />Direttore Commerciale</div>
</div>
<div style="float: left; width: 100%;">
<div style="width: 80%; float: left; text-align: left;">Data:</div>
</div>
<div style="float: left; width: 100%;">
<p>Timbro e firma</p>
</div>
</div>

thank you for the time you are spending helping me, really appreciate it!

Here I attached an image of the pdf that I have generated using your HTML

oh…i see…this is really odd, same code but different results…

now I am really lost…

Let me share the sql file of the template that i have created based on your template. Do execute in your database and try.

Please find attached zip Testtemplate.zip (1.7 KB)

loaded your sql template but the result is still the same…not working…

just to give you all the information, this is how I have created my Quote

as you can see I have 2 groups with one product line each

For testing purpose, can you try with single group for now. As i left for the day, i cannot try now

ok, I think that you have correctly address the issue: with a single group is working correctly!
…now I need to find out what is causing this groups related problem…