Print Format Builder - Customizing Items Table (v5)

When using the Print Format Builder is there a way to customize how the Items Table prints out?

I have found the Edit Columns button/function, but that doesn’t do what I’m wanting to do. We have a specific format that we’re trying to get, rather than the information be in columns in the printout we want something like:

1st Assistant, 2 Hours @ $150.00 … $300.00
(description if required)
2nd Assistant, 3 Hours @ $100.00 … $300.00
3rd Assistant, 3 Hours @ $75.00 … $225.00

Where the subtotal for the line item is the only thing that is lined up on the column.

Build the table using Jinja {% for %}

You can loop over doc.items property to get

I have a similar issue and would like to use custom HTML in the table section in the Print Format Builder . Can you share some sample code of how this was acheived.

David,

Sadly, I never got there. I put it off because I don’t quite understand Jinja. If you figured it out, I’d love to know.

KMR

Rishan can you pls resend that last link again. We can’t open that link.

https://manual.erpnext.com/contents/customize-erpnext/print-format

Rishab, if you dont mind can you please send me the code to build table using jinja {% for %} to loop over doc.items property? it will be a great help to create Quotation format.

Hi @rmehta!

That link shows an error:

    Traceback (innermost last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 25, in render
    data = render_page_by_language(path)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 91, in render_page_by_language
    return render_page(path)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 113, in render_page
    return build(path)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 122, in build
    return build_method(path)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py", line 138, in build_page
    context = get_context(path)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py", line 31, in get_context
    context = build_context(context)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py", line 94, in build_context
    context.data = build_template(context)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/template.py", line 28, in build_template
    add_index(out, context)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/website/template.py", line 133, in add_index
    if next_item.name[0]!="/":
 TypeError: 'NoneType' object has no attribute '__getitem__'

Fixed.

1 Like