Call custom field to print format from Quotation Item

Hello everyone
My question is this:
It is possible that in the Quotation the item has a subheader above them, and later it is shown in print format?
I create a custom field in DOCTYPE Quotation Item and I need to call it to print format.
in my custom print format i have done this:

{% set c = frappe.get_doc("Quotation Item", doc.quotation_item) %}
 {{ c.sub-header or '' }}

It’s possible to do something like this?

Hi, I am not sure that you can use doc.quotation_item. Or could you please explain me where are going to take it?
In general, in the print format for receiving data about item loop and table are used

Thakns. i solved it with this code:

{%- if row.sub_encabezado -%}
   {{row.sub_encabezado or ''}}
{%- endif -%}

But i need something like this:

Put some items per block with it’s sub-total, and other other block with it’s items and sub-total, and later calculate net_total, and finally grand-total.

It’s possibly?

i really need help.

but how do you calculate net_total and grand-total in the normal view? I mean you can take this net_total and grand_total like
{{ doc.net_total }} {{ doc.grnad_total}} or not?

The image is from a format made in excel.

As you can see there are 2 blocks, the first has 4 items, the second has an item. The sub-total that is shown in the blue lines, are the sum of the items of each block. And until the end, sum net-total of all items.

Is it possible to do this in erpnext?

Thanks @SwitsolAG

Hi, yes I think it is possible but I cannot understand how you decide that these 4 items should be separated from other one. I’ve read about your custom field in the Quotation Item but I cannot understand how it works. Which data are you adding to this custom field?

That field is to create the subhead that is shown in white letters. As for the items being shown separately, it is Because the company wants it so.

I have tried to do something similar to the format you already have in the company.
Or is there a better way to do it?

and you can have several Subtotals in the item’s table? or just one?

That’s the idea, which has several sub-totals. One sub-totals per block. And to the end that calculates the net-total of the blocks. And finally the grand-Total

sorry but I don’t have any ideas how it can be calculated and I am afraid of that it is not possible

Thank you. I also assumed that it was not possible :grin: