Browse Source

Factura legal bioelectric

SEBAS 8 months ago
commit
c827e0856e

+ 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_bioelectric, nota_credito_bioelectric, account_invoice, res_currency, factura_legal_bioelectric, models

BIN
__init__.pyc


+ 45 - 0
__openerp__.py

@@ -0,0 +1,45 @@
+# -*- 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 bioelectric',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Factura Venta Legal bioelectric
+==========================
+
+Formato para imprimir la factura legal de bioelectric
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com',
+    'depends': ['base','account'],
+    'data': [
+        'factura_venta_bioelectric.xml',
+        'nota_credito_bioelectric.xml',
+        'factura_legal_bioelectric.xml',
+        'views/account_invoice_view.xml',
+        'account_invoice_view.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_legal_bioelectric.py

@@ -0,0 +1,30 @@
+from openerp import api, models
+import datetime
+from num2words import num2words
+
+class report_legal_bioelectric(models.AbstractModel):
+    _name = 'report.factura_venta_bioelectric.report_legal_bioelectric'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('factura_venta_bioelectric.report_legal_bioelectric')
+        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_bioelectric.report_legal_bioelectric', 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
factura_legal_bioelectric.pyc


+ 539 - 0
factura_legal_bioelectric.xml

@@ -0,0 +1,539 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+  <data>
+
+     <report id="factura_legal_bioelectric"
+        model="account.invoice"
+        string="Factura Legal"
+        report_type="qweb-html"
+        name="factura_venta_bioelectric.report_legal_bioelectric"
+        file="factura_venta_bioelectric.report_legal_bioelectric"
+     />
+
+    <template id="report_header_custom" inherit_id="report.external_layout_header">
+         <xpath expr="//div[@class='header']" position="replace">
+            <div class ="header">
+            </div>
+         </xpath>
+    </template>
+
+    <template id="external_layout_footer" inherit_id="report.external_layout_footer">
+        <xpath expr="//div[@class='footer']"  position="replace">
+            <div class ="footer">
+            </div>
+        </xpath>
+    </template>
+
+    <template id="report_legal_bioelectric">
+        <t t-call="report.html_container">
+            <t t-call="report.external_layout">
+			        <t t-foreach="[1]" t-as="i">
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 2.67mm;
+                            font-family: Arial, Helvetica, sans-serif;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        <!-- .header1 {
+                            display: flex;
+                            justify-content: space-between;
+                            align-items: center;
+                            width: 100%;
+                            padding: 20px;
+                            border: 2px solid #ddd;
+                            border-radius: 10px;
+                        } -->
+                        .client {
+                            border: 2px solid #ddd;
+                            border-radius: 10px;
+                            padding: 20px;
+                            margin-bottom: 20px;
+                            display: flex;
+                        }
+                        .sumas {
+                            border: 2px solid #ddd;
+                            border-radius: 10px;
+                            padding: 20px;
+                            margin-bottom: 20px;
+                            display: flex;
+                        }
+
+                        .logo{
+                            height: 0.6cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .descripcion1{
+                            width: 11.2cm;
+                            font-size: 11px;
+                            padding-top: 0.2cm;
+                            float: left;
+                            min-height: 0cm;
+                        }
+
+                        .descripcion2{
+                            width: 11cm;
+                            font-size: 10px;
+                            float: left;
+                            min-height: 0cm;
+                        }
+
+                        .descripcion3{
+                            width: 18cm;
+                            font-size: 10px;
+                            float: left;
+                            min-height: 0cm;
+                        }
+
+                        .email{
+                            width: 13cm;
+                            font-size: 10px;
+                            float: left;
+                            min-height: 0cm;
+                        }
+
+
+                        .tel{
+                            width: 18cm;
+                            float: left;
+                            font-size: 10px;
+                            min-height: 0cm;
+                        }
+
+                        .fecha_emision_data{
+                            width: 9.1cm;
+                            padding-left: 0.1cm;
+                            float: left;
+                            min-height: 0.6cm;
+                        }
+                        .contado_x{
+                            width: 7.4cm;
+                            float: left;
+                            padding-left: 0.0cm;
+                            min-height: 0.6cm;
+                        }
+
+                        .linea2{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .razon_data{
+                            width: 15cm;
+                            float: left;
+                            padding-left: 0.1cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea3{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .direccion_data{
+                            width: 13.5cm;
+                            float: left;
+                            padding-left: 0.1cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea4{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                         .ruc_data{
+                             width: 11.9cm;
+                             float: left;
+                             padding-left: 0.1cm;
+                             min-height: 0.4cm;
+                         }
+                        .telefono_data{
+                            width: 6.8cm;
+                            float: left;
+                            padding-left: 2.3cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea5{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .nota_remision_data{
+                            width: 8.3cm;
+                            float: left;
+                            padding-left: 2.5cm;
+                            min-height: 0.5cm;
+                        }
+
+                         .product {
+                               border-collapse: collapse;
+                               width: 100%;
+                           }
+
+                           .product th,
+                           .product td {
+                               border: 1px solid #ddd;
+                               padding: 10px;
+                               text-align: center;
+                           }
+                           .articulos{
+                               height: 7.65cm;
+                           }
+
+                        .art-col2{
+						                padding-left: 0.8cm;
+                            border-left: 2px solid #ddd;
+                            border-right: 2px solid #ddd;
+                            width:15%;
+                            text-align: center;
+                        }
+                        .art-col3{
+                            padding-left: 1cm;
+                            border-left: 2px solid #ddd;
+                            border-right: 2px solid #ddd;
+                            width:40%;
+                        }
+                        .art-col4{
+                            width:15%;
+                            border-left: 2px solid #ddd;
+                            border-right: 2px solid #ddd;
+                            text-align: right;
+                        }
+                        .art-col5{
+                            width:10%;
+                            border-left: 2px solid #ddd;
+                            border-right: 2px solid #ddd;
+                            text-align: right;
+                        }
+                        .art-col6{
+                            width:10%;
+                            border-left: 2px solid #ddd;
+                            border-right: 2px solid #ddd;
+                            text-align: right;
+                        }
+                        .art-col7{
+                            width:20%;
+                            border-left: 2px solid #ddd;
+                            border-right: 2px solid #ddd;
+                            text-align: right;
+                        }
+                        .logo-container {
+                          padding-top: 20px;
+                          padding-left: 2px;
+                          border-left: 2px solid #ddd;
+                          border-right: 2px solid #ddd;
+                          padding-bottom: 20px;
+                          padding-left: 19px;
+                        }
+
+						           .logo1{
+                            height: 0.2cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .logo2{
+                             height: 1.06cm;
+                             width: 100%;
+                             top: 0px;
+                         }
+                        .subtotal_data{
+                            width: 6cm;
+                            float: left;
+                            padding-top: 0.002cm;
+                            padding-left: 2.3cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_excentas{
+                            width: 1.8cm;
+                            float: left;
+                            text-align: right;
+							              padding-left: 10cm;
+                            padding-top: 0.7cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_5{
+                            width: 1cm;
+                            float: left;
+							              padding-left: 1cm;
+                            text-align: right;
+                            padding-top: 0.7cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_10{
+                            width: 2.3cm;
+                            float: left;
+							              padding-left: 0.8cm;
+                            text-align: left;
+                            padding-top: 0.7cm;
+                            min-height: 0.2cm;
+                        }
+                        .total_pagar_data{
+                            width: 16.4cm;
+                            float: left;
+                            padding-top: 0.01mm;
+                            padding-left: 0.1cm;
+                            min-height: 0.3cm;
+                        }
+                        .total_pagar{
+                            width: 2.3cm;
+                            float: right;
+                            padding-top: 0.01mm;
+                            padding-left: 0.8cm;
+                            min-height: 0.3cm;
+                        }
+                        .iva_5_data{
+                            width: 9cm;
+                            float: left;
+                            padding-left: 4.7cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_10_data{
+                            width: 7.2cm;
+                            float: left;
+                            padding-left: 3.8cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_total_data{
+                            width: 7cm;
+                            float: left;
+                            padding-left: 3.3cm;
+                            min-height: 0.25cm;
+                        }
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                          <div style="margin-top: 1.3cm;"></div>
+                          <div class="row" >
+                                <t></t>
+                      					<div class="col-xs-3" style="border-top-left-radius: 10px; border-bottom-left-radius: 10px; padding-left: 0.01mm; padding-top: 0.01mm; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+                                  <div class="logo-container">
+                                    	<img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % o.company_id.logo"
+                          							style="max-height: 125px;" />
+                                   </div>
+                                   <div style="margin-top: 0.3cm;"></div>
+                                   <t><center><strong>INNOVACIÓN, TECNOLOGÍA Y SEGURIDAD</strong></center></t>
+                                   <div style="margin-top: 0.3cm;"></div>
+                      					</div>
+                      				  <div class="col-xs-5" style="padding-left: 0.01mm; padding-top: 0.01mm; padding-bottom: 0.01mm; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+
+                                    <div >
+                      								<h3><center><strong><i>BIOELECTRIC</i></strong></center></h3>
+                      							</div>
+                      							<div>
+                      								<t><center><b>de Armando Javier Aguilar Ramos</b></center></t>
+                                      <t><center><b>Instalaciones eléctricas, electromécanicas y electrónicas.</b></center></t>
+                                      <t><center><b>Comercio al por menor de otros artículos N.C.P.</b></center></t>
+                                      <t><center><b>Comercio al por menor de otros artículos de Ferretería</b></center></t>
+                                      <t><center><b>Calle Cabo 7 Silvio Ovelar c/ Paso de Patria</b></center></t>
+                                      <t><center><b>San Antonio - Paraguay</b></center></t>
+                                      <t><center><b>bioelectricpy@gmail.com - (0981) 939 132</b></center></t>
+
+                      								<!-- <t>
+                      								<span t-field="o.company_id.phone" />
+                      								</t> -->
+
+                      							</div>
+
+                      						</div>
+                      						<div class="col-xs-4 pull-right" style="border-top-right-radius: 10px; padding-bottom: 0.2cm; border-bottom-right-radius: 10px;padding-left: 0.01mm; padding-top: 0.01mm; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+                                        <t></t>
+                                         <div style="margin-top: 0.3cm;"> </div>
+                          							<t>
+                                          <div>
+                          								  <!-- <center><strong>TIMBRADO Nº</strong><span t-field="o.timbrado" /></center> -->
+                                            <center><strong>TIMBRADO Nº</strong><span t-field="o.talonario_id" /></center>
+                                          </div>
+                          							</t>
+                          							<t>
+                                          <div>
+                          								   <!-- <center><strong>Fecha Inicio Vigencia:</strong><span t-field="o.talonario.fecha_inicio" /></center> -->
+                                             <center><strong>Fecha Inicio Vigencia:</strong>13/06/2024</center>
+                                          </div>
+                          							</t>
+                                        <t>
+                                          <div>
+                                             <!-- <center><strong>Fecha Fin Vigencia:</strong><span t-field="o.fecha_final"/></center> -->
+                                             <center><strong>Fecha Fin Vigencia:</strong>30/06/2025</center>
+                                          </div>
+                                        </t>
+                                        <t>
+                                          <div>
+                                             <center><strong>RUC:</strong><span t-field="o.company_id.vat" /></center>
+                                          </div>
+                                        </t>
+                                        <t>
+                                          <div>
+                                              <h3><center><strong>FACTURA</strong></center></h3>
+                                          </div>
+                                        </t>
+                                        <t>
+                                          <div>
+                          							   	<h4><center><strong><span t-field="o.name" /></strong></center></h4>
+                                          </div>
+                          							</t>
+                      							</div>
+                      			 <!-- </div> recuard-->
+                           </div>
+                           <div style="margin-top: 0.3cm;"></div>
+                           <!-- <div class="client"> -->
+
+                             <table style="border-collapse: collapse; width: 100%;">
+                              <tr>
+                                <td style="padding-left: 0.2cm; padding-top: 0.2cm; border-top: 3px solid #ddd; border-bottom: 2px solid #ddd; border-left: 3px solid #ddd; border-right: 2px solid #ddd; width: 50%;"><strong>Fecha: </strong><span t-field="o.date_invoice" t-field-options='{"format": "dd MMM yyyy"}'/></td>
+                                <td style="border-top: 3px solid #ddd; padding-top: 0.2cm; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 3px solid #ddd; width: 50%;">
+                                  <strong>Condición de Venta:</strong>
+                                    <t t-if="o.contado == True">Contado</t>
+                                    <t t-if="o.contado == False">Crédito</t>
+                                </td>
+                              </tr>
+                              </table>
+                              <table style="border-collapse: collapse; width: 100%;">
+                              <tr>
+                                <td style="padding-left: 0.2cm; border-top: 2px solid #ddd;  border-bottom: 2px solid #ddd; border-left: 3px solid #ddd; border-right: 3px solid #ddd; width: 100%;"><strong>Cliente: </strong><span t-field="o.partner_id.name"/></td>
+                                <!-- <td style="border: none;">Celda 4</td> -->
+                              </tr>
+                              </table>
+                              <table style="border-collapse: collapse; width: 100%;">
+                              <tr>
+                                <td style="padding-left: 0.2cm;  border-top: 2px solid #ddd;  border-bottom: 2px solid #ddd;; border-left: 3px solid #ddd; border-right: 3px solid #ddd; width: 100%;"><strong>Dirección: </strong><t t-f="o.partner_id.street"><span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/></t>
+                                <t t-f="not o.partner_id.street"> </t></td>
+                                <!-- <td style="border: none;"></td> -->
+                              </tr>
+                              </table>
+                              <table style="border-collapse: collapse; width: 100%;">
+                               <tr>
+                                 <td style="padding-left: 0.2cm; padding-top: 0.2cm; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd;; border-left: 3px solid #ddd; border-right: 2px solid #ddd; width: 50%;"><strong>Pedido por: </strong><span t-field="o.pedido_por" t-field-options='{"format": "dd MMM yyyy"}'/></td>
+                                 <td style="border-top: 2px solid #ddd; padding-top: 0.2cm; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd;; border-right: 3px solid #ddd; width: 50%;"><strong>Ficha Nº: </strong><span t-field="o.ficha_nro"/></td>
+                               </tr>
+                               </table>
+                              <table style="border-collapse: collapse; width: 100%;">
+                              <tr>
+                                <td style="padding-left: 0.2cm; padding-bottom: 0.2cm; border-top: 3px solid #ddd; border-bottom: 3px solid #ddd; border-left: 2px solid #ddd; border-right: none; width: 40%;"><strong>RUC Nº: </strong><span t-field="o.partner_id.ruc"/></td>
+                                <td style="border-top: 2px solid #ddd; padding-bottom: 0.2cm; border-bottom: 3px solid #ddd; border-left: 2px solid #ddd; border-right: 3px solid #ddd; width: 60%;"><strong>Teléfono: </strong><span t-field="o.partner_id.phone"/></td>
+                              </tr>
+                            </table>
+
+                            <div style="margin-top: 0.3cm;"></div>
+
+                            <table style="border-collapse: collapse; width: 100%;" class="product">
+                                <!-- <thead> -->
+                                    <tr>
+                                      <th style="padding: 0.2cm; width:10%; border-collapse: collapse; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;" class="text-center">Cantidad</th>
+                                      <th style="padding: 0.2cm; width:45%; border-collapse: collapse; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;" class="text-center">Descripción</th>
+                                      <th style="padding: 0.2cm; width:15%; border-collapse: collapse; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;" class="text-center">Precio Unit.</th>
+                                      <th style="padding: 0.2cm; width:10%; border-collapse: collapse; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;" class="text-center">Exentas</th>
+                                      <th style="padding: 0.2cm; width:10%; border-collapse: collapse; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;" class="text-center">IVA 5%</th>
+                                      <th style="padding: 0.2cm; width:20%; border-collapse: collapse; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;" class="text-center">IVA 10%</th>
+                                    </tr>
+                                <!-- </thead> -->
+                              </table>
+                             <div style="height: 8.60cm;border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+                                  <table style="border-collapse: collapse; width: 100%; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+                                        <tr t-foreach="o.invoice_line" t-as="l">
+                                          <td style="padding: 0.1cm; width:10%; border-collapse: collapse; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;"><span t-esc="'{0:,.0f}'.format(l.quantity)"/></td>
+                                          <td style="padding: 0.1cm; width:45%; border-collapse: collapse; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;"><span t-field="l.product_id.name"/></td>
+                                          <td style="padding: 0.1cm; width:15%; border-collapse: collapse; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;"></td>
+                                          <td style="text-align: right; padding: 0.1cm; width:10%; border-collapse: collapse; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;"></td>
+                                          <td style="text-align: right; padding: 0.1cm; width:10%; border-collapse: collapse; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;"></td>
+                                          <td style="text-align: right; padding: 0.1cm; width:15%; border-collapse: collapse; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;"><span t-esc="'{0:,.0f}'.format((l.quantity * l.price_unit))"/></td>
+                                        </tr>
+                                        <!-- Inserta más filas aquí -->
+                                 </table>
+                            </div>
+                            <div style="margin-top: 0.3cm;"></div>
+                            <table style="border-collapse: collapse; width: 100%; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+
+                                    <td colspan="3" style="text-align: left;"><strong>Subtotales:</strong></td>
+                                    <td></td>
+                                    <td></td>
+                                    <td></td>
+                                    <td style="text-align: right;"><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></td>
+                            </table>
+
+
+                            <!-- <div class="sumas"> -->
+                              <div style="margin-top: 0.3cm;"></div> <!-- Separación de 0,5 cm -->
+                                <table style="width: 100%;">
+                                   <tbody>
+                                       <tr>
+                                           <td style="width: 75%; padding: 10px; border: 1px solid #ccc;">
+                                               <div><strong>TOTAL A PAGAR (en letras) Gs.: </strong><span t-esc="convertir(o.amount_total,o.currency_id.en_letras)"/></div>
+                                           </td>
+                                           <td style="width: 25%; padding: 10px; border: 1px solid #ccc; text-align: right;">
+                                               <div><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></div>
+                                           </td>
+                                       </tr>
+                                   </tbody>
+                                </table>
+
+                                <div style="margin-top: 0.3cm;"></div> <!-- Separación de 0,5 cm -->
+                                  <table style="width: 100%;">
+                                     <tbody>
+                                         <tr>
+                                             <td style="width: 50%; padding: 10px; border: 1px solid #ccc;">
+                                                 <div><strong>Liquidación del IVA:(5%)</strong></div>
+                                             </td>
+                                             <td style="width: 20%; padding: 10px; border: 1px solid #ccc;">
+                                                 <div class="iva_10_data"><strong>(10%) </strong><span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></div>
+                                             </td>
+                                             <td style="width: 30%; padding: 10px; border: 1px solid #ccc;">
+                                                 <div class="iva_total_data"><strong>Total del IVA: </strong><span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></div>
+                                             </td>
+                                         </tr>
+                                     </tbody>
+                                  </table>
+
+
+                                  <div class="col-xs-8" style="border-top-left-radius: 10px; border-bottom-left-radius: 10px; padding-left: 0.01mm; padding-top: 0.01mm; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+
+
+                                      <div style="font-size: 1.71mm;">
+                                        <div style="margin-top: 0.3cm;"></div>
+                                        <t><center><b>Recibi conforme los servicios y mercaderías detallados en esta factura y pagaré el importe consignado al vencimiento del plazo señalado.Todos los efectos legales emergentes a esta obligación quedan sometidos a la jurisdicción de los tribunales de Asunción. A partir del vencimiento Bioelectric RUC 4474131-6, queda facultada a aplicar intereses legales y recargos por mora ala tasa máxima establecida por el Banco Central del Paraguay.  </b></center></t>
+                                        <t><center><b>Con la aceptación de la presente factura autorizo a Bioelectric RUC 4474131-6 para que un atraso posterior de 90 días en el pago del presente crédito, incluya mi nombre personal o razón social que represento, en cualquier registro general de acuerdo a lo establecido en la Ley 1969/02. El único comprobante de cancelación de la factura crédito constituye nuestro recibo oficial de cobranzas, el tiempo de repuesta a garantías o reclamos es de 24 a 72 hs según nivel de urgencias en días hábiles, los costos de servicios pueden variar según horario.</b></center></t>
+                                        <!-- <t><center><b>Comercio al por menor de otros artículos N.C.P.</b></center></t>
+                                        <t><center><b>Comercio al por menor de otros artículos de Ferretería</b></center></t>
+                                        <t><center><b>Calle Cabo 7 Silvio Ovelar c/ Paso de Patria</b></center></t>
+                                        <t><center><b>San Antonio - Paraguay</b></center></t>
+                                        <t><center><b>bioelectricpy@gmail.com - (0981) 939 132</b></center></t>  -->
+                                        <div style="margin-top: 0.3cm;"></div>
+                                      </div>
+
+                                  </div>
+                                  <div class="col-xs-4" style="border-top-left-radius: 10px; border-bottom-left-radius: 10px; padding-left: 0.01mm; padding-top: 0.01mm; border-top: 2px solid #ddd; border-bottom: 2px solid #ddd; border-left: 2px solid #ddd; border-right: 2px solid #ddd;">
+
+                                       <div  style="margin-top: 0.2cm;"><strong>Recibí conforme: .................................</strong></div>
+
+                                       <div style="margin-top: 0.2cm;"><strong>Aclaración: ........................................</strong></div>
+
+                                       <div style="margin-top: 0.2cm;"><strong>C.I.Nº: ............................................</strong></div>
+
+                                      <div style="margin-top: 0.2cm;"><strong>Teléfono: ...........................................</strong></div>
+                                      <div style="margin-top: 0.3cm;"></div>
+                                  </div>
+
+
+
+                        <t t-if="i == 1">
+                          <div class="logo2"> </div>
+                        </t>
+
+                        <!--   <t t-if="i == 2">
+                          <div class="logo2"> </div>
+                        </t>  -->
+                      </div>
+                    </t>
+                  </div>
+				        </t>
+              </t>
+          </t>
+    </template>
+
+ </data>
+</openerp>

+ 342 - 0
factura_legal_bioelectric2.xml

@@ -0,0 +1,342 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="factura_legal_bioelectric"
+        model="account.invoice"
+        string="Factura Legal"
+        report_type="qweb-html"
+        name="factura_venta_bioelectric.report_legal_bioelectric"
+        file="factura_venta_bioelectric.report_legal_bioelectric"
+     />
+
+    <template id="report_header_custom" inherit_id="report.external_layout_header">
+         <xpath expr="//div[@class='header']" position="replace">
+            <div class ="header">
+            </div>
+         </xpath>
+    </template>
+
+    <template id="external_layout_footer" inherit_id="report.external_layout_footer">
+        <xpath expr="//div[@class='footer']"  position="replace">
+            <div class ="footer">
+            </div>
+        </xpath>
+    </template>
+
+    <template id="report_legal_bioelectric">
+        <t t-call="report.html_container">
+            <t t-call="report.external_layout">
+			    <t t-foreach="[1,2]" t-as="i">
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 2.7mm;
+                            font-family: Arial, Helvetica, sans-serif;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        .logo{
+                            height: 1.83cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .fecha_emision_data{
+                            width: 10.6cm;
+                            padding-left: 3.8cm;
+                            float: left;
+                            min-height: 0.6cm;
+                        }
+                        .contado_x{
+                            width: 3.7cm;
+                            float: right;
+                            padding-left: 0.7cm;
+                            min-height: 0.6cm;
+                        }
+                        .linea2{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.5cm;
+                         }
+                        .razon_data{
+                            width: 13cm;
+                            float: left;
+                            padding-left: 4.9cm;
+                            min-height: 0.4cm;
+                        }
+                        .ruc_data{
+                            width: 5.5cm;
+                            float: left;
+                            padding-left: 1.8cm;
+                            min-height: 0.4cm;
+                        }
+                        .linea3{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.3cm;
+                         }
+                        .direccion_data{
+                            width: 14cm;
+                            float: left;
+                            padding-left: 3.5cm;
+                            min-height: 0.5cm;
+                        }
+                        .telefono_data{
+                            width: 10cm;
+                            float: left;
+                            padding-left: 6.9cm;
+                            min-height: 0.4cm;
+                        }
+                        .linea4{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.3cm;
+                         }
+
+                        .linea5{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+
+
+                        .cab-articulos{
+                            height: 0.92cm;
+                            clear: both;
+                        }
+                        .articulos{
+                            height: 7.12cm;
+                        }
+                        .art-col1{
+                            width:2.3cm;
+                            text-align: center;
+                        }
+                        .art-col2{
+							              padding-left: 0.93cm;
+                            width:1.8cm;
+                            text-align: center;
+                        }
+                        .art-col3{
+                            padding-left: 0.05cm;
+                            width:7.65cm;
+                        }
+                        .art-col4{
+                            width:1.5cm;
+                            text-align: right;
+                        }
+                        .art-col5{
+                            width:2.2cm;
+                            text-align: right;
+                        }
+                        .art-col6{
+                            width:2.0cm;
+                            text-align: right;
+                        }
+                        .art-col7{
+                            width:1.7cm;
+                            text-align: right;
+                        }
+						           .logo1{
+                            height: 1.85cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .logo2{
+                             height: 3.38cm;
+                             width: 100%;
+                             top: 0px;
+                         }
+
+                        .logo3{
+                             height: 0.4cm;
+                             width: 100%;
+                             top: 0px;
+                         }
+
+                         .art-col21{
+                             width:0.9cm;
+                             text-align: center;
+                         }
+                         .art-col22{
+                            padding-left: 0.93cm;
+                             width:1cm;
+                             text-align: center;
+                         }
+                         .art-col23{
+                             padding-left: 0.3cm;
+                              text-align: right;
+                             width:7.2cm;
+                         }
+                         .art-col24{
+                             width:1.5cm;
+                             text-align: right;
+                         }
+                         .art-col25{
+                             width:2.5cm;
+                             text-align: left;
+                         }
+                         .art-col26{
+                             width:2.2cm;
+                             text-align: left;
+                         }
+                         .art-col27{
+                             width:3.4cm;
+                             text-align: right;
+                         }
+
+                        .subtotal_excentas{
+                            width: 1cm;
+                            float: left;
+                            text-align: right;
+							              padding-left: 0.3cm;
+                            padding-top: 0.5cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_5{
+                            width: 0.7cm;
+                            float: left;
+							              padding-left: 0.3cm;
+                            text-align: right;
+                            padding-top: 0.5cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_10{
+                            width: 2.5cm;
+                            float: right;
+							              padding-left: 1.1cm;
+                            text-align: right;
+                            padding-top: 0.5cm;
+                            min-height: 0.2cm;
+                        }
+                        .total_pagar_data{
+                            width: 11.5cm;
+                            float: left;
+                            padding-top: 1.5cm;
+                            padding-left: 2cm;
+                            min-height: 0.2cm;
+                        }
+                        .total_pagar{
+                            width: 6.2cm;
+                            float: left;
+                            padding-top: 0.4cm;
+                            padding-left: 0.9cm;
+                            min-height: 0.25cm;
+                        }
+
+                        .iva_5_data{
+                            width:6cm;
+                            float: left;
+                            padding-top: 0.5cm;
+                            padding-left: 6.0cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_10_data{
+                            width: 5.0cm;
+                            float: left;
+                            padding-top: 0.5cm;
+                            padding-left: 1.5cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_total_data{
+                            width: 4.2cm;
+                            float: left;
+                            padding-top: 0.5cm;
+                            padding-left: 0.5cm;
+                            min-height: 0.25cm;
+                        }
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="logo"> </div>
+                            <div class="linea1">
+                                <div class="fecha_emision_data"><span t-field="o.date_invoice" t-field-options='{"format": "dd MMMM yyyy"}'/></div>
+                                <div class="contado_x">
+                                    <t t-if="o.contado">Contado</t><t t-if="o.credito">Crédito</t>
+                                </div>
+                            </div>
+
+                            <div class="linea2">
+                                <div class="razon_data"><span t-field="o.partner_id.name"/></div>
+                                <div class="ruc_data"><span t-field="o.partner_id.ruc"/></div>
+                            </div>
+
+                            <div class="linea3">
+                                <div class="direccion_data">
+                                    <t t-f="o.partner_id.street"><span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/></t>
+                                    <t t-f="not o.partner_id.street"> </t>
+                                    <div class="telefono_data"><span t-field="o.partner_id.phone"/></div>
+                                </div>
+                            </div>
+
+                            <div class="linea4">
+
+                            </div>
+							              <div class="linea5">
+
+                            </div>
+                            <div class="cab-articulos"> </div>
+                            <div class="articulos">
+                                <table class="tab-articulos">
+                                    <tr t-foreach="o.invoice_line" t-as="l">
+                                        <td class="art-col1"></td>
+                                        <td class="art-col2"><span t-esc="'{0:,.0f}'.format(l.quantity)"/></td>
+                                        <td class="art-col3"><span t-field="l.name"/></td>
+                                        <td class="art-col4"><span t-esc="'{0:,.0f}'.format(l.price_unit)"/></td>
+                                        <td class="art-col5"> </td>
+                                        <td class="art-col6"> </td>
+                                        <td class="art-col7"><span t-esc="'{0:,.0f}'.format(l.price_unit*l.quantity)"/></td>
+                                   </tr>
+                                </table>
+                            </div>
+
+
+                                <table class="tab-articulos">
+                                        <td class="art-col1"> </td>
+                                        <td class="art-col2"> </td>
+                                        <td class="art-col3"> </td>
+                                        <td class="art-col4"> </td>
+                                        <td class="art-col5"> </td>
+                                        <td class="art-col6"> </td>
+                                        <td class="art-col7"><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></td>
+                                </table>
+
+                                <div class="logo3"> </div>
+                                <table class="tab-articulos1">
+                                        <td class="art-col21"> </td>
+                                        <td class="art-col22"> </td>
+                                        <td class="art-col23"><span t-esc="convertir(o.amount_total,o.currency_id.en_letras)"/> </td>
+                                        <td class="art-col24"></td>
+                                        <td class="art-col25"> </td>
+                                        <td class="art-col26"> </td>
+                                        <td class="art-col27"><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></td>
+                                </table>
+                                <div class="logo3"> </div>
+                                <table class="tab-articulos">
+                                        <td class="art-col21"> </td>
+                                        <td class="art-col22"></td>
+                                        <td class="art-col23"> <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></td>
+                                        <td class="art-col24"></td>
+                                        <td class="art-col25"></td>
+                                        <td class="art-col26"><span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></td>
+                                        <td class="art-col27"></td>
+                                </table>
+
+                         </div>
+                         <t t-if="i == 1">
+                              <div class="logo1"> </div>
+                          </t>
+
+                    </t>
+                </div>
+				</t>
+            </t>
+        </t>
+    </template>
+
+</data>
+</openerp>

+ 30 - 0
factura_venta_bioelectric.py

@@ -0,0 +1,30 @@
+from openerp import api, models
+import datetime
+from num2words import num2words
+
+class report_factura_bioelectric(models.AbstractModel):
+    _name = 'report.factura_venta_bioelectric.report_factura_bioelectric'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('factura_venta_bioelectric.report_factura_bioelectric')
+        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_bioelectric.report_factura_bioelectric', 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
factura_venta_bioelectric.pyc


+ 305 - 0
factura_venta_bioelectric.xml

@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="factura_venta_bioelectric"
+        model="account.invoice"
+        string="Factura Legal"
+        report_type="qweb-html"
+        name="factura_venta_bioelectric.report_factura_bioelectric"
+        file="factura_venta_bioelectric.report_factura_bioelectric"
+     />
+
+    <template id="report_header_custom" inherit_id="report.external_layout_header">
+         <xpath expr="//div[@class='header']" position="replace">
+            <div class ="header">
+            </div>
+         </xpath>
+    </template>
+
+    <template id="external_layout_footer" inherit_id="report.external_layout_footer">
+        <xpath expr="//div[@class='footer']"  position="replace">
+            <div class ="footer">
+            </div>
+        </xpath>
+    </template>
+
+    <template id="report_factura_bioelectric">
+        <t t-call="report.html_container">
+            <t t-call="report.external_layout">
+			    <t t-foreach="[1,2]" t-as="i">
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 2.67mm;
+                            font-family: Arial, Helvetica, sans-serif;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        .logo{
+                            height: 3.5cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .fecha_emision_data{
+                            width: 13.1cm;
+                            padding-left: 4.9cm;
+                            float: left;
+                            min-height: 0.6cm;
+                        }
+                        .contado_x{
+                            width: 0.4cm;
+                            float: left;
+                            padding-left: 0.2cm;
+                            min-height: 0.6cm;
+                        }
+                        .credito_x{
+                            width: 0.3cm;
+                            float: left;
+                            padding-left: 0.8cm;
+                            min-height: 0.6cm;
+                        }
+                        .linea2{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .razon_data{
+                            width: 15cm;
+                            float: left;
+                            padding-left: 4.9cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea3{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .direccion_data{
+                            width: 13.5cm;
+                            float: left;
+                            padding-left: 4.7cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea4{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                         .ruc_data{
+                             width: 11.9cm;
+                             float: left;
+                             padding-left: 4.1cm;
+                             min-height: 0.4cm;
+                         }
+                        .telefono_data{
+                            width: 6.8cm;
+                            float: left;
+                            padding-left: 2.3cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea5{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .nota_remision_data{
+                            width: 8.3cm;
+                            float: left;
+                            padding-left: 2.5cm;
+                            min-height: 0.5cm;
+                        }
+
+                        .cab-articulos{
+                            height: 0.4cm;
+                            clear: both;
+                        }
+                        .articulos{
+                            height: 4.92cm;
+                        }
+                        .art-col2{
+						                padding-left: 0.0cm;
+                            width:0.7cm;
+                            text-align: center;
+                        }
+                        .art-col3{
+                            padding-left: 0.3cm;
+                            width:9.7cm;
+                        }
+                        .art-col4{
+                            width:2.1cm;
+                            text-align: right;
+                        }
+                        .art-col5{
+                            width:1.9cm;
+                            text-align: right;
+                        }
+                        .art-col6{
+                            width:2.3cm;
+                            text-align: right;
+                        }
+                        .art-col7{
+                            width:2.1cm;
+                            text-align: right;
+                        }
+						           .logo1{
+                            height: 2.48cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .logo2{
+                             height: 0.46cm;
+                             width: 100%;
+                             top: 0px;
+                         }
+                        .subtotal_data{
+                            width: 6cm;
+                            float: left;
+                            padding-top: 0.002cm;
+                            padding-left: 2.3cm;
+                            min-height: 0.9cm;
+                        }
+                        .subtotal_excentas{
+                            width: 1.8cm;
+                            float: left;
+                            text-align: right;
+							              padding-left: 10cm;
+                            padding-top: 0.7cm;
+                            min-height: 0.9cm;
+                        }
+                        .subtotal_5{
+                            width: 1cm;
+                            float: left;
+							              padding-left: 1cm;
+                            text-align: right;
+                            padding-top: 0.7cm;
+                            min-height: 0.9cm;
+                        }
+                        .subtotal_10{
+                            width: 2.3cm;
+                            float: left;
+						              	padding-left: 0.8cm;
+                            text-align: left;
+                            padding-top: 0.7cm;
+                            min-height: 0.9cm;
+                        }
+                        .total_pagar_data{
+                            width: 16.4cm;
+                            float: left;
+                            padding-top: 0.06mm;
+                            padding-left: 4.8cm;
+                            min-height: 0.7cm;
+                        }
+                        .total_pagar{
+                            width: 2.3cm;
+                            float: right;
+                            padding-top: 0.06mm;
+                            padding-left: 0.8cm;
+                            min-height: 0.7cm;
+                        }
+                        .iva_5_data{
+                            width: 5cm;
+                            float: left;
+                            padding-top: 0.08mm;
+                            padding-left: 4.7cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_10_data{
+                            width: 5.2cm;
+                            float: left;
+                            padding-top: 0.08mm;
+                            padding-left: 3.8cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_total_data{
+                            width: 7cm;
+                            float: left;
+                            padding-top: 0.08mm;
+                            padding-left: 3.3cm;
+                            min-height: 0.25cm;
+                        }
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="logo"> </div>
+                            <div class="linea1">
+                                <div class="fecha_emision_data"><span t-field="o.date_invoice" t-field-options='{"format": "dd MMM yyyy"}'/></div>
+                                <div class="contado_x">
+                                    <t t-if="o.contado == True">X</t>
+                                    <t t-if="o.contado == False"></t>
+                                </div>
+                                <div class="credito_x">
+                                    <t t-if="o.credito == True">X</t>
+                                    <t t-if="o.credito == False"></t>
+                                </div>
+                            </div>
+
+                            <div class="linea2">
+                                <div class="razon_data"><span t-field="o.partner_id.name"/></div>
+                            </div>
+
+                            <div class="linea3">
+                                <div class="direccion_data">
+                                    <t t-f="o.partner_id.street"><span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/></t>
+                                    <t t-f="not o.partner_id.street"> </t>
+                                </div>
+                            </div>
+
+                            <div class="linea4">
+                                <div class="ruc_data"><span t-field="o.partner_id.ruc"/></div>
+                                <div class="telefono_data"><span t-field="o.partner_id.phone"/></div>
+                            </div>
+							              <div class="linea5">
+                            <div class="nota_remision_data"> </div>
+                            </div>
+                            <div class="cab-articulos"> </div>
+                            <div class="articulos">
+
+                                <table class="tab-articulos">
+                                    <tr t-foreach="o.invoice_line" t-as="l">
+                                        <td class="art-col2"><span t-esc="'{0:,.2f}'.format(l.quantity)"/></td>
+                                        <td class="art-col3"><span t-field="l.product_id.name"/></td>
+                                        <td class="art-col4"><span t-esc="'{0:,.0f}'.format(l.price_unit)"/></td>
+                                        <td class="art-col5"> </td>
+                                        <td class="art-col6"> </td>
+                                        <td class="art-col7"><span t-esc="'{0:,.0f}'.format((l.quantity * l.price_unit))"/></td>
+                                   </tr>
+                                </table>
+
+                            </div>
+
+                             <div class="subtotal_data"> </div>
+                             <div class="subtotal_excentas"> </div>
+                             <div class="subtotal_5"> </div>
+                             <td style="font-size:7.0px;">
+                                <div class="subtotal_10"><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></div>
+                            </td>
+                            <div class="total_pagar_data">Gs.: <span t-esc="convertir(o.amount_total,o.currency_id.en_letras)"/></div>
+                            <div class="total_pagar"><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></div>
+
+
+                             <div class="iva_5_data"> </div>
+                             <div class="iva_10_data"><span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></div>
+                             <div class="iva_total_data"><span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></div>
+                        </div>
+                        <t t-if="i == 1">
+                          <div class="logo1"> </div>
+                        </t>
+
+                        <t t-if="i == 2">
+                          <div class="logo2"> </div>
+                        </t>
+                    </t>
+                </div>
+				</t>
+            </t>
+        </t>
+    </template>
+
+</data>
+</openerp>

+ 3 - 0
models/__init__.py

@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import account_invoice

BIN
models/__init__.pyc


+ 10 - 0
models/account_invoice.py

@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+
+from openerp import api, models, fields
+
+class account_invoice(models.Model):
+    _inherit = "account.invoice"
+    _name = 'account.invoice'
+
+    pedido_por = fields.Char(string='Pedido por')
+    ficha_nro = fields.Char(string='Ficha Nº')

BIN
models/account_invoice.pyc


+ 30 - 0
nota_credito_bioelectric.py

@@ -0,0 +1,30 @@
+from openerp import api, models
+import datetime
+from num2words import num2words
+
+class report_notacredito_2ca(models.AbstractModel):
+    _name = 'report.factura_venta_2ca.report_notacredito_2ca'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('factura_venta_2ca.report_notacredito_2ca')
+        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_2ca.report_notacredito_2ca', 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
nota_credito_bioelectric.pyc


+ 293 - 0
nota_credito_bioelectric.xml

@@ -0,0 +1,293 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="nota_credito_bioelectric"
+        model="account.invoice"
+        string="Nota de crédito"
+        report_type="qweb-html"
+        name="factura_venta_bioelectric.report_notacredito_bioelectric"
+        file="factura_venta_bioelectric.report_notacredito_bioelectric"
+     />
+
+    <template id="report_header_custom" inherit_id="report.external_layout_header">
+         <xpath expr="//div[@class='header']" position="replace">
+            <div class ="header">
+            </div>
+         </xpath>
+    </template>
+
+    <template id="external_layout_footer" inherit_id="report.external_layout_footer">
+        <xpath expr="//div[@class='footer']"  position="replace">
+            <div class ="footer">
+            </div>
+        </xpath>
+    </template>
+
+    <template id="report_notacredito_bioelectric">
+        <t t-call="report.html_container">
+            <t t-call="report.external_layout">
+			    <t t-foreach="[1,2,3]" t-as="i">
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 2.67mm;
+                            font-family: Arial, Helvetica, sans-serif;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        .logo{
+                            height: 0.4cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .fecha_emision_data{
+                            width: 11cm;
+                            padding-left: 9cm;
+                            float: left;
+                            min-height: 0.6cm;
+                        }
+                        .contado_x{
+                            width: 0.5cm;
+                            float: left;
+                            padding-left: 1.8cm;
+                            min-height: 0.6cm;
+                        }
+                        .credito_x{
+                            width: 0.5cm;
+                            float: left;
+                            padding-left: 1.3cm;
+                            min-height: 0.6cm;
+                        }
+                        .linea2{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .razon_data{
+                            width: 15cm;
+                            float: left;
+                            padding-left: 9.9cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea3{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .direccion_data{
+                            width: 14cm;
+                            float: left;
+                            padding-left: 9.5cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea4{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                         .ruc_data{
+                             width: 10.7cm;
+                             float: left;
+                             padding-left: 9.1cm;
+                             min-height: 0.4cm;
+                         }
+                        .telefono_data{
+                            width: 6.8cm;
+                            float: left;
+                            padding-left: 2.3cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea5{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .nota_remision_data{
+                            width: 8.3cm;
+                            float: left;
+                            padding-left: 2.5cm;
+                            min-height: 0.5cm;
+                        }
+
+                        .cab-articulos{
+                            height: 0.7cm;
+                            clear: both;
+                        }
+                        .articulos{
+                            height: 3.65cm;
+                        }
+                        .art-col1{
+                            width:0.9cm;
+                            text-align: center;
+                        }
+                        .art-col2{
+						    padding-left: 0.8cm;
+                            width:1cm;
+                            text-align: center;
+                        }
+                        .art-col3{
+                            padding-left: 1cm;
+                            width:9.4cm;
+                        }
+                        .art-col4{
+                            width:1.9cm;
+                            text-align: right;
+                        }
+                        .art-col5{
+                            width:2.2cm;
+                            text-align: right;
+                        }
+                        .art-col6{
+                            width:2.5cm;
+                            text-align: right;
+                        }
+                        .art-col7{
+                            width:1.9cm;
+                            text-align: right;
+                        }
+						.logo1{
+                            height: 3.83cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .subtotal_data{
+                            width: 6cm;
+                            float: left;
+                            padding-top: 0.002cm;
+                            padding-left: 2.3cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_excentas{
+                            width: 1.8cm;
+                            float: left;
+                            text-align: right;
+						    padding-left: 10cm;
+                            padding-top: 0.7cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_5{
+                            width: 1cm;
+                            float: left;
+							padding-left: 1cm;
+                            text-align: right;
+                            padding-top: 0.7cm;
+                            min-height: 0.2cm;
+                        }
+                        .subtotal_10{
+                            width: 2.3cm;
+                            float: left;
+							padding-left: 0.8cm;
+                            text-align: left;
+                            padding-top: 0.7cm;
+                            min-height: 0.2cm;
+                        }
+                        .total_pagar_data{
+                            width: 16.4cm;
+                            float: left;
+                            padding-top: 0.01mm;
+                            padding-left: 4.8cm;
+                            min-height: 0.3cm;
+                        }
+                        .total_pagar{
+                            width: 2.3cm;
+                            float: right;
+                            padding-top: 0.01mm;
+                            padding-left: 0.8cm;
+                            min-height: 0.3cm;
+                        }
+                        .iva_5_data{
+                            width: 5cm;
+                            float: left;
+                            padding-left: 4.7cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_10_data{
+                            width: 5cm;
+                            float: left;
+                            padding-left: 3.8cm;
+                            min-height: 0.25cm;
+                        }
+                        .iva_total_data{
+                            width: 7cm;
+                            float: left;
+                            padding-left: 3.6cm;
+                            min-height: 0.25cm;
+                        }
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="logo"> </div>
+                            <div class="linea1">
+                                <div class="fecha_emision_data"><span t-field="o.date_invoice" t-field-options='{"format": "dd MMM yyyy"}'/></div>
+                                <div class="contado_x">
+                                    <t t-if="o.contado == True">x</t>
+                                    <t t-if="o.contado == False"></t>
+                                </div>
+                                <div class="credito_x">
+                                    <t t-if="o.credito == True">x</t>
+                                    <t t-if="o.credito == False"></t>
+                                </div>
+                            </div>
+
+                            <div class="linea2">
+                                <div class="razon_data"><span t-field="o.partner_id.name"/></div>
+                            </div>
+
+                            <div class="linea3">
+                                <div class="direccion_data">
+                                    <t t-f="o.partner_id.street"><span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/></t>
+                                    <t t-f="not o.partner_id.street"> </t>
+                                </div>
+                            </div>
+
+                            <div class="linea4">
+                                <div class="ruc_data"><span t-field="o.partner_id.ruc"/></div>
+                                <div class="telefono_data"><span t-field="o.partner_id.phone"/></div>
+                            </div>
+							<div class="linea5">
+                                <div class="nota_remision_data"> </div>
+                            </div>
+                            <div class="cab-articulos"> </div>
+                            <div class="articulos">
+                                <table class="tab-articulos">
+                                    <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"><span t-esc="'{0:,.0f}'.format(l.quantity)"/></td>
+                                        <td class="art-col3"><span t-field="l.product_id.name"/></td>
+                                        <td class="art-col4"><span t-esc="'{0:,.0f}'.format(l.price_unit)"/></td>
+                                        <td class="art-col5"> </td>
+                                        <td class="art-col6"> </td>
+                                        <td class="art-col7"><span t-esc="'{0:,.0f}'.format(l.price_unit*l.quantity)"/></td>
+                                   </tr>
+                                </table>
+                            </div>
+
+                             <div class="subtotal_data"> </div>
+                             <div class="subtotal_excentas"> </div>
+                             <div class="subtotal_5"> </div>
+                             <td style="font-size:7.0px;">
+                                <div class="subtotal_10"><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></div>
+                            </td>
+                             <div class="total_pagar_data">Gs.: <span t-esc="convertir(o.amount_total,o.currency_id.en_letras)"/></div>
+                             <div class="total_pagar"><span t-esc="'{0:,.0f}'.format(o.amount_total)"/></div>
+
+                             <div class="iva_5_data"> </div>
+                             <div class="iva_10_data"><span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></div>
+                             <div class="iva_total_data"><span t-esc="'{0:,.0f}'.format(o.amount_tax)"/></div>
+                        </div>
+                       <div class="logo1"> </div>
+                    </t>
+                </div>
+				</t>
+            </t>
+        </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


+ 42 - 0
views/account_invoice_view.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+    <data>
+
+        <record id="account_invoice_pedido_form" model="ir.ui.view">
+            <field name="name">account.invoice.pedido</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form" />
+            <field name="arch" type="xml">
+                <field name="partner_id" position="after">
+                        <field name="pedido_por"/>
+                        <field name="ficha_nro"/>
+                </field>
+            </field>
+        </record>
+
+        <record id="account_invoiced_pedido_view" model="ir.ui.view">
+            <field name="name">account.invoiced.pedido.view</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_tree" />
+            <field name="arch" type="xml">
+                <field name="date_invoice" position="before">
+                    <field name="pedido_por"/>
+                    <field name="ficha_nro"/>
+                </field>
+            </field>
+        </record>
+
+        <record id="view_accountinvoices_filterficha_search" model="ir.ui.view">
+            <field name="name">accountinvoices.filterficha.search</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.view_account_invoice_filter" />
+            <field name="arch" type="xml">
+              <search>
+                   <field name="ficha_nro"/>
+               </search>
+            </field>
+        </record>
+
+    </data>
+</openerp>