Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.38 KB | None | 0 0
  1. <!--
  2. Sample Print Format for ERPNext
  3. Please use at your own discretion
  4. For suggestions and contributions:
  5. https://github.com/frappe/erpnext-print-templates
  6.  
  7. Freely usable under MIT license
  8. -->
  9.  
  10. <!-- Style Settings -->
  11. <style>
  12. /*
  13. common style for whole page
  14. This should include:
  15. + page size related settings
  16. + font family settings
  17. + line spacing settings
  18. */
  19. @media screen {
  20. body {
  21. width: 8.3in;
  22. }
  23. }
  24.  
  25. html, body, div, span, td {
  26. font-family: "Georgia", serif;
  27. font-size: 12px;
  28. }
  29.  
  30. body {
  31. padding: 10px;
  32. margin: auto;
  33. font-size: 12px;
  34. }
  35.  
  36. .common {
  37. font-family: "Georgia", serif !important;
  38. font-size: 12px;
  39. padding: 10px 0px;
  40. }
  41.  
  42. table {
  43. border-collapse: collapse;
  44. width: 100%;
  45. vertical-align: top;
  46. }
  47.  
  48. table td {
  49. padding: 2px 0px;
  50. }
  51.  
  52. table h1, h2, h3, h4, h5, h6 {
  53. padding: 0px;
  54. margin: 0px;
  55. }
  56.  
  57. table.header-table td {
  58. vertical-align: top;
  59. }
  60.  
  61. table.header-table thead {
  62. border-bottom: 1px solid black;
  63. }
  64.  
  65. table.header-table h3 {
  66. color: gray;
  67. }
  68.  
  69. table.header-table thead td {
  70. padding: 5px 0px;
  71. }
  72.  
  73. div.page-body table td:nth-child(6),
  74. div.page-body table td:nth-child(7) {
  75. text-align: right;
  76. }
  77.  
  78. table.footer-table td {
  79. vertical-align: top;
  80. }
  81.  
  82. table.footer-table td table td:nth-child(2),
  83. table.footer-table td table td:nth-child(3) {
  84. text-align: right;
  85. }
  86. </style>
  87.  
  88.  
  89. <!-- Javascript -->
  90. <script>
  91. si_std = {
  92. print_item_table: function() {
  93. var table = print_table(
  94. 'Purchase Invoice Slip',
  95. doc.name,
  96. 'Purchase Invoice',
  97. 'Purchase Invoice Item',
  98. [// Here specify the table columns to be displayed
  99. 'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',
  100. 'rate', 'amount'
  101. ],
  102. [// Here specify the labels of column headings
  103. 'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',
  104. 'UoM', 'Basic Rate', 'Amount'
  105. ],
  106. [// Here specify the column widths
  107. '3%', '10%', '15%', '32%', '5%',
  108. '5%', '15%', '15%'
  109. ]
  110. );
  111.  
  112. // This code takes care of page breaks
  113. if(table.appendChild) {
  114. out = table.innerHTML;
  115. } else {
  116. out = '';
  117. for(var i=0; i < (table.length-1); i++) {
  118. out += table[i].innerHTML +
  119. '<div style = "page-break-after: always;" \
  120. class = "page_break"></div>\
  121. <div class="page-settings"></div>';
  122. }
  123. out += table[table.length-1].innerHTML;
  124. }
  125. return out;
  126. },
  127.  
  128.  
  129. print_other_charges: function(parent) {
  130. var oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');
  131. var rows = '<table width=100%>\n';
  132. for(var i=0; i<oc.length; i++) {
  133. rows +=
  134. '<tr>\n' +
  135. '\t<td>' + oc[i].description + '</td>\n' +
  136. '\t<td style="width: 38%; text-align: right;">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\n' +
  137. '</tr>\n';
  138. }
  139. return rows + '</table>\n';
  140. }
  141. };
  142. </script>
  143.  
  144.  
  145. <!-- Page Layout Settings -->
  146. <div class='common page-header'>
  147. <!--
  148. Page Header will contain
  149. + table 1
  150. + table 1a
  151. - Name
  152. - Address
  153. - Contact
  154. - Mobile No
  155. + table 1b
  156. - Voucher Date
  157. - Due Date
  158. -->
  159. <table class='header-table' cellspacing=0>
  160. <thead>
  161. <tr><td><script>'<h1>' + (doc.select_print_heading || 'Purchase Invoice Slip') + '</h1>'</script></td></tr>
  162. <tr><td><h3><script>cur_frm.docname</script></h3></td></tr>
  163. </thead>
  164. <tbody>
  165. <tr>
  166. <td width=60%><table width=100% cellspacing=0><tbody>
  167. <tr>
  168. <td width=22%><b>Name</b></td>
  169. <td><script>doc.supplier_name</script></td>
  170. </tr>
  171. <tr>
  172. <td><b>Address</b></td>
  173. <td><script>replace_newlines(doc.address_display)</script></td>
  174. </tr>
  175. <tr>
  176. <td><b>Contact</b></td>
  177. <td><script>doc.contact_display</script></td>
  178. </tr>
  179. </tbody></table></td>
  180. <td><table width=100% cellspacing=0><tbody>
  181. <tr>
  182. <td width=63%><b>Posting Date</b></td>
  183. <td><script>date.str_to_user(doc.transaction_date)</script></td>
  184. <tr>
  185. </tbody></table></td>
  186. </tr>
  187. </tbody>
  188. <tfoot>
  189.  
  190. </tfoot>
  191. </table>
  192. </div>
  193. <div class='common page-body'>
  194. <!--
  195. Page Body will contain
  196. + table 2
  197. - Sales Invoice Data
  198. -->
  199. <script>si_std.print_item_table()</script>
  200. </div>
  201. <div class='common page-footer'>
  202. <!--
  203. Page Footer will contain
  204. + table 3
  205. - Terms and Conditions
  206. - Total Rounded Amount Calculation
  207. - Total Rounded Amount in Words
  208. -->
  209. <table class='footer-table' width=100% cellspacing=0>
  210. <thead>
  211.  
  212. </thead>
  213. <tbody>
  214. <tr>
  215. <td width=60% style='padding-right: 10px;'>
  216. <b>Terms, Conditions &amp; Other Information:</b><br />
  217. <script>doc.terms</script>
  218. </td>
  219. <td>
  220. <table cellspacing=0 width=100%><tbody>
  221. <tr>
  222. <td>Net Total</td>
  223. <td style="width: 38%; text-align: right;"><script>
  224. format_currency(doc.net_total_import, doc.currency)
  225. </script></td>
  226. </tr>
  227. <tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
  228. <tr style='font-weight: bold'>
  229. <td>Grand Total</td>
  230. <td style="width: 38%; text-align: right;"><script>
  231. format_currency(doc.grand_total_import, doc.currency)
  232. </script></td>
  233. </tr>
  234. </tbody></table>
  235. <br /><b>In Words</b><br />
  236. <i><script>doc.in_words_import</script></i>
  237. </td>
  238. </tr>
  239. </tbody>
  240. <tfoot>
  241.  
  242. </tfoot>
  243. </table>
  244. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement