Advertisement
Nuc0

Untitled

Jan 24th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 7.32 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/webnotes/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: "Arial", sans-serif;
  27.         font-size: 10px;
  28.     }
  29.  
  30.     body {
  31.         padding: 10px;
  32.         margin: auto;
  33.         font-size: 10px;
  34.         line-height: 150%;
  35.     }
  36.  
  37.     .common {
  38.         font-family: "Arial", sans-serif !important;
  39.         font-size: 10px;
  40.         padding: 10px 0px;
  41.     }
  42.  
  43.     table {
  44.         border-collapse: collapse;
  45.         width: 100%;
  46.         vertical-align: top;
  47.     }
  48.  
  49.     table td {
  50.         padding: 2px 0px;
  51.     }
  52.    
  53.     table h1, h2, h3, h4, h5, h6 {
  54.         padding: 0px;
  55.         margin: 0px;
  56.     }
  57.  
  58.     table.header-table td {
  59.         vertical-align: top;
  60.     }
  61.  
  62.     table.header-table thead {
  63.         border-bottom: 1px solid black;
  64.     }
  65.  
  66.     table.header-table h3 {
  67.         color: gray;
  68.     }
  69.  
  70.     table.header-table thead td {
  71.         padding: 5px 0px;
  72.     }
  73.  
  74.     div.page-body table td:nth-child(6),
  75.     div.page-body table td:nth-child(7) {
  76.         text-align: right;
  77.     }
  78.  
  79.     table.footer-table td {
  80.         vertical-align: top;
  81.     }
  82.  
  83.     table.footer-table td table td:nth-child(2),
  84.     table.footer-table td table td:nth-child(3) {
  85.         text-align: right;
  86.     }
  87. </style>
  88.  
  89.  
  90. <!-- Javascript -->
  91. <script>
  92.     si_std = {
  93.         print_item_table: function() {
  94.             var table = print_table(
  95.                 'Sales Invoice',
  96.                 doc.name,
  97.                 'entries',
  98.                 'Sales Invoice Item',
  99.                 [// Here specify the table columns to be displayed
  100.                     'Sr', 'item_name', 'description', 'qty',
  101.                     'basic_rate', 'amount'
  102.                 ],
  103.                 [// Here specify the labels of column headings
  104.                     'Sr', 'Nombre', 'Descripción', 'Cant',
  105.                     'Unitario', 'Monto'
  106.                 ],
  107.                 [// Here specify the column widths
  108.                     '3%', '22%', '40%', '5%',
  109.                     '15%', '15%'
  110.                 ],
  111.                 null,
  112.                 null,
  113.                {
  114.                 // return Quantity
  115.                     'qty': function(data_row) {
  116.                            return format_number(data_row.qty,null, 2);
  117.                     }
  118.                }
  119.  
  120.             );
  121.  
  122.             // This code takes care of page breaks
  123.             if(table.appendChild) {
  124.                 out = table.innerHTML;
  125.             } else {
  126.                 out = '';
  127.                 for(var i=0; i < (table.length-1); i++) {
  128.                     out += table[i].innerHTML +
  129.                         '<div style = "page-break-after: always;" \
  130.                         class = "page_break"></div>\
  131.                         <div class="page-settings"></div>';
  132.                 }
  133.                 out += table[table.length-1].innerHTML;
  134.             }
  135.             return out;
  136.         },
  137.  
  138.  
  139.         print_other_charges: function(parent) {
  140.             var oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');
  141.             var rows = '<table width=100%>\n';
  142.             for(var i=0; i<oc.length; i++) {
  143.                 if(!oc[i].included_in_print_rate) {
  144.                     rows +=
  145.                         '<tr>\n' +
  146.                             '\t<td>' + oc[i].description + '</td>\n' +
  147.                             '\t<td>AR$</td>\n' +
  148.                             '\t<td width=39%, align="right">' + format_number(oc[i].tax_amount,null,2) + '</td>\n' +
  149.                         '</tr>\n';
  150.                 }
  151.             }
  152.             return rows + '</table>\n';
  153.         }
  154.     };
  155. </script>
  156.  
  157.  
  158. <!-- Page Layout Settings -->
  159. <div class='common page-header'>
  160.     <!--
  161.         Page Header will contain
  162.             + table 1
  163.                 + table 1a
  164.                     - Name
  165.                     - Address
  166.                     - Contact
  167.                     - Mobile No
  168.                 + table 1b
  169.                     - Voucher Date
  170.                     - Due Date
  171.     -->
  172.     <table class='header-table' cellspacing=0>
  173.         <thead>
  174.                        
  175.             <!-- <tr><td><script>cur_frm.docname</script></td></tr> -->
  176.         </thead>
  177.         <tbody>
  178.                         <tr><td height="100"></td>
  179.             <tr>
  180.                 <td width=70%><table width=100% cellspacing=0><tbody>
  181.                     <tr>
  182.                         <td width=22%><b>R.Social</b></td>
  183.                         <td><script>doc.customer_name</script></td>
  184.                     </tr>
  185.                                         <tr>
  186.                         <td><b>CUIT</b></td>
  187.                         <td><script>doc.customer_cuit</script></td>
  188.                     </tr>
  189.                                         <tr>
  190.                         <td><b>IVA</b></td>
  191.                         <td><script>doc.customer_cond</script></td>
  192.                     </tr>
  193.                     <tr>
  194.                         <td><b>Dirección</b></td>
  195.                         <td><script>replace_newlines(doc.address_display)</script></td>
  196.                     </tr>
  197.                     <tr>
  198.                         <td><b>Contacto</b></td>
  199.                         <td><script>doc.contact_display</script></td>
  200.                     </tr>
  201.                 </tbody></table></td>
  202.                 <td><table width=100% cellspacing=0><tbody>
  203.                                         <tr>
  204.                         <td><b>DOC</b></td>
  205.                         <td><script>cur_frm.docname</script></td>
  206.                     <tr>
  207.                                         <tr>
  208.                         <td><b>Factura</b></td>
  209.                         <td><script>doc.factura_nro</script></td>
  210.                     <tr>
  211.                     <tr>
  212.                         <td width=50%><b>Fecha</b></td>
  213.                         <td><script>date.str_to_user(doc.posting_date)</script></td>
  214.                     <tr>
  215.                     <tr>
  216.                         <td><script>
  217.                             (doc.convert_into_recurring_invoice && doc.recurring_id)
  218.                            ?"<b>Invoice Period</b>"
  219.                            :"";
  220.                         </script></td>
  221.                         <td><script>
  222.                             (doc.convert_into_recurring_invoice && doc.recurring_id)
  223.                            ?(date.str_to_user(doc.invoice_period_from_date) +
  224.                                ' to ' + date.str_to_user(doc.invoice_period_to_date))
  225.                            :"";
  226.                         </script></td>
  227.                     <tr>
  228.                     <tr>
  229.                         <td><b>Vencimiento</b></td>
  230.                         <td><script>date.str_to_user(doc.due_date)</script></td>
  231.                     <tr>
  232.                                         <tr>
  233.                         <td><b>Forma de Pago</b></td>
  234.                         <td><script>doc.mode_of_payment</script></td>
  235.                     <tr>                   
  236.                 </tbody></table></td>
  237.             </tr>
  238.         </tbody>
  239.         <tfoot>
  240.        
  241.         </tfoot>
  242.     </table>
  243. </div>
  244. <div class='common page-body'>
  245.     <!--
  246.         Page Body will contain
  247.             + table 2
  248.                 - Sales Invoice Data
  249.     -->
  250.     <script>si_std.print_item_table()</script>
  251. </div>
  252. <div class='common page-footer'>
  253.     <!--
  254.         Page Footer will contain
  255.             + table 3
  256.                 - Terms and Conditions
  257.                 - Total Rounded Amount Calculation
  258.                 - Total Rounded Amount in Words
  259.     -->
  260.     <table class='footer-table' width=100% cellspacing=0>
  261.         <thead>
  262.            
  263.         </thead>
  264.         <tbody>
  265.             <tr>
  266.                 <td width=60% style='padding-right: 10px;'>
  267.                      <!-- <b>Terms, Conditions &amp; Other Information:</b><br />
  268.                     <script>doc.terms</script>  -->
  269.                 </td>
  270.                 <td>
  271.                     <table cellspacing=0 width=100%><tbody>
  272.                         <tr>
  273.                             <td>Sub Total</td>
  274.                             <td>AR$</td>
  275.                             <td width=38%, align="right"><script>
  276.                                 format_number(doc.net_total,null,2)
  277.                             </script></td>
  278.                         </tr>
  279.                         <tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
  280.                         <tr>
  281.                             <td><b>Total</b></td>
  282.                             <td><b>AR$</b></td>
  283.                             <td align="right"><b><script>
  284.                                 format_number(doc.grand_total,null,2)
  285.                             </script></b></td>
  286.                         </tr>
  287.                         <!-- <tr style='font-weight: bold'>
  288.                             <td>Rounded Total</td>
  289.                             <td align="left">AR$</td>
  290.                             <td align="right"><script>
  291.                                 format_number(doc.rounded_total,null,2)
  292.                             </script></td>
  293.                         </tr> -->
  294.                     </tbody></table>
  295.                     <!-- <br /><b>In Words</b><br />
  296.                     <i><script>doc.in_words_export</script></i> -->
  297.                 </td>
  298.             </tr>
  299.                         <tr>
  300.                            <td>Emitir cheque a nombre de AGEKA SRL NO A LA ORDEN</td>
  301.                 </tr>
  302.         </tbody>
  303.         <tfoot>
  304.        
  305.         </tfoot>
  306.     </table>
  307. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement