Explorar o código

Para imprimir recibo de pago 2ca

Sebas %!s(int64=5) %!d(string=hai) anos
achega
8c2651a17f
Modificáronse 10 ficheiros con 371 adicións e 0 borrados
  1. 28 0
      __init__.py
  2. BIN=BIN
      __init__.pyc
  3. 46 0
      __openerp__.py
  4. 29 0
      report_recibo2ca.py
  5. BIN=BIN
      report_recibo2ca.pyc
  6. 221 0
      report_recibo2ca.xml
  7. 31 0
      res_currency.py
  8. BIN=BIN
      res_currency.pyc
  9. 16 0
      res_currency_view.xml
  10. BIN=BIN
      static/description/icon.png

+ 28 - 0
__init__.py

@@ -0,0 +1,28 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_brand for OpenERP                                                  #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Mathieu Lemercier, mathieu@netandco.net,                          #
+#             Franck Bret, franck@netandco.net                                  #
+#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>   #
+#                                                                               #
+#    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 report_recibo2ca, res_currency

BIN=BIN
__init__.pyc


+ 46 - 0
__openerp__.py

@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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/>.
+#
+##############################################################################
+
+
+{
+    'name': 'Recibo de Cobro',
+    'version': '1.1',
+    'category': 'Ventas',
+    'sequence': 19,
+    'summary': 'Recibo',
+    'description': """
+Recibo 2CA
+===============
+
+Recibo 2CA.
+
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com',
+    'depends': ['base','sale','account'],
+    'data': [
+        'report_recibo2ca.xml',
+        'res_currency_view.xml',
+    ],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 29 - 0
report_recibo2ca.py

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


+ 221 - 0
report_recibo2ca.xml

@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="informe_recibo_2ca"
+        model="account.voucher"
+        string="Recibo"
+        report_type="qweb-html"
+        name="recibo_2ca.recibo_2ca"
+        file="recibo_2ca.recibo_2ca"
+     />
+
+    <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="recibo_2ca">
+        <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: 3.2mm;
+                            font-family: Arial, Helvetica, sans-serif;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        .logo{
+                            width: 100%;
+                            top: -0.12cm;
+                            top: 0px;
+                        }
+                        .fecha_emision_data{
+                            width: 12.5cm;
+                            padding-left: 9.7cm;
+                            float: left;
+                            min-height: 1.4cm;
+                        }
+                        .contado_x{
+                            width: 1.0cm;
+                            float: left;
+                            padding-left: 1.1cm;
+                            min-height: 1.4cm;
+                        }
+                        .credito_x{
+                            width: 4.5cm;
+                            float: left;
+                            padding-left: 1.3cm;
+                            min-height: 1.4cm;
+                        }
+                        .linea2{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .razon_data{
+                            width: 11.cm;
+                            float: left;
+                            padding-left: 12.9cm;
+                            min-height: 2.1cm;
+                        }
+                        .linea3{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                        .direccion_data{
+                            width: 16cm;
+                            float: left;
+                            padding-left: 13.5cm;
+                            min-height: 1.0cm;
+                        }
+                        .linea4{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+                         .ruc_data{
+                             width: 12.1cm;
+                             float: left;
+                             padding-left: 8.5cm;
+                             min-height: 1.5cm;
+                         }
+                        .telefono_data{
+                            width: 6.8cm;
+                            float: left;
+                            padding-left: 3.4cm;
+                            min-height: 1.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.5cm;
+                            clear: both;
+                        }
+
+                        .divisoria2{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 2.9cm;
+                        }
+
+                        .descripcion4{
+                            width: 13cm;
+                            padding-left: 7.9cm;
+                            float: left;
+                            min-height: 1.6cm;
+                        }
+
+                        .divisoria3{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.5cm;
+                        }
+
+                        .descripcion5{
+                            width: 13cm;
+                            padding-left: 8.9cm;
+                            float: left;
+                            min-height: 1.1cm;
+                        }
+
+                        .divisoria4{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.5cm;
+                        }
+
+                        .fecha{
+                            width: 13cm;
+                            padding-left: 2cm;
+                            float: left;
+                            min-height: 0.5cm;
+                        }
+
+                        .logo1{
+                            min-height: 4.0cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="logo"> </div>
+                            <div class="linea1">
+                                <div class="fecha_emision_data"></div>
+                                <div class="contado_x">
+
+                                </div>
+                                <div class="credito_x">
+                                    <span t-esc="'{0:,.0f}'.format(o.amount)"/>
+                                </div>
+                            </div>
+
+                            <div class="linea2">
+
+                            </div>
+
+                            <div class="linea3">
+                                <div class="direccion_data">
+                                    <span t-field="o.number"/>
+                                </div>
+                            </div>
+
+                            <div class="linea4">
+                                <div class="ruc_data"><span t-field="o.partner_id.name"/></div>
+                                <div class="telefono_data"><span t-field="o.partner_id.ruc"/></div>
+                            </div>
+							<div class="linea5">
+                            </div>
+
+                            <div class="divisoria2">
+								<div class="descripcion4"><span t-esc="convertir(o.amount,o.currency_id.en_letras1)"/></div>
+
+							</div>
+                            <div class="cab-articulos"> </div>
+							<div class="divisoria3">
+								<div class="descripcion5"><span t-field="o.reference"/></div>
+
+							</div>
+							<div class="divisoria4">
+								<div class="fecha"><span t-field="o.date" t-field-options='{"format": "d MMMM y"}'/></div>
+
+							</div>
+                        </div>
+                       <div class="logo1"> </div>
+                    </t>
+                </div>
+				</t>
+            </t>
+        </t>
+    </template>
+
+</data>
+</openerp>

+ 31 - 0
res_currency.py

@@ -0,0 +1,31 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    product_features for OpenERP                                                  #
+#    Copyright (C) 2009 NetAndCo (<http://www.netandco.net>).                   #
+#    Authors, Mathieu Lemercier, mathieu@netandco.net,                          #
+#             Franck Bret, franck@netandco.net                                  #
+#    Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>   #
+#                                                                               #
+#    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_letras1 = fields.Char('En letras')

BIN=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_letras1"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>

BIN=BIN
static/description/icon.png