Bläddra i källkod

Para imprimir nota común en Tag en gastos

sebas 3 år sedan
incheckning
f91570b228
7 ändrade filer med 449 tillägg och 0 borttagningar
  1. 22 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 39 0
      __openerp__.py
  4. 17 0
      factura_gasto_tag.py
  5. BIN
      factura_gasto_tag.pyc
  6. 371 0
      factura_gasto_tag.xml
  7. 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 #
+###################################################################################
+import factura_gasto_tag

BIN
__init__.pyc


+ 39 - 0
__openerp__.py

@@ -0,0 +1,39 @@
+# -*- 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': 'Nota de gasto Tag',
+    'version': '0.1',
+    'category': 'Product',
+    'description': """
+Nota de gasto Tag
+
+Formato para imprimir nota de gasto Tag
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com',
+    'depends': ['base','account'],
+    'data': [
+        'factura_gasto_tag.xml'
+    ],
+    'installable': True,
+}

+ 17 - 0
factura_gasto_tag.py

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

BIN
factura_gasto_tag.pyc


+ 371 - 0
factura_gasto_tag.xml

@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="factura_gasto_tag"
+        model="account.invoice"
+        string="Nota de Gasto"
+        report_type="qweb-html"
+        name="factura_gasto_tag.report_facturagasto_tag"
+        file="factura_gasto_tag.report_facturagasto_tag"
+     />
+
+     <record id="paperformat_lowmargin" model="report.paperformat">
+        <field name="name">European A4 low margin</field>
+        <field name="default" eval="True" />
+        <field name="format">A4</field>
+        <field name="page_height">0</field>
+        <field name="page_width">0</field>
+        <field name="orientation">Portrait</field>
+        <field name="margin_top">1</field>
+        <field name="margin_bottom">1</field>
+        <field name="margin_left">2</field>
+        <field name="margin_right">2</field>
+        <field name="header_line" eval="False" />
+        <field name="header_spacing">0</field>
+        <field name="dpi">90</field>
+    </record>
+
+    <record id="factura_gasto_tag.factura_gasto_tag" model="ir.actions.report.xml">
+        <field name="paperformat_id" ref="factura_gasto_tag.paperformat_lowmargin" />
+    </record>
+
+    <template id="report_facturagasto_tag">
+        <t t-call="report.html_container">
+			    <!-- <t t-foreach="[1,2]" t-as="i"> -->
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 3.6mm;
+                            font-family: Arial;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                            padding-left: 2cm;
+                            padding-right: 1cm;
+                            height: 15cm;
+                        }
+                        .descripcion1{
+                            width: 11.2cm;
+                            font-size: 13px;
+                            padding-top: 0.5cm;
+                            float: left;
+                            min-height: 0.7cm;
+                        }
+
+                        .descripcion2{
+                            width: 13cm;
+                            font-size: 11px;
+                            float: left;
+                            min-height: 0cm;
+                        }
+
+                        .descripcion3{
+                            width: 15cm;
+                            font-size: 11px;
+                            float: left;
+                            min-height: 0cm;
+                        }
+                        .descripcion4{
+                            width: 15cm;
+                            font-size: 11px;
+                            float: left;
+                            min-height: 0.3cm;
+                        }
+                        .email{
+                            width: 13cm;
+                            font-size: 11px;
+                            float: left;
+                            min-height: 0.3cm;
+                        }
+                        .tel{
+                            width: 13cm;
+                            float: left;
+                            font-size: 11px;
+                            min-height: 0.3cm;
+                        }
+                        .rucdata1{
+                            width: 13cm;
+                            float: left;
+                            font-size: 11px;
+                            min-height: 0.3cm;
+                        }
+                        .table-condensed>tbody>tr>td {
+                            padding: 1px !important;
+                        }
+                        .divisoria{
+                            height: 0.5cm;
+                            clear: both;
+                        }
+                        .linea1{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.5cm;
+                         }
+                        .fecha_emision_data{
+                            width: 8.5cm;
+                            float: left;
+                            min-height: 0.5cm;
+                        }
+                        .number{
+                            width: 7cm;
+                            float: left;
+                            padding-left: 0.8cm;
+                            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: 8cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+
+                        .linea5{
+                            position: relative;
+                            top: -0.12cm;
+                            min-height: 0.3cm;
+                         }
+                        .vendor{
+                            width: 5cm;
+                            float: left;
+                            padding-left: 0.8cm;
+                            min-height: 0.4cm;
+                        }
+
+                        .contado_x{
+                            width: 8.0cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+                        .nota_remision_data{
+                            width: 7cm;
+                            float: left;
+                            padding-left: 0.8cm;
+                            min-height: 0.4cm;
+                        }
+
+                        .cab-articulos{
+                            height: 0.4cm;
+                            clear: both;
+                        }
+                        .articulos{
+                            height: 4.5cm;
+                            width: 14cm;
+                        }
+                        .art-col1{
+                            width:1.9cm;
+                            text-align: center;
+                        }
+                        .art-col2{
+                            padding-left: 0.3cm;
+                            width:12cm;
+                        }
+                        .art-col3{
+                            padding-left: 0.3cm;
+                            text-align: right;
+                            width:3cm;
+                        }
+                        .art-col4{
+                            width:3.4cm;
+                            text-align: right;
+                        }
+                        .art-col5{
+                            width:3.4cm;
+                            text-align: right;
+                        }
+
+						.logo1{
+                            height: 2cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+
+
+                    </style>
+                    <t t-foreach="docs" t-as="o">
+                        <div class="pagina">
+                            <div class="divisoria"> </div>
+                            <div style="border:0.3px solid #000;"></div>
+                            <div class="divisoria"> </div>
+                            <div class="row">
+
+                                <div class="col-xs-8">
+
+                                    <tr>
+                                        <div class="descripcion">
+                                        </div>
+                                    </tr>
+
+                                    <tr>
+                                        <div class="descripcion1"><b><i>TAG PRINT</i></b></div>
+                                    </tr>
+
+                                    <tr>
+                                        <div class="descripcion4"><b>R.U.C. N°: 80088298-9</b></div>
+                                    </tr>
+                                    <tr>
+                                            <div class="email"><b>Avda. Dr. Ignacio A. Pane</b></div>
+                                    </tr>
+                                    <tr>
+                                        <div class="tel"><b>Ciudad del Este - Paraguay</b></div>
+                                    </tr>
+                                    <tr>
+                                        <div class="rucdata1"><b>(061) 579 233</b></div>
+                                    </tr>
+                                </div>
+
+                                <div class="col-xs-4">
+                                    <center>
+                                        <img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % o.company_id.logo" style="max-height: 150px;max-width: 140px;"/>
+                                    </center>
+                                </div>
+
+                            </div>
+
+                            <div class="divisoria"> </div>
+                            <div style="border:0.3px solid #000;"></div>
+                            <div class="divisoria"> </div>
+                            <div class="linea1">
+                                <div class="fecha_emision_data"><b>FECHA GASTO: </b><span t-field="o.date_invoice" t-field-options='{"format": "dd MMMM yyyy"}'/></div>
+                                <div class="number"><strong>NOTA DE GASTO N°: </strong><span t-field="o.name"/></div>
+                            </div>
+
+                            <div class="linea2">
+                                <div class="razon_data"><b>PROVEEDOR: </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>TEL.: </b><span t-field="o.partner_id.phone"/></div>
+                                <div class="vendor"><b>USUARIO: </b><span t-field="o.user_id.name"/></div>
+                            </div>
+
+                            <!-- <div class="linea5">
+                                <div class="contado_x"><b>FORMA DE PAGO: </b><t t-if="o.contado == True">Contado</t><t t-if="o.contado == False">Crédito</t></div>
+                                <div class="nota_remision_data"><b>CONDICIÓN DE PAGO: </b><span t-field="o.payment_term.note"/></div>
+                            </div> -->
+
+                            <div class="divisoria"> </div>
+                            <div style="border:0.3px solid #000;"></div>
+                            <div class="divisoria"> </div>
+
+                            <table class="table table-condensed table-bordered">
+                                <thead>
+                                    <tr>
+                                        <th class="art-col1">CODIGO</th>
+                                        <th class="art-col2">DESCRIPCION</th>
+                                        <th class="art-col3">CANT.</th>
+                                        <th class="art-col4">PRECIO </th>
+                                        <th class="art-col5">TOTAL </th>
+                                    </tr>
+                               </thead>
+                               <tbody class="sale_tbody">
+                                   <t t-set="valor_mat" t-value="0"/>
+                                   <t t-set="qty" t-value="0"/>
+                                    <tr t-foreach="o.invoice_line" t-as="l">
+                                        <td class="art-col1">
+                                            <span t-field="l.product_id.id"/>
+                                        </td>
+                                        <td class="art-col2">
+                                           <span t-field="l.name"/>
+                                        </td>
+                                        <td class="art-col3">
+                                            <span t-esc= "'{0:,.0f}'.format(int(l.quantity)).replace(',', '.')">
+                                                <span t-value="qty + l.quantity"/></span>
+                                                <t t-set="qty" t-value="qty + l.quantity"/>
+                                        </td>
+                                        <td class="art-col4">
+                                            <span t-esc="'{0:,.0f}'.format(l.price_unit)"/>
+                                        </td>
+
+                                        <td class="art-col5">
+                                            <span t-esc= "'{0:,.0f}'.format((l.quantity * l.price_unit)).replace(',', '.')">
+                                                <span t-value="valor_mat+(l.quantity * l.price_unit)"/></span>
+                                                <t t-set="valor_mat" t-value="valor_mat+(l.quantity * l.price_unit)"/>
+                                        </td>
+                                    </tr>
+
+                                </tbody>
+                            </table>
+                            <div class="row">
+                                <div class="col-xs-12 pull-right">
+                                    <table class="table table-condensed">
+                                        <td class="art-col1"><b>Totales: </b></td>
+                                        <td class="art-col2"></td>
+                                        <td class="art-col3">
+                                            <span t-esc="'{0:,.0f}'.format(int(qty)).replace(',', '.')"></span>
+                                        </td>
+                                        <td class="art-col4"></td>
+                                        <td class="art-col5">
+                                            <span t-esc="'{0:,.0f}'.format((valor_mat)).replace(',', '.')"></span>
+                                        </td>
+                                    </table>
+                                 </div>
+                            </div>
+
+                            <div class="row">
+                                <div class="col-xs-4 pull-right">
+                                    <table class="table table-condensed">
+
+                                        <tr class="border-black">
+                                            <td><strong>Total</strong></td>
+                                            <td class="text-right">
+
+
+                                                    <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
+
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </div>
+                            </div>
+                        </div>
+
+                    </t>
+                </div>
+
+
+        </t>
+    </template>
+
+</data>
+</openerp>

BIN
static/description/icon.png