Dear @lasalesi
i try your suggestion but not working fine please find my code below
<!-- positions -->
<p></p>
<table style="width: 100%; float: left;" border="1">
<tr>
<th style="width: 30%;">Product</th>
<th style="width: 20%;">Module</th>
<th style="width: 20%;">QTY</th>
<th style="width: 20%;">VIS.</th>
<th style="width: 10%;">Brand</th>
</tr>
<!-- prepare groups -->
{% set group_total = {} %}
{% for n in doc.items %}
{% if group_total[n.item_group] is defined %}
{% if group_total.update({n.item_group: group_total[n.item_group] + n.amount}) %}{% endif %}
{% else %}
{% if group_total.update({n.item_group: n.amount}) %}{% endif %}
{% endif %}
{% endfor %}
{% for key, value in group_total.iteritems() %}
{% for n in doc.items %}
<!-- add group items -->
{% if n.item_group == key %}
<tr>
<td>{{ n.item_name}}</td>
<td>{{ n.get_formatted('item_group') }}</td>
<td>{{ n.qty }} {{ n.stock_uom }}</td>
<td><img src="{{ n.image }}" style="width: 60%"></td>
<td>{{ n.brand }}</td>
</tr>
</table>
<div class="page-break"></div>
{% endif %}
{% endfor %}
<!-- total per group -->
<tr>
<td>Total</td>
<td>{{ key }}</td>
<td></td>
<td></td>
<td>{{ value }}</td>
</tr>
{% endfor %}
</table>
<!-- summary and taxes -->
<p></p>
<table style="width: 100%; ">
<tr>
<td style="width: 60%;"></td>
<td style="width: 20%;">
Net Total<br />
{% for t in doc.taxes %}
{{ t.description }}<br />
{% endfor %}
{% if doc.discount_amount != 0 %}
Rabatt<br />
{% endif %}
<strong>Grand Total</strong>
</td>
<td style="width: 20%;">
{{ doc.get_formatted('total') }}<br />
{% for t in doc.taxes %}
{{ t.get_formatted('tax_amount') }}<br />
{% endfor %}
{% if doc.discount_amount != 0 %}
-{{ doc.get_formatted('discount_amount') }}<br />
{% endif %}
<strong>{{ doc.get_formatted('base_grand_total') }}</strong>
</td>
</tr>
</table>