- In the “standard” print settings, there is a Sales Order which has
- a block for Items(Table)
I have found that Jinja print formats offer better formatting control - probably since I don’t really know what I’m doing - I just mangle things until they work OK.
I created a jinja template for the items(Table) which contains something approx like this… (I now it’s not pretty but it works OK for my needs…)
{# Get the tax/VAT rate for THIS.document #}
{% set this_docs_vat_rate = frappe.db.get_value("Sales Taxes and Charges", {"parent": doc.name}, "rate") %}
{%- for row in doc.items -%}
<tr>
<td style="width: 3%;">{{ row.idx }}</td>
<td class="sm">
{{ row.item_code }}<br>
<span class="xs">{% if row.item_code != row.item_name -%} {{ row.item_name}} {%- endif %}</span>
</td>
<td class="rt xs" style="width: 10%;">{{ "%.2f"|format(row.rate) }}</td>
<td class="rt xs" style="width: 10%;">{{ "%.2f"|format(row.rate * (this_docs_vat_rate/100) )}}</td>
{# <br><small>@{{ (this_docs_vat_rate) }}%</small> #}
<td class="rt xs" style="width: 10%;">{{ "%.2f"|format(row.rate * (1+(this_docs_vat_rate/100)) ) }}</td>
<td class="cn sm" style="width: 8%;">{{ row.qty }}</td>
<td class="rt sm vb" style="width: 10%;">{{ "%.2f"|format(row.amount * (1) ) }}</td>
<td class="rt sm vb" style="width: 10%;">{{ "%.2f"|format(row.amount * (1+ (this_docs_vat_rate/100)) ) }}</td>
</tr>
{%- endfor -%}
-
In the standard prints, the Sales Order print format also has
- a block for Pricing Rules Detail (Table)
- Pricing Rule
- Item Code
- Margin Type
- Rate or Discount
- Rule Applied
- a block for Pricing Rules Detail (Table)
-
Can anyone assist with the equivalent jinja block
- with relevant Pricing Rule outer block/loop & inner block field names
- ie. doc.items → xxx.yyy
- to create the same table using Jinja print format?
- with relevant Pricing Rule outer block/loop & inner block field names