Exactly what I’m looking for, but it seems I might be pasting the script in wrongly, basically, I pasted it in a new Custom HTML element within the print format. But its not working.
I can see you are using this Print Format on a Payment Entry, that Doctype doesn’t have a child table called “sales_invoice_item”, unless you have created the field, that might be the reason why you are getting a blank screen.
here is one example with one of the existing fields on that DocType, I will use the “references” table
Thank you @Lewinta. So that is exactly what I’m trying to achieve; pull the items table from the invoice. Not much relevant documentation on the topic yet.
This is all you need, check it out, you can print any child table if you understand the following code...
<table class="table table-bordered">
<tbody>
<tr>
<th>`HeadingField1`</th>
<th>`HeadingField2`</th>
</tr>
{%- for item in doc.`child_table`-%}
<tr>
<td> {{item.`field1`}}</td>
<td> {{item.`field2`}}</td>
</tr>
{%- endfor -%}
</tbody>
</table>
This helped me so much so thank you! What if we have about 20 invoices on one check? I’m looking for a way to have it continue the table to the right as I have only a few columns on my table. I have shrunk it down and can fit about 10 invoices on one table now but need to have it carry to the next area. Any help on that?
On payment entry doctype, I have address displaying. Now, I need it to display on print format for me. I got this:
{{ no such element: erpnext.accounts.doctype.payment_entry.payment_entry.PaymentEntry object[‘address_display’] }}