Jelajahi Sumber

Para imprimir recibo común wenet

sebastian 5 tahun lalu
melakukan
5f9a7cafb1
9 mengubah file dengan 439 tambahan dan 0 penghapusan
  1. 28 0
      __init__.py
  2. TEMPAT SAMPAH
      __init__.pyc
  3. 46 0
      __openerp__.py
  4. 29 0
      report_recibowenet.py
  5. 289 0
      report_recibowenet.xml
  6. 31 0
      res_currency.py
  7. TEMPAT SAMPAH
      res_currency.pyc
  8. 16 0
      res_currency_view.xml
  9. TEMPAT SAMPAH
      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_recibowenet, res_currency

TEMPAT SAMPAH
__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 wenet
+===============
+
+Recibo wenet.
+
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com',
+    'depends': ['base','sale','account','account_voucher_comment'],
+    'data': [
+        'report_recibowenet.xml',
+        'res_currency_view.xml',
+    ],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 29 - 0
report_recibowenet.py

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

+ 289 - 0
report_recibowenet.xml

@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+
+		 <report id="informe_recibo_wenet"
+            model="account.voucher"
+            string="Recibo"
+            report_type="qweb-pdf"
+            name="recibo_wenet.recibo_wenet"
+            file="recibo_wenet.recibo_wenet"
+         />
+
+
+		<record id="paperformat_lowmargin" model="report.paperformat">
+			   <field name="name">A4</field>
+			   <field name="default" eval="True" />
+			   <field name="format">custom</field>
+			   <field name="page_height">297</field>
+			   <field name="page_width">210</field>
+			   <field name="orientation">Portrait</field>
+			   <field name="margin_top">3</field>
+			   <field name="margin_bottom">3</field>
+			   <field name="margin_left">2</field>
+			   <field name="margin_right">2</field>
+			   <field name="header_line" eval="False" />
+			   <field name="header_spacing">3</field>
+			   <field name="dpi">90</field>
+ 		</record>
+
+
+		 <record id="recibo_wenet.informe_recibo_wenet" model="ir.actions.report.xml">
+			 <field name="paperformat_id" ref="recibo_wenet.paperformat_lowmargin" />
+		 </record>
+
+	<template id="recibo_wenet">
+    	<t t-call="report.html_container">
+			<div class="page">
+				<style type="text/css">
+					body{
+						font-size: 7.5mm;
+						font-family: Arial;
+					}
+					div{
+						padding: 0px;
+					}
+					.pagina{
+						width:19.3cm;
+						padding-left: 1.5cm;
+						padding-right: 1.5cm;
+					}
+					.descripcion{
+						width: 11.2cm;
+						font-size: 13px;
+						padding-top: 0.5cm;
+						float: left;
+						min-height: 0cm;
+					}
+
+					.descripcion1{
+						width: 11.2cm;
+						font-size: 18px;
+						padding-top: 0.2cm;
+						float: left;
+						min-height: 0cm;
+					}
+
+					.descripcion2{
+						width: 13cm;
+						font-size: 12px;
+						float: left;
+						min-height: 0cm;
+					}
+
+					.descripcion3{
+						width: 15cm;
+						font-size: 12px;
+						float: left;
+						min-height: 0cm;
+					}
+					.descripcion4{
+						width: 15cm;
+						font-size: 12px;
+						float: left;
+						min-height: 0cm;
+					}
+
+					.email{
+						width: 13cm;
+						font-size: 12px;
+						float: left;
+						min-height: 0cm;
+					}
+
+					.ciudad{
+						width: 13cm;
+						float: left;
+						font-size: 12px;
+						min-height: 0cm;
+					}
+					.tel{
+						width: 13cm;
+						float: left;
+						font-size: 10px;
+						min-height: 0cm;
+					}
+					.rucdata{
+						width: 13cm;
+						float: left;
+						font-size: 12px;
+						min-height: 0cm;
+					}
+					.divisoria{
+						height: 0.5cm;
+						clear: both;
+					}
+					diva {
+  						text-decoration-line: overline;
+					}
+					.titulo{
+						width: 19.2cm;
+						text-align: center;
+						width: 100%;
+						min-height: 0.9cm;
+					}
+					.number{
+						width: 13cm;
+						float: left;
+						margin-left: 1cm;
+						font-size: 15px;
+						min-height: 0cm;
+					}
+					.date{
+						width: 13cm;
+						float: left;
+						margin-left: 1cm;
+						font-size: 15px;
+						min-height: 0cm;
+					}
+					.amount{
+						width: 13cm;
+						float: left;
+						margin-left: 1cm;
+						font-size: 15px;
+						min-height: 0cm;
+					}
+					.currency{
+						width: 19cm;
+						float: left;
+						margin-left: 1cm;
+						font-size: 15px;
+						min-height: 0cm;
+					}
+
+					.firma{
+						width: 19cm;
+						float: left;
+						margin-left: 1cm;
+						font-size: 15px;
+						min-height: 0cm;
+					}
+					margen{
+						margin-right: 20px;
+					}
+					div{
+						padding: 0px;
+					}
+
+				</style>
+
+				<t t-foreach="docs" t-as="o">
+					<div class="pagina">
+						<div class="row">
+						    <!-- <div class="col-xs-6">
+								<center>
+									<img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % o.company_id.logo" style="max-height: 250px;max-width: 80px;"/>
+								</center>
+							</div> -->
+							<div class="col-xs-6">
+
+								<tr>
+									<div class="descripcion">
+									</div>
+								</tr>
+
+								<tr>
+									<div class="descripcion1"><b><i>FERRETERIA wenet</i></b></div>
+								</tr>
+
+								<tr>
+									<div class="descripcion2"><b>de Mazapy S.A.</b></div>
+								</tr>
+								<tr>
+									<div class="descripcion3"><b></b></div>
+								</tr>
+
+								<tr>
+									<div class="descripcion4"><b>Avda. Las Residentas - Ruta 10 </b></div>
+								</tr>
+								<tr>
+									<div class="email"><b>Katueté - Paraguay</b></div>
+								</tr>
+								<tr>
+									<div class="ciudad"><b></b></div>
+								</tr>
+								<tr>
+									<div class="tel"><b>(0983) 272496 - (0981) 845372</b></div>
+								</tr>
+								<tr>
+									<div class="rucdata"><b>R.U.C. N° 80085177-3 </b></div>
+								</tr>
+
+					    	</div>
+
+							<div class="divisoria"> </div>
+							<div class="divisoria"> </div>
+							<hr width="125%" style="border: 2px dashed #C0C0C0" color="#000000" size="6"></hr>
+							<div class="divisoria"> </div>
+
+
+                            <div class="titulo" >
+								<h3 class="text-center"><strong>        RECIBO DE DINERO</strong></h3>
+								<h4 class="text-center"></h4>
+                            </div>
+
+
+							 <div class="col-xs-12">
+
+								<br>
+									<tr>
+										<div class="number"><strong>Numero de Pago: </strong><i t-field="o.number"/></div>
+									</tr>
+
+									<tr>
+										<div class="date"><strong>Fecha: </strong><span t-field="o.date" t-field-options='{"format": "d MMMM y"}'/></div>
+									</tr>
+									<tr>
+									    <div class="amount">
+										    <strong>Monto pagado: </strong><i t-field="o.amount"/> <span t-field="o.currency_id.symbol"/>
+									   </div>
+									</tr>
+								</br>
+							</div>
+
+								<br>
+								</br>
+
+							<div class="col-xs-12">
+								<br>
+									<div class="currency">
+										<p t-if="o.currency_id.id==3">Recibi de <b t-field="o.partner_id.name"/> o a su orden el monto de <span t-esc="convertir(o.amount,o.currency_id.en_letras1)"/>Dolares en concepto de pago por ......................................................................................... de la Factura Nro <span t-field="o.reference"/></p>
+										<p t-if="o.currency_id.id==20">Recibi de <b t-field="o.partner_id.name"/> o a su orden el monto de <span t-esc="convertir(o.amount,o.currency_id.en_letras1)"/>Pesos Argentinos en concepto de pago por ........................................................................................ de la Factura Nro <span t-field="o.reference"/></p>
+										<p t-if="o.currency_id.id==7">Recibi de <b t-field="o.partner_id.name"/> o a su orden el monto de <span t-esc="convertir(o.amount,o.currency_id.en_letras1)"/>Reales en concepto de pago por ......................................................................................... de la Factura Nro <span t-field="o.reference"/></p>
+										<p t-if="o.currency_id.id==1">Recibi de <b t-field="o.partner_id.name"/> o a su orden el monto de <span t-esc="convertir(o.amount,o.currency_id.en_letras1)"/>Euros en concepto de pago por ......................................................................................... de la Factura Nro <span t-field="o.reference"/></p>
+										<tr>
+										<p t-if="o.currency_id.id==166">Recibi de <b t-field="o.partner_id.name"/> o a su orden el monto de <span t-esc="convertir(o.amount,o.currency_id.en_letras1)"/>Guaranies.</p>
+										</tr>
+										<tr>
+										   <p t-if="o.currency_id.id==166">En concepto de: <span t-field="o.comment_obs"/></p>
+										</tr>
+										<tr>
+										   <p t-if="o.currency_id.id==166">de la Factura Nro <span t-field="o.reference"/></p>
+										</tr>
+									</div>
+								</br>
+							</div>
+
+
+							<div class="divisoria"> </div>
+							<br>
+								<div class="col-xs-6">
+									<div class="firma">
+									   <strong>Firma:   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _</strong>
+									</div>
+								</div>
+							</br>
+
+							<br>
+							</br>
+							<br>
+							</br>
+						</div>
+					</div>
+				</t>
+			</div>
+    	</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')

TEMPAT SAMPAH
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>

TEMPAT SAMPAH
static/description/icon.png