Re: [erpnext-user-forum] Letterhead (issue?) with new template engine

245 views
Skip to first unread message

Anand Doshi

unread,
Aug 30, 2014, 4:32:02 AM8/30/14
to ERPNext User's Forum
Hi Federico,

I suppose you will need to add this in the code:

{%- from "templates/print_formats/standard_macros.html" import add_header -%}

<div class="page-break">
    {{ add_header(0, 1, doc, letter_head, no_letterhead) }}
   
    {# rest of your print format #}
</div>


You can have a look at how standard.html is written to get more ideas on how the whole thing works.

-Anand.


On Sat, Aug 30, 2014 at 6:45 AM, Federico Torreti <torr...@gmail.com> wrote:
Folks - Loving the possibility to use CSS bootstrap for the new template engine, great addition!

As I am translating my templates, I am having an issue as in the company letterhead does not display in the new template engines, despite the "letterhead tick box" is marked. In the old templates the letterhead shows without any problems and it disappears when the tick is removed.

I am sure I am missing something obvious here, any suggestions on what I am doing wrong?

Thanks,
Fede
  


--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/0a18b012-1de9-4c70-bade-ff4b4802d178%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Federico Torreti

unread,
Aug 30, 2014, 5:34:34 AM8/30/14
to erpnext-u...@googlegroups.com
This is what I needed.

How do I access the standard template in the hosted environment?
Before it was very easy and straightforward but now the new standard templates seem not to be there?


On Saturday, 30 August 2014 16:32:02 UTC+8, Anand Doshi wrote:
Hi Federico,

I suppose you will need to add this in the code:

{%- from "templates/print_formats/standard_macros.html" import add_header -%}

<div class="page-break">
    {{ add_header(0, 1, doc, letter_head, no_letterhead) }}
   
    {# rest of your print format #}
</div>


You can have a look at how standard.html is written to get more ideas on how the whole thing works.

-Anand.
On Sat, Aug 30, 2014 at 6:45 AM, Federico Torreti <torr...@gmail.com> wrote:
Folks - Loving the possibility to use CSS bootstrap for the new template engine, great addition!

As I am translating my templates, I am having an issue as in the company letterhead does not display in the new template engines, despite the "letterhead tick box" is marked. In the old templates the letterhead shows without any problems and it disappears when the tick is removed.

I am sure I am missing something obvious here, any suggestions on what I am doing wrong?

Thanks,
Fede
  


--
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+unsub...@googlegroups.com.

Federico Torreti

unread,
Aug 30, 2014, 5:59:07 AM8/30/14
to erpnext-u...@googlegroups.com
Additionally - Any ideas why the following does not print any of the items in a quotation:

{%- for row in doc.entries -%}
        <tr>
            <td style="width: 3%;">{{ row.idx }}</td>
            <td style="width: 20%;">
                {{ row.item_name }}
                {% if row.item_code != row.item_name -%}
                <br>Item Code: {{ row.item_code}}
                {%- endif %}
            </td>
            <td style="width: 37%;">
                <div style="border: 0px;">{{ row.description }}</div></td>
            <td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
            <td style="width: 15%; text-align: right;">{{
                row.get_formatted("rate", doc) }}</td>
            <td style="width: 15%; text-align: right;">{{
                row.get_formatted("amount", doc) }}</td>
        </tr>
        {%- endfor -%}


Anand Doshi

unread,
Sep 1, 2014, 1:02:53 AM9/1/14
to ERPNext User's Forum
Standard.html is complicated and not an obvious candidate of an example for most simple use cases, since it uses a lot of pre-processing.


For your 2nd question, try using:

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

since the fieldname of "Quotation Item" Table field is "quotation_details". You can find this out from Setup > Customize > Customize Form and selecting Quotation. Maybe, we can standardize this.

You can also use:

{%- for row in doc.get(doc.fname) -%}
We store the Item Table's fieldname in doc.fname, so this should work for most erpnext transactions where both item table and tax table exists in the same form.

-Anand.


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-fo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/74ed809c-7b83-4fa2-8754-2d2f8967e57a%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages