Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}
- {% if letter_head and not no_letterhead %}
- <div class="letter-head">{{ letter_head }}</div>
- {% endif %}
- {%- if doc.meta.is_submittable and doc.docstatus==0-%}
- <div class="alert alert-info text-center">
- <h4 style="margin: 0px;">{{ _("DRAFT") }}</h4></div>
- {%- endif -%}
- {%- if doc.meta.is_submittable and doc.docstatus==2-%}
- <div class="alert alert-danger text-center">
- <h4 style="margin: 0px;">{{ _("CANCELLED") }}</h4></div>
- {%- endif -%}
- {% if max_pages > 1 %}
- <p class="text-right">{{ _("Page #{0} of {1}").format(page_num, max_pages) }}</p>
- {% endif %}
- {%- endmacro -%}
- <style>
- .table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {
- background-color: #B7CCF2;
- color:#000000;
- font-size:16px;
- }
- .print-format table, .print-format tr,
- .print-format td, .print-format div, .print-format p {
- font-family: sans-serif;
- line-height: 90%;
- vertical-align: middle;
- }
- @media screen {
- .print-format {
- width: 210mm;
- padding: 10mm;
- min-height: 297mm;
- footer {page-break-after: always;}
- }
- }
- </style>
- <small>
- {{ add_header(0,1,doc,letter_head, no_letterhead) }}
- <table class="table table-condensed table-bordered">
- <tr>
- <td colspan="2">
- <b style="font-size:16px;">{{ doc.select_print_heading or (doc.print_heading if doc.print_heading != None
- else _(doc.doctype)) }}</b>
- </td>
- <td style="width:34%">
- <b style="font-size:16px; text-align:left; vertical-align:middle;">{{ _("#") }}{{ doc.name }}</b><br>
- </td>
- </tr>
- </table>
- <table class = "table table-condensed table-bordered">
- <tr>
- <td style="width: 33%;">
- <b>{{ _("To") }}:</b> {{ doc.customer_name }}<br>
- <b>{{ _("Address") }}:</b> {{ doc.address_display }}
- </td>
- <td style="width: 33%;">
- <b>{{ _("Ship To") }}:</b> {{ doc.shipping_address_name}}<br>
- <b>{{ _("Address") }}:</b> {{ doc.shipping_address }}
- </td>
- <td style="width: 34%;">
- <b>{{ _("Date") }}:</b> {{ doc.get_formatted("transaction_date") }}<br>
- <b>{{ _("PO #") }}:</b> {{ doc.po_no }} <br>
- <b>{{ _("PO Date") }}:</b> {{ doc.get_formatted("po_date") }}<small><br>
- </small>
- <b>{{ _("Buyer VAT") }}:</b> {{ doc.get_formatted("vat_tin") }}<small><br>
- </small>
- <b>{{ _("Buyer CST") }}:</b> {{ doc.get_formatted("cst_tin") }}
- </td>
- </tr>
- </table>
- <table class="table table-condensed table-hover table-bordered">
- <tr>
- <th>Sr</th>
- <th>Description</th>
- <th class="text-right">Qty</th>
- <th class="text-right">Rate</th>
- <th class="text-right">Amount</th>
- </tr>
- {%- for row in doc.entries -%}
- <tr>
- <td style="width: 3%;">{{ row.idx }}</td>
- <td style="width: 57%;">{{ row.description }}</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 -%}
- </tbody>
- </table>
- <table class="table table-condensed table-bordered" width="1247">
- <tr>
- <td width="808">
- <small>
- </small> </td>
- <td width="429">
- <table class="table table-condensed">
- <tr>
- <td class="text-right" style="width: 30%">
- {{ _("Net Total") }}
- </td>
- <td class="text-right">
- {{ doc.get_formatted("net_total_export") }}
- </td>
- </tr>
- {%- for row in doc.other_charges -%}
- {%- if not row.included_in_print_rate -%}
- <tr height:100%>
- <td class="text-right" style="width: 70%">
- {{ row.description }}
- </td>
- <td class="text-right">
- {{ row.get_formatted("tax_amount", doc) }}
- </td>
- </tr>
- {%- endif -%}
- {%- endfor -%}
- {%- if doc.discount_amount -%}
- <tr>
- <td class="text-right" style="width: 70%">
- {{ _("Discount") }}
- </td>
- <td class="text-right">
- {{ doc.get_formatted("discount_amount") }}
- </td>
- </tr>
- {%- endif -%}
- <tr>
- <td class="text-right" style="width: 70%">
- <big><b>{{ _("Grand Total") }}</b></big>
- </td>
- <td class="text-right">
- <big><b>{{ doc.get_formatted("rounded_total") }}</b></big>
- </td>
- </tr>
- </td>
- <tr>
- <td class="text-right" style="width: 70%" colspan="2">
- <p dir="ltr">
- <small>
- {% if doc.in_words_export %}
- <b>{{ _("Total Amount (In Words)") }}: </b><br>
- {{ doc.in_words_export }}
- {%- endif -%}
- </small>
- </p>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </small>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement