Browse Source

Modulo factura_comun_kava

sebas 8 years ago
commit
f317fdf5ed
8 changed files with 327 additions and 0 deletions
  1. 27 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 45 0
      __openerp__.py
  4. 22 0
      factura_comun_kava.py
  5. BIN
      factura_comun_kava.pyc
  6. 233 0
      factura_comun_kava.xml
  7. BIN
      static/description/icon.png
  8. BIN
      static/img/kava.png

+ 27 - 0
__init__.py

@@ -0,0 +1,27 @@
+# -*- 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 factura_comun_kava

BIN
__init__.pyc


+ 45 - 0
__openerp__.py

@@ -0,0 +1,45 @@
+# -*- 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/>.      #
+#                                                                               #
+#################################################################################
+###################################################################################
+# Product features is an Openobject module wich enable features management for products #
+###################################################################################
+{
+    'name': 'Factura Venta Comun Kava',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Factura Venta Comun Kava
+==========================
+
+Formato para imprimir la Factura Venta Comun Kava
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com.py',
+    'depends': ['base','account'],
+    'data': [
+        'factura_comun_kava.xml'
+    ],
+    'installable': True,
+}

+ 22 - 0
factura_comun_kava.py

@@ -0,0 +1,22 @@
+from openerp import api, models
+import datetime
+
+
+class report_factura_comun(models.AbstractModel):
+    _name = 'report.factura_comun_kava.report_factura_comun'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('factura_comun_kava.report_factura_comun')
+        docargs = {
+            'doc_ids': self._ids,
+            'doc_model': report.model,
+            'docs': self.env[report.model].browse(self._ids),
+            'calcular_precio':self.calcular_precio,
+        }
+        return report_obj.render('factura_comun_kava.report_factura_comun', docargs)
+
+
+    def calcular_precio(self,precio):
+        return (precio*1.1)

BIN
factura_comun_kava.pyc


+ 233 - 0
factura_comun_kava.xml

@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="factura_comun_kava"
+        model="account.invoice"
+        string="Factura Comun"
+        report_type="qweb-html"
+        name="factura_comun_kava.report_factura_comun"
+        file="factura_comun_kava.report_factura_comun"
+     />
+
+    <template id="report_factura_comun">
+        <t t-call="report.html_container">
+            <t t-call="report.external_layout">
+			    <t t-foreach="[1,2]" t-as="i">
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 3mm;
+                            font-family: Arial;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        .logo{
+                            height: 2cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .fecha_emision_data{
+                            width: 11.5cm;
+                            float: left;
+                            min-height: 0.5cm;
+                        }
+                        .contado_x{
+                            width: 1.8cm;
+                            float: left;
+                            padding-left: 9cm;
+                            min-height: 0.5cm;
+                        }
+                        .credito_x{
+                            width: 1.8cm;
+                            float: left;
+                            padding-left: 1.6cm;
+                            min-height: 0.5cm;
+                        }
+                        .linea2{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.5cm;
+                         }
+                        .razon_data{
+                            width: 12cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+                        .ruc_data{
+                            width: 5cm;
+                            float: left;
+                            min-height: 0.5cm;
+                        }
+                        .linea3{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.3cm;
+                         }
+                        .direccion_data{
+                            width: 14cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+                        .linea4{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.3cm;
+                         }
+                        .telefono_data{
+                            width: 10cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+                        .linea5{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.4cm;
+                         }
+
+                        .nota_remision_data{
+                            width: 4cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+
+                        .cab-articulos{
+                            height: 0.8cm;
+                            clear: both;
+                        }
+                        .articulos{
+                            height: 4.5cm;
+                        }
+                        .art-col1{
+                            width:0.4cm;
+                            text-align: center;
+                        }
+                        .art-col2{
+							              padding-left: 0.7cm;
+                            width:1cm;
+                            text-align: center;
+                        }
+                        .art-col3{
+                            padding-left: 0.3cm;
+                            width:9cm;
+                        }
+                        .art-col4{
+                            width:0.9cm;
+                            text-align: right;
+                        }
+                        .art-col5{
+                            width:2.8cm;
+                            text-align: right;
+                        }
+                        .art-col6{
+                            width:2.7cm;
+                            text-align: right;
+                        }
+                        .art-col7{
+                            width:1.5cm;
+                            text-align: right;
+                        }
+						           .logo1{
+                            height: 2cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="logo"> </div>
+                            <div class="text-left">
+                                <!--<img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % o.company_id.logo" style="max-height: 45px;"/>-->
+                                <img t-att-src="'data:image/png;base64,static/img/kava.png'"/>
+                            </div>
+                            <div class="cab-articulos"> </div>
+                            <div class="linea3">
+                                <div class="fecha_emision_data">Ciudad del Este,<span t-field="o.date_invoice" t-field-options='{"format": "dd MMMM yyyy"}'/></div>
+                            </div>
+
+                            <div class="linea2">
+                                <div class="razon_data"><b>Cliente: </b><span t-field="o.partner_id.name"/></div>
+                                <div class="ruc_data"><b>R.U.C N°: </b><span t-field="o.partner_id.ruc"/></div>
+                            </div>
+
+                            <div class="linea3">
+                                <div class="direccion_data">
+                                    <t t-f="o.partner_id.street"><b>Direccion: </b><span t-field="o.partner_id.street"/> <span t-field="o.partner_id.street2"/></t>
+                                    <t t-f="not o.partner_id.street"> </t>
+                                </div>
+                            </div>
+
+                            <div class="linea4">
+                                <div class="telefono_data"><b>Telefono: </b><span t-field="o.partner_id.phone"/></div>
+                            </div>
+
+
+                            <table class="table table-condensed">
+                                <thead>
+                                    <tr>
+                                        <th class="text-left">Description</th>
+                                        <th class="text-right">Quantity</th>
+                                        <th class="text-right">Unit Price</th>
+                                        <th class="text-right">Price</th>
+                                    </tr>
+                               </thead>
+                               <tbody class="sale_tbody">
+                                    <tr t-foreach="o.invoice_line" t-as="l">
+                                        <td>
+                                           <span t-field="l.name"/>
+                                        </td>
+                                        <td class="text-right">
+                                            <span t-field="l.quantity"/>
+                                        </td>
+                                        <td class="text-right">
+                                            <span t-field="l.price_unit"/>
+                                        </td>
+
+                                        <td class="text-right">
+                                            <span t-esc="l.price_unit*l.quantity"/>
+                                        </td>
+                                    </tr>
+                                </tbody>
+                            </table>
+
+                            <div class="row">
+                                <div class="col-xs-4 pull-right">
+                                    <table class="table table-condensed">
+                                        <tr class="border-black">
+                                            <td><strong>Total s/ IVA</strong></td>
+                                            <td class="text-right">
+                                                <span t-field="o.amount_untaxed"/>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>IVA</td>
+                                            <td class="text-right">
+                                                <span t-field="o.amount_tax"/>
+                                            </td>
+                                        </tr>
+                                        <tr class="border-black">
+                                            <td><strong>Total</strong></td>
+                                            <td class="text-right">
+                                                <span t-field="o.amount_total"/>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </div>
+                            </div>
+                        </div>
+                       <div class="logo1"> </div>
+                    </t>
+                </div>
+				</t>
+            </t>
+        </t>
+    </template>
+
+</data>
+</openerp>

BIN
static/description/icon.png


BIN
static/img/kava.png