Selaa lähdekoodia

impresion de pagare y nota de presupuesto crifin

Sebas 6 vuotta sitten
commit
b3d0e70b94

+ 20 - 0
__init__.py

@@ -0,0 +1,20 @@
+# -*- 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 res_currency, orden_pago

BIN
__init__.pyc


+ 37 - 0
__openerp__.py

@@ -0,0 +1,37 @@
+# -*- 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/>.      #
+#                                                                               #
+#################################################################################
+
+{
+    'name': 'Presupuesto de venta y Pagaré',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Presupuesto de venta y Pagaré Crifin
+
+Formato para imprimir Presupuesto de venta y Pagaré
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com.py',
+    'depends': ['base','sale'],
+    'data': [
+	    'orden_de_pago.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>

+ 92 - 0
numbers_to_letters.py

@@ -0,0 +1,92 @@
+# -*- coding: utf-8 -*-
+import unittest
+
+def numero_to_letras(numero):
+	indicador = [("",""),("MIL","MIL"),("MILLON","MILLONES"),("MIL","MIL"),("BILLON","BILLONES")]
+	entero = int(numero)
+	decimal = int(round((numero - entero)*100))
+	#print 'decimal : ',decimal
+	contador = 0
+	numero_letras = ""
+	numero_letrasd = ""
+
+	while entero >0:
+		a = entero % 1000
+		if contador == 0:
+			en_letras = convierte_cifra(a,1).strip()
+		else :
+			en_letras = convierte_cifra(a,0).strip()
+		if a==0:
+			numero_letras = en_letras+" "+numero_letras
+		elif a==1:
+			if contador in (1,3):
+				numero_letras = indicador[contador][0]+" "+numero_letras
+			else:
+				numero_letras = en_letras+" "+indicador[contador][0]+" "+numero_letras
+		else:
+			numero_letras = en_letras+" "+indicador[contador][1]+" "+numero_letras
+
+		numero_letras = numero_letras.strip()
+		contador = contador + 1
+		entero = int(entero / 1000)
+
+
+	contadord=0
+	while decimal >0:
+		d = decimal % 1000
+		if contadord == 0:
+			en_letrasd = convierte_cifra(d,1).strip()
+
+		numero_letrasd =" COM "+str(en_letrasd.strip())
+		contadord = contadord + 1
+		decimal = int(decimal / 1000)
+
+	numero_letras = numero_letras+ str(numero_letrasd)
+	# print 'numero: ',numero
+	# print numero_letras
+	return numero_letras
+
+
+
+def convierte_cifra(numero,sw):
+	lista_centana = ["",("CIEN","CIENTO"),"DOSCIENTOS","TRESCIENTOS","CUATROCIENTOS","QUINIENTOS","SEISCIENTOS","SETECIENTOS","OCHOCIENTOS","NOVECIENTOS"]
+	lista_decena = ["",("DIEZ","ONCE","DOCE","TRECE","CATORCE","QUINCE","DIECISEIS","DIECISIETE","DIECIOCHO","DIECINUEVE"),
+					("VEINTE","VEINTI"),("TREINTA","TREINTA Y "),("CUARENTA" , "CUARENTA Y "),
+					("CINCUENTA" , "CINCUENTA Y "),("SESENTA" , "SESENTA Y "),
+					("SETENTA" , "SETENTA Y "),("OCHENTA" , "OCHENTA Y "),
+					("NOVENTA" , "NOVENTA Y ")
+				]
+	lista_unidad = ["",("UN" , "UNO"),"DOS","TRES","CUATRO","CINCO","SEIS","SIETE","OCHO","NUEVE"]
+	centena = int (numero / 100)
+	decena = int((numero -(centena * 100))/10)
+	unidad = int(numero - (centena * 100 + decena * 10))
+	#print "centena: ",centena, "decena: ",decena,'unidad: ',unidad
+	texto_centena = ""
+	texto_decena = ""
+	texto_unidad = ""
+
+	#Validad las centenas
+	texto_centena = lista_centana[centena]
+	if centena == 1:
+		if (decena + unidad)!=0:
+			texto_centena = texto_centena[1]
+		else :
+	 		texto_centena = texto_centena[0]
+
+
+	#Valida las decenas
+	texto_decena = lista_decena[decena]
+	if decena == 1 :
+		 texto_decena = texto_decena[unidad]
+ 	elif decena > 1 :
+ 		if unidad != 0 :
+ 			texto_decena = texto_decena[1]
+ 		else:
+ 			texto_decena = texto_decena[0]
+ 	#Validar las unidades
+ 	#print "texto_unidad: ",texto_unidad
+ 	if decena != 1:
+ 		texto_unidad = lista_unidad[unidad]
+ 		if unidad == 1:
+ 			texto_unidad = texto_unidad[sw]
+ 	return "%s %s %s" %(texto_centena,texto_decena,texto_unidad)

BIN
numbers_to_letters.pyc


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 324 - 0
orden_de_pago.xml


+ 25 - 0
orden_pago.py

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

BIN
orden_pago.pyc


+ 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


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä