Supplier Address in Print Format

Dear All,

in supplier doctype when i try to print, there is no address how ever i have created address and contact but these are not displayed in print format.

Any one can help.

Hi,

Report this issue on GitHub

Also, you can create new Print Format. Check

Best,
Prakash

Hello @gsbaig,

You can customised standard.html file. Please refer the below code.

{%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}
{% if doc.doctype == ‘Sales Invoice’ %}
{% if letter_head and not no_letterhead %}

{{ letter_head }}

{% endif %}
{%- if doc.meta.is_submittable and doc.docstatus==0-%}

{{ _(“DRAFT”) }}


{%- endif -%}
{%- if doc.meta.is_submittable and doc.docstatus==2-%}

{{ _(“CANCELLED”) }}


{%- endif -%}
{% if max_pages > 1 %}

{{ _(“Page #{0} of {1}”).format(page_num, max_pages) }}


{% endif %}
{% endif %}
{%- endmacro -%}

{% if doc.doctype == ‘Sales Invoice’ %}

.table{ border: 2px solid black; color:#000000; font-size:16px; } .tr{ border: 2px solid black; } .print-format table, .print-format tr, .print-format td, .print-format div, .print-format p { font-family: sans-serif; font-size: 15px; line-height: 90%; vertical-align: middle; } @media screen { .print-format { width: 210mm; padding: 10mm; min-height: 297mm; footer {page-break-after: always;} } } {{ add_header(0,1,doc,letter_head, no_letterhead) }} {% if doc.company_address %} {% set cc = frappe.get_doc("Address", doc.company_address) %}

{{ cc.address_title }}

{{ cc.address_line1 }}

                 <p style="font-size:12px;"> {{ cc.address_line2 }}</p>
                  Phone : {{ cc.phone }}, Email : {{ cc.email_id }} <br><br>
                  CIN No.: {{ doc.name }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GST No.: {{ cc.gstin }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; State Code: {{ cc.gst_state_number }}
</td> 
{% endif %}
{{ _("Party name.") }}:  {{ doc.customer }}
{{ _("Invoice No.") }}:{{ doc.name }}
{{ _("Ship To") }}::  
{{ doc.address_display }}
{{ _("Date") }}:  {{ doc.posting_date }}
{{ _("GST No.") }}:   {{ doc.billing_address_gstin }}
{{ _("Contact Person") }}:   {{ doc.contact_person }}
{% if doc.customer_address %} {% set cc = frappe.get_doc("Address", doc.customer_address) %} {{ _("State Code") }}:   {{ cc.gst_state_number }}
{% endif %}
{% if doc.customer_address %} {% set cc = frappe.get_doc("Address", doc.customer_address) %} {{ _("Contact No.") }}:   {{ cc.phone }}
{% endif %}
{{ _("PAN.") }}:
{{ _("L R No.") }}:

{{ _("Shipped From") }}:
{{ doc.place_of_supply }}
{%- for row in doc.items -%}
    </tr> 
    {%- endfor -%} 
</tbody> 
Sr Description Qty UOM Desc % Net Rate Amount
{{ row.idx }} {{ row.description }} {{ row.qty }} {{ row.uom }} {{ row.discount_percentage }} {{ row.rate }} {{ row.amount }}
{% for t in doc.payment_schedule %} {% if t.payment_term %} {% set acc = frappe.get_doc("Payment Term", t.payment_term) %} {{ _("Pay Terms") }}:   {{ acc.payment_term_name }}
{{ _("Credit Days") }}:   {{ acc.credit_days }}
{{ _("Currency") }}:   {{ doc.currency }}
{{ _("In Words") }}:   {{ doc.in_words }}

     <b>{{ _("Terms") }}:&nbsp;&nbsp;</b> {{ doc.terms }}<br> 
    {% endif %}
    {% endfor %}
</td> 
<td style="width: 50%;text-align:right;"> 
    <b>{{ _("Sub Total") }}:&nbsp;&nbsp;</b> {{ doc.net_total }}<br> 
</td> 

{% for d in doc.taxes %} {% if d.account_head %} {% set acc = frappe.get_doc("Account", d.account_head) %} {{ acc.account_name }} {{ d.tax_amount }}
{% endif %} {% endfor %}

{{ _("Grand Total") }}: {{ doc.grand_total }}
{{ _("Remarks
PO NO:4032830825
PO DT:19.02.2018
TOTAL CRTNS-") }}:

{{ _("E & O.E
For PEGASUS TOY-KRAFT PRIVATE LIMITED
( AUTHORISED SIGNATORY )") }}:

{% else %}

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

{% for page in layout %}
<div class="page-break">
    <div {% if print_settings.repeat_header_footer %} id="header-html" class="hidden-pdf" {% endif %}>
        {{ add_header(loop.index, layout|len, doc, letter_head, no_letterhead, footer, print_settings) }}
    </div>

    {% if print_settings.repeat_header_footer %}
    <div id="footer-html" class="visible-pdf">
        {% if not no_letterhead and footer %}
        <div class="letter-head-footer">
            {{ footer }}
        </div>
        {% endif %}
        <p class="text-center small page-number visible-pdf">
            {{ _("Page {0} of {1}").format('<span class="page"></span>', '<span class="topage"></span>') }}
        </p>
    </div>
    {% endif %}

    {% for section in page %}
    <div class="row section-break">
        {%- if doc._line_breaks and loop.index != 1 -%}<hr>{%- endif -%}
        {%- if doc._show_section_headings and section.label and section.has_data -%}
        <h4 class='col-sm-12'>{{ _(section.label) }}</h4>
        {%- endif -%}
        {% for column in section.columns %}
            <div class="col-xs-{{ (12 / section.columns|len)|int }} column-break">
            {% for df in column.fields %}
                {{ render_field(df, doc) }}
            {% endfor %}
            </div>
        {% endfor %}
    </div>
    {% endfor %}
</div>
{% endfor %}

{% endif %}

Please see output for above code.

Thanks.

1 Like