Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- Sample Print Format for ERPNext
- Please use at your own discretion
- For suggestions and contributions:
- https://github.com/webnotes/erpnext-print-templates
- Freely usable under MIT license
- -->
- <!-- Style Settings -->
- <style>
- /*
- common style for whole page
- This should include:
- + page size related settings
- + font family settings
- + line spacing settings
- */
- @media screen {
- body {
- width: 8.3in;
- }
- }
- html, body, div, span, td {
- font-family: "Arial", sans-serif;
- font-size: 10px;
- }
- body {
- padding: 10px;
- margin: auto;
- font-size: 10px;
- line-height: 150%;
- }
- .common {
- font-family: "Arial", sans-serif !important;
- font-size: 10px;
- padding: 10px 0px;
- }
- table {
- border-collapse: collapse;
- width: 100%;
- vertical-align: top;
- }
- table td {
- padding: 2px 0px;
- }
- table h1, h2, h3, h4, h5, h6 {
- padding: 0px;
- margin: 0px;
- }
- table.header-table td {
- vertical-align: top;
- }
- table.header-table thead {
- border-bottom: 1px solid black;
- }
- table.header-table h3 {
- color: gray;
- }
- table.header-table thead td {
- padding: 5px 0px;
- }
- div.page-body table td:nth-child(6),
- div.page-body table td:nth-child(7) {
- text-align: right;
- }
- table.footer-table td {
- vertical-align: top;
- }
- table.footer-table td table td:nth-child(2),
- table.footer-table td table td:nth-child(3) {
- text-align: right;
- }
- </style>
- <!-- Javascript -->
- <script>
- si_std = {
- print_item_table: function() {
- var table = print_table(
- 'Sales Invoice',
- doc.name,
- 'entries',
- 'Sales Invoice Item',
- [// Here specify the table columns to be displayed
- 'Sr', 'item_name', 'description', 'qty',
- 'basic_rate', 'amount'
- ],
- [// Here specify the labels of column headings
- 'Sr', 'Nombre', 'Descripción', 'Cant',
- 'Unitario', 'Monto'
- ],
- [// Here specify the column widths
- '3%', '22%', '40%', '5%',
- '15%', '15%'
- ],
- null,
- null,
- {
- // return Quantity
- 'qty': function(data_row) {
- return format_number(data_row.qty,null, 2);
- }
- }
- );
- // This code takes care of page breaks
- if(table.appendChild) {
- out = table.innerHTML;
- } else {
- out = '';
- for(var i=0; i < (table.length-1); i++) {
- out += table[i].innerHTML +
- '<div style = "page-break-after: always;" \
- class = "page_break"></div>\
- <div class="page-settings"></div>';
- }
- out += table[table.length-1].innerHTML;
- }
- return out;
- },
- print_other_charges: function(parent) {
- var oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');
- var rows = '<table width=100%>\n';
- for(var i=0; i<oc.length; i++) {
- if(!oc[i].included_in_print_rate) {
- rows +=
- '<tr>\n' +
- '\t<td>' + oc[i].description + '</td>\n' +
- '\t<td>AR$</td>\n' +
- '\t<td width=39%, align="right">' + format_number(oc[i].tax_amount,null,2) + '</td>\n' +
- '</tr>\n';
- }
- }
- return rows + '</table>\n';
- }
- };
- </script>
- <!-- Page Layout Settings -->
- <div class='common page-header'>
- <!--
- Page Header will contain
- + table 1
- + table 1a
- - Name
- - Address
- - Contact
- - Mobile No
- + table 1b
- - Voucher Date
- - Due Date
- -->
- <table class='header-table' cellspacing=0>
- <thead>
- <!-- <tr><td><script>cur_frm.docname</script></td></tr> -->
- </thead>
- <tbody>
- <tr><td height="100"></td>
- <tr>
- <td width=70%><table width=100% cellspacing=0><tbody>
- <tr>
- <td width=22%><b>R.Social</b></td>
- <td><script>doc.customer_name</script></td>
- </tr>
- <tr>
- <td><b>CUIT</b></td>
- <td><script>doc.customer_cuit</script></td>
- </tr>
- <tr>
- <td><b>IVA</b></td>
- <td><script>doc.customer_cond</script></td>
- </tr>
- <tr>
- <td><b>Dirección</b></td>
- <td><script>replace_newlines(doc.address_display)</script></td>
- </tr>
- <tr>
- <td><b>Contacto</b></td>
- <td><script>doc.contact_display</script></td>
- </tr>
- </tbody></table></td>
- <td><table width=100% cellspacing=0><tbody>
- <tr>
- <td><b>DOC</b></td>
- <td><script>cur_frm.docname</script></td>
- <tr>
- <tr>
- <td><b>Factura</b></td>
- <td><script>doc.factura_nro</script></td>
- <tr>
- <tr>
- <td width=50%><b>Fecha</b></td>
- <td><script>date.str_to_user(doc.posting_date)</script></td>
- <tr>
- <tr>
- <td><script>
- (doc.convert_into_recurring_invoice && doc.recurring_id)
- ?"<b>Invoice Period</b>"
- :"";
- </script></td>
- <td><script>
- (doc.convert_into_recurring_invoice && doc.recurring_id)
- ?(date.str_to_user(doc.invoice_period_from_date) +
- ' to ' + date.str_to_user(doc.invoice_period_to_date))
- :"";
- </script></td>
- <tr>
- <tr>
- <td><b>Vencimiento</b></td>
- <td><script>date.str_to_user(doc.due_date)</script></td>
- <tr>
- <tr>
- <td><b>Forma de Pago</b></td>
- <td><script>doc.mode_of_payment</script></td>
- <tr>
- </tbody></table></td>
- </tr>
- </tbody>
- <tfoot>
- </tfoot>
- </table>
- </div>
- <div class='common page-body'>
- <!--
- Page Body will contain
- + table 2
- - Sales Invoice Data
- -->
- <script>si_std.print_item_table()</script>
- </div>
- <div class='common page-footer'>
- <!--
- Page Footer will contain
- + table 3
- - Terms and Conditions
- - Total Rounded Amount Calculation
- - Total Rounded Amount in Words
- -->
- <table class='footer-table' width=100% cellspacing=0>
- <thead>
- </thead>
- <tbody>
- <tr>
- <td width=60% style='padding-right: 10px;'>
- <!-- <b>Terms, Conditions & Other Information:</b><br />
- <script>doc.terms</script> -->
- </td>
- <td>
- <table cellspacing=0 width=100%><tbody>
- <tr>
- <td>Sub Total</td>
- <td>AR$</td>
- <td width=38%, align="right"><script>
- format_number(doc.net_total,null,2)
- </script></td>
- </tr>
- <tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>
- <tr>
- <td><b>Total</b></td>
- <td><b>AR$</b></td>
- <td align="right"><b><script>
- format_number(doc.grand_total,null,2)
- </script></b></td>
- </tr>
- <!-- <tr style='font-weight: bold'>
- <td>Rounded Total</td>
- <td align="left">AR$</td>
- <td align="right"><script>
- format_number(doc.rounded_total,null,2)
- </script></td>
- </tr> -->
- </tbody></table>
- <!-- <br /><b>In Words</b><br />
- <i><script>doc.in_words_export</script></i> -->
- </td>
- </tr>
- <tr>
- <td>Emitir cheque a nombre de AGEKA SRL NO A LA ORDEN</td>
- </tr>
- </tbody>
- <tfoot>
- </tfoot>
- </table>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement