Advertisement
Guest User

Print Format ERPNEXT

a guest
Jan 15th, 2015
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.22 KB | None | 0 0
  1. {%- macro add_header(page_num, max_pages, doc, letter_head, no_letterhead) -%}
  2. {% if letter_head and not no_letterhead %}
  3. <div class="letter-head">{{ letter_head }}</div>
  4. {% endif %}
  5. {%- if doc.meta.is_submittable and doc.docstatus==0-%}
  6. <div class="alert alert-info text-center">
  7. <h4 style="margin: 0px;">{{ _("DRAFT") }}</h4></div>
  8. {%- endif -%}
  9. {%- if doc.meta.is_submittable and doc.docstatus==2-%}
  10. <div class="alert alert-danger text-center">
  11. <h4 style="margin: 0px;">{{ _("CANCELLED") }}</h4></div>
  12. {%- endif -%}
  13. {% if max_pages > 1 %}
  14. <p class="text-right">{{ _("Page #{0} of {1}").format(page_num, max_pages) }}</p>
  15. {% endif %}
  16. {%- endmacro -%}
  17.  
  18. <style>
  19. .table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {
  20. background-color: #B7CCF2;
  21. color:#000000;
  22. font-size:16px;
  23. }
  24. .print-format table, .print-format tr,
  25. .print-format td, .print-format div, .print-format p {
  26. font-family: sans-serif;
  27. line-height: 90%;
  28. vertical-align: middle;
  29. }
  30. @media screen {
  31. .print-format {
  32. width: 210mm;
  33. padding: 10mm;
  34. min-height: 297mm;
  35. footer {page-break-after: always;}
  36. }
  37. }
  38. </style>
  39.  
  40. <small>
  41. {{ add_header(0,1,doc,letter_head, no_letterhead) }}
  42. <table class="table table-condensed table-bordered">
  43. <tr>
  44. <td colspan="2">
  45. <b style="font-size:16px;">{{ doc.select_print_heading or (doc.print_heading if doc.print_heading != None
  46. else _(doc.doctype)) }}</b>
  47. </td>
  48. <td style="width:34%">
  49. <b style="font-size:16px; text-align:left; vertical-align:middle;">{{ _("#") }}{{ doc.name }}</b><br>
  50. </td>
  51. </tr>
  52. </table>
  53.  
  54. <table class = "table table-condensed table-bordered">
  55. <tr>
  56. <td style="width: 33%;">
  57. <b>{{ _("To") }}:</b> {{ doc.customer_name }}<br>
  58. <b>{{ _("Address") }}:</b> {{ doc.address_display }}
  59. </td>
  60. <td style="width: 33%;">
  61. <b>{{ _("Ship To") }}:</b> {{ doc.shipping_address_name}}<br>
  62. <b>{{ _("Address") }}:</b> {{ doc.shipping_address }}
  63. </td>
  64. <td style="width: 34%;">
  65. <b>{{ _("Date") }}:</b> {{ doc.get_formatted("transaction_date") }}<br>
  66. <b>{{ _("PO #") }}:</b> {{ doc.po_no }} <br>
  67. <b>{{ _("PO Date") }}:</b> {{ doc.get_formatted("po_date") }}<small><br>
  68. </small>
  69. <b>{{ _("Buyer VAT") }}:</b> {{ doc.get_formatted("vat_tin") }}<small><br>
  70. </small>
  71. <b>{{ _("Buyer CST") }}:</b> {{ doc.get_formatted("cst_tin") }}
  72.  
  73. </td>
  74. </tr>
  75. </table>
  76.  
  77. <table class="table table-condensed table-hover table-bordered">
  78. <tr>
  79. <th>Sr</th>
  80. <th>Description</th>
  81. <th class="text-right">Qty</th>
  82. <th class="text-right">Rate</th>
  83. <th class="text-right">Amount</th>
  84. </tr>
  85. {%- for row in doc.entries -%}
  86. <tr>
  87. <td style="width: 3%;">{{ row.idx }}</td>
  88. <td style="width: 57%;">{{ row.description }}</td>
  89. <td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
  90. <td style="width: 15%; text-align: right;">{{
  91. row.get_formatted("rate", doc) }}</td>
  92. <td style="width: 15%; text-align: right;">{{
  93. row.get_formatted("amount", doc) }}</td>
  94. </tr>
  95. {%- endfor -%}
  96. </tbody>
  97. </table>
  98. <table class="table table-condensed table-bordered" width="1247">
  99. <tr>
  100. <td width="808">
  101.  
  102. <small>
  103. </small>&nbsp;</td>
  104. <td width="429">
  105. <table class="table table-condensed">
  106. <tr>
  107. <td class="text-right" style="width: 30%">
  108. {{ _("Net Total") }}
  109. </td>
  110. <td class="text-right">
  111. {{ doc.get_formatted("net_total_export") }}
  112. </td>
  113. </tr>
  114. {%- for row in doc.other_charges -%}
  115. {%- if not row.included_in_print_rate -%}
  116. <tr height:100%>
  117. <td class="text-right" style="width: 70%">
  118. {{ row.description }}
  119. </td>
  120. <td class="text-right">
  121. {{ row.get_formatted("tax_amount", doc) }}
  122. </td>
  123. </tr>
  124. {%- endif -%}
  125. {%- endfor -%}
  126. {%- if doc.discount_amount -%}
  127. <tr>
  128. <td class="text-right" style="width: 70%">
  129. {{ _("Discount") }}
  130. </td>
  131. <td class="text-right">
  132. {{ doc.get_formatted("discount_amount") }}
  133. </td>
  134. </tr>
  135. {%- endif -%}
  136. <tr>
  137. <td class="text-right" style="width: 70%">
  138. <big><b>{{ _("Grand Total") }}</b></big>
  139. </td>
  140. <td class="text-right">
  141. <big><b>{{ doc.get_formatted("rounded_total") }}</b></big>
  142. </td>
  143. </tr>
  144. </td>
  145.  
  146. <tr>
  147. <td class="text-right" style="width: 70%" colspan="2">
  148.  
  149. <p dir="ltr">
  150.  
  151. <small>
  152. {% if doc.in_words_export %}
  153. <b>{{ _("Total Amount (In Words)") }}: </b><br>
  154. {{ doc.in_words_export }}
  155. {%- endif -%}
  156. </small>
  157. </p>
  158. </td>
  159. </tr>
  160.  
  161. </table>
  162.  
  163. </td>
  164. </tr>
  165. </table>
  166. </small>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement