Browse Source

Formato para imprimir la ticket venta ferreteria

SEBAS 6 days ago
commit
0ad4a03b64
7 changed files with 186 additions and 0 deletions
  1. 18 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 39 0
      __openerp__.py
  4. BIN
      static/description/icon.png
  5. 22 0
      ticket_venta_ferreteria.py
  6. BIN
      ticket_venta_ferreteria.pyc
  7. 107 0
      ticket_venta_ferreteria.xml

+ 18 - 0
__init__.py

@@ -0,0 +1,18 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    This program is free software: you can redistribute it and/or modify       #
+#    it under the terms of the GNU Affero General Public License as             #
+#    published by the Free Software Foundation, either version 3 of the         #
+#    License, or (at your option) any later version.                            #
+#                                                                               #
+#    This program is distributed in the hope that it will be useful,            #
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
+#    GNU Affero General Public License for more details.                        #
+#                                                                               #
+#    You should have received a copy of the GNU Affero General Public License   #
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
+#                                                                               #
+###################################################################################
+from . import ticket_venta_ferreteria

BIN
__init__.pyc


+ 39 - 0
__openerp__.py

@@ -0,0 +1,39 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    This program is free software: you can redistribute it and/or modify       #
+#    it under the terms of the GNU Affero General Public License as             #
+#    published by the Free Software Foundation, either version 3 of the         #
+#    License, or (at your option) any later version.                            #
+#                                                                               #
+#    This program is distributed in the hope that it will be useful,            #
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of             #
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              #
+#    GNU Affero General Public License for more details.                        #
+#                                                                               #
+#    You should have received a copy of the GNU Affero General Public License   #
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product features is an Openobject module wich enable features management for products #
+###################################################################################
+{
+    'name': 'Ticket Venta Ferreteria',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Ticket Venta Odonto Imagen
+==========================
+
+Formato para imprimir Ticket Venta Ferreteria
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com',
+    'depends': ['base','account'],
+    'data': [
+        'ticket_venta_ferreteria.xml'
+    ],
+    'installable': True,
+}

BIN
static/description/icon.png


+ 22 - 0
ticket_venta_ferreteria.py

@@ -0,0 +1,22 @@
+from openerp import api, models
+import datetime
+from num2words import num2words
+
+class report_ticket_ferreteria(models.AbstractModel):
+    _name = 'report.ticket_venta_ferreteria.report_ticket_ferreteria'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('ticket_venta_ferreteria.report_ticket_ferreteria')
+        docargs = {
+            'doc_ids': self._ids,
+            'doc_model': report.model,
+            'docs': self.env[report.model].browse(self._ids),
+            'calcular_precio':self.calcular_precio,
+        }
+        return report_obj.render('ticket_venta_ferreteria.report_ticket_ferreteria', docargs)
+
+
+    def calcular_precio(self,precio):
+        return (precio*1.1)

BIN
ticket_venta_ferreteria.pyc


+ 107 - 0
ticket_venta_ferreteria.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="ticket_venta_ferreteria"
+        model="account.invoice"
+        string="Ticket"
+        report_type="qweb-html"
+        name="ticket_venta_ferreteria.report_ticket_ferreteria"
+        file="ticket_venta_ferreteria.report_ticket_ferreteria"
+     />
+
+    <record id="paperformat_lowmargin" model="report.paperformat">
+         <field name="name">Ticket Venta</field>
+         <field name="default" eval="True" />
+         <field name="format">custom</field>
+         <field name="page_height">150</field>
+         <field name="page_width">75</field>
+         <field name="orientation">Portrait</field>
+         <field name="margin_top">3</field>
+         <field name="margin_bottom">3</field>
+         <field name="margin_left">3</field>
+         <field name="margin_right">3</field>
+         <field name="header_line" eval="False" />
+         <field name="header_spacing">3</field>
+         <field name="dpi">90</field>
+    </record>
+
+    <record id="ticket_venta_ferreteria.ticket_venta_ferreteria" model="ir.actions.report.xml">
+        <field name="paperformat_id" ref="ticket_venta_ferreteria.paperformat_lowmargin" />
+    </record>
+
+    <template id="report_ticket_ferreteria">
+        <t t-call="report.html_container">
+            <div class="page">
+                <style>
+                    .table-condensed>tbody>tr>td {
+                        padding: 1px !important;
+                        font-size: 10px;
+                        font-family: Arial;
+                        text-align: left;
+                    }
+                    .borderless td, .borderless th {
+                        border: none !important;
+                    }
+                </style>
+
+                <t t-foreach="docs" t-as="o">
+                    <div class="pagina">
+                        <div style="text-align: center; font-size: 11px; font-family: Arial;">
+                            <b>BIOMARKET</b>
+                        </div>
+                        <div style="font-size:9.5px; text-align: center;">
+                            <span t-field="o.create_date" t-options='{"format": "dd/MM/yyyy hh:mm:ss"}'/>
+                        </div>
+                        <div style="font-size:10px;">
+                            <b>Cliente:</b> <span t-field="o.partner_id.name"/> - <b>Tel:</b> <span t-field="o.partner_id.mobile"/>
+                        </div>
+
+                        <table class="table table-condensed borderless">
+                            <thead>
+                                <tr>
+                                    <th style="width:10%; text-align: center;">Cant.</th>
+                                    <th style="width:50%;">Producto</th>
+                                    <th style="width:15%; text-align: center;">Código</th>
+                                    <th style="width:15%; text-align: center;">Precio</th>
+                                    <th style="width:15%; text-align: right;">Subtotal</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                <tr t-foreach="o.invoice_line" t-as="l">
+                                    <td style="text-align: center;"><span t-esc="'%.0f'%l.quantity"/></td>
+                                    <td><span t-field="l.name"/></td>
+                                    <td style="text-align: center;"><span t-field="l.product_id.default_code"/></td>
+                                    <td style="text-align: center;"><span t-esc="'{0:,.0f}'.format(l.price_unit)"/></td>
+                                    <td style="text-align: right;"><span t-esc="'{0:,.2f}'.format(l.quantity * l.price_unit)"/></td>
+                                </tr>
+                            </tbody>
+                        </table>
+
+                        <table class="table table-condensed borderless">
+                            <tbody>
+                                <tr>
+                                    <td><b>Sub Total:</b></td>
+                                    <td style="text-align: right;"><span t-esc="'{0:,.2f}'.format(o.amount_untaxed)"/></td>
+                                </tr>
+                                <tr>
+                                    <td><b>Descuento:</b></td>
+                                    <td style="text-align: right;"><span t-esc="'{0:,.2f}'.format(o.amount_total - o.amount_untaxed)"/></td>
+                                </tr>
+                                <tr>
+                                    <td><b>Total:</b></td>
+                                    <td style="text-align: right;"><span t-esc="'{0:,.2f}'.format(o.amount_total)"/></td>
+                                </tr>
+                            </tbody>
+                        </table>
+
+                        <div style="text-align: center; font-size:10px;">
+                            <b>GRACIAS POR SU PREFERENCIA!</b>
+                        </div>
+                    </div>
+                </t>
+            </div>
+        </t>
+    </template>
+</data>
+</openerp>