Преглед на файлове

Impresión de presupuesto Gavilan

Sebas преди 5 години
ревизия
a9ec0d5345
променени са 13 файла, в които са добавени 575 реда и са изтрити 0 реда
  1. 22 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 42 0
      __openerp__.py
  4. 17 0
      account_invoice_view.xml
  5. 30 0
      factura_venta_gavilan.py
  6. BIN
      factura_venta_gavilan.pyc
  7. 381 0
      report_saleorder_document1.xml
  8. 26 0
      res_currency.py
  9. BIN
      res_currency.pyc
  10. 16 0
      res_currency_view.xml
  11. 41 0
      sale_order.py
  12. BIN
      sale_order.pyc
  13. BIN
      static/description/icon.png

+ 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_gavilan, sale_order, res_currency

BIN
__init__.pyc


+ 42 - 0
__openerp__.py

@@ -0,0 +1,42 @@
+# -*- 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': 'Presupuesto de Venta Gavilan',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Presupuesto de Venta Gavilan
+======================================
+
+Formato para imprimir la Presupuesto de Venta de Gavilan
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com',
+    'depends': ['base','sale'],
+    'data': [
+        'report_saleorder_document1.xml',
+        'account_invoice_view.xml',
+        'res_currency_view.xml'
+    ],
+    'installable': True,
+}

+ 17 - 0
account_invoice_view.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+    <data>
+        <record id="sale_order_cred_cont" model="ir.ui.view">
+            <field name="name">sale.order.cred.cont</field>
+            <field name="model">sale.order</field>
+            <field name="inherit_id" ref="sale.view_order_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_venta_gavilan.py

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


+ 381 - 0
report_saleorder_document1.xml

@@ -0,0 +1,381 @@
+<?xml version="1.0"?>
+<openerp>
+<data>
+
+    <report id="report_saleorder_document1"
+        model="sale.order"
+        string="Presupuesto de Venta"
+        report_type="qweb-html"
+        name="factura_venta_gavilan.report_presupuesto_gavilan"
+        file="factura_venta_gavilan.report_presupuesto_gavilan"
+    />
+
+
+
+
+   <template id="report_presupuesto_gavilan">
+        <t t-call="report.external_layout">
+            <div class="page">
+                <style type="text/css">
+                    body{
+                        font-size: 3.2mm;
+                        font-family: Arial;
+                        }
+                    div{
+                        padding: 0px;
+                    }
+                    .pagina{
+                        width:19.3cm;
+                    }
+
+                    .descripcion{
+                        width: 11.2cm;
+                        font-size: 13px;
+                        padding-top: 0.5cm;
+                        float: left;
+                        min-height: 0cm;
+                    }
+
+                    .descripcion1{
+                        width: 11.2cm;
+                        font-size: 17px;
+                        padding-top: 0.2cm;
+                        float: left;
+                        min-height: 0cm;
+                    }
+
+                    .descripcion11{
+                        width: 11.2cm;
+                        font-size: 17px;
+                        padding-top: 0.2cm;
+                        float: left;
+                        min-height: 0cm;
+                    }
+
+                    .descripcion2{
+                        width: 13cm;
+                        font-size: 10px;
+                        float: left;
+                        min-height: 0cm;
+                    }
+
+                    .descripcion3{
+                        width: 15cm;
+                        font-size: 10px;
+                        float: left;
+                        min-height: 0cm;
+                    }
+                    .descripcion4{
+                        width: 15cm;
+                        font-size: 10px;
+                        float: left;
+                        min-height: 0cm;
+                    }
+
+                    .email{
+                        width: 13cm;
+                        font-size: 10px;
+                        float: left;
+                        min-height: 0cm;
+                    }
+
+                    .ciudad{
+                        width: 13cm;
+                        float: left;
+                        font-size: 10px;
+                        min-height: 0cm;
+                    }
+                    .tel{
+                        width: 13cm;
+                        float: left;
+                        font-size: 10px;
+                        min-height: 0cm;
+                    }
+                    .rucdata{
+                        width: 13cm;
+                        float: left;
+                        font-size: 10px;
+                        min-height: 0cm;
+                    }
+                    .table-condensed>tbody>tr>td {
+                        padding: 1px !important;
+                    }
+                    .divisoria{
+                        height: 0.9cm;
+                        clear: both;
+                    }
+                    .titulo{
+                        width: 19.2cm;
+                        text-align: center;
+                        width: 100%;
+                        min-height: 0.9cm;
+                    }
+                    .fecha_emision_data{
+                        width: 12.5cm;
+                        float: left;
+                        min-height: 0.5cm;
+                    }
+                    .vendor{
+                        width: 6.7cm;
+                        float: left;
+                        min-height: 0.5cm;
+                    }
+
+                    .razon_data{
+                        width: 12.5cm;
+                        float: left;
+                        min-height: 0.4cm;
+                    }
+                    .ruc_data{
+                        width: 6.7cm;
+                        float: left;
+                        min-height: 0.4cm;
+                    }
+                    .direccion_data{
+                        width: 19.2cm;
+                        float: left;
+                        min-height: 0.4cm;
+                    }
+                    .telefono_data{
+                        width: 19.2cm;
+                        float: left;
+                        min-height: 0.4cm;
+                    }
+
+                    .note{
+                        width: 19.2cm;
+                        float: left;
+                        min-height: 0.4cm;
+                    }
+
+                    .cab-articulos{
+                        height: 0.4cm;
+                        clear: both;
+                    }
+                    .articulos{
+                        height: 4.5cm;
+                    }
+                    .art-col1{
+                        width:2.3cm;
+                        text-align: center;
+                    }
+                    .art-col2{
+                        width:11.3cm;
+                        text-align: left;
+                    }
+                    .art-col3{
+                        padding-left: 0.5cm;
+                        width:3cm;
+                        text-align: right;
+                    }
+                    .art-col4{
+                        padding-left: 0.5cm;
+                        width:3cm;
+                        text-align: right;
+                    }
+
+                    .spad{
+                        width: 8.5cm;
+                        float: left;
+                        padding-top: 0.09cm;
+                        padding-bottom: 0.12cm;
+                        min-height: 0.4cm;
+                    }
+
+                    .sub_total{
+                        width: 8cm;
+                        float: left;
+                        text-align: right;
+                        padding-top: 0.09cm;
+                        font-size: 3.5mm;
+                        padding-left: 9.5cm;
+                        padding-bottom: 0.12cm;
+                        min-height: 0.4cm;
+                    }
+                    .total_iva{
+                        width: 8cm;
+                        float: left;
+                        text-align: right;
+                        padding-top: 0.09cm;
+                        font-size: 3.5mm;
+                        padding-left: 9.5cm;
+                        padding-bottom: 0.12cm;
+                        min-height: 0.4cm;
+                    }
+                    .total_total{
+                        width: 8cm;
+                        float: left;
+                        text-align: right;
+                        padding-top: 0.09cm;
+                        font-size: 3.5mm;
+                        padding-left: 9.5cm;
+                        padding-bottom: 0.12cm;
+                        min-height: 0.4cm;
+                    }
+                    .total_pagar_data{
+                        width: 19.2cm;
+                        float: left;
+                        min-height: 0.4cm;
+                    }
+                    .logo1{
+                        height: 2cm;
+                        width: 100%;
+                        top: 0px;
+                    }
+
+                </style>
+
+                <t t-foreach="docs" t-as="o">
+                    <div class="pagina">
+                        <div class="row">
+                            <div class="col-xs-4">
+                                <tr>
+                                    <div class="descripcion">
+                                    </div>
+                                </tr>
+
+                                <tr>
+                                    <div class="descripcion1"><b><i>GAVILAN COMPANY</i></b></div>
+                                </tr>
+
+                                <tr>
+                                    <div class="descripcion2"><b>de Prins Gavilán Mendez</b></div>
+                                </tr>
+                                <tr>
+                                    <div class="descripcion11"></div>
+                                </tr>
+                                <tr>
+                                    <div class="descripcion3"><b>Sistemas de promoción en medios digitales</b></div>
+                                </tr>
+
+                                <tr>
+                                    <div class="descripcion4"><b>R.U.C. N°: 4525936-4</b></div>
+                                </tr>
+                                <tr>
+                                    <div class="email"><b></b></div>
+                                </tr>
+                                <tr>
+                                    <div class="ciudad"><b>Avda. Julio C. Riquelme Km.7 - Ciudad Nueva</b></div>
+                                </tr>
+                                <tr>
+                                    <div class="tel"><b>Ciudad del Este - Paraguay</b></div>
+                                </tr>
+                                <tr>
+                                    <div class="rucdata"><b>Teléfono: (0984) 707 850</b></div>
+                                </tr>
+
+                            </div>
+                            <div class="col-xs-8">
+                                <center>
+                                    <img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % o.company_id.logo" style="max-height: 240px;max-width: 80px;"/>
+                                </center>
+                            </div>
+                        </div>
+
+
+                        <div class="divisoria"> </div>
+
+                        <h2>
+                            <center>
+                            <span>Presupuesto N° </span>
+                            <span t-field="o.name"/>
+                            </center>
+                        </h2>
+
+                        <table class="table table-condensed table-bordered">
+                            <tr>
+                                <td class="fecha_emision_data"><b>Fecha: </b><span t-field="o.date_order" t-field-options='{"format": "dd MMMM yyyy"}'/></td>
+                                <td class="vendor"><b>Vendedor: </b><span t-field="o.user_id.name"/></td>
+                            </tr>
+                            <tr>
+                                <td class="razon_data"><b>Nombre o Razón Social: </b><span t-field="o.partner_id.name"/></td>
+                                <td class="ruc_data"><b>R.U.C N°: </b><span t-field="o.partner_id.ruc"/></td>
+                            </tr>
+                            <tr>
+                                <td class="direccion_data"><b>Direccion: </b><span t-field="o.partner_id.street"/></td>
+                            </tr>
+                            <tr>
+                                <td class="telefono_data"><b>Telefono: </b><span t-field="o.partner_id.phone"/></td>
+                            </tr>
+                            <tr>
+                                <td class="note"><b>Por medio de la presente ponemos a su consideración el presente presupuesto.</b></td>
+                            </tr>
+                        </table>
+
+                        <div class="divisoria"> </div>
+
+                        <table>
+                            <thead>
+                                <tr>
+                                    <th class="art-col1">Cantidad</th>
+                                    <th class="art-col2">Descripción</th>
+                                    <th class="art-col3">Precio Unitario</th>
+                                    <th class="art-col4">Sub Total</th>
+                                </tr>
+                           </thead>
+                           <tbody class="sale_tbody">
+                                <tr t-foreach="o.order_line" t-as="l">
+                                    <td class="art-col1">
+                                        <span t-esc="'%.0f'%l.product_uom_qty"/>
+                                    </td>
+                                    <td class="art-col2">
+                                       <span t-field="l.name"/>
+                                    </td>
+                                    <td class="art-col3">
+                                        <span t-esc="'{0:,.0f}'.format(l.price_unit)"/>
+                                    </td>
+                                    <td class="art-col4">
+                                        <span t-esc="'{0:,.0f}'.format(l.price_unit*l.product_uom_qty)"/>
+                                    </td>
+                                </tr>
+                            </tbody>
+                        </table>
+
+                        <div class="divisoria"> </div>
+                        <div class="sub_total">
+                            <strong>Sub Total: </strong> <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
+                        </div>
+
+                        <div class="total_iva">
+                            <strong>Total IVA: </strong> <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
+                        </div>
+                        <div class="total_total">
+                            <strong>Total: </strong> <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
+                        </div>
+
+                        <div class="total_pagar_data">En letras: <span t-esc="convertir(o.amount_total,o.currency_id.en_letras1)"/></div> -->
+
+                        <div class="divisoria"> </div>
+
+                        <p t-field="o.note"/>
+                        <p t-if="o.payment_term.note">
+                            <strong>Condición de Pago:</strong>
+                            <span t-field="o.payment_term.note"/>
+                        </p>
+                        <p>
+                            <strong>Plazo de Pago:</strong>
+                            <span t-field="o.payment_term.note"/>
+                        </p>
+                        <p>
+                            <strong>Garantia:</strong>
+                            <span t-field="o.payment_term.note"/>
+                        </p>
+
+                        <div>
+                            <center>
+                            <strong>Validez del presente presupuesto 15 días</strong>
+                           </center>
+                        </div>
+                        <div class="divisoria"> </div>
+                        <div>
+                            <center>
+                            <strong>GRACIAS POR CONFIAR EN NOSOTROS</strong>
+                           </center>
+                        </div>
+                    </div>
+                </t>
+            </div>
+        </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_letras1 = 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_letras1" model="ir.ui.view">
+            <field name="name">res.currency.en.letras1</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>

+ 41 - 0
sale_order.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 sale_order(models.Model):
+    _inherit = 'sale.order'
+    _name = 'sale.order'
+
+    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
sale_order.pyc


BIN
static/description/icon.png