Selaa lähdekoodia

Para impresión de recibo en union

SEBAS 10 kuukautta sitten
commit
d8f000bb3c

+ 22 - 0
__init__.py

@@ -0,0 +1,22 @@
+# -*- 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 Brand is an Openobject module wich enable Brand management for products #
+###################################################################################
+from . import factura_venta_union, account_invoice, res_currency, report_reciboenfactura

BIN
__init__.pyc


+ 42 - 0
__openerp__.py

@@ -0,0 +1,42 @@
+# -*- 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': 'Factura Venta Legal Union',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Factura Venta Legal Union
+
+Formato para imprimir la factura legal de Union
+
+    """,
+    'author': 'union/Sebastian Penayo',
+    'website': 'http://www.union.com',
+    'depends': ['base','account', 'eiru_invoiceid_voucher'],
+    'data': [
+        'factura_venta_union.xml',
+        'account_invoice_view.xml',
+        'report_reciboenfactura.xml',
+        'res_currency_view.xml'
+    ],
+    'installable': True,
+}

+ 41 - 0
account_invoice.py

@@ -0,0 +1,41 @@
+# -*- 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 openerp import models, fields, api
+
+class account_invoice(models.Model):
+    _inherit = 'account.invoice'
+    _name = 'account.invoice'
+
+    contado = fields.Boolean('Contado')
+    credito = fields.Boolean('Crédito')
+
+    _defaults = {
+        'contado': True
+    }
+
+    @api.one
+    @api.onchange('credito')
+    def cambiar_estado_credito(self):
+        self.contado = not self.credito
+
+    @api.one
+    @api.onchange('contado')
+    def cambiar_estado_contado(self):
+        self.credito = not self.contado

BIN
account_invoice.pyc


+ 17 - 0
account_invoice_view.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+    <data>
+        <record id="account_invoice_cred_cont" model="ir.ui.view">
+            <field name="name">account.invoice.cred.cont</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form" />
+            <field name="arch" type="xml">
+                <field name="fiscal_position" position="after">
+                        <field name="contado"/>
+                        <field name="credito"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 30 - 0
factura_venta_union.py

@@ -0,0 +1,30 @@
+from openerp import api, models
+import datetime
+from num2words import num2words
+
+class report_factura_union(models.AbstractModel):
+    _name = 'report.factura_venta_union.report_factura_union'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('factura_venta_union.report_factura_union')
+        docargs = {
+            'doc_ids': self._ids,
+            'doc_model': report.model,
+            'docs': self.env[report.model].browse(self._ids),
+            'convertir':self.convertir,
+            'calcular_precio':self.calcular_precio,
+        }
+        return report_obj.render('factura_venta_union.report_factura_union', docargs)
+
+    def convertir(self,nro,moneda):
+        letra = num2words(nro,lang="es")
+        letra = letra.capitalize()
+        if not moneda:
+            moneda=''
+        letra = letra +' '+moneda
+        return letra
+
+    def calcular_precio(self,precio):
+        return (precio*1.1)

+ 474 - 0
factura_venta_union.xml

@@ -0,0 +1,474 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="factura_venta_union"
+        model="account.invoice"
+        string="Factura Legal"
+        report_type="qweb-html"
+        name="factura_venta_union.report_factura_union"
+        file="factura_venta_union.report_factura_union"
+     />
+
+    <template id="report_factura_union">
+        <t t-call="report.html_container">
+            <t t-foreach="[1,2,3]" t-as="i">
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 3.0mm;
+
+                            font-family: Arial;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        .logo{
+                            height: 1.68cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .logo1{
+                            height: 1.2cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .logo2{
+                            height: 1.1cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .articulos{
+                            height: 3.385cm;
+                        }
+                        .art-col11{
+                            padding-left: 0.2mm;
+                            width:3.0cm;
+                            font-size: 2.9mm;
+                            text-align: center;
+                            vertical-align: top;
+                            min-height: 0.4cm;
+                        }
+                        .art-col13{
+                            padding-left: 0.5cm;
+                            font-size: 3.1mm;
+                            width:1.4cm;
+                            text-align: left;
+                            vertical-align: top;
+                            min-height: 0.4cm;
+                        }
+                        .art-col14{
+                            width:4.2cm;
+                            font-size: 3.1mm;
+                            padding-left: 0.8mm;
+                            text-align: center;
+                            vertical-align: top;
+                            min-height: 0.4cm;
+
+                        }
+                        .art-col12{
+                            padding-left: 0.2mm;
+                            width:2.370cm;
+                            font-size: 3.1mm;
+                            text-align: right;
+                            vertical-align: top;
+                            min-height: 0.4cm;
+                        }
+                        .art-col15{
+                            width:3.66cm;
+                            font-size: 2.9mm;
+                            text-align: right;
+                            vertical-align: top;
+                            min-height: 0.4cm;
+
+                        }
+
+                        .art-col16{
+                            width:1.6cm;
+                            font-size: 3mm;
+                            vertical-align: top;
+                            text-align: right;
+                            min-height: 0.4cm;
+
+                        }
+                        .art-col17{
+                            width:4.1cm;
+                            font-size: 3.5mm;
+                            text-align: right;
+                            vertical-align: top;
+                            min-height: 0.4cm;
+
+                        }
+                        .fecha_emision_data{
+                            width: 11.1cm;
+                            padding-left:2.8cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+                        .contado_x{
+                            width: 2cm;
+                            float: right;
+                            padding-left: 2.42cm;
+                            min-height: 0.4cm;
+                        }
+                        .credito_x{
+                            width:2.5cm;
+                            float: left;
+                            padding-left: 1.0cm;
+                            min-height: 0.4cm;
+                        }
+
+                        .ruc_data{
+                            width: 11.7cm;
+                            float: left;
+                            padding-left: 4.8cm;
+                            min-height: 0.4cm;
+                        }
+                        .razon_data{
+                            width: 11.7cm;
+                            float: left;
+                            padding-left: 4.0cm;
+                            min-height: 0.4cm;
+                        }
+                        .direccion_data{
+                            width: 13.5cm;
+                            float: left;
+                            padding-left:2.7cm;
+                            min-height: 0.4cm;
+                        }
+                        .telefono_data{
+                            width: 3.5cm;
+                            float: right;
+                            padding-left: 0.1mm;
+                            min-height: 0.4cm;
+                        }
+                        .nota_remision_data{
+                            width: 13cm;
+                            float: left;
+                            padding-left: 2.8cm;
+                            min-height: 0cm;
+                        }
+                        .dias_credito{
+                            width: 5cm;
+                            float: left;
+                            padding-left: 0.8cm;
+                            min-height: 0cm;
+                        }
+                        .cab-articulos{
+                            height: 0.77cm;
+                            clear: both;
+                        }
+                        .divisoria1{
+                            height: 6.6cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .cab-articulos2{
+                            height: 0.2cm;
+                            clear: both;
+                        }
+
+                        .borderless td, .borderless th {
+                            border: none !important;
+                        }
+                        .table-condensed>tbody>tr>td {
+                            padding: 1px !important;
+                        }
+                        .table-super-condensed>tbody>tr>td {
+                            padding: 5px !important;
+                        }
+                        .table-condensed2>tbody>tr>td {
+                            padding: 2.5px !important;
+                        }
+
+                        .table-condensed3>tbody>tr>td {
+                            padding: 0.5px !important;
+                        }
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="logo"> </div>
+                            <table class="tab-articulos2">
+                              <td class="art-col11"> </td>
+                              <td class="art-col13">
+
+                                  <span t-field="o.date_invoice" t-field-options='{"format": "dd"}'/>
+
+                              </td>
+                              <td class="art-col14">
+                                  <span t-field="o.date_invoice" t-field-options='{"format": "MMMM"}'/>
+                              </td>
+                              <td class="art-col12">
+                                  <!-- <span t-field="o.date_invoice" t-field-options='{"format": "yy"}'/> -->
+                                  <t>        4</t>
+                              </td>
+                              <td class="art-col15">
+
+                              </td>
+
+                              <td class="art-col16">
+                                <div class="contado_x">
+                                    <t t-if="o.contado == True">x</t>
+                                </div>
+                              </td>
+                              <td class="art-col17">
+                                <div class="credito_x">
+                                    <t t-if="o.credito == True">x</t>
+                                </div>
+                              </td>
+                            </table>
+                            <tr>
+                                <div class="ruc_data"><span t-field="o.partner_id.ruc"/></div>
+                            </tr>
+
+                            <tr>
+                                <div class="razon_data"><span t-field="o.partner_id.name"/></div>
+                            </tr>
+
+                            <tr>
+                                <div class="direccion_data">
+                                    <t t-f="o.partner_id.street"><span t-field="o.partner_id.street"/> </t>
+                                    <t t-f="not o.partner_id.street"> </t>
+                                </div>
+
+                            </tr>
+
+                            <tr>
+                                <div class="nota_remision_data"></div>
+                                <div class="dias_credito"></div>
+                            </tr>
+
+                            <div class="cab-articulos"> </div>
+                            <div style="height:2.96cm; padding-right:0.9cm;">
+                                <div style="font-family: Arial;">
+                                    <table class="table borderless table-condensed">
+                                        <t t-set="valor_exentas" t-value="0"/>
+                                        <t t-set="valor_5" t-value="0"/>
+                                        <t t-set="valor_10" t-value="0"/>
+                                        <tbody>
+                                            <tr t-foreach="o.invoice_line" t-as="l">
+                                                <!-- CANTIDAD -->
+                                                <td style="font-size:9.5px;font-family: Arial;width:0.76cm;overflow: auto; text-align: left;">
+                                                    <span t-esc="'%.0f'%l.quantity"/>
+                                                </td>
+
+                                                <!-- NOMBRE DEL PRODUCTO -->
+                                                <td style="font-size:9.3px;font-family: Arial;width:2.74cm;text-align: left;">
+                                                    <span t-field="l.name"/>
+                                                    <!-- Correspondiente al mes de <span t-field="o.date_invoice" t-field-options='{"format": "MMMM/yy"}'/>- Vence: <span t-field="o.date_due"/> -->
+                                                </td>
+                                                <!-- PRECIO UNITARIO -->
+                                                <td style="font-size:9.2px;font-family: Arial;width:0.14cm;overflow: auto; text-align: right;">
+                                                    <t t-if="o.currency_id.id == 166">
+                                                        <span t-esc="'{0:,.0f}'.format(l.price_unit)"/>
+                                                    </t>
+                                                    <t t-if="o.currency_id.id != 166">
+                                                        <span t-esc="'{0:,.2f}'.format(l.price_unit)"/>
+                                                    </t>
+                                                </td>
+                                                <!-- EXENTAS -->
+                                                <td style="font-size:9.2px;font-family: Arial;width:0.98cm;overflow: auto; text-align: right;">
+                                                    <span t-if="'IVA 5% Venta' not in [ilt.name for ilt in l.invoice_line_tax_id] and 'IVA 10% Venta' not in [ilt.name for ilt in l.invoice_line_tax_id]">
+                                                        <t t-if="o.currency_id.id == 166">
+                                                            <span t-esc="'{0:,.0f}'.format(l.quantity * l.price_unit)"/>
+                                                        </t>
+                                                        <t t-if="o.currency_id.id != 166">
+                                                            <span t-esc="'{0:,.2f}'.format(l.quantity * l.price_unit)"/>
+                                                        </t>
+                                                        <t t-set="valor_exentas" t-value="valor_exentas+(l.quantity * l.price_unit)"/>
+                                                    </span>
+                                                </td>
+
+                                                <!-- IVA 5% -->
+                                                <td style="font-size:9.2px;font-family: Arial;width:1.0cm;overflow: auto; text-align: right;">
+                                                    <span t-if="'IVA 5% Venta' in [ilt.name for ilt in l.invoice_line_tax_id] and 'IVA 10% Venta' not in [ilt.name for ilt in l.invoice_line_tax_id]">
+                                                        <t t-if="o.currency_id.id == 166">
+                                                            <span t-esc="'{0:,.0f}'.format(l.quantity * l.price_unit)"/>
+                                                        </t>
+                                                        <t t-if="o.currency_id.id != 166">
+                                                            <span t-esc="'{0:,.2f}'.format(l.quantity * l.price_unit)"/>
+                                                        </t>
+                                                        <t t-set="valor_5" t-value="valor_5+(l.quantity * l.price_unit)"/>
+                                                    </span>
+                                                </td>
+
+                                                <!-- IVA 10% -->
+                                                <td style="font-size:9.2px;font-family: Arial;width:0.8cm;overflow: auto; text-align: right;padding-right: 0.2cm;">
+                                                    <span t-if="'IVA 10% Venta' in [ilt.name for ilt in l.invoice_line_tax_id]">
+                                                        <t t-if="o.currency_id.id == 166">
+                                                            <span t-esc="'{0:,.0f}'.format(l.quantity * l.price_unit)"/>
+                                                        </t>
+                                                        <t t-if="o.currency_id.id != 166">
+                                                            <span t-esc="'{0:,.2f}'.format(l.quantity * l.price_unit)"/>
+                                                        </t>
+                                                        <t t-set="valor_10" t-value="valor_10+(l.quantity * l.price_unit)"/>
+                                                    </span>
+                                                </td>
+                                            </tr>
+                                        </tbody>
+                                    </table>
+                                </div>
+                            </div>
+
+
+
+                            <div style="height:0.5cm;padding-left:1.7cm;padding-right:0.9cm;">
+                                    <t t-set="total_exentas" t-value="0"/>
+                                    <t t-set="total_5" t-value="0"/>
+                                    <t t-set="total_10" t-value="0"/>
+                                    <t t-set="iva_5" t-value="0"/>
+                                    <t t-set="iva_10" t-value="0"/>
+                                    <t t-set="iva_exentas" t-value="0"/>
+                                    <table class="table borderless table-condensed3">
+                                        <tbody>
+
+                                            <tr>
+                                                <td style="font-size:10px;font-family: Arial;width:0.7cm;overflow: auto; text-align: center;min-height: 0.7;"></td>
+                                                <td style="font-size:10px;font-family: Arial;width:1.80cm;overflow: auto; text-align: center;min-height: 0.7;"></td>
+                                                <td style="font-size:10px;font-family: Arial;width:1.2cm;overflow: auto; text-align: center;min-height: 0.7;"></td>
+                                                <td style="font-size: 3mm;font-family: Arial;width:1.2cm;overflow: auto; text-align: center;min-height: 0.7;">
+                                                    <t t-if="o.currency_id.id == 166">
+                                                        <span t-esc="'{0:,.0f}'.format(valor_exentas)"/>
+                                                    </t>
+                                                    <t t-if="o.currency_id.id != 166">
+                                                        <span t-esc="'{0:,.2f}'.format(valor_exentas)"/>
+                                                    </t>
+                                                    <t t-set="iva_exentas" t-value="valor_exentas"/>
+                                                </td>
+                                                <td style="font-size: 3mm;font-family: Arial;width:0.8cm;overflow: auto; text-align: right;min-height: 0.7;">
+                                                    <t t-if="o.currency_id.id == 166">
+                                                        <span t-esc="'{0:,.0f}'.format(valor_5)"/>
+                                                    </t>
+                                                    <t t-if="o.currency_id.id != 166">
+                                                        <span t-esc="'{0:,.2f}'.format(valor_5)"/>
+                                                    </t>
+                                                    <t t-set="iva_5" t-value="valor_5/21" />
+                                                </td>
+                                                <td style="font-size: 3mm;font-family: Arial;width:1.1cm;overflow: auto; text-align: right;min-height: 0.7;">
+                                                    <t t-if="o.currency_id.id == 166">
+                                                        <span t-esc="'{0:,.0f}'.format(valor_10)"/>
+                                                    </t>
+                                                    <t t-if="o.currency_id.id != 166">
+                                                        <span t-esc="'{0:,.2f}'.format(valor_10)"/>
+                                                    </t>
+                                                    <t t-set="iva_10" t-value="(valor_10)/11" />
+                                                </td>
+                                            </tr>
+                                          </tbody>
+                                      </table>
+                              </div>
+                              <div style="height:0.5cm;padding-top:-0.4cm; padding-right:0.9cm;">
+                                      <table class="table borderless table-condensed3">
+                                          <tbody>
+
+                                            <!-- LINEA TOTAL EN LETRAS Y TOTAL GENERAL -->
+
+                                                <td style="font-size:10px;font-family: Arial;width:2.0cm;overflow: auto; text-align: center;"></td>
+                                                <!-- <td style="padding-top:1.2cm;font-size:10px;font-family: Arial;width:0.3cm;overflow: auto; text-align: center;"></td> -->
+                                                <td style="font-size: 2.8mm;padding-left: 2.8cm;font-family: Arial;width:13.0cm;overflow: auto; text-align: left;">
+                                                    <t t-if="o.currency_id.id == 166">
+                                                        <div>Gs <span t-esc="convertir('%.0f'%o.amount_total,o.currency_id.en_letras)"/></div>
+                                                    </t>
+                                                    <t t-if="o.currency_id.id != 166">
+                                                        <div>Dólares <span t-esc="convertir('%.2f'%o.amount_total,o.currency_id.en_letras)"/></div>
+                                                    </t>
+                                                </td>
+                                              <!--   <td style="padding-top:1.2cm;font-size:10px;font-family: Arial;width:0.5cm;overflow: auto; text-align: center;"></td>
+                                                <td style="padding-top:1.2cm;font-size:10px;font-family: Arial;width:0.5cm;overflow: auto; text-align: right;"></td>
+                                                <td style="padding-top:1.2cm;font-size:10px;font-family: Arial;width:0.7cm;overflow: auto; text-align: right;">
+                                               </td>  -->
+                                                <td style="font-size: 3mm;font-family: Arial;width:1.8cm;overflow: auto; text-align: right;">
+                                                    <t t-if="o.currency_id.id == 166">
+                                                      <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
+                                                    </t>
+                                                    <t t-if="o.currency_id.id != 166">
+                                                      <span t-esc="'{0:,.2f}'.format(o.amount_total)"/>
+                                                    </t>
+                                                </td>
+
+                                          </tbody>
+                                      </table>
+                                </div>
+                                  <div style="height:0.6cm;padding-top:-0.1cm;">
+                                      <table class="table borderless table-condensed3">
+                                          <tbody>
+
+                                              <td style="font-size:2.9mm;font-family: Arial;width:0.8cm;overflow: auto; text-align: center;"></td>
+                                              <td style="font-size:3mm;font-family: Arial;width:5.5cm;overflow: auto; text-align: center;">
+                                                  <t t-if="o.currency_id.id == 166">
+                                                      <div>
+                                                          <t t-if="iva_5 != 0">
+                                                              <span t-esc="'{0:,.0f}'.format(iva_5)"/>
+                                                          </t>
+                                                      </div>
+                                                  </t>
+                                                  <t t-if="o.currency_id.id != 166">
+                                                      <div>
+                                                          <t t-if="iva_5 != 0">
+                                                              <span t-esc="'{0:,.0f}'.format(iva_5)"/>
+                                                          </t>
+                                                      </div>
+                                                  </t>
+                                              </td>
+                                              <td style="padding-left: 2.0cm;font-size:3mm;font-family: Arial;width:4cm;overflow: auto; text-align: left;">
+                                                <t t-if="o.currency_id.id == 166">
+                                                    <div>
+                                                        <t t-if="iva_10 != 0">
+
+                                                            <span t-esc="'{0:,.0f}'.format(iva_10)"/>
+                                                        </t>
+                                                    </div>
+                                                </t>
+                                                <t t-if="o.currency_id.id != 166">
+                                                    <div>
+                                                        <t t-if="iva_10 != 0">
+                                                            <span t-esc="'{0:,.0f}'.format(iva_10)"/>
+                                                        </t>
+
+                                                    </div>
+                                                </t>
+                                              </td>
+                                              <td style="font-size:2.9mm;font-family: Arial;width:2cm;overflow: auto; text-align: left;">
+
+                                              </td>
+                                              <td style="font-size:10px;font-family: Arial;width:2.0cm;overflow: auto; text-align: left;">
+                                                <t t-if="o.currency_id.id == 166">
+
+                                                    <span t-esc="'{0:,.0f}'.format(iva_5+iva_10)"/>
+                                                </t>
+                                                <t t-if="o.currency_id.id != 166">
+
+                                                    <span t-esc="'{0:,.0f}'.format(iva_5+iva_10)"/>
+                                                </t>
+                                              </td>
+
+                                              <td style="font-size:3mm;font-family: Arial;width:2.5cm;overflow: auto; text-align: left;">
+
+                                              </td>
+                                              <td style="font-size:10px;font-family: Arial;width:2.3cm;overflow: auto; text-align: right;">
+                                              </td>
+                                            </tbody>
+                                        </table>
+
+                                    </div>
+
+                                    <t t-if="i == 1">
+                                    <div class="logo1"> </div>
+                                    </t>
+                                    <t t-if="i == 2">
+                                    <div class="logo2"> </div>
+                                    </t>
+
+                        </div>
+
+                    </t>
+
+                </div>
+            </t>
+        </t>
+    </template>
+</data>
+</openerp>

+ 29 - 0
report_reciboenfactura.py

@@ -0,0 +1,29 @@
+from openerp import api, models
+from num2words import num2words
+
+class report_recibonenfactura(models.AbstractModel):
+    _name = 'report.factura_venta_union.reciboenfactura_union'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('factura_venta_union.reciboenfactura_union')
+        docargs = {
+            'doc_ids': self._ids,
+            'doc_model': report.model,
+            'docs': self.env[report.model].browse(self._ids),
+            'convertir':self.convertir,
+            'calcular_precio':self.calcular_precio,
+        }
+        return report_obj.render('factura_venta_union.reciboenfactura_union', docargs)
+
+    def convertir(self,nro,moneda):
+        letra = num2words(nro,lang="es")
+        letra = letra.capitalize()
+        if not moneda:
+            moneda=''
+        letra = letra +' '+moneda
+        return letra
+
+    def calcular_precio(self,precio):
+        return (precio*1.1)

BIN
report_reciboenfactura.pyc


+ 343 - 0
report_reciboenfactura.xml

@@ -0,0 +1,343 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+
+	 <report id="informe_reciboenfactura_union"
+        model="account.invoice"
+        string="Recibo en factura"
+        report_type="qweb-pdf"
+        name="factura_venta_union.reciboenfactura_union"
+        file="factura_venta_union.reciboenfactura_union"
+     />
+
+	<record id="paperformat_lowmargin" model="report.paperformat">
+          <field name="name">factura</field>
+          <field name="default" eval="True" />
+          <field name="format">custom</field>
+          <field name="page_height">140</field>
+          <field name="page_width">210</field>
+          <field name="orientation">Portrait</field>
+          <field name="margin_top">3</field>
+          <field name="margin_bottom">2</field>
+          <field name="margin_left">3</field>
+          <field name="margin_right">0</field>
+          <field name="header_line" eval="False" />
+          <field name="header_spacing">3</field>
+          <field name="dpi">90</field>
+    </record>
+
+
+	<record id="factura_venta_union.informe_reciboenfactura_union" model="ir.actions.report.xml">
+		<field name="paperformat_id" ref="factura_venta_union.paperformat_lowmargin" />
+	</record>
+
+	<template id="reciboenfactura_union">
+		<t t-call="report.html_container">
+		    <!-- <t t-foreach="[1]" t-as="i"> -->
+						<div class="page">
+								<style type="text/css">
+										body{
+												font-size: 4.0mm;
+												font-family: Arial;
+												font-weight: bold;
+										}
+										body1{
+												font-size: 4.3mm;
+												font-weight: bold;
+												font-family: Calibri;
+										}
+										div{
+												padding: 0px;
+										}
+										.pagina{
+												width:19.5cm;
+												padding-left: 3cm;
+												padding-right: 0cm;
+												height: 14cm;
+										}
+										.titulo{
+											width: 19.2cm;
+											text-align: center;
+											padding-top: 2.5cm;
+											margin-left: 0.8cm;
+											width: 100%;
+											min-height: 0.9cm;
+										}
+										.descripcion1{
+												width: 11.2cm;
+												font-size: 15px;
+												padding-top: 0.5cm;
+												float: left;
+												min-height: 0.7cm;
+										}
+
+										.descripcion2{
+												width: 12cm;
+												font-size: 15px;
+												float: left;
+												min-height: 0cm;
+										}
+
+										.descripcion3{
+												width: 15cm;
+												font-size: 15px;
+												float: left;
+												min-height: 0cm;
+										}
+										.descripcion4{
+												width: 15cm;
+												font-size: 15px;
+												float: left;
+												min-height: 0.3cm;
+										}
+										.email{
+												width: 13cm;
+												font-size: 15px;
+												float: left;
+												min-height: 0.3cm;
+										}
+
+										.table-condensed>tbody>tr>td {
+												padding: 1px !important;
+										}
+										.divisoria{
+												height: 0.1cm;
+												clear: both;
+										}
+										.linea1{
+												position: relative;
+												top: -0.12cm;
+												min-height: 0.5cm;
+										 }
+										.fecha_emision_data{
+												width: 8.0cm;
+												font-size: 4.0mm;
+												float: left;
+												min-height: 0.5cm;
+										}
+										.number{
+												width: 5cm;
+												float: left;
+												font-size: 4.0mm;
+												padding-left: 0.2cm;
+												min-height: 0.5cm;
+										}
+										.linea2{
+												position: relative;
+												top: -0.12cm;
+												min-height: 0.5cm;
+										 }
+										.razon_data{
+												width: 12cm;
+												font-size: 4.0mm;
+												float: left;
+												min-height: 0.4cm;
+										}
+										.linea3{
+												position: relative;
+												top: -0.12cm;
+												min-height: 0.5cm;
+										 }
+										.ruc{
+												width: 7cm;
+												float: left;
+												font-size: 4.0mm;
+												min-height: 0.4cm;
+										}
+										.due{
+												width: 6cm;
+												float: left;
+												font-size: 4.0mm;
+												min-height: 0.4cm;
+										}
+										.linea4{
+												position: relative;
+												top: -0.12cm;
+												min-height: 0.3cm;
+										 }
+										 .street{
+												 width: 15cm;
+												 float: left;
+												 font-size: 4.0mm;
+												 min-height: 0.4cm;
+										 }
+										 .mobile{
+												 width: 7cm;
+												 float: left;
+												 font-size: 4.0mm;
+												 min-height: 0.4cm;
+										 }
+										 .linea5{
+ 												position: relative;
+ 												top: -0.12cm;
+ 												min-height: 0.3cm;
+ 										 }
+										 .vendor{
+												 width: 7cm;
+												 float: left;
+												 font-size: 4.0mm;
+												 min-height: 0.4cm;
+										 }
+
+										 .fechapago{
+												 width: 6cm;
+												 float: left;
+												 font-size: 4.0mm;
+												 min-height: 0.4cm;
+										 }
+
+										.cab-articulos{
+												height: 0.4cm;
+												clear: both;
+										}
+										.articulos{
+												height: 4.5cm;
+												width: 14cm;
+										}
+										.art-col1{
+												width:1.9cm;
+												text-align: center;
+										}
+										.art-col2{
+												padding-left: 0.3cm;
+												width:12cm;
+										}
+										.art-col3{
+												padding-left: 0.3cm;
+												text-align: right;
+												width:3cm;
+										}
+										.art-col4{
+												width:3.4cm;
+												text-align: right;
+										}
+										.art-col5{
+												width:3.4cm;
+												text-align: right;
+										}
+
+										.total_pagar_data{
+												width: 17.5cm;
+												float: left;
+												font-size: 4.0mm;
+												padding-top: 0.01mm;
+												min-height: 0.3cm;
+										}
+
+								</style>
+
+								<t t-foreach="docs" t-as="o">
+										<div class="pagina">
+                        <div class="divisoria" ></div>
+												<div style="border:0.3px solid #000;"></div>
+												<div class="titulo" >
+														<h4 class="text-center"><strong>RECIBO DE DINERO Nº: <span t-field="o.name"/></strong></h4>
+														<h3 class="text-center">Flash Net</h3>
+												</div>
+
+												<div style="border:0.3px solid #000;"></div>
+												<div class="divisoria"> </div>
+												<div class="linea1">
+														<div class="fecha_emision_data"><b>FECHA: </b><span t-field="o.date_invoice" t-field-options='{"format": "dd MMMM yyyy"}'/></div>
+														<div class="number"><strong>REF. VENTA: </strong><span t-field="o.name"/></div>
+												</div>
+
+												<div class="linea2">
+														<div class="razon_data"><b>CLIENTE: </b><span t-field="o.partner_id.name"/></div>
+												</div>
+
+												<div class="linea3">
+														<div class="ruc"><b>R.U.C. Nº: </b><span t-field="o.partner_id.ruc"/></div>
+														<div class="due"><b>Vencimiento: </b><span t-field="o.date_due"/></div>
+												</div>
+
+												<div class="linea4">
+													  <div class="street"><b>DIRECCIÓN: </b><span t-field="o.partner_id.street"/></div>
+														<div class="mobile"><b>TÉLEFONO: </b><span t-field="o.partner_id.mobile"/></div>
+												</div>
+	                      <div class="linea5">
+														<div class="vendor"><b>COBRADOR: </b><span t-field="o.employee_id"/></div>
+														<div class="fechapago"><b>FECHA DE PAGO: </b></div>
+												</div>
+
+												<div class="divisoria"> </div>
+												<div style="border:0.3px solid #000;"></div>
+												<div class="divisoria"> </div>
+
+												<table class="table table-condensed table-bordered">
+														<thead>
+																<tr>
+																		<th class="art-col1">CODIGO</th>
+																		<th class="art-col2">DESCRIPCION</th>
+																		<th class="art-col3">CANT.</th>
+																		<th class="art-col4">P. UNIT </th>
+																		<th class="art-col5">SUBTOTAL</th>
+																</tr>
+													 </thead>
+													 <tbody class="sale_tbody">
+															 <t t-set="valor_mat" t-value="0"/>
+															 <t t-set="qty" t-value="0"/>
+																<tr t-foreach="o.invoice_line" t-as="l">
+																		<td class="art-col1">
+																				<span t-field="l.product_id.default_code"/>
+																		</td>
+																		<td class="art-col2">
+																			 Correspondiente al mes de <span t-field="o.date_invoice" t-field-options='{"format": "MMMM/yy"}'/>- Vence: <span t-field="o.date_due"/>
+																		</td>
+																		<td class="art-col3">
+																				<span t-esc= "'{0:,.0f}'.format(int(l.quantity)).replace(',', '.')">
+																						<span t-value="qty + l.quantity"/></span>
+																						<t t-set="qty" t-value="qty + l.quantity"/>
+																		</td>
+																		<td class="art-col4">
+																				<span t-esc="'{0:,.0f}'.format(l.price_unit)"/>
+																		</td>
+
+																		<td class="art-col5">
+																				<span t-esc= "'{0:,.0f}'.format((l.quantity * l.price_unit)).replace(',', '.')">
+																						<span t-value="valor_mat+(l.quantity * l.price_unit)"/></span>
+																						<t t-set="valor_mat" t-value="valor_mat+(l.quantity * l.price_unit)"/>
+																		</td>
+																</tr>
+
+														</tbody>
+												</table>
+												<div class="row">
+														<div class="col-xs-12 pull-right">
+																<table class="table table-condensed">
+																		<td class="art-col1"><b>Totales: </b></td>
+																		<td class="art-col2"></td>
+																		<td class="art-col3">
+																				<span t-esc="'{0:,.0f}'.format(int(qty)).replace(',', '.')"></span>
+																		</td>
+																		<td class="art-col4"></td>
+																		<td class="art-col5">
+																				<span t-esc="'{0:,.0f}'.format((valor_mat)).replace(',', '.')"></span>
+																		</td>
+																</table>
+														 </div>
+												</div>
+
+												<div class="row">
+														<div class="col-xs-12 pull-right">
+																<table class="table table-condensed">
+
+																		<tr class="border-black">
+																				<td><div class="total_pagar_data"><b>Total a pagar: </b><span t-esc="convertir(o.amount_total,o.currency_id.en_letras)"/>	Gs. <span t-esc="'{0:,.0f}'.format(o.amount_total)"/></div></td>
+
+																		</tr>
+																</table>
+
+														</div>
+
+												</div>
+										</div>
+                    <p style="page-break-after:always"></p>
+								</t>
+						</div>
+		    </t>
+
+	   </template>
+</data>
+</openerp>

+ 26 - 0
res_currency.py

@@ -0,0 +1,26 @@
+# -*- 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 openerp import models, fields
+
+class res_currency(models.Model):
+    _inherit = 'res.currency'
+    _name = 'res.currency'
+
+    en_letras = fields.Char('En letras')

BIN
res_currency.pyc


+ 16 - 0
res_currency_view.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+    <data>
+        <record id="res_currency_en_letras" model="ir.ui.view">
+            <field name="name">res.currency.en.letras</field>
+            <field name="model">res.currency</field>
+            <field name="inherit_id" ref="base.view_currency_form" />
+            <field name="arch" type="xml">
+                <field name="symbol" position="after">
+                    <field name="en_letras"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>

BIN
static/description/icon.png