Browse Source

Modulo para imprimir pagaré Athletic

sebas 4 years ago
commit
6c19639df8
10 changed files with 276 additions and 0 deletions
  1. 28 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 46 0
      __openerp__.py
  4. 29 0
      report_pagaregolden.py
  5. BIN
      report_pagaregolden.pyc
  6. 120 0
      report_pagaregolden.xml
  7. 31 0
      res_currency.py
  8. BIN
      res_currency.pyc
  9. 22 0
      res_currency_view.xml
  10. 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_pagaregolden, res_currency

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': 'Pagaré',
+    'version': '1.1',
+    'category': 'Ventas',
+    'sequence': 19,
+    'summary': 'Pagaré',
+    'description': """
+Pagaré Athletic
+===============
+
+Pagaré Athletic.
+
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': '',
+    'depends': ['base','sale','account'],
+    'data': [
+        'report_pagaregolden.xml',
+        'res_currency_view.xml',
+    ],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 29 - 0
report_pagaregolden.py

@@ -0,0 +1,29 @@
+from openerp import api, models
+from num2words import num2words
+
+class report_pagaregolden(models.AbstractModel):
+    _name = 'report.informes_pagare_athletic.report_pagaregolden'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('informes_pagare_athletic.report_pagaregolden')
+        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('informes_pagare_athletic.report_pagaregolden', docargs)
+
+    def convertir(self,nro,moneda):
+        letra = num2words(nro,lang="es")
+        letra = letra.capitalize()
+        if not moneda:
+            moneda=''
+        letra = letra +' '+moneda
+        return letra
+
+    def calcular_precio(self,precio):
+        return (precio*1.1)

BIN
report_pagaregolden.pyc


+ 120 - 0
report_pagaregolden.xml

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+
+		 <report id="informe_pagare_golden"
+            model="account.invoice"
+            string="Pagaré"
+            report_type="qweb-pdf"
+            name="informes_pagare_athletic.report_pagaregolden"
+            file="informes_pagare_athletic.report_pagaregolden"
+         />
+
+<template id="report_pagaregolden">
+    <t t-call="report.html_container">
+        <t t-call="report.external_layout">
+			<div class="page">
+				<t t-foreach="docs" t-as="o">
+				    <br>
+					</br>
+					<br>
+					</br>
+					<br>
+						<h2 class="text-center">PAGARE A LA ORDEN</h2>
+					</br>
+					<br>
+					</br>
+					<!-- <br> -->
+						<div t-if="o.number" class="col-sm-6">
+							<strong>Nro: </strong><i t-field="o.number"/>
+						</div>
+						<div t-if="o.residual" class="col-sm-6">
+							<strong>Monto a pagar: </strong><i t-field="o.residual"/><span t-field="o.currency_id.symbol"/>
+						</div>
+                    <!-- </br> -->
+                    <br/>
+					<div t-if="o.date_invoice" class="col-sm-6">
+						<strong>Fecha: </strong><i t-field="o.date_invoice"/>
+					</div>
+					<div t-if="o.partner_id.payment_amount_due" class="col-sm-6">
+							<strong>Importe adeudado: </strong><i t-field="o.partner_id.payment_amount_due"/><span t-field="o.currency_id.symbol"/>
+					</div>
+
+						<!-- <div t-if="o.voucher_id.date" class="col-xs-6">
+							<strong>Ciudad del Este, </strong><span t-field="o.voucher_id.date" t-field-options='{"format": "d MMMM y"}'/>
+						</div> -->
+						<!-- <div t-if="o.partner_id.date_maturity" class="col-xs-6">
+							<strong>Vencimiento: </strong><span t-field="o.move_id.date_maturity" t-field-options='{"format": "d/MM/y"}'/>
+						</div>	 -->
+					<br>
+					</br>
+					<br>
+					</br>
+					<br>
+					<p>Pagaré a <b t-field="o.company_id.name"/> o a su orden el monto de <b t-esc="convertir(o.residual,o.currency_id.en_letras1)"/><span t-field="o.currency_id.symbol"/></p>
+
+                    <p>Por igual valor recibido en _ _ a mi (nuestra) entera satisfacción. Queda expresamente convenido que la falta de pago de este pagaré, me (nos) constituirá(n) en mora automáticamente, sin necesidad de interpelación judicial o extrajudicial alguna, devengando durante el tiempo de la mora un interés del _ _ , un interés moratorio _ _ % por el simple retardo sin que esto implique prórroga del plazo de la obligación. Asimismo, me (nos) obligamos a pagar cualquier gasto en que incurra el acreedor con relación a este préstamo, en caso de que el mismo sea reclamado por la vía judicial o extrajudicial. El simple vencimiento establecerá la mora, autorizando la inclusión de mi Nombre Personal o Razón Social que represento a la base de datos de INFORMCONF conforme a  lo establecido en la Ley 1682/01 y su modificatoria 1969/02, como también para que se pueda proveer la información a terceros  interesados. A los efectos legales y procesales nos sometemos a la jurisdicción de los tribunales de la Ciudad del Este, Alto Paraná y renunciando a cualquier otra que pudiera corresponder. Las partes constituyen domicilio especial en los lugares indicados en el presente documento.</p>
+                    </br>
+					<br>
+						<div class="col-xs-6">
+							<strong><u>Deudor</u></strong>
+						</div>
+						<div class="col-xs-6">
+							<strong><u>Co-deudor</u></strong>
+						</div>
+					</br>
+
+					<br>
+						<div t-if="o.partner_id.name" class="col-xs-6">
+							<strong>Nombre: </strong><i t-field="o.partner_id.name"/>
+						</div>
+						<div t-if="o.partner_id.name" class="col-xs-6">
+							<strong>Nombre: </strong>
+						</div>
+					</br>
+					<br>
+						<div t-if="o.partner_id.street" class="col-xs-6">
+							<strong>Domicilio: </strong><i t-field="o.partner_id.street"/>
+						</div>
+						<div t-if="o.partner_id.street" class="col-xs-6">
+							<strong>Domicilio: </strong>
+						</div>
+					</br>
+					<br>
+						<div t-if="o.partner_id.ruc" class="col-xs-6">
+							<strong>Cédula de Identidad: </strong><i t-field="o.partner_id.ruc"/>
+						</div>
+						<div class="col-xs-6">
+							<strong>Cédula de Identidad: </strong>
+						</div>
+                    </br>
+					<br>
+					<div class="col-xs-6">
+                    <strong>Teléfono: </strong><i t-field="o.partner_id.phone"/>  <t> / </t><i t-field="o.partner_id.mobile"/>
+					</div>
+					<div class="col-xs-6">
+                    <strong>Teléfono: </strong>
+					</div>
+                    </br>
+					<br>
+					</br>
+					<br>
+						<div class="col-xs-6">
+							<strong>Firma: _ _ _ _ _ _ _ _</strong>
+						</div>
+						<div class="col-xs-6">
+							<strong>Firma: _ _ _ _ _ _ _ _</strong>
+						</div>
+                    </br>
+					<br>
+					</br>
+					<br>
+					</br>
+				</t>
+			</div>
+		</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
res_currency.pyc


+ 22 - 0
res_currency_view.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" 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>
+  The licence is in the file __openerp__.py
+-->
+<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
static/description/icon.png