Bläddra i källkod

Para imprimir presupuesto de venta de cemobo

Sebas 5 år sedan
incheckning
d4b1ff631a

+ 19 - 0
__init__.py

@@ -0,0 +1,19 @@
+# -*- 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 . import presupuesto_venta_cemobo

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 Cemobo',
+    'version': '0.1',
+    'category': 'Sale',
+    'description': """
+Presupuesto de Venta Cemobo
+
+
+Formato para imprimir el Presupuesto de Venta Cemobo
+
+    """,
+    'author': 'Eiru/Sebastian Penayo',
+    'website': 'http://www.eiru.com.py',
+    'depends': ['base','sale'],
+    'data': [
+	    'presupuesto_venta_cemobo.xml'
+    ],
+    'installable': True,
+}

+ 22 - 0
presupuesto_venta_cemobo.py

@@ -0,0 +1,22 @@
+from openerp import api, models
+import datetime
+
+
+class report_presupuesto_cemobo(models.AbstractModel):
+    _name = 'report.presupuesto_venta_cemobo.report_presupuesto_cemobo'
+
+    @api.multi
+    def render_html(self, data=None):
+        report_obj = self.env['report']
+        report = report_obj._get_report_from_name('presupuesto_venta_cemobo.report_presupuesto_cemobo')
+        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('presupuesto_venta_cemobo.report_presupuesto_cemobo', docargs)
+
+
+    def calcular_precio(self,precio):
+        return (precio*1.1)

BIN
presupuesto_venta_cemobo.pyc


+ 371 - 0
presupuesto_venta_cemobo.xml

@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+     <report id="presupuesto_venta_cemobo"
+        model="sale.order"
+        string="Presupuesto de Venta"
+        report_type="qweb-html"
+        name="presupuesto_venta_cemobo.report_presupuesto_cemobo"
+        file="presupuesto_venta_cemobo.report_presupuesto_cemobo"
+     />
+
+    <template id="report_presupuesto_cemobo">
+        <t t-call="report.html_container">
+
+                <div class="page">
+                    <style type="text/css">
+                        body{
+                            font-size: 3mm;
+                            font-family: Arial;
+                        }
+                        div{
+                            padding: 0px;
+                        }
+                        .pagina{
+                            width:19.3cm;
+                        }
+                        .descripcion1{
+                            width: 11.2cm;
+                            font-size: 13px;
+                            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;
+                        }
+                        .table-condensed>tbody>tr>td {
+                            padding: 1px !important;
+                        }
+                        .divisoria{
+                            height: 0.5cm;
+                            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: 12.5cm;
+                            float: left;
+                            min-height: 0.4cm;
+                        }
+                        .telefono_data{
+                            width: 6.7cm;
+                            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:1.3cm;
+                            text-align: center;
+                        }
+                        .art-col2{
+                            width:3cm;
+                            text-align: left;
+                        }
+                        .art-col3{
+							padding-left: 0.7cm;
+                            width:1cm;
+                            text-align: center;
+                        }
+                        .art-col4{
+                            padding-left: 0.3cm;
+                            width:9cm;
+                        }
+                        .art-col5{
+                            width:2.9cm;
+                            text-align: right;
+                        }
+                        .art-col6{
+                            width:3cm;
+                            text-align: right;
+                        }
+                        .art-col7{
+                            width:4.2cm;
+                            text-align: right;
+                        }
+
+                        .spad{
+                            width: 8.5cm;
+                            float: left;
+                            padding-top: 0.09cm;
+                            padding-bottom: 0.12cm;
+                            min-height: 0.4cm;
+                        }
+
+                        .subtotal_mat{
+                            width: 4.3cm;
+                            float: left;
+                            text-align: right;
+                            padding-top: 0.09cm;
+                            padding-left: 1cm;
+                            padding-bottom: 0.12cm;
+                            min-height: 0.4cm;
+                        }
+                        .subtotal_mo{
+                            width: 3.6cm;
+                            float: left;
+                            text-align: right;
+                            padding-top: 0.09cm;
+                            padding-bottom: 0.12cm;
+                            min-height: 0.4cm;
+                        }
+						.logo1{
+                            height: 2cm;
+                            width: 100%;
+                            top: 0px;
+                        }
+                        .foto_personal {
+                            position: absolute;
+                            top: 1.5cm;
+                            left:0.25cm;
+                        }
+
+
+                    </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="divisoria"> </div>
+
+
+                            <div class="row">
+                                <div class="col-xs-4">
+
+                                    <tr>
+                                        <div class="descripcion1"><b><i>CEMOBO S.R.L.</i></b></div>
+                                    </tr>
+
+                                    <tr>
+                                        <div class="descripcion2"><b>Centro de Motores y Bombas</b></div>
+                                    </tr>
+                                    <tr>
+                                        <div class="email"><b>ventas@cemobo.com.py - R.U.C. N°: 3685604</b></div>
+                                    </tr>
+                                    <tr>
+                                        <div class="ciudad"><b>CIUDAD DEL ESTE - PARAGUAY</b></div>
+                                    </tr>
+                                    <tr>
+                                        <div class="tel"><b> +595 61 578 458 - +595 986 453 027</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: 150px;max-width: 100px;"/>
+                                    </center> -->
+
+
+                                </div>
+                            </div>
+                            <div class="divisoria"> </div>
+                                <div class="titulo" >
+                                    <h3><strong>NOTA DE PRESUPUESTO N°: <span t-field="o.name"/></strong></h3>
+                                </div>
+
+
+                                <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>Cliente: </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">
+                                            <t t-f="o.partner_id.street"><b>Direccion: </b><span t-field="o.partner_id.street"/></t>
+                                            <t t-f="not o.partner_id.street"> </t>
+                                        </td>
+                                        <td class="telefono_data"><b>Telefono: </b><span t-field="o.partner_id.phone"/></td>
+                                    </tr>
+                                </table>
+
+
+                            <table class="table table-condensed table-bordered">
+                                <thead>
+                                    <tr>
+                                        <th class="text-center">Cantidad</th>
+                                        <th class="text-center">Descripción de producto/servicio</th>
+                                        <th class="text-center">Prec. Unitario</th>
+                                        <th class="text-center">Subtotal</th>
+                                    </tr>
+                               </thead>
+                               <tbody class="sale_tbody">
+                                   <t t-set="valor_mat" t-value="0"/>
+                                   <!-- <t t-set="valor_mo" t-value="0"/>  -->
+                                    <tr t-foreach="o.order_line" t-as="l">
+                                        <td class="text-center">
+                                            <span t-esc="'%.0f'%l.product_uom_qty"/>
+                                        </td>
+                                        <td>
+                                           <span t-field="l.name"/>
+                                        </td>
+                                        <td class="text-right">
+                                                <t t-if="o.currency_id.id == 166">
+                                                    <span t-esc="'{0:,.0f}'.format(l.price_unit)"/>
+                                                </t>
+
+                                        </td>
+
+                                        <td class="text-right">
+                                                <span t-if="o.currency_id.id == 166">
+                                                    <span t-esc= "'{0:,.0f}'.format(int(l.product_uom_qty * l.price_unit)).replace(',', '.')">
+                                                        <span t-value="valor_mat+(l.product_uom_qty * l.price_unit)"/></span>
+                                                        <t t-set="valor_mat" t-value="valor_mat+(l.product_uom_qty * l.price_unit)"/>
+                                                    </span>
+                                        </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-col3"></td>
+                                        <td class="art-col4"></td>
+                                        <td class="art-col5">
+                                            <span t-esc="'{0:,.0f}'.format(int(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 s/ IVA</strong></td>
+                                            <td class="text-right">
+                                                <t t-if="o.currency_id.id == 166">
+                                                    <span t-esc="'{0:,.0f}'.format(o.amount_untaxed)"/>
+                                                </t>
+                                                <t t-if="o.currency_id.id != 166">
+                                                    <span t-esc="'{0:,.2f}'.format(o.amount_untaxed)"/>
+                                                </t>
+                                            </td>
+                                        </tr>
+                                        <tr>
+                                            <td>IVA</td>
+                                            <td class="text-right">
+                                                <t t-if="o.currency_id.id == 166">
+                                                    <span t-esc="'{0:,.0f}'.format(o.amount_tax)"/>
+                                                </t>
+                                                <t t-if="o.currency_id.id != 166">
+                                                    <span t-esc="'{0:,.2f}'.format(o.amount_tax)"/>
+                                                </t>
+                                            </td>
+                                        </tr> -->
+                                        <tr class="border-black">
+                                            <td><strong>Total</strong></td>
+                                            <td class="text-right">
+                                                <t t-if="o.currency_id.id == 166">
+                                                    <span t-esc="'{0:,.0f}'.format(o.amount_total)"/>
+                                                </t>
+                                                <t t-if="o.currency_id.id != 166">
+                                                    <span t-esc="'{0:,.2f}'.format(o.amount_total)"/>
+                                                </t>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </div>
+                            </div>
+                            <table class="table table-condensed table-bordered">
+                                <!-- <tr>
+                                    <td class="note"><b>OBS.: Los totales de costo de materiales y mano de obra 10% iva incluído</b></td>
+                                </tr> -->
+                                <tr>
+                                    <td class="payment_term"><b>Forma de Pago: </b><span t-field="o.payment_term"/></td>
+                                </tr>
+                            </table>
+
+
+                        </div>
+                       <div class="logo1"> </div>
+                    </t>
+                </div>
+        </t>
+    </template>
+
+</data>
+</openerp>

BIN
static/description/icon.png


BIN
static/img/kava.png


+ 3 - 0
static/src/css/style.css

@@ -0,0 +1,3 @@
+.print_workorder{
+    height: 35px;
+}