Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 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_title }}<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") }}
  68. </td>
  69. </tr>
  70. </table>
  71.  
  72. <table class="table table-condensed table-hover table-bordered">
  73. <tr>
  74. <th>Sr</th>
  75. <th>Description</th>
  76. <th class="text-right">Qty</th>
  77. <th class="text-right">Rate</th>
  78. <th class="text-right">Amount</th>
  79. </tr>
  80. {%- for row in doc.sales_order_details -%}
  81. <tr>
  82. <td style="width: 3%;">{{ row.idx }}</td>
  83. <td style="width: 57%;">{{ row.description }}</td>
  84. <td style="width: 10%; text-align: right;">{{ row.qty }} {{ row.uom or row.stock_uom }}</td>
  85. <td style="width: 15%; text-align: right;">{{
  86. row.get_formatted("rate", doc) }}</td>
  87. <td style="width: 15%; text-align: right;">{{
  88. row.get_formatted("amount", doc) }}</td>
  89. </tr>
  90. {%- endfor -%}
  91. </tbody>
  92. </table>
  93. <table class="table table-condensed table-bordered">
  94. <tr>
  95. <td width="50%">
  96. <p>{% if doc.terms %} <b>{{ _("Auxiliary Information") }}: </b>{{ doc.terms or "" }}
  97. {%- endif -%}
  98. </p>
  99. <p style="font-size:12px">{% if doc.in_words_export %}
  100. <b>{{ _("Total Amount (In Words)") }}: </b><br>
  101. {{ doc.in_words_export }}
  102. {%- endif -%}
  103. </p><br><br>
  104. <table class="table table-condensed">
  105. <tr>
  106. <td height="100px"; valign="top">
  107. <b>{{ _("Received By:") }}</b>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td>
  112. <b>{{ _("Customer Sign") }}</b>
  113. </td>
  114. </tr>
  115. </table>
  116.  
  117. </td>
  118. <td>
  119. <table class="table table-condensed">
  120. <tr>
  121. <td class="text-right" style="width: 30%">
  122. {{ _("Net Total") }}
  123. </td>
  124. <td class="text-right">
  125. {{ doc.get_formatted("net_total_export") }}
  126. </td>
  127. </tr>
  128. {%- for row in doc.other_charges -%}
  129. {%- if not row.included_in_print_rate -%}
  130. {%- if row.tax_amount -%}
  131. <tr height:100%>
  132. <td class="text-right" style="width: 70%">
  133. {{ row.description }}
  134. </td>
  135. <td class="text-right">
  136. {{ row.get_formatted("tax_amount", doc) }}
  137. </td>
  138. </tr>
  139. {%- endif -%}
  140. {%- endif -%}
  141. {%- endfor -%}
  142. {%- if doc.discount_amount -%}
  143. <tr>
  144. <td class="text-right" style="width: 70%">
  145. {{ _("Discount") }}
  146. </td>
  147. <td class="text-right">
  148. {{ doc.get_formatted("discount_amount") }}
  149. </td>
  150. </tr>
  151. {%- endif -%}
  152. <tr>
  153. <td class="text-right" style="width: 70%">
  154. <big><b>{{ _("Grand Total") }}</b></big>
  155. </td>
  156. <td class="text-right">
  157. <big><b>{{ doc.get_formatted("grand_total_export") }}</b></big>
  158. </td>
  159. </tr>
  160. </td>
  161.  
  162. </table>
  163.  
  164. </td>
  165. </tr>
  166. </table>
  167. {% if doc.get("other_charges", filters={"included_in_print_rate": 1}) %}
  168. <hr>
  169. <p><b>Taxes Included:</b></p>
  170. <table class="table table-condensed no-border">
  171. <tbody>
  172. {%- for row in doc.other_charges -%}
  173. {%- if row.included_in_print_rate -%}
  174. <tr>
  175. <td class="text-right" style="width: 70%">
  176.  
  177. {{ row.description }}
  178. </td>
  179. <td class="text-right">
  180. {{ row.get_formatted("tax_amount", doc) }}
  181. </td>
  182. <tr>
  183. {%- endif -%}
  184. {%- endfor -%}
  185. </tbody>
  186. </table>
  187. {%- endif -%}
  188. <hr>
  189. </small>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement