1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?xml version="1.0" encoding="utf-8"?>
- <openerp>
- <data>
- <template id="ticket_venta_template">
- <!-- NOTA: no llamamos a web.assets_frontend porque en Odoo8 puede no existir -->
- <t t-set="layout" t-value="None"/>
- <html>
- <head>
- <meta charset="utf-8"/>
- <title>Ticket</title>
- <style type="text/css">
- @page { size: 78mm auto; margin: 0; }
- html, body { padding: 0; margin: 0; }
- .page {
- width: 78mm;
- font-family: monospace;
- font-size: 12px;
- line-height: 1.2;
- padding: 2mm 2mm;
- box-sizing: border-box;
- }
- .center { text-align: center; }
- .right { text-align: right; }
- .divider { border-top: 1px dashed #000; margin: 3px 0; }
- table { width: 100%; border-collapse: collapse; }
- th, td { padding: 0; vertical-align: top; }
- .qty { width: 18%; }
- .desc { width: 52%; }
- .tot { width: 30%; text-align: right; white-space: nowrap; }
- </style>
- </head>
- <body>
- <div class="page">
- <div class="center">
- <strong><t t-esc="doc.company_id and doc.company_id.name or ''"/></strong><br/>
- <t t-esc="doc.company_id and (doc.company_id.actividad or '') or ''"/><br/>
- <t t-esc="doc.company_id and (doc.company_id.street or '') or ''"/><br/>
- <t t-esc="doc.company_id and (doc.company_id.street2 or '') or ''"/><br/>
- <t t-if="doc.company_id and doc.company_id.phone">Tel: <t t-esc="doc.company_id.phone"/></t><br/>
- -------------------------------
- </div>
- <div>
- <strong>Factura:</strong> <t t-esc="doc.number or doc.name or ''"/><br/>
- <strong>Cliente:</strong> <t t-esc="doc.partner_id and doc.partner_id.name or ''"/><br/>
- <t t-if="doc.date_invoice"><strong>Fecha:</strong> <t t-esc="doc.date_invoice"/></t>
- <div class="divider"></div>
- </div>
- <table>
- <thead>
- <tr>
- <th class="qty">Cant</th>
- <th class="desc">Descripción</th>
- <th class="tot">Total</th>
- </tr>
- </thead>
- <tbody>
- <tr t-foreach="doc.invoice_line" t-as="line">
- <td class="qty"><t t-esc="'{0:,.0f}'.format(line.quantity)"/></td>
- <td class="desc"><t t-esc="line.name"/></td>
- <td class="tot"><t t-esc="'{0:,.0f}'.format(line.quantity * line.price_unit)"/></td>
- </tr>
- </tbody>
- </table>
- <div class="divider"></div>
- <div class="right">
- <strong>Total:</strong> <t t-esc="'{0:,.0f}'.format(doc.amount_total)"/>
- </div>
- <div class="center" style="margin-top:6px;">¡Gracias por su compra!</div>
- </div>
- <script type="text/javascript">
- window.onload = function() {
- try { window.print(); } catch(e) {}
- setTimeout(function(){ window.close(); }, 500);
- };
- </script>
- </body>
- </html>
- </template>
- </data>
- </openerp>
|