Removing repetitive po_number and po_date

I have finally able to link Sales Invoice Items table with Referred Sales Order and Delivery Note.
From Standart Invoice Format Sales Items appears as below.

After digging more, i create following custom formatting codes to view Delivery Note and Sales Order details in seperate table on The Same Sales Invoice ;

At Each Item on the Sales Invoice i see po_no , po_date ,shipment delivery note date . There can be more then one item on same order and delivery note. As a result repeating po_no and delivery_date seen on the main table.

Is there a simple way to filter out the same table filed content on Jinja? Simply comparing the field with following row item and unprinting if it is the same.

So far i search Jinja forms but could fine any approriate solution.

Please help me to solve my issue if anybody has experienced the same problem.

@molcar, dont have a simple solution to do this!

I finally figured out how to make it: With this way you don’t need to populate new custom script or alter main code… Not that hard :smile:

    {%- for row in doc.items -%}

    {%- if row.po_no is none -%}

    {% else %}
    {%- if row.po_no != rrr1 -%}
     <big>{{ row.po_no or '' }}  </big><p></td>
    {%- if row.po_date -%}
     <td> <big>{{ row.get_formatted("po_date" or '')}}</big> <p></td>
    {%- endif -%}

    {% set rrr1 = (row.po_no) %}

    {%- endif -%}
    {%- endif -%}
    {%- endfor -%}